esm: refactor responseURL handling#43164
Closed
guybedford wants to merge 8 commits intonodejs:masterfrom
Closed
Conversation
Collaborator
|
Review requested:
|
ljharb
reviewed
May 21, 2022
aduh95
reviewed
May 21, 2022
aduh95
reviewed
May 21, 2022
aduh95
reviewed
May 21, 2022
aduh95
approved these changes
May 22, 2022
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Collaborator
This was referenced May 23, 2022
JungMinu
approved these changes
May 24, 2022
This was referenced May 25, 2022
Collaborator
This was referenced May 28, 2022
JakobJingleheimer
approved these changes
May 29, 2022
Member
There was a problem hiding this comment.
Huzzah! Thank you for handling this. A couple nits and a possible naming thing, nothing big 😁
I see you removed the fetch cache check: could you add a test case to test/es-module/test-esm-loader-http-imports.mjs to ensure only the 1 fetch happens? (I can do if you prefer)
ljharb
reviewed
Jun 1, 2022
19 tasks
19 tasks
This reverts commit a2923a9.
Collaborator
Collaborator
guybedford
added a commit
that referenced
this pull request
Jun 3, 2022
PR-URL: #43164 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com> Reviewed-By: Jacob Smith <jacob@frende.me>
Contributor
Author
|
Landed in dfa896f. |
21 tasks
italojs
pushed a commit
to italojs/node
that referenced
this pull request
Jun 6, 2022
PR-URL: nodejs#43164 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com> Reviewed-By: Jacob Smith <jacob@frende.me>
danielleadams
pushed a commit
that referenced
this pull request
Jun 11, 2022
PR-URL: #43164 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com> Reviewed-By: Jacob Smith <jacob@frende.me>
Merged
danielleadams
pushed a commit
that referenced
this pull request
Jun 13, 2022
PR-URL: #43164 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com> Reviewed-By: Jacob Smith <jacob@frende.me>
Contributor
|
This didn't land cleanly in v18.x (maybe related to #42623 or the work mentioned here #43385 (comment)), so adding a backport-blocked label. |
Contributor
Author
|
@danielleadams yes, this should land after #43130, which in turn should land after #42623. |
danielleadams
pushed a commit
that referenced
this pull request
Jun 13, 2022
PR-URL: #43164 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com> Reviewed-By: Jacob Smith <jacob@frende.me>
targos
pushed a commit
that referenced
this pull request
Jul 12, 2022
PR-URL: #43164 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com> Reviewed-By: Jacob Smith <jacob@frende.me>
targos
pushed a commit
that referenced
this pull request
Jul 19, 2022
PR-URL: #43164 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com> Reviewed-By: Jacob Smith <jacob@frende.me>
targos
pushed a commit
that referenced
this pull request
Jul 31, 2022
PR-URL: #43164 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com> Reviewed-By: Jacob Smith <jacob@frende.me>
guangwong
pushed a commit
to noslate-project/node
that referenced
this pull request
Oct 10, 2022
PR-URL: nodejs/node#43164 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com> Reviewed-By: Jacob Smith <jacob@frende.me>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refactors responseURL handling solving the same issue as #43130 but with the architecture changes to
responseURLas discussed in that PR by treating the module wrap, translators, parentUrl in resolution and providers URLs as the responseURL, as opposed to the module map URL, the resolved URL and the first argument to load as the initial URL. This is consistent with web specifications and gives the correct relative resolution,import.meta.urletc without further function calls being necessary.In addition this exposes the
responseURLreturn value to theloadhook, which is optional. This is landing as treating that as an undocumented loader API for now, since it's generally not an encouraged pattern but is needed by the core loader piping. Whether it should be a public API is a question for the loaders design more generally.@nodejs/modules @nodejs/loaders