From f0a04cbdec3f7fee9afbd7f9f5947deab1011f94 Mon Sep 17 00:00:00 2001 From: Ryan Waskiewicz Date: Thu, 30 Dec 2021 08:42:44 -0500 Subject: [PATCH 01/10] chore(dependencies: upgrade typescript to v4.4.4 --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index cd798c2ed8a..8b8b497516a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -80,7 +80,7 @@ "sizzle": "^2.3.6", "terser": "5.6.1", "tslib": "^2.1.0", - "typescript": "4.3.5", + "typescript": "^4.4.4", "webpack": "^4.46.0", "ws": "7.4.6" }, @@ -11239,9 +11239,9 @@ } }, "node_modules/typescript": { - "version": "4.3.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.5.tgz", - "integrity": "sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA==", + "version": "4.4.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.4.tgz", + "integrity": "sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -21162,9 +21162,9 @@ } }, "typescript": { - "version": "4.3.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.5.tgz", - "integrity": "sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA==", + "version": "4.4.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.4.tgz", + "integrity": "sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA==", "dev": true }, "uglify-js": { diff --git a/package.json b/package.json index e19319dc732..e8ccb9b28a8 100644 --- a/package.json +++ b/package.json @@ -123,7 +123,7 @@ "sizzle": "^2.3.6", "terser": "5.6.1", "tslib": "^2.1.0", - "typescript": "4.3.5", + "typescript": "^4.4.4", "webpack": "^4.46.0", "ws": "7.4.6" }, From e7e7f1a4d93757343986e0f1f1d53b88770dc045 Mon Sep 17 00:00:00 2001 From: Ryan Waskiewicz Date: Thu, 30 Dec 2021 08:59:43 -0500 Subject: [PATCH 02/10] update client browser patching update client-patch-browser.ts patching of `performance.mark()` & `performance.measure()` to be ignored by the type checker. this patch allows stencil to support Safari 10; since we don't have access to a non-existent performance buffer and changing the return value for either of these functions could be considered a breaking chamge, defer altering the (non-compliant) functions until stencil drops support for Safari 10 --- src/client/client-patch-browser.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/client/client-patch-browser.ts b/src/client/client-patch-browser.ts index 90f35f17517..4e40509830b 100644 --- a/src/client/client-patch-browser.ts +++ b/src/client/client-patch-browser.ts @@ -21,6 +21,10 @@ export const patchBrowser = (): Promise => { if (BUILD.profile && !performance.mark) { // not all browsers support performance.mark/measure (Safari 10) + // because the mark/measure APIs are designed to write entries to a buffer in the browser that does not exist, + // simply stub the implementations out. + // TODO(STENCIL-323): Remove this patch when support for older browsers is removed (breaking) + // @ts-ignore performance.mark = performance.measure = () => { /*noop*/ }; From 7dd75f0551eaca89288b022f2f82497d92daa2a3 Mon Sep 17 00:00:00 2001 From: Ryan Waskiewicz Date: Thu, 30 Dec 2021 09:07:34 -0500 Subject: [PATCH 03/10] remove non-compliant `window.location.reload()` arguments `reload` has no parameter, although Firefox supports a non-standard 'forceGet' boolean parameter for bypassing its cache. for all other browsers, this is otherwise ignored. these arguments are used in the context of stencil's dev-server (IE are only used at dev time). given these two statements, the risk of a truly breaking change is deemed minimal here --- src/dev-server/dev-server-client/app-update.ts | 4 ++-- src/dev-server/dev-server-client/client-web-socket.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dev-server/dev-server-client/app-update.ts b/src/dev-server/dev-server-client/app-update.ts index 4620229f706..292d0080abc 100644 --- a/src/dev-server/dev-server-client/app-update.ts +++ b/src/dev-server/dev-server-client/app-update.ts @@ -65,7 +65,7 @@ const appUpdate = (win: d.DevClientWindow, config: d.DevClientConfig, buildResul // then let's refresh the page from the root of the server appReset(win, config, () => { logReload(`Initial load`); - win.location.reload(true); + win.location.reload(); }); return; } @@ -111,7 +111,7 @@ const appHmr = (win: Window, hmr: d.HotModuleReplacement) => { } if (shouldWindowReload) { - win.location.reload(true); + win.location.reload(); return; } diff --git a/src/dev-server/dev-server-client/client-web-socket.ts b/src/dev-server/dev-server-client/client-web-socket.ts index e65a46ef175..03c94e29a96 100644 --- a/src/dev-server/dev-server-client/client-web-socket.ts +++ b/src/dev-server/dev-server-client/client-web-socket.ts @@ -76,7 +76,7 @@ export const initClientWebSocket = (win: d.DevClientWindow, config: d.DevClientC clearInterval(requestBuildResultsTmrId); if (win['s-build-id'] !== msg.buildResults.buildId) { - win.location.reload(true); + win.location.reload(); } win['s-build-id'] = msg.buildResults.buildId; return; From 03c8d67c1c7ff01d0fcf7a1ab373d782d4d78a9e Mon Sep 17 00:00:00 2001 From: Ryan Waskiewicz Date: Thu, 30 Dec 2021 09:38:43 -0500 Subject: [PATCH 04/10] update fn signature of mock-doc's customElementRegistry#whenDefined set the return type of `whenDefined` to be `Promise` over `Promise` to meet new type checking expectations with TS v4.4. this leads to a small functional change in that the return value for this function when the internal registry contains an entry for a given `tagName`, the function now returns the constructor associated with the tag name, rather than void. --- src/mock-doc/custom-element-registry.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mock-doc/custom-element-registry.ts b/src/mock-doc/custom-element-registry.ts index 073c32144df..0ae85e5279c 100644 --- a/src/mock-doc/custom-element-registry.ts +++ b/src/mock-doc/custom-element-registry.ts @@ -81,14 +81,14 @@ export class MockCustomElementRegistry implements CustomElementRegistry { } } - whenDefined(tagName: string) { + whenDefined(tagName: string): Promise { tagName = tagName.toLowerCase(); if (this.__registry != null && this.__registry.has(tagName) === true) { - return Promise.resolve(); + return this.__registry.get(tagName).cstr; } - return new Promise((resolve) => { + return new Promise((resolve) => { if (this.__whenDefined == null) { this.__whenDefined = new Map(); } From bb9c00c5b0730de82d6b9f1e93c475f65cbed494 Mon Sep 17 00:00:00 2001 From: Ryan Waskiewicz Date: Thu, 30 Dec 2021 10:05:47 -0500 Subject: [PATCH 05/10] update mock-doc performance function signatures update the function signatures of mock-doc's performance implementation by declaring the return type on `mark()` and `measure()` to align with the `Performance` interface, but _continue to return undefined_, ignorning the type checker errors. stencil's stubs for these functions assume access to underlying browser api's (namely a performance buffer). given that older browsers may not support this functionality and implementating a mock version of these functions falls well outside the scope of a typescript update, simply ignore the errors. we take this approach, rather than: ```typescript // @ts-ignore mark(): void { /* no-op */ } ``` as stencil can (and does) instantiate an instance of `MockPerformance` and attempts to assign it to variable(s) that are of type `Performance`. this circumvents the type checker (although stencil was lying to it already) to prevent additional `// @ts-ignore` pragmas this may result in typing errors for consumers, however the actual values shall remain the same. --- src/mock-doc/performance.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/mock-doc/performance.ts b/src/mock-doc/performance.ts index ef64a41f8ba..3fc60be76de 100644 --- a/src/mock-doc/performance.ts +++ b/src/mock-doc/performance.ts @@ -40,11 +40,21 @@ export class MockPerformance implements Performance { return [] as any; } - mark() { + // Stencil's implementation of `mark` is non-compliant with the `Performance` interface. Because Stencil will + // instantiate an instance of this class and may attempt to assign it to a variable of type `Performance`, the return + // type must match the `Performance` interface (rather than typing this function as returning `void` and ignoring the + // associated errors returned by the type checker) + // @ts-ignore + mark(): PerformanceMark { // } - measure() { + // Stencil's implementation of `measure` is non-compliant with the `Performance` interface. Because Stencil will + // instantiate an instance of this class and may attempt to assign it to a variable of type `Performance`, the return + // type must match the `Performance` interface (rather than typing this function as returning `void` and ignoring the + // associated errors returned by the type checker) + // @ts-ignore + measure(): PerformanceMeasure { // } From 28269aba12c2abcaa351c17d38ce47d31e7cc5b8 Mon Sep 17 00:00:00 2001 From: Ryan Waskiewicz Date: Thu, 30 Dec 2021 10:21:28 -0500 Subject: [PATCH 06/10] window - add ts-ignore to handle mock-window & window type diffs --- src/hydrate/runner/window-initialize.ts | 2 ++ src/mock-doc/window.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/hydrate/runner/window-initialize.ts b/src/hydrate/runner/window-initialize.ts index 12cb3d40060..7724483d0ea 100644 --- a/src/hydrate/runner/window-initialize.ts +++ b/src/hydrate/runner/window-initialize.ts @@ -47,6 +47,8 @@ export function initializeWindow( } try { + // TODO(STENCIL-345) - Evaluate reconciling MockWindow, Window differences + // @ts-ignore win.customElements = null; } catch (e) {} diff --git a/src/mock-doc/window.ts b/src/mock-doc/window.ts index 92bc14c060c..aa89f6eb77a 100644 --- a/src/mock-doc/window.ts +++ b/src/mock-doc/window.ts @@ -802,6 +802,8 @@ export function cloneWindow(srcWin: Window, opts: { customElementProxy?: boolean const clonedWin = new MockWindow(false); if (!opts.customElementProxy) { + // TODO(STENCIL-345) - Evaluate reconciling MockWindow, Window differences + // @ts-ignore srcWin.customElements = null; } From 0e8898652a1c9905084bb5cab9b401da4d6d6344 Mon Sep 17 00:00:00 2001 From: Ryan Waskiewicz Date: Thu, 30 Dec 2021 13:46:24 -0500 Subject: [PATCH 07/10] useUnknownInCatchVariables enable `useUnknownInCatchVariables` in all TSConfig files, with the exception of the main `tsconfig.json`. Although flipping that bit was originally going to be a part of the TS 4.4 upgrade, our decision to upgrade from 4.3 -> 4.5 directly increased scope a bit. That and the fact there are ~90 places where we want to rework the code, I feel more comfortable splitting that off into a separate effort --- scripts/tsconfig.json | 1 + src/runtime/test/tsconfig.json | 1 + src/runtime/vdom/test/tsconfig.json | 1 + src/testing/tsconfig.internal.json | 3 ++- test/browser-compile/tsconfig.json | 3 ++- test/end-to-end/tsconfig.json | 3 ++- test/hello-vdom/tsconfig.json | 1 + test/hello-world/tsconfig.parent.json | 1 + test/ionic-app/tsconfig.json | 1 + test/jest-spec-runner/tsconfig.json | 1 + test/karma/test-invisible-prehydration/tsconfig.json | 1 + test/karma/test-prerender/tsconfig-prerender.json | 1 + test/karma/test-sibling/tsconfig.json | 1 + test/karma/tsconfig-stencil.json | 1 + test/karma/tsconfig.json | 3 ++- test/performance/tsconfig.json | 1 + test/prerender-shadow/tsconfig.json | 3 ++- test/style-modes/tsconfig.json | 3 ++- test/todo-app/tsconfig.json | 1 + tsconfig.json | 2 ++ 20 files changed, 27 insertions(+), 6 deletions(-) diff --git a/scripts/tsconfig.json b/scripts/tsconfig.json index fea3c0f7837..24834c82fee 100644 --- a/scripts/tsconfig.json +++ b/scripts/tsconfig.json @@ -15,6 +15,7 @@ "pretty": true, "target": "es2017", "incremental": false, + "useUnknownInCatchVariables": true }, "include": [ "**/*.ts" diff --git a/src/runtime/test/tsconfig.json b/src/runtime/test/tsconfig.json index e93d816cfbe..b560cdb7341 100644 --- a/src/runtime/test/tsconfig.json +++ b/src/runtime/test/tsconfig.json @@ -18,6 +18,7 @@ "noUnusedParameters": true, "pretty": true, "target": "es2017", + "useUnknownInCatchVariables": true, "baseUrl": ".", "paths": { "@stencil/core": ["../../index.ts"], diff --git a/src/runtime/vdom/test/tsconfig.json b/src/runtime/vdom/test/tsconfig.json index 087474fd3fd..340a72e168a 100644 --- a/src/runtime/vdom/test/tsconfig.json +++ b/src/runtime/vdom/test/tsconfig.json @@ -17,6 +17,7 @@ "noUnusedParameters": true, "pretty": true, "target": "es2017", + "useUnknownInCatchVariables": true, "baseUrl": ".", "paths": { "@stencil/core": ["../../../index.ts"], diff --git a/src/testing/tsconfig.internal.json b/src/testing/tsconfig.internal.json index b842abdac52..1926b09d9c2 100644 --- a/src/testing/tsconfig.internal.json +++ b/src/testing/tsconfig.internal.json @@ -21,6 +21,7 @@ "noUnusedParameters": true, "pretty": true, "target": "es2017", + "useUnknownInCatchVariables": true, "baseUrl": ".", "paths": { "@stencil/core/cli": [ @@ -46,4 +47,4 @@ ] } } -} \ No newline at end of file +} diff --git a/test/browser-compile/tsconfig.json b/test/browser-compile/tsconfig.json index 3677e6e142c..70643b01877 100644 --- a/test/browser-compile/tsconfig.json +++ b/test/browser-compile/tsconfig.json @@ -20,6 +20,7 @@ "noUnusedParameters": true, "pretty": true, "target": "es2017", + "useUnknownInCatchVariables": true, "baseUrl": ".", "paths": { "@stencil/core/testing": [ @@ -39,4 +40,4 @@ "include": [ "src" ] -} \ No newline at end of file +} diff --git a/test/end-to-end/tsconfig.json b/test/end-to-end/tsconfig.json index 6b43d7f8d99..f6fe223731f 100644 --- a/test/end-to-end/tsconfig.json +++ b/test/end-to-end/tsconfig.json @@ -21,6 +21,7 @@ "noUnusedParameters": true, "pretty": true, "target": "es2017", + "useUnknownInCatchVariables": true, "baseUrl": ".", "paths": { "@stencil/core": [ @@ -40,4 +41,4 @@ "include": [ "src" ] -} \ No newline at end of file +} diff --git a/test/hello-vdom/tsconfig.json b/test/hello-vdom/tsconfig.json index fef320664c6..2577d176760 100644 --- a/test/hello-vdom/tsconfig.json +++ b/test/hello-vdom/tsconfig.json @@ -19,6 +19,7 @@ "noUnusedLocals": true, "noUnusedParameters": true, "target": "es2017", + "useUnknownInCatchVariables": true, "baseUrl": ".", "paths": { "@stencil/core": ["../../internal"], diff --git a/test/hello-world/tsconfig.parent.json b/test/hello-world/tsconfig.parent.json index 2e95cc59bb2..ddfe5644efa 100644 --- a/test/hello-world/tsconfig.parent.json +++ b/test/hello-world/tsconfig.parent.json @@ -19,6 +19,7 @@ "noUnusedLocals": true, "noUnusedParameters": true, "target": "es2017", + "useUnknownInCatchVariables": true, "baseUrl": ".", "paths": { "@stencil/core": ["../../internal"], diff --git a/test/ionic-app/tsconfig.json b/test/ionic-app/tsconfig.json index 001fd080590..055c7e68586 100644 --- a/test/ionic-app/tsconfig.json +++ b/test/ionic-app/tsconfig.json @@ -12,6 +12,7 @@ "noUnusedParameters": true, "jsx": "react", "jsxFactory": "h", + "useUnknownInCatchVariables": true, "baseUrl": ".", "paths": { "@stencil/core": ["../../internal"], diff --git a/test/jest-spec-runner/tsconfig.json b/test/jest-spec-runner/tsconfig.json index 62572a919ab..80496fe47da 100755 --- a/test/jest-spec-runner/tsconfig.json +++ b/test/jest-spec-runner/tsconfig.json @@ -19,6 +19,7 @@ "noUnusedParameters": true, "pretty": true, "target": "es2017", + "useUnknownInCatchVariables": true, "baseUrl": ".", "paths": { "@stencil/core": ["../../internal"], diff --git a/test/karma/test-invisible-prehydration/tsconfig.json b/test/karma/test-invisible-prehydration/tsconfig.json index 245fa297063..6105969289f 100644 --- a/test/karma/test-invisible-prehydration/tsconfig.json +++ b/test/karma/test-invisible-prehydration/tsconfig.json @@ -21,6 +21,7 @@ "noUnusedParameters": false, "pretty": true, "target": "es2017", + "useUnknownInCatchVariables": true, "baseUrl": ".", "paths": { "@stencil/core": ["../../../internal"], diff --git a/test/karma/test-prerender/tsconfig-prerender.json b/test/karma/test-prerender/tsconfig-prerender.json index caf1eaca8bf..98e1d7cfa62 100644 --- a/test/karma/test-prerender/tsconfig-prerender.json +++ b/test/karma/test-prerender/tsconfig-prerender.json @@ -22,6 +22,7 @@ "noUnusedParameters": true, "pretty": true, "target": "es2017", + "useUnknownInCatchVariables": true, "baseUrl": ".", "paths": { "@stencil/core": ["../../../internal"], diff --git a/test/karma/test-sibling/tsconfig.json b/test/karma/test-sibling/tsconfig.json index 86a96d96429..298cfbea2a1 100644 --- a/test/karma/test-sibling/tsconfig.json +++ b/test/karma/test-sibling/tsconfig.json @@ -21,6 +21,7 @@ "noUnusedParameters": false, "pretty": true, "target": "es2017", + "useUnknownInCatchVariables": true, "baseUrl": ".", "paths": { "@stencil/core": ["../../../internal"], diff --git a/test/karma/tsconfig-stencil.json b/test/karma/tsconfig-stencil.json index e38ec6e013e..b5a9d1fbe54 100644 --- a/test/karma/tsconfig-stencil.json +++ b/test/karma/tsconfig-stencil.json @@ -22,6 +22,7 @@ "noUnusedParameters": true, "pretty": true, "target": "es2017", + "useUnknownInCatchVariables": true, "baseUrl": ".", "paths": { "@stencil/core": ["../../internal"], diff --git a/test/karma/tsconfig.json b/test/karma/tsconfig.json index 88770a84a8f..ba82ac6b827 100644 --- a/test/karma/tsconfig.json +++ b/test/karma/tsconfig.json @@ -21,12 +21,13 @@ "noUnusedParameters": false, "pretty": true, "target": "es5", + "useUnknownInCatchVariables": true, "outDir": "tmp-compiled-tests", "baseUrl": ".", "paths": { "@stencil/core": ["../../internal"], "@stencil/core/internal": ["../../internal"], - "@stencil/core/testing": ["../../testing"], + "@stencil/core/testing": ["../../testing"] } }, "include": [ diff --git a/test/performance/tsconfig.json b/test/performance/tsconfig.json index 67454b5403e..e176bd73887 100644 --- a/test/performance/tsconfig.json +++ b/test/performance/tsconfig.json @@ -19,6 +19,7 @@ "noUnusedLocals": true, "noUnusedParameters": true, "target": "es2017", + "useUnknownInCatchVariables": true, "baseUrl": ".", "paths": { "@stencil/core": ["../../internal"], diff --git a/test/prerender-shadow/tsconfig.json b/test/prerender-shadow/tsconfig.json index fa617dfb26e..02a7a5eae50 100644 --- a/test/prerender-shadow/tsconfig.json +++ b/test/prerender-shadow/tsconfig.json @@ -19,6 +19,7 @@ "noUnusedLocals": true, "noUnusedParameters": true, "target": "es2017", + "useUnknownInCatchVariables": true, "baseUrl": ".", "paths": { "@stencil/core": [ @@ -32,4 +33,4 @@ "include": [ "src" ] -} \ No newline at end of file +} diff --git a/test/style-modes/tsconfig.json b/test/style-modes/tsconfig.json index 085e1f105f8..2334ad0437b 100644 --- a/test/style-modes/tsconfig.json +++ b/test/style-modes/tsconfig.json @@ -19,6 +19,7 @@ "noUnusedLocals": true, "noUnusedParameters": true, "target": "es2017", + "useUnknownInCatchVariables": true, "baseUrl": ".", "paths": { "@stencil/core": [ @@ -35,4 +36,4 @@ "include": [ "src" ] -} \ No newline at end of file +} diff --git a/test/todo-app/tsconfig.json b/test/todo-app/tsconfig.json index a1cb88778a1..a77f1c6bcd1 100755 --- a/test/todo-app/tsconfig.json +++ b/test/todo-app/tsconfig.json @@ -18,6 +18,7 @@ "noImplicitReturns": true, "noUnusedLocals": true, "noUnusedParameters": true, + "useUnknownInCatchVariables": true, "target": "es2017", "baseUrl": ".", "paths": { diff --git a/tsconfig.json b/tsconfig.json index ba861eea791..57f2b4eb2b5 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -22,6 +22,8 @@ "resolveJsonModule": true, "sourceMap": true, "target": "es2018", + // TODO(STENCIL-346): Enable useUnknownInCatchVariables flag for main project + "useUnknownInCatchVariables": false, "baseUrl": ".", "paths": { "@app-data": ["src/app-data/index.ts"], From c76ec2fc8f073d63f71f3d2f6c2e5b59b683769a Mon Sep 17 00:00:00 2001 From: Ryan Waskiewicz Date: Thu, 30 Dec 2021 14:23:45 -0500 Subject: [PATCH 08/10] [PAUSE] Stop current line of work, look into TS 4.5 level of effort i'm concerned about the `matchFile` call and how the method changes for v4.4, then is reverted in v4.5. based on the conversations/issues in GH surrounding these changes, I'm strongly considering moving directly to v4.5. pause here to investiage those changes --- src/compiler/sys/typescript/typescript-sys.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/compiler/sys/typescript/typescript-sys.ts b/src/compiler/sys/typescript/typescript-sys.ts index edc878a3844..a866d236672 100644 --- a/src/compiler/sys/typescript/typescript-sys.ts +++ b/src/compiler/sys/typescript/typescript-sys.ts @@ -83,6 +83,8 @@ export const patchTsSystemFileSystem = ( tsSys.readDirectory = (path, extensions, exclude, include, depth) => { const cwd = stencilSys.getCurrentDirectory(); + // TODO(STENCIL-XXXX): Remove the final argument passed to `matchFiles` when Stencil is upgraded to TS v4.5 + // TODO(STENCIL-344): Replace `matchFiles` with a function that is publicly exposed return (ts as any).matchFiles( path, extensions, @@ -92,7 +94,10 @@ export const patchTsSystemFileSystem = ( cwd, depth, getAccessibleFileSystemEntries, - realpath + realpath, + // TODO: Is this the right thing to do with all the patching we do? + // https://github.com/parcel-bundler/parcel/pull/6784 + ts.sys.directoryExists ); }; From 797fdcf5ad3cd930895cbc2d1c45883658bed628 Mon Sep 17 00:00:00 2001 From: Ryan Waskiewicz Date: Thu, 30 Dec 2021 16:28:49 -0500 Subject: [PATCH 09/10] TS 4.5 update karma-typescript with https://github.com/monounity/karma-typescript/commit/f4cdc437eddb0d820f7b6cf54554ac6246a818f0 update TypeScript to v4.5.4 remove the temporary hack during the TS v4.4 upgrade for `matchFile` call to succeed. update single unit test that was failing following the upgrade. update typescript import statements that were broken as a result of the upgrade to handle `AssertClause`s. move typescript calls to use factory methods --- package-lock.json | 14 +- package.json | 2 +- src/compiler/sys/dependencies.json | 1 + src/compiler/sys/typescript/typescript-sys.ts | 6 +- src/compiler/transformers/style-imports.ts | 5 +- .../transformers/test/parse-props.spec.ts | 2 +- src/compiler/transformers/transform-utils.ts | 9 +- .../update-stencil-core-import.ts | 14 +- test/karma/package-lock.json | 337 +++++++++--------- test/karma/package.json | 2 +- 10 files changed, 192 insertions(+), 200 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8b8b497516a..c30fe71dbed 100644 --- a/package-lock.json +++ b/package-lock.json @@ -80,7 +80,7 @@ "sizzle": "^2.3.6", "terser": "5.6.1", "tslib": "^2.1.0", - "typescript": "^4.4.4", + "typescript": "4.5.4", "webpack": "^4.46.0", "ws": "7.4.6" }, @@ -11239,9 +11239,9 @@ } }, "node_modules/typescript": { - "version": "4.4.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.4.tgz", - "integrity": "sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA==", + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.4.tgz", + "integrity": "sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -21162,9 +21162,9 @@ } }, "typescript": { - "version": "4.4.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.4.tgz", - "integrity": "sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA==", + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.4.tgz", + "integrity": "sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg==", "dev": true }, "uglify-js": { diff --git a/package.json b/package.json index e8ccb9b28a8..34e6f353d1c 100644 --- a/package.json +++ b/package.json @@ -123,7 +123,7 @@ "sizzle": "^2.3.6", "terser": "5.6.1", "tslib": "^2.1.0", - "typescript": "^4.4.4", + "typescript": "4.5.4", "webpack": "^4.46.0", "ws": "7.4.6" }, diff --git a/src/compiler/sys/dependencies.json b/src/compiler/sys/dependencies.json index 333d6deecd3..d7f12642ed4 100644 --- a/src/compiler/sys/dependencies.json +++ b/src/compiler/sys/dependencies.json @@ -52,6 +52,7 @@ "compiler/lib.es2020.symbol.wellknown.d.ts", "compiler/lib.es2021.d.ts", "compiler/lib.es2021.full.d.ts", + "compiler/lib.es2021.intl.d.ts", "compiler/lib.es2021.promise.d.ts", "compiler/lib.es2021.string.d.ts", "compiler/lib.es2021.weakref.d.ts", diff --git a/src/compiler/sys/typescript/typescript-sys.ts b/src/compiler/sys/typescript/typescript-sys.ts index a866d236672..7ea2b1c80de 100644 --- a/src/compiler/sys/typescript/typescript-sys.ts +++ b/src/compiler/sys/typescript/typescript-sys.ts @@ -83,7 +83,6 @@ export const patchTsSystemFileSystem = ( tsSys.readDirectory = (path, extensions, exclude, include, depth) => { const cwd = stencilSys.getCurrentDirectory(); - // TODO(STENCIL-XXXX): Remove the final argument passed to `matchFiles` when Stencil is upgraded to TS v4.5 // TODO(STENCIL-344): Replace `matchFiles` with a function that is publicly exposed return (ts as any).matchFiles( path, @@ -94,10 +93,7 @@ export const patchTsSystemFileSystem = ( cwd, depth, getAccessibleFileSystemEntries, - realpath, - // TODO: Is this the right thing to do with all the patching we do? - // https://github.com/parcel-bundler/parcel/pull/6784 - ts.sys.directoryExists + realpath ); }; diff --git a/src/compiler/transformers/style-imports.ts b/src/compiler/transformers/style-imports.ts index 6bbca5f8459..86db4ba2b8f 100644 --- a/src/compiler/transformers/style-imports.ts +++ b/src/compiler/transformers/style-imports.ts @@ -70,12 +70,13 @@ const updateEsmStyleImportPath = ( const orgImportPath = n.moduleSpecifier.text; const importPath = getStyleImportPath(transformOpts, tsSourceFile, cmp, style, orgImportPath); - statements[i] = ts.updateImportDeclaration( + statements[i] = ts.factory.updateImportDeclaration( n, n.decorators, n.modifiers, n.importClause, - ts.createStringLiteral(importPath) + ts.factory.createStringLiteral(importPath), + undefined ); break; } diff --git a/src/compiler/transformers/test/parse-props.spec.ts b/src/compiler/transformers/test/parse-props.spec.ts index 114184064b8..4161eb5dc8b 100644 --- a/src/compiler/transformers/test/parse-props.spec.ts +++ b/src/compiler/transformers/test/parse-props.spec.ts @@ -168,7 +168,7 @@ describe('parse props', () => { location: 'global', }, }, - resolved: 'any', + resolved: 'Object', original: 'Object', }, docs: { diff --git a/src/compiler/transformers/transform-utils.ts b/src/compiler/transformers/transform-utils.ts index 3f42b9ea0c1..1e15d6ba744 100644 --- a/src/compiler/transformers/transform-utils.ts +++ b/src/compiler/transformers/transform-utils.ts @@ -595,9 +595,12 @@ export const createImportStatement = (importFnNames: string[], importPath: strin importFnName = splt[0]; } - return ts.createImportSpecifier( - typeof importFnName === 'string' && importFnName !== importAs ? ts.createIdentifier(importFnName) : undefined, - ts.createIdentifier(importAs) + return ts.factory.createImportSpecifier( + false, + typeof importFnName === 'string' && importFnName !== importAs + ? ts.factory.createIdentifier(importFnName) + : undefined, + ts.factory.createIdentifier(importAs) ); }); diff --git a/src/compiler/transformers/update-stencil-core-import.ts b/src/compiler/transformers/update-stencil-core-import.ts index 4f84c0a90fe..20731a37dbd 100644 --- a/src/compiler/transformers/update-stencil-core-import.ts +++ b/src/compiler/transformers/update-stencil-core-import.ts @@ -25,17 +25,21 @@ export const updateStencilCoreImports = (updatedCoreImportPath: string): ts.Tran const keepImports = origImports.map((e) => e.getText()).filter((name) => KEEP_IMPORTS.has(name)); if (keepImports.length > 0) { - const newImport = ts.updateImportDeclaration( + const newImport = ts.factory.updateImportDeclaration( s, undefined, undefined, - ts.createImportClause( + ts.factory.createImportClause( + false, undefined, - ts.createNamedImports( - keepImports.map((name) => ts.createImportSpecifier(undefined, ts.createIdentifier(name))) + ts.factory.createNamedImports( + keepImports.map((name) => + ts.factory.createImportSpecifier(false, undefined, ts.factory.createIdentifier(name)) + ) ) ), - ts.createStringLiteral(updatedCoreImportPath) + ts.factory.createStringLiteral(updatedCoreImportPath), + undefined ); newStatements.push(newImport); } diff --git a/test/karma/package-lock.json b/test/karma/package-lock.json index fe67c4cf3f9..86c653b7e9d 100644 --- a/test/karma/package-lock.json +++ b/test/karma/package-lock.json @@ -3,35 +3,35 @@ "lockfileVersion": 1, "dependencies": { "@babel/code-frame": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.0.tgz", - "integrity": "sha512-IF4EOMEV+bfYwOmNxGzSnjR2EmQod7f1UXOpZM3l4i4o4QNwzjtJAu/HxdjHq0aYBvdqMuQEY1eg0nqW9ZPORA==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", + "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", "dev": true, "requires": { - "@babel/highlight": "^7.16.0" + "@babel/highlight": "^7.16.7" } }, "@babel/compat-data": { - "version": "7.16.4", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.16.4.tgz", - "integrity": "sha512-1o/jo7D+kC9ZjHX5v+EHrdjl3PhxMrLSOTGsOdHJ+KL8HCaEK6ehrVL2RS6oHDZp+L7xLirLrPmQtEng769J/Q==", + "version": "7.16.8", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.16.8.tgz", + "integrity": "sha512-m7OkX0IdKLKPpBlJtF561YJal5y/jyI5fNfWbPxh2D/nbzzGI4qRyrD8xO2jB24u7l+5I2a43scCG2IrfjC50Q==", "dev": true }, "@babel/core": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.16.0.tgz", - "integrity": "sha512-mYZEvshBRHGsIAiyH5PzCFTCfbWfoYbO/jcSdXQSUQu1/pW0xDZAUP7KEc32heqWTAfAHhV9j1vH8Sav7l+JNQ==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.16.0", - "@babel/generator": "^7.16.0", - "@babel/helper-compilation-targets": "^7.16.0", - "@babel/helper-module-transforms": "^7.16.0", - "@babel/helpers": "^7.16.0", - "@babel/parser": "^7.16.0", - "@babel/template": "^7.16.0", - "@babel/traverse": "^7.16.0", - "@babel/types": "^7.16.0", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.16.7.tgz", + "integrity": "sha512-aeLaqcqThRNZYmbMqtulsetOQZ/5gbR/dWruUCJcpas4Qoyy+QeagfDsPdMrqwsPRDNxJvBlRiZxxX7THO7qtA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.16.7", + "@babel/generator": "^7.16.7", + "@babel/helper-compilation-targets": "^7.16.7", + "@babel/helper-module-transforms": "^7.16.7", + "@babel/helpers": "^7.16.7", + "@babel/parser": "^7.16.7", + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.16.7", + "@babel/types": "^7.16.7", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -70,12 +70,12 @@ } }, "@babel/generator": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.16.0.tgz", - "integrity": "sha512-RR8hUCfRQn9j9RPKEVXo9LiwoxLPYn6hNZlvUOR8tSnaxlD0p0+la00ZP9/SnRt6HchKr+X0fO2r8vrETiJGew==", + "version": "7.16.8", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.16.8.tgz", + "integrity": "sha512-1ojZwE9+lOXzcWdWmO6TbUzDfqLD39CmEhN8+2cX9XkDo5yW1OpgfejfliysR2AWLpMamTiOiAp/mtroaymhpw==", "dev": true, "requires": { - "@babel/types": "^7.16.0", + "@babel/types": "^7.16.8", "jsesc": "^2.5.1", "source-map": "^0.5.0" }, @@ -89,13 +89,13 @@ } }, "@babel/helper-compilation-targets": { - "version": "7.16.3", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.3.tgz", - "integrity": "sha512-vKsoSQAyBmxS35JUOOt+07cLc6Nk/2ljLIHwmq2/NM6hdioUaqEXq/S+nXvbvXbZkNDlWOymPanJGOc4CBjSJA==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.7.tgz", + "integrity": "sha512-mGojBwIWcwGD6rfqgRXVlVYmPAv7eOpIemUG3dGnDdCY4Pae70ROij3XmfrH6Fa1h1aiDylpglbZyktfzyo/hA==", "dev": true, "requires": { - "@babel/compat-data": "^7.16.0", - "@babel/helper-validator-option": "^7.14.5", + "@babel/compat-data": "^7.16.4", + "@babel/helper-validator-option": "^7.16.7", "browserslist": "^4.17.5", "semver": "^6.3.0" }, @@ -108,146 +108,125 @@ } } }, - "@babel/helper-function-name": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.16.0.tgz", - "integrity": "sha512-BZh4mEk1xi2h4HFjWUXRQX5AEx4rvaZxHgax9gcjdLWdkjsY7MKt5p0otjsg5noXw+pB+clMCjw+aEVYADMjog==", + "@babel/helper-environment-visitor": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.7.tgz", + "integrity": "sha512-SLLb0AAn6PkUeAfKJCCOl9e1R53pQlGAfc4y4XuMRZfqeMYLE0dM1LMhqbGAlGQY0lfw5/ohoYWAe9V1yibRag==", "dev": true, "requires": { - "@babel/helper-get-function-arity": "^7.16.0", - "@babel/template": "^7.16.0", - "@babel/types": "^7.16.0" + "@babel/types": "^7.16.7" } }, - "@babel/helper-get-function-arity": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.0.tgz", - "integrity": "sha512-ASCquNcywC1NkYh/z7Cgp3w31YW8aojjYIlNg4VeJiHkqyP4AzIvr4qx7pYDb4/s8YcsZWqqOSxgkvjUz1kpDQ==", + "@babel/helper-function-name": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.16.7.tgz", + "integrity": "sha512-QfDfEnIUyyBSR3HtrtGECuZ6DAyCkYFp7GHl75vFtTnn6pjKeK0T1DB5lLkFvBea8MdaiUABx3osbgLyInoejA==", "dev": true, "requires": { - "@babel/types": "^7.16.0" + "@babel/helper-get-function-arity": "^7.16.7", + "@babel/template": "^7.16.7", + "@babel/types": "^7.16.7" } }, - "@babel/helper-hoist-variables": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.0.tgz", - "integrity": "sha512-1AZlpazjUR0EQZQv3sgRNfM9mEVWPK3M6vlalczA+EECcPz3XPh6VplbErL5UoMpChhSck5wAJHthlj1bYpcmg==", + "@babel/helper-get-function-arity": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.7.tgz", + "integrity": "sha512-flc+RLSOBXzNzVhcLu6ujeHUrD6tANAOU5ojrRx/as+tbzf8+stUCj7+IfRRoAbEZqj/ahXEMsjhOhgeZsrnTw==", "dev": true, "requires": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.16.7" } }, - "@babel/helper-member-expression-to-functions": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.16.0.tgz", - "integrity": "sha512-bsjlBFPuWT6IWhl28EdrQ+gTvSvj5tqVP5Xeftp07SEuz5pLnsXZuDkDD3Rfcxy0IsHmbZ+7B2/9SHzxO0T+sQ==", + "@babel/helper-hoist-variables": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz", + "integrity": "sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg==", "dev": true, "requires": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.16.7" } }, "@babel/helper-module-imports": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.0.tgz", - "integrity": "sha512-kkH7sWzKPq0xt3H1n+ghb4xEMP8k0U7XV3kkB+ZGy69kDk2ySFW1qPi06sjKzFY3t1j6XbJSqr4mF9L7CYVyhg==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.7.tgz", + "integrity": "sha512-LVtS6TqjJHFc+nYeITRo6VLXve70xmq7wPhWTqDJusJEgGmkAACWwMiTNrvfoQo6hEhFwAIixNkvB0jPXDL8Wg==", "dev": true, "requires": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.16.7" } }, "@babel/helper-module-transforms": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.16.0.tgz", - "integrity": "sha512-My4cr9ATcaBbmaEa8M0dZNA74cfI6gitvUAskgDtAFmAqyFKDSHQo5YstxPbN+lzHl2D9l/YOEFqb2mtUh4gfA==", - "dev": true, - "requires": { - "@babel/helper-module-imports": "^7.16.0", - "@babel/helper-replace-supers": "^7.16.0", - "@babel/helper-simple-access": "^7.16.0", - "@babel/helper-split-export-declaration": "^7.16.0", - "@babel/helper-validator-identifier": "^7.15.7", - "@babel/template": "^7.16.0", - "@babel/traverse": "^7.16.0", - "@babel/types": "^7.16.0" - } - }, - "@babel/helper-optimise-call-expression": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.16.0.tgz", - "integrity": "sha512-SuI467Gi2V8fkofm2JPnZzB/SUuXoJA5zXe/xzyPP2M04686RzFKFHPK6HDVN6JvWBIEW8tt9hPR7fXdn2Lgpw==", - "dev": true, - "requires": { - "@babel/types": "^7.16.0" - } - }, - "@babel/helper-replace-supers": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.16.0.tgz", - "integrity": "sha512-TQxuQfSCdoha7cpRNJvfaYxxxzmbxXw/+6cS7V02eeDYyhxderSoMVALvwupA54/pZcOTtVeJ0xccp1nGWladA==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.16.7.tgz", + "integrity": "sha512-gaqtLDxJEFCeQbYp9aLAefjhkKdjKcdh6DB7jniIGU3Pz52WAmP268zK0VgPz9hUNkMSYeH976K2/Y6yPadpng==", "dev": true, "requires": { - "@babel/helper-member-expression-to-functions": "^7.16.0", - "@babel/helper-optimise-call-expression": "^7.16.0", - "@babel/traverse": "^7.16.0", - "@babel/types": "^7.16.0" + "@babel/helper-environment-visitor": "^7.16.7", + "@babel/helper-module-imports": "^7.16.7", + "@babel/helper-simple-access": "^7.16.7", + "@babel/helper-split-export-declaration": "^7.16.7", + "@babel/helper-validator-identifier": "^7.16.7", + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.16.7", + "@babel/types": "^7.16.7" } }, "@babel/helper-simple-access": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.16.0.tgz", - "integrity": "sha512-o1rjBT/gppAqKsYfUdfHq5Rk03lMQrkPHG1OWzHWpLgVXRH4HnMM9Et9CVdIqwkCQlobnGHEJMsgWP/jE1zUiw==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.16.7.tgz", + "integrity": "sha512-ZIzHVyoeLMvXMN/vok/a4LWRy8G2v205mNP0XOuf9XRLyX5/u9CnVulUtDgUTama3lT+bf/UqucuZjqiGuTS1g==", "dev": true, "requires": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.16.7" } }, "@babel/helper-split-export-declaration": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.0.tgz", - "integrity": "sha512-0YMMRpuDFNGTHNRiiqJX19GjNXA4H0E8jZ2ibccfSxaCogbm3am5WN/2nQNj0YnQwGWM1J06GOcQ2qnh3+0paw==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz", + "integrity": "sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw==", "dev": true, "requires": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.16.7" } }, "@babel/helper-validator-identifier": { - "version": "7.15.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz", - "integrity": "sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", + "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", "dev": true }, "@babel/helper-validator-option": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.14.5.tgz", - "integrity": "sha512-OX8D5eeX4XwcroVW45NMvoYaIuFI+GQpA2a8Gi+X/U/cDUIRsV37qQfF905F0htTRCREQIB4KqPeaveRJUl3Ow==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz", + "integrity": "sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ==", "dev": true }, "@babel/helpers": { - "version": "7.16.3", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.16.3.tgz", - "integrity": "sha512-Xn8IhDlBPhvYTvgewPKawhADichOsbkZuzN7qz2BusOM0brChsyXMDJvldWaYMMUNiCQdQzNEioXTp3sC8Nt8w==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.16.7.tgz", + "integrity": "sha512-9ZDoqtfY7AuEOt3cxchfii6C7GDyyMBffktR5B2jvWv8u2+efwvpnVKXMWzNehqy68tKgAfSwfdw/lWpthS2bw==", "dev": true, "requires": { - "@babel/template": "^7.16.0", - "@babel/traverse": "^7.16.3", - "@babel/types": "^7.16.0" + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.16.7", + "@babel/types": "^7.16.7" } }, "@babel/highlight": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.0.tgz", - "integrity": "sha512-t8MH41kUQylBtu2+4IQA3atqevA2lRgqA2wyVB/YiWmsDSuylZZuXOUy9ric30hfzauEFfdsuk/eXTRrGrfd0g==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.7.tgz", + "integrity": "sha512-aKpPMfLvGO3Q97V0qhw/V2SWNWlwfJknuwAunU7wZLSfrM4xTBvg7E5opUVi1kJTBKihE38CPg4nBiqX83PWYw==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.15.7", + "@babel/helper-validator-identifier": "^7.16.7", "chalk": "^2.0.0", "js-tokens": "^4.0.0" } }, "@babel/parser": { - "version": "7.16.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.16.4.tgz", - "integrity": "sha512-6V0qdPUaiVHH3RtZeLIsc+6pDhbYzHR8ogA8w+f+Wc77DuXto19g2QUwveINoS34Uw+W8/hQDGJCx+i4n7xcng==", + "version": "7.16.8", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.16.8.tgz", + "integrity": "sha512-i7jDUfrVBWc+7OKcBzEe5n7fbv3i2fWtxKzzCvOjnzSxMfWMigAhtfJ7qzZNGFNMsCCd67+uz553dYKWXPvCKw==", "dev": true }, "@babel/runtime": { @@ -260,29 +239,30 @@ } }, "@babel/template": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.16.0.tgz", - "integrity": "sha512-MnZdpFD/ZdYhXwiunMqqgyZyucaYsbL0IrjoGjaVhGilz+x8YB++kRfygSOIj1yOtWKPlx7NBp+9I1RQSgsd5A==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.16.7.tgz", + "integrity": "sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w==", "dev": true, "requires": { - "@babel/code-frame": "^7.16.0", - "@babel/parser": "^7.16.0", - "@babel/types": "^7.16.0" + "@babel/code-frame": "^7.16.7", + "@babel/parser": "^7.16.7", + "@babel/types": "^7.16.7" } }, "@babel/traverse": { - "version": "7.16.3", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.16.3.tgz", - "integrity": "sha512-eolumr1vVMjqevCpwVO99yN/LoGL0EyHiLO5I043aYQvwOJ9eR5UsZSClHVCzfhBduMAsSzgA/6AyqPjNayJag==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.16.0", - "@babel/generator": "^7.16.0", - "@babel/helper-function-name": "^7.16.0", - "@babel/helper-hoist-variables": "^7.16.0", - "@babel/helper-split-export-declaration": "^7.16.0", - "@babel/parser": "^7.16.3", - "@babel/types": "^7.16.0", + "version": "7.16.8", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.16.8.tgz", + "integrity": "sha512-xe+H7JlvKsDQwXRsBhSnq1/+9c+LlQcCK3Tn/l5sbx02HYns/cn7ibp9+RV1sIUqu7hKg91NWsgHurO9dowITQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.16.7", + "@babel/generator": "^7.16.8", + "@babel/helper-environment-visitor": "^7.16.7", + "@babel/helper-function-name": "^7.16.7", + "@babel/helper-hoist-variables": "^7.16.7", + "@babel/helper-split-export-declaration": "^7.16.7", + "@babel/parser": "^7.16.8", + "@babel/types": "^7.16.8", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -305,12 +285,12 @@ } }, "@babel/types": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.16.0.tgz", - "integrity": "sha512-PJgg/k3SdLsGb3hhisFvtLOw5ts113klrpLuIPtCJIU+BB24fqq6lf8RWqKJEjzqXR9AEH1rIb5XTqwBHB+kQg==", + "version": "7.16.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.16.8.tgz", + "integrity": "sha512-smN2DQc5s4M7fntyjGtyIPbRJv6wW4rU/94fmYJ7PKQuZkC0qGMHXJbg6sNGt12JmVr4k5YaptI/XtiLJBnmIg==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.15.7", + "@babel/helper-validator-identifier": "^7.16.7", "to-fast-properties": "^2.0.0" } }, @@ -436,9 +416,9 @@ } }, "acorn": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.6.0.tgz", - "integrity": "sha512-U1riIR+lBSNi3IbxtaHOIKdH8sLFv3NYfNv8sg7ZsNhcfl4HF2++BfqqrNAxoCLQW1iiylOj76ecnaUxz+z9yw==", + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", + "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", "dev": true }, "acorn-walk": { @@ -526,9 +506,9 @@ } }, "async": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.2.tgz", - "integrity": "sha512-H0E+qZaDEfx/FY4t7iLRv1W2fFI6+pyCeTw1uN20AQPiwqwM6ojPxHxdLv4z8hi2DtnW9BOckSspLucW7pIE5g==", + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.3.tgz", + "integrity": "sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g==", "dev": true }, "atob": { @@ -783,13 +763,13 @@ } }, "browserslist": { - "version": "4.18.1", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.18.1.tgz", - "integrity": "sha512-8ScCzdpPwR2wQh8IT82CA2VgDwjHyqMovPBZSNH54+tm4Jk2pCuv90gmAdH6J84OCRWi0b4gMe6O6XPXuJnjgQ==", + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.19.1.tgz", + "integrity": "sha512-u2tbbG5PdKRTUoctO3NBD8FQ5HdPh1ZXPHzp1rwaa5jTc+RV9/+RlWiAIKmjRPQF+xbGM9Kklj5bZQFa2s/38A==", "dev": true, "requires": { - "caniuse-lite": "^1.0.30001280", - "electron-to-chromium": "^1.3.896", + "caniuse-lite": "^1.0.30001286", + "electron-to-chromium": "^1.4.17", "escalade": "^3.1.1", "node-releases": "^2.0.1", "picocolors": "^1.0.0" @@ -902,9 +882,9 @@ "dev": true }, "caniuse-lite": { - "version": "1.0.30001286", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001286.tgz", - "integrity": "sha512-zaEMRH6xg8ESMi2eQ3R4eZ5qw/hJiVsO/HlLwniIwErij0JDr9P+8V4dtx1l+kLq6j3yy8l8W4fst1lBnat5wQ==", + "version": "1.0.30001299", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001299.tgz", + "integrity": "sha512-iujN4+x7QzqA2NCSrS5VUy+4gLmRd4xv6vbBBsmfVqTx8bLAD8097euLqQgKxSVLvxjSDcvF1T/i9ocgnUFexw==", "dev": true }, "chalk": { @@ -1373,9 +1353,9 @@ "dev": true }, "electron-to-chromium": { - "version": "1.4.14", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.14.tgz", - "integrity": "sha512-RsGkAN9JEAYMObS72kzUsPPcPGMqX1rBqGuXi9aa4TBKLzICoLf+DAAtd0fVFzrniJqYzpby47gthCUoObfs0Q==", + "version": "1.4.44", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.44.tgz", + "integrity": "sha512-tHGWiUUmY7GABK8+DNcr474cnZDTzD8x1736SlDosVH8+/vRJeqfaIBAEHFtMjddz/0T4rKKYsxEc8BwQRdBpw==", "dev": true }, "elliptic": { @@ -2169,9 +2149,9 @@ } }, "is-negative-zero": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz", - "integrity": "sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", + "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==", "dev": true }, "is-number": { @@ -2270,12 +2250,12 @@ } }, "is-weakref": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.1.tgz", - "integrity": "sha512-b2jKc2pQZjaeFYWEf7ScFj+Be1I+PXmlu572Q8coTXZ+LD/QQZ7ShPMst8h16riVgyXTQwUsFEl74mDvc/3MHQ==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", + "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", "dev": true, "requires": { - "call-bind": "^1.0.0" + "call-bind": "^1.0.2" } }, "isarray": { @@ -2400,9 +2380,9 @@ } }, "istanbul-reports": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.1.tgz", - "integrity": "sha512-q1kvhAXWSsXfMjCdNHNPKZZv94OlspKnoGv+R9RGbnqOOQ0VbNfLFgQDVgi7hHenKsndGq3/o0OBdzDXthWcNw==", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.3.tgz", + "integrity": "sha512-x9LtDVtfm/t1GFiLl3NffC7hz+I1ragvgX1P/Lg1NlIagifZDKUkuuaAxH/qpwj2IuEfD8G2Bs/UKp+sZ/pKkg==", "dev": true, "requires": { "html-escaper": "^2.0.0", @@ -2545,9 +2525,9 @@ "dev": true }, "karma-typescript": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/karma-typescript/-/karma-typescript-5.5.2.tgz", - "integrity": "sha512-2rNhiCMrIF+VR8jMuovOLSRjNkjdoE/kQ4XYZU94lMkHNQtnqCaToAnztMj4fuOPRErL7VIkwvJEO7jBd47Q6A==", + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/karma-typescript/-/karma-typescript-5.5.3.tgz", + "integrity": "sha512-l1FHurolXEBIzRa9ExpNtjzysAhsi/vLpTazpwLHWWK86mknvVpqor6pRZ5Nid7jvOPrTBqAq0JRuLgiCdRkFw==", "dev": true, "requires": { "acorn": "^8.1.0", @@ -2867,9 +2847,9 @@ } }, "object-inspect": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.11.1.tgz", - "integrity": "sha512-If7BjFlpkzzBeV1cqgT3OSWT3azyoxDGajR+iGnFBfVV2EWyDyWaZZW2ERDjUaY2QM8i5jI3Sj7mhsM4DDAqWA==", + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.0.tgz", + "integrity": "sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==", "dev": true }, "object-is": { @@ -3282,13 +3262,14 @@ "dev": true }, "resolve": { - "version": "1.20.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", - "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", + "version": "1.21.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.21.0.tgz", + "integrity": "sha512-3wCbTpk5WJlyE4mSOtDLhqQmGFi0/TD9VPwmiolnk8U0wRgMEktqCXd3vy5buTO3tljvalNvKrjHEfrd2WpEKA==", "dev": true, "requires": { - "is-core-module": "^2.2.0", - "path-parse": "^1.0.6" + "is-core-module": "^2.8.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" } }, "resolve-cwd": { @@ -3808,6 +3789,12 @@ "has-flag": "^3.0.0" } }, + "supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true + }, "temp-fs": { "version": "0.9.9", "resolved": "https://registry.npmjs.org/temp-fs/-/temp-fs-0.9.9.tgz", diff --git a/test/karma/package.json b/test/karma/package.json index 53ae55bfe1b..3ae52e35fd0 100644 --- a/test/karma/package.json +++ b/test/karma/package.json @@ -37,7 +37,7 @@ "karma-ie-launcher": "^1.0.0", "karma-jasmine": "^4.0.1", "karma-polyfill": "^1.1.0", - "karma-typescript": "^5.5.2", + "karma-typescript": "^5.5.3", "normalize.css": "^8.0.1", "rollup-plugin-node-polyfills": "^0.1.2", "webpack-cli": "^4.9.1", From b365de1984f4e948f5acee6f5da0ba1e61508fd2 Mon Sep 17 00:00:00 2001 From: Ryan Waskiewicz Date: Thu, 27 Jan 2022 11:33:19 -0500 Subject: [PATCH 10/10] return Promise for mock-doc CE registry hit instead of bare ctor --- src/mock-doc/custom-element-registry.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mock-doc/custom-element-registry.ts b/src/mock-doc/custom-element-registry.ts index 0ae85e5279c..e76cfb9a424 100644 --- a/src/mock-doc/custom-element-registry.ts +++ b/src/mock-doc/custom-element-registry.ts @@ -85,7 +85,7 @@ export class MockCustomElementRegistry implements CustomElementRegistry { tagName = tagName.toLowerCase(); if (this.__registry != null && this.__registry.has(tagName) === true) { - return this.__registry.get(tagName).cstr; + return Promise.resolve(this.__registry.get(tagName).cstr); } return new Promise((resolve) => {