You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
inspector: normalized script URL in inspector protocol #22223
Node internally uses the platform-specific path as script URL in some cases and file URL in other (see --experimental-modules). It makes using protocol much harder, e.g., when we need to set breakpoint ahead of time, we need to generate RegExp that will match platform-specific path and file URL to be ready for a different way how Node executes module.
I have a plan to make everything better:
Add new V8InspectorClient method: resourceNameToURL. V8Inspector calls this method whenever getting a new URL from Node, e.g., when the new script is parsed.
Implement this method for Node. Node implementation will normalize the platform-specific path to the file URL.
Backport these two patches through Node 10 back to 8 since they should not affect anything in runtime and will make a life of different Node tools much easier.
+1. This has caused some confusion in bcoe/c8#14, and I wouldn't surprised if other Inspector-based tools also meet this.
Backport these two patches through Node 10 back to 8 since they should not affect anything in runtime and will make a life of different Node tools much easier.
This is the part I'm not sure about. I could certainly imagine existing tools using the format of the URL (that it's… not a URL) to distinguish Node.js instances from Chrome, for example. Changing the URL of an inspected script could be seen as a semver-major change even.
distinguish Node.js instances from Chrome, for example
Are we talking about Electron case when Node.js and Chrome share the same V8? Otherwise, it sounds like we should have two different connection one to node and one to Chrome. In Elector like case Debugger.scriptParsed event contains an executionContextAuxData field that should include various information for Node scripts and Chrome scripts.
I believe that at least I can backport my V8 change to current master branch and start working on normalization for Node 11. At the same time I think that with current URLs it is not possible to write a tool that will work nicely with experimental modules and regular modules without processing file URL case, so most tools should be prepared, and it would be nice to get it merged to Node 10 to help tools developers.
Activity
TimothyGu commentedon Aug 10, 2018
+1. This has caused some confusion in bcoe/c8#14, and I wouldn't surprised if other Inspector-based tools also meet this.
This is the part I'm not sure about. I could certainly imagine existing tools using the format of the URL (that it's… not a URL) to distinguish Node.js instances from Chrome, for example. Changing the URL of an inspected script could be seen as a semver-major change even.
alexkozy commentedon Aug 10, 2018
Are we talking about Electron case when Node.js and Chrome share the same V8? Otherwise, it sounds like we should have two different connection one to node and one to Chrome. In Elector like case Debugger.scriptParsed event contains an executionContextAuxData field that should include various information for Node scripts and Chrome scripts.
I believe that at least I can backport my V8 change to current master branch and start working on normalization for Node 11. At the same time I think that with current URLs it is not possible to write a tool that will work nicely with experimental modules and regular modules without processing file URL case, so most tools should be prepared, and it would be nice to get it merged to Node 10 to help tools developers.
alexkozy commentedon Aug 13, 2018
@TimothyGu
I have alternative to merging back proposal: merge it back to Node 8 but enable only behind the flag. WDYT?
I need it for ndb.
fix: use well-formatted URLs when setting breakpoints (#535)
inspector: implemented V8InspectorClient::resourceNameToUrl