-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
module: do not warn when require(esm) comes from node_modules #55960
module: do not warn when require(esm) comes from node_modules #55960
Conversation
As part of the standard experimental feature graduation policy, when we unflagged require(esm) we moved the experimental warning to be emitted when require() is actually used to load ESM, which previously was an error. However, some packages in the ecosystem have already being using try-catch to load require(esm) to e.g. resolve optional dependency, and emitting warning from there instead of throwing directly could break the CLI output. To reduce the disruption for releases, as a compromise, this patch skips the warning if require(esm) comes from node_modules, where users typically don't have much control over the code. This warning will be eventually removed when require(esm) becomes stable. This patch was originally intended for the LTS releases, though it seems there's appetite for it on v23.x as well so it's re-targeted to the main branch.
Review requested:
|
Not sure it needs a fast-track, though it was already reviewed and approved before in #55217 |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #55960 +/- ##
==========================================
- Coverage 88.01% 87.99% -0.02%
==========================================
Files 653 653
Lines 187735 187872 +137
Branches 35874 35888 +14
==========================================
+ Hits 165229 165318 +89
- Misses 15693 15723 +30
- Partials 6813 6831 +18
|
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.
lgtm
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.
LGTM. Is my understanding correct that the plan is to revert immediately after it has landed, and the revert won't land on release lines (or maybe only 23.x)?
Fast-track has been requested by @aduh95. Please 👍 to approve. |
Seems unnecessary to revert (and would be introducing backport conflicts) if it's going to be on both 23 and 22, at most we still get extra warnings on nightlies if we revert which doesn't seem super...useful? |
Landed in 1919560 |
As part of the standard experimental feature graduation policy, when we unflagged require(esm) we moved the experimental warning to be emitted when require() is actually used to load ESM, which previously was an error. However, some packages in the ecosystem have already being using try-catch to load require(esm) to e.g. resolve optional dependency, and emitting warning from there instead of throwing directly could break the CLI output.
To reduce the disruption for releases, as a compromise, this patch skips the warning if require(esm) comes from node_modules, where users typically don't have much control over the code. This warning will be eventually removed when require(esm) becomes stable.
This patch was originally intended for the LTS releases (originally in #55217), though it seems there's appetite for it on v23.x as well so it's re-targeted to the main branch.
Refs: #55217
Refs: #52697