| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
Is this supposed to be a WIP? Are we waiting for some V8 API addition that we can feed sourcemaps to to pair with this?
Sorry, something went wrong.
@joyeecheung I've been thinking about this design problem for a little bit of time now, and the conclusion I've been coming to is we'd need to support source maps in both Node.js and V8: Role I feel V8 should serve in supporting source maps
Role I feel Node.js should serve in supporting source maps
The scope of this proposalI propose we start simple, by collecting source maps from source files, caching them, and exposing them similarly to how we expose coverage. In follow up pull requests we could then gradually introduce additional behavior:
|
Sorry, something went wrong.
|
@joyeecheung l added the method WriteSourceMapCache, which writes the source map cache to disk at the same time that the coverage data is written. To me, it seemed like the most straight forward place to expose source maps from their JavaScript implementation in source_map.js to inspector_profiler.cc for serializing, was as an accessor on the global process object. As you've recommended, I intend to extend on the source-map support further to:
Which is why I'd like to keep much of the implementation in source_map.js, taking advantage of higher level APIs, ideally just performing serialization in C++, if we can find an approach that makes folks happy. |
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
PR-URL: #28960 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com>
PR-URL: #28960 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com>
Notable changes: * crypto: * Add `oaepLabel` option #29489 * deps: * Update V8 to 7.7.299.11 #28918 * More efficient memory handling * Stack trace serialization got faster * The `Intl.NumberFormat` API gained new functionality * For more information: https://v8.dev/blog/v8-release-77 * events: * Add support for `EventTarget` in `once` #29498 * fs: * Expose memory file mapping flag `UV_FS_O_FILEMAP` #29260 * inspector: * New API - `Session.connectToMainThread` #28870 * process: * Initial SourceMap support via `env.NODE_V8_COVERAGE` #28960 * stream: * Make `_write()` optional when `_writev()` is implemented #29639 * tls: * Add option to override signature algorithms #29598 * util: * Add `encodeInto` to `TextEncoder` #29524 * worker: * The `worker_thread` module is now stable #29512
PR-URL: #28960 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com>
Notable changes: * crypto: * Add `oaepLabel` option #29489 * deps: * Update V8 to 7.7.299.11 #28918 * More efficient memory handling * Stack trace serialization got faster * The `Intl.NumberFormat` API gained new functionality * For more information: https://v8.dev/blog/v8-release-77 * events: * Add support for `EventTarget` in `once` #29498 * fs: * Expose memory file mapping flag `UV_FS_O_FILEMAP` #29260 * inspector: * New API - `Session.connectToMainThread` #28870 * process: * Initial SourceMap support via `env.NODE_V8_COVERAGE` #28960 * stream: * Make `_write()` optional when `_writev()` is implemented #29639 * tls: * Add option to override signature algorithms #29598 * util: * Add `encodeInto` to `TextEncoder` #29524 * worker: * The `worker_thread` module is now stable #29512 PR-URL: #29695
Notable changes: * crypto: * Add `oaepLabel` option #29489 * deps: * Update V8 to 7.7.299.11 #28918 * More efficient memory handling * Stack trace serialization got faster * The `Intl.NumberFormat` API gained new functionality * For more information: https://v8.dev/blog/v8-release-77 * events: * Add support for `EventTarget` in `once` #29498 * fs: * Expose memory file mapping flag `UV_FS_O_FILEMAP` #29260 * inspector: * New API - `Session.connectToMainThread` #28870 * process: * Initial SourceMap support via `env.NODE_V8_COVERAGE` #28960 * stream: * Make `_write()` optional when `_writev()` is implemented #29639 * tls: * Add option to override signature algorithms #29598 * util: * Add `encodeInto` to `TextEncoder` #29524 * worker: * The `worker_thread` module is now stable #29512 PR-URL: #29695
| Back | FazBrowse Home | New Git URL |
Adds support for caching source maps when they're observed in footer of script file, and outputting them to the coverage directory if NODE_V8_COVERAGE is enabled.
This is seen as an initial step towards more thorough support for source maps inside Node.js itself.
Goal of this PR
Get it to the point where upstream tooling can detect source maps, even in the cases where they've been inserted by custom loaders or require.extensions.
Future Work (outside the scope of this PR)
Checklist
CC: @schuay, @snehasi (I've left some tests blank and I think this would be a great starting point for some of the work we're doing in the mentorship program).
Remaining Work