Uh oh!
There was an error while loading. Please reload this page.
esm: refactor responseURL handling - #43164
Conversation
nodejs-github-bot
commented
May 21, 2022
Review requested:
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
nodejs-github-bot
commented
May 23, 2022
nodejs-github-bot
commented
May 27, 2022
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)
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This reverts commit a2923a9.
nodejs-github-bot
commented
Jun 3, 2022
nodejs-github-bot
commented
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>
guybedford
commented
Jun 3, 2022
Landed in dfa896f. |
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>
danielleadams
commented
Jun 13, 2022
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. |
guybedford
commented
Jun 13, 2022
@danielleadams yes, this should land after #43130, which in turn should land after #42623. |
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>
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>
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>
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>
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