From fefc78265503e24addc9c88829bed891cc7ef81c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kari=20S=C3=B6derholm?= Date: Fri, 9 Oct 2020 13:58:31 +0300 Subject: [PATCH] fix: declare webworker lib for sw.ts with TS triple-slash directive Revert adding lib section to tsconfig.json to avoid needing a manual upgrade step in projects. Fixes #9144 --- flow-client/tsconfig.json | 6 ------ .../resources/com/vaadin/flow/server/frontend/tsconfig.json | 6 ------ flow-server/src/main/resources/sw.ts | 2 ++ flow-server/src/main/resources/tsconfig.json | 6 ------ 4 files changed, 2 insertions(+), 18 deletions(-) diff --git a/flow-client/tsconfig.json b/flow-client/tsconfig.json index 3a8c1b33391..6ab25133171 100644 --- a/flow-client/tsconfig.json +++ b/flow-client/tsconfig.json @@ -4,12 +4,6 @@ "inlineSources": true, "module": "esNext", "target": "es2015", - "lib": [ - "es2015", - "dom", - "dom.iterable", - "webworker" - ], "moduleResolution": "node", "strict": true, "noFallthroughCasesInSwitch": true, diff --git a/flow-server/src/main/resources/com/vaadin/flow/server/frontend/tsconfig.json b/flow-server/src/main/resources/com/vaadin/flow/server/frontend/tsconfig.json index f7ed22f6888..45edf6f1b0e 100644 --- a/flow-server/src/main/resources/com/vaadin/flow/server/frontend/tsconfig.json +++ b/flow-server/src/main/resources/com/vaadin/flow/server/frontend/tsconfig.json @@ -9,12 +9,6 @@ "inlineSources": true, "module": "esNext", "target": "es2017", - "lib": [ - "es2017", - "dom", - "dom.iterable", - "webworker" - ], "moduleResolution": "node", "strict": true, "noFallthroughCasesInSwitch": true, diff --git a/flow-server/src/main/resources/sw.ts b/flow-server/src/main/resources/sw.ts index 576c2a7bf14..b9c2e5af876 100644 --- a/flow-server/src/main/resources/sw.ts +++ b/flow-server/src/main/resources/sw.ts @@ -1,3 +1,5 @@ +/// + importScripts('sw-runtime-resources-precache.js'); import {skipWaiting, clientsClaim} from 'workbox-core'; import {precacheAndRoute} from 'workbox-precaching'; diff --git a/flow-server/src/main/resources/tsconfig.json b/flow-server/src/main/resources/tsconfig.json index df0e3fbe2b2..fd1d4135302 100644 --- a/flow-server/src/main/resources/tsconfig.json +++ b/flow-server/src/main/resources/tsconfig.json @@ -4,12 +4,6 @@ "inlineSources": true, "module": "esNext", "target": "es2017", - "lib": [ - "es2017", - "dom", - "dom.iterable", - "webworker" - ], "moduleResolution": "node", "strict": true, "noFallthroughCasesInSwitch": true,