Skip to content

process: clarify the pre- and post-condition of esm setup - #25530

Closed
joyeecheung wants to merge 1 commit into
nodejs:masterfrom
joyeecheung:move-esm
Closed

process: clarify the pre- and post-condition of esm setup#25530
joyeecheung wants to merge 1 commit into
nodejs:masterfrom
joyeecheung:move-esm

Conversation

@joyeecheung

Copy link
Copy Markdown
Member

This patch:

  • Clarifies the dependency of the ESM loader initialization
    (process.cwd() and the value of --loader) in node.js.
  • Moves the initialization of the per-isolate importModuleDynamically
    and initializeImportMetaObject callbacks into node.js
  • Moves the initialization of the ESM loader into
    prepareUserCodeExecution() since it potentially involves
    execution of user code (similar to --require for CJS modules).
Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

This patch:
- Clarifies the dependency of the ESM loader initialization
(`process.cwd()` and the value of `--loader`) in `node.js`.
- Moves the initialization of the per-isolate `importModuleDynamically`
and `initializeImportMetaObject` callbacks into `node.js`
- Moves the initialization of the ESM loader into
`prepareUserCodeExecution()` since it potentially involves
execution of user code (similar to `--require` for CJS modules).
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-botnodejs-github-bot added the process Issues and PRs related to the process subsystem. label Jan 16, 2019
@joyeecheung

Copy link
Copy Markdown
MemberAuthor

@joyeecheung

Copy link
Copy Markdown
MemberAuthor

According to the GitHub reviewer recommendation, @devsnek@guybedford@addaleax PTAL. This helps moving the first loading of 'internal/modules/cjs/loader' into prepareUserCodeExecution so that we can split the execution mode selection from bootstrapping (getting the environment ready).

@joyeecheung

Copy link
Copy Markdown
MemberAuthor

joyeecheung added a commit that referenced this pull request Jan 23, 2019
This patch:
- Clarifies the dependency of the ESM loader initialization
(`process.cwd()` and the value of `--loader`) in `node.js`.
- Moves the initialization of the per-isolate `importModuleDynamically`
and `initializeImportMetaObject` callbacks into `node.js`
- Moves the initialization of the ESM loader into
`prepareUserCodeExecution()` since it potentially involves
execution of user code (similar to `--require` for CJS modules).
PR-URL: #25530
Reviewed-By: Gus Caplan <me@gus.host>
@joyeecheung

Copy link
Copy Markdown
MemberAuthor

Landed in a93c825

addaleax pushed a commit that referenced this pull request Jan 23, 2019
This patch:
- Clarifies the dependency of the ESM loader initialization
(`process.cwd()` and the value of `--loader`) in `node.js`.
- Moves the initialization of the per-isolate `importModuleDynamically`
and `initializeImportMetaObject` callbacks into `node.js`
- Moves the initialization of the ESM loader into
`prepareUserCodeExecution()` since it potentially involves
execution of user code (similar to `--require` for CJS modules).
PR-URL: #25530
Reviewed-By: Gus Caplan <me@gus.host>
@MylesBorinsMylesBorins mentioned this pull request Jan 24, 2019
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

processIssues and PRs related to the process subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@joyeecheung@nodejs-github-bot@devsnek