process: initial SourceMap support via NODE_V8_COVERAGE#28960
process: initial SourceMap support via NODE_V8_COVERAGE#28960bcoe wants to merge 1 commit intonodejs:masterfrom
Conversation
joyeecheung
left a comment
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?
@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:
|
fd155c3 to
3b07d5b
Compare
|
@joyeecheung l added the method To me, it seemed like the most straight forward place to expose source maps from their JavaScript implementation in 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 |
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>
|
Landed in 8f06773 🎉 |
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
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
make -j4 test(UNIX), orvcbuild test(Windows) passesCC: @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
discuss future API direction (pull together design doc?).