modules: reduce circular dependency of internal/modules/cjs/loader#30349
Closed
joyeecheung wants to merge 1 commit intonodejs:masterfrom
Closed
modules: reduce circular dependency of internal/modules/cjs/loader#30349joyeecheung wants to merge 1 commit intonodejs:masterfrom
joyeecheung wants to merge 1 commit intonodejs:masterfrom
Conversation
Collaborator
guybedford
approved these changes
Nov 10, 2019
Contributor
guybedford
left a comment
There was a problem hiding this comment.
Looks good, thanks for the refactoring here.
Contributor
There was a problem hiding this comment.
Note this is hookable through --loader and can be detected via the parent === undefined case. A separate isMain argument has also been considered for the API in future.
jasnell
approved these changes
Nov 12, 2019
Previously `internal/bootstrap/pre_execution.js` requires `internal/modules/cjs/loader.js` which in turn requires `internal/bootstrap/pre_execution.js`. This patch moves the entry point execution logic out of `pre_execution.js` and puts it into `internal/modules/run_main.js`. It also tests that `Module.runMain` can be monkey-patched before further deprecation/refactoring can be done. Also added an internal assertion `hasLoadedAnyUserCJSModule` for documentation purposes.
dfd70f5 to
70b7123
Compare
Member
Author
|
Rebased |
Collaborator
Collaborator
Collaborator
addaleax
approved these changes
Nov 19, 2019
addaleax
pushed a commit
that referenced
this pull request
Nov 19, 2019
Previously `internal/bootstrap/pre_execution.js` requires `internal/modules/cjs/loader.js` which in turn requires `internal/bootstrap/pre_execution.js`. This patch moves the entry point execution logic out of `pre_execution.js` and puts it into `internal/modules/run_main.js`. It also tests that `Module.runMain` can be monkey-patched before further deprecation/refactoring can be done. Also added an internal assertion `hasLoadedAnyUserCJSModule` for documentation purposes. PR-URL: #30349 Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Member
|
Landed in efce655 |
BridgeAR
pushed a commit
that referenced
this pull request
Nov 19, 2019
Previously `internal/bootstrap/pre_execution.js` requires `internal/modules/cjs/loader.js` which in turn requires `internal/bootstrap/pre_execution.js`. This patch moves the entry point execution logic out of `pre_execution.js` and puts it into `internal/modules/run_main.js`. It also tests that `Module.runMain` can be monkey-patched before further deprecation/refactoring can be done. Also added an internal assertion `hasLoadedAnyUserCJSModule` for documentation purposes. PR-URL: #30349 Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Merged
Member
|
depends on #29866 to land on v12.x-staging |
targos
pushed a commit
that referenced
this pull request
Jan 14, 2020
Previously `internal/bootstrap/pre_execution.js` requires `internal/modules/cjs/loader.js` which in turn requires `internal/bootstrap/pre_execution.js`. This patch moves the entry point execution logic out of `pre_execution.js` and puts it into `internal/modules/run_main.js`. It also tests that `Module.runMain` can be monkey-patched before further deprecation/refactoring can be done. Also added an internal assertion `hasLoadedAnyUserCJSModule` for documentation purposes. PR-URL: #30349 Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Member
|
Actually, I fixed the few conflicts and landed on v12.x-staging in 4de6097 |
BethGriggs
pushed a commit
that referenced
this pull request
Feb 6, 2020
Previously `internal/bootstrap/pre_execution.js` requires `internal/modules/cjs/loader.js` which in turn requires `internal/bootstrap/pre_execution.js`. This patch moves the entry point execution logic out of `pre_execution.js` and puts it into `internal/modules/run_main.js`. It also tests that `Module.runMain` can be monkey-patched before further deprecation/refactoring can be done. Also added an internal assertion `hasLoadedAnyUserCJSModule` for documentation purposes. PR-URL: #30349 Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Merged
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.
Previously
internal/bootstrap/pre_execution.jsrequiresinternal/modules/cjs/loader.jswhich in turn requiresinternal/bootstrap/pre_execution.js. This patch moves theentry point execution logic out of
pre_execution.jsandputs it into
internal/modules/run_main.js. It also teststhat
Module.runMaincan be monkey-patched before furtherdeprecation/refactoring can be done.
Also added an internal assertion of
hasLoadedAnyUserCJSModulefor documentation purposes.
Inspired by nodejs/help#2259
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes