-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
lib: allow skipping source maps in node_modules #56639
base: main
Are you sure you want to change the base?
Conversation
Review requested:
|
fb1a57e
to
cfc1fd9
Compare
cfc1fd9
to
94667aa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Considering many enable source maps via --enable-source-maps
I think it also warrants something like --disable-source-maps-in-node-modules
or some other flag with a better name? Otherwise end users have to preload a script that invokes the API which is a bit of a hassle. We can set it to false by default for existing releases and in the next major release, flip it to true.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #56639 +/- ##
=======================================
Coverage 89.21% 89.21%
=======================================
Files 662 662
Lines 191934 191961 +27
Branches 36945 36947 +2
=======================================
+ Hits 171227 171266 +39
+ Misses 13543 13542 -1
+ Partials 7164 7153 -11
|
94667aa
to
593b4ff
Compare
Files in `node_modules` are not authored by the user directly and the original sources are less relevant to the user. Skipping source maps in `node_modules` improves the general performance. Add `module.setSourceMapsSupport(enabled, options)` to skip source maps in `node_modules` if it is needed. This moves all source maps related API to `node:module` and this a step to promote the source maps API to stable.
593b4ff
to
cf84bcb
Compare
Updated with The new API |
changes: | ||
- version: REPLACEME | ||
pr-url: https://github.com/nodejs/node/pull/56639 | ||
description: the `process.setSourceMapsEnabled` has been deprecated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changes: | |
- version: REPLACEME | |
pr-url: https://github.com/nodejs/node/pull/56639 | |
description: the `process.setSourceMapsEnabled` has been deprecated. |
changes: | ||
- version: REPLACEME | ||
pr-url: https://github.com/nodejs/node/pull/56639 | ||
description: the `process.sourceMapsEnabled` has been deprecated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changes: | |
- version: REPLACEME | |
pr-url: https://github.com/nodejs/node/pull/56639 | |
description: the `process.sourceMapsEnabled` has been deprecated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please add an entry in deprecations.md
?
|
You're right, I miss that! In that case, we should not use the word "deprecated" and keep it as experimental in that case |
--> | ||
> Stability: 1 - Experimental | ||
> Stability: 0 - Deprecated: Use [`module.getSourceMapsSupport()`][] instead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
> Stability: 0 - Deprecated: Use [`module.getSourceMapsSupport()`][] instead. | |
> Stability: 1 - Experimental: Use [`module.getSourceMapsSupport()`][] instead. |
--> | ||
> Stability: 1 - Experimental | ||
> Stability: 0 - Deprecated: Use [`module.setSourceMapsSupport()`][] instead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
> Stability: 0 - Deprecated: Use [`module.setSourceMapsSupport()`][] instead. | |
> Stability: 1 - Experimental: Use [`module.setSourceMapsSupport()`][] instead. |
Files in
node_modules
are not authored by the user directly and theoriginal sources are less relevant to the user.
Skipping source maps in
node_modules
improves the generalperformance. Add
module.setSourceMapsSupport(enabled, options)
toskip source maps in
node_modules
if it is needed. This movesall source maps related API to
node:module
and this a step topromote the source maps API to stable.