-
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
esm: fix inconsistency with importAssertion in resolve hook #55365
esm: fix inconsistency with importAssertion in resolve hook #55365
Conversation
Review requested:
|
8530577
to
b923ecb
Compare
b923ecb
to
213c6eb
Compare
Updated the commit message and fixed the lint issue. |
213c6eb
to
0a3ceda
Compare
Fixed |
As the [documentation](https://nodejs.org/docs/latest/api/module.html#customization-hooks:~:text=The%20property%20context.importAssertions%20is%20replaced%20with%20context.importAttributes.%20Using%20the%20old%20name%20is%20still%20supported%20and%20will%20emit%20an%20experimental%20warning.) says, the `context.importAssertion` should be still supported and emit a warning. This is true for the load hook, but not correct for context of the resolve hook. This PR is tring to fix the inconsistency.
0a3ceda
to
78cfeef
Compare
Made a minor change to the test of the load hook to make it consistent with the test of the resolve hook. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #55365 +/- ##
==========================================
+ Coverage 88.40% 88.41% +0.01%
==========================================
Files 652 652
Lines 186777 186889 +112
Branches 36029 36067 +38
==========================================
+ Hits 165114 165243 +129
+ Misses 14919 14886 -33
- Partials 6744 6760 +16
|
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
Landed in c0aebed |
As the documentation states, the `context.importAssertion` should be still supported and emit a warning. This is true for the `load` hook, but not correct for context of the `resolve` hook. This commit fixes the inconsistency. PR-URL: #55365 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
As the documentation states, the `context.importAssertion` should be still supported and emit a warning. This is true for the `load` hook, but not correct for context of the `resolve` hook. This commit fixes the inconsistency. PR-URL: nodejs#55365 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
As the documentation states, the `context.importAssertion` should be still supported and emit a warning. This is true for the `load` hook, but not correct for context of the `resolve` hook. This commit fixes the inconsistency. PR-URL: nodejs#55365 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
As the documentation says, the
context.importAssertions
should be still supported and emit a warning. This is true for the load hook, but not correct for context of the resolve hook.This PR is tring to fix the inconsistency.