vm: rename vm.Module to vm.SourceTextModule#22007
Conversation
|
Is it in preparation for adding other kinds of modules? |
|
@targos mostly... even if the spec doesn't define any more types we should still name them correctly. |
cjihrig
left a comment
There was a problem hiding this comment.
No opinion on the change, but the code LGTM.
|
It doesn't have to be semver major. The API is experimental and behind a flag |
|
Not that you have to, but can you explain this? What kind of ES modules would not have some kind of source text associated with them? If this is to distinguish from e.g. WASM modules or so, maybe referring to the used language might be better? (Also, fyi: @nodejs/modules) |
|
@addaleax At the last TC39 meeting, a new type of Module Records backed by JavaScript source called Dynamic Module Records was discussed, and it is now at Stage 1. Regardless of whether that proposal makes it all the way into the spec, |
|
@devsnek Would also be nice if my last comment (#22007 (comment)) is integrated into the commit message body. |
|
@TimothyGu will do when I land 👍 |
At the last TC39 meeting, a new type of Module Records backed by JavaScript source called Dynamic Module Records was discussed, and it is now at Stage 1. Regardless of whether that proposal makes it all the way into the spec, SourceTextModule is indeed a more descriptive and accurate name for what this class represents. PR-URL: nodejs#22007 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Jan Krems <jan.krems@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Yuta Hiroto <hello@hiroppy.me> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: John-David Dalton <john.david.dalton@gmail.com> Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
62adcd3 to
2bdcdfc
Compare
|
landed in 2bdcdfc |
At the last TC39 meeting, a new type of Module Records backed by JavaScript source called Dynamic Module Records was discussed, and it is now at Stage 1. Regardless of whether that proposal makes it all the way into the spec, SourceTextModule is indeed a more descriptive and accurate name for what this class represents. PR-URL: #22007 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Jan Krems <jan.krems@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Yuta Hiroto <hello@hiroppy.me> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: John-David Dalton <john.david.dalton@gmail.com> Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Should have always been named SourceTextModule
/cc @nodejs/vm
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes