镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Exclude global types from devtools user test - #20172

Merged
Wesley Wigham (weswigham) merged 1 commit into
microsoft:masterfrom
weswigham:no-node-in-devtools
Nov 20, 2017
Merged

Wesley Wigham (weswigham) merged 1 commit into
microsoft:masterfrom
weswigham:no-node-in-devtools

Conversation

@weswigham

@weswigham Wesley Wigham (weswigham) commented Nov 20, 2017 •

Copy link
Copy Markdown
Member

Because it contained a handful of conflicting declarations which happened to trigger an error from #19356, which has a machine-specific path in the message.

Could we revert #19356 and instead implement #10489 in the near future? At least internally I don't think we've ever been happy with seeing those paths in any baselines; especially when they appear in a library file.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A couple of questions, although I think it's fine to merge.

node_modules/chrome-devtools-frontend/front_end/cm/comment.js(6,17): error TS2307: Cannot find module '../../lib/codemirror'.
node_modules/chrome-devtools-frontend/front_end/cm/comment.js(7,19): error TS2304: Cannot find name 'define'.
node_modules/chrome-devtools-frontend/front_end/cm/comment.js(7,43): error TS2304: Cannot find name 'define'.
node_modules/chrome-devtools-frontend/front_end/cm/comment.js(8,5): error TS2304: Cannot find name 'define'.
node_modules/chrome-devtools-frontend/front_end/cm/markselection.js(12,9): error TS2304: Cannot find name 'require'.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

should it have 'node' in order to find require?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

require in these files is part of a UMD header. It's not actually in use, in the strictest sense:

(function(mod) {
  if (typeof exports == "object" && typeof module == "object") // CommonJS
    mod(require("../../lib/codemirror"));
  else if (typeof define == "function" && define.amd) // AMD
    define(["../../lib/codemirror"], mod);
  else // Plain browser env
    mod(CodeMirror);
})(function(CodeMirror) {

and chrome doesn't define it in their externs file (likely because the entire cm folder is marked as external, and so is not strictly checked).

@@ -5866,7 +5886,7 @@ node_modules/chrome-devtools-frontend/front_end/cm/codemirror.js(8795,39): error
node_modules/chrome-devtools-frontend/front_end/cm/codemirror.js(8799,38): error TS2339: Property 'offset' does not exist on type '{ [x: string]: any; node: any; start: number; end: number; collapse: any; coverStart: any; coverE...'.
Property 'offset' does not exist on type '{ [x: string]: any; node: any; start: number; end: number; collapse: any; coverStart: any; coverE...'.
node_modules/chrome-devtools-frontend/front_end/cm/codemirror.js(8817,16): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'number'.
node_modules/chrome-devtools-frontend/front_end/cm/codemirror.js(8818,3): error TS2322: Type 'Timer' is not assignable to type 'boolean'.
node_modules/chrome-devtools-frontend/front_end/cm/codemirror.js(8818,3): error TS2322: Type 'number' is not assignable to type 'boolean'.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

is this a result of this change, or just an update in the baselines?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

node re-typed setTimeout to return Timer instead of just number.

@weswigham
Wesley Wigham (weswigham) merged commit 2c8e49f into microsoft:master Nov 20, 2017
@weswigham
Wesley Wigham (weswigham) deleted the no-node-in-devtools branch November 20, 2017 23:17
@sandersn

Copy link
Copy Markdown
Member

This only gets rid of a few of the absolute paths in error messages. I agree that we should address this generally in the compiler.

@weswigham

Copy link
Copy Markdown
Member Author

Mohamed Hegazy (@mhegazy) already opened #20178 to track

@microsoft Microsoft (microsoft) locked and limited conversation to collaborators Jun 14, 2018
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