-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
inspector: normalized script URL in inspector protocol #22223
Comments
+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. |
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. |
@TimothyGu I need it for ndb. |
Newer versions of Node will require that URLs be well-formatted when setting breakpoints (and will also return well-formatted URLs), as a result of nodejs/node#22223 (this will also affect versions of Node to which that PR will be backported). Enforcing well-formatted URLs will break the Debug Agent, so this PR addresses that. If tests pass for current versions of Node, I think this should be merged now (rather than wait for Node 11).
V8Inspector exposes protocol for inspection and debugging node state. There are a lot of different URL exposures:
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:
The text was updated successfully, but these errors were encountered: