Skip to content

Conversation

@typescript-bot
Copy link
Collaborator

Please review the diff and merge if no changes are unexpected.
You can view the build log here.

cc @weswigham @sandersn @mhegazy

Copy link
Member

@sandersn sandersn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look OK, a result of binding and typing module.exports, except for chome-devtools-frontend and webpack. I need to investigate those further, although they could turn out to be fine too.

@@ -0,0 +1,7 @@
Exit Code: 1
Standard output:
lib/NormalModule.js(163,12): error TS2451: Cannot redeclare block-scoped variable 'module'.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

webpack is creating its own module a la const module = new NativeModule(filename, this); return module.exports. This already has some suppressed errors, although this one is not a good one since the global module is not supposed to be a block-scoped variable. I think some predicate I recently added needs to check SymbolFlags.ModuleExports in addition to looking for the syntax module.exports.

@@ -29,8 +29,6 @@ node_modules/chrome-devtools-frontend/front_end/Runtime.js(270,9): error TS2322:
Type 'void' is not assignable to type 'undefined'.
node_modules/chrome-devtools-frontend/front_end/Runtime.js(280,5): error TS2322: Type 'Promise<void>' is not assignable to type 'Promise<undefined>'.
node_modules/chrome-devtools-frontend/front_end/Runtime.js(283,7): error TS2554: Expected 2-3 arguments, but got 1.
node_modules/chrome-devtools-frontend/front_end/Runtime.js(398,24): error TS1138: Parameter declaration expected.
node_modules/chrome-devtools-frontend/front_end/Runtime.js(398,24): error TS8024: JSDoc '@param' tag has name 'function', but there is no parameter with that name.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a result of better closure function type parsing

@@ -2821,6 +2819,9 @@ node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighth
node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(60267,11): error TS2304: Cannot find name 'define'.
node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(60267,32): error TS2304: Cannot find name 'define'.
node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(60268,1): error TS2304: Cannot find name 'define'.
node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(60288,5): error TS2322: Type '{ exports: { [x: string]: any; }; id: any; loaded: boolean; }' is not assignable to type '{ "../../../tests/cases/user/chrome-devtools-frontend/node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background": any; }'.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AMD module tries to overwrite module, but it's now already bound and therefore gives an assignability error.

@@ -3255,6 +3252,12 @@ node_modules/chrome-devtools-frontend/front_end/bindings_test_runner/IsolatedFil
node_modules/chrome-devtools-frontend/front_end/bindings_test_runner/IsolatedFilesystemTestRunner.js(275,8): error TS2551: Property '_entry' does not exist on type 'typeof TestFileSystem'. Did you mean 'Entry'?
node_modules/chrome-devtools-frontend/front_end/bindings_test_runner/IsolatedFilesystemTestRunner.js(276,8): error TS2339: Property '_modificationTimesDelta' does not exist on type 'typeof TestFileSystem'.
node_modules/chrome-devtools-frontend/front_end/bindings_test_runner/OverridesTestRunner.js(7,13): error TS1064: The return type of an async function or method must be the global Promise<T> type.
node_modules/chrome-devtools-frontend/front_end/bindings_test_runner/PersistenceTestRunner.js(45,46): error TS2345: Argument of type '(bindingCreated: (arg0: PersistenceBinding) => any, bindingRemoved: (arg0: PersistenceBinding) => any) => DefaultMapping' is not assignable to parameter of type '(arg0: (arg0: PersistenceBinding) => any, arg1: (arg0: PersistenceBinding) => any) => { [x: string]: any; dispose: () => void; }'.
Type 'DefaultMapping' is not assignable to type '{ [x: string]: any; dispose: () => void; }'.
Property '_workspace' does not exist on type '{ [x: string]: any; dispose: () => void; }'.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better parsing of function types leads to better type checking, and a new variance error.

@@ -7930,7 +7915,6 @@ node_modules/chrome-devtools-frontend/front_end/network/NetworkWaterfallColumn.j
node_modules/chrome-devtools-frontend/front_end/network/NetworkWaterfallColumn.js(613,32): error TS2339: Property '_LayerStyle' does not exist on type 'typeof NetworkWaterfallColumn'.
node_modules/chrome-devtools-frontend/front_end/network/NetworkWaterfallColumn.js(616,32): error TS2339: Property '_TextLayer' does not exist on type 'typeof NetworkWaterfallColumn'.
node_modules/chrome-devtools-frontend/front_end/network/RequestCookiesView.js(55,48): error TS2555: Expected at least 2 arguments, but got 1.
node_modules/chrome-devtools-frontend/front_end/network/RequestCookiesView.js(81,26): error TS2554: Expected 4 arguments, but got 0.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better function parsing means that trailing = on function()= is now recognised.

node_modules/chrome-devtools-frontend/front_end/sdk/TargetManager.js(15,120): error TS2694: Namespace 'Common' has no exported member 'Event'.
node_modules/chrome-devtools-frontend/front_end/sdk/TargetManager.js(17,20): error TS1099: Type argument list cannot be empty.
node_modules/chrome-devtools-frontend/front_end/sdk/TargetManager.js(17,21): error TS1005: '>' expected.
node_modules/chrome-devtools-frontend/front_end/sdk/TargetManager.js(104,35): error TS2345: Argument of type 'new (arg1: Target) => T' is not assignable to parameter of type 'new (arg1: Target) => SDKModel'.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better parsing means better parse errors. Looks like we catch a bug that closure misses, where the type parameter is on the method but should be on the class. (or, perhaps, there should be no type parameters at all.)

@sandersn
Copy link
Member

Opened #25869 to fix the webpack regression. Let's close this PR and wait for tomorrow's to update the other baselines.

@sandersn sandersn closed this Jul 23, 2018
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants