Skip to content

vm: expose import phase on SourceTextModule.moduleRequests - #58829

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
legendecas:vm-modulerequests
Jun 28, 2025
Merged

vm: expose import phase on SourceTextModule.moduleRequests#58829
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
legendecas:vm-modulerequests

Conversation

@legendecas

Copy link
Copy Markdown
Member

Expose import phase on vm.SourceTextModule.moduleRequests. This deprecates vm.SourceTextModule.dependencySpecifiers as it does not expose import attributes nor import phase.

Refs: #37648

@legendecaslegendecas added the vm Issues and PRs related to the vm subsystem. label Jun 25, 2025
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/loaders
  • @nodejs/vm

@nodejs-github-botnodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. labels Jun 25, 2025
@codecov

codecovBot commented Jun 25, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.08%. Comparing base (100c6da) to head (f363954).
⚠️ Report is 592 commits behind head on main.

Additional details and impacted files
@@ Coverage Diff @@## main #58829 +/- ##
==========================================
- Coverage 90.10% 90.08% -0.02% 
==========================================
Files 640 640 Lines 188384 188479 +95 Branches 36932 36964 +32 ==========================================
+ Hits 169735 169791 +56 - Misses 11356 11402 +46 + Partials 7293 7286 -7 
Files with missing linesCoverage Δ
lib/internal/vm/module.js98.39% <100.00%> (+0.08%)⬆️
src/module_wrap.cc72.75% <100.00%> (+0.15%)⬆️

... and 50 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@joyeecheungjoyeecheung left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this!

Comment threaddoc/api/vm.md Outdated
Comment threadlib/internal/vm/module.js Outdated
@legendecaslegendecas added request-ci Add this label to start a Jenkins CI on a PR. and removed request-ci Add this label to start a Jenkins CI on a PR. labels Jun 27, 2025
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@legendecaslegendecas added the commit-queue Add this label to land a pull request using GitHub Actions. label Jun 28, 2025
@nodejs-github-botnodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Jun 28, 2025
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator
Commit Queue failed
node:internal/modules/esm/resolve:275
throw new ERR_MODULE_NOT_FOUND(
^

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/opt/hostedtoolcache/node/22.16.0/x64/lib/node_modules/@node-core/utils/node_modules/css-what/dist/esm/index.js' imported from /opt/hostedtoolcache/node/22.16.0/x64/lib/node_modules/@node-core/utils/node_modules/cheerio-select/lib/esm/index.js
at finalizeResolution (node:internal/modules/esm/resolve:275:11)
at moduleResolve (node:internal/modules/esm/resolve:860:10)
at defaultResolve (node:internal/modules/esm/resolve:984:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:780:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:704:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:687:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:305:38)
at ModuleJob._link (node:internal/modules/esm/module_job:137:49) {
code: 'ERR_MODULE_NOT_FOUND',
url: 'file:///opt/hostedtoolcache/node/22.16.0/x64/lib/node_modules/@node-core/utils/node_modules/css-what/dist/esm/index.js'
}

Node.js v22.16.0

https://github.com/nodejs/node/actions/runs/15943184073

@marco-ippolito

Copy link
Copy Markdown
Member
Commit Queue failed
node:internal/modules/esm/resolve:275
throw new ERR_MODULE_NOT_FOUND(
^

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/opt/hostedtoolcache/node/22.16.0/x64/lib/node_modules/@node-core/utils/node_modules/css-what/dist/esm/index.js' imported from /opt/hostedtoolcache/node/22.16.0/x64/lib/node_modules/@node-core/utils/node_modules/cheerio-select/lib/esm/index.js
at finalizeResolution (node:internal/modules/esm/resolve:275:11)
at moduleResolve (node:internal/modules/esm/resolve:860:10)
at defaultResolve (node:internal/modules/esm/resolve:984:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:780:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:704:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:687:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:305:38)
at ModuleJob._link (node:internal/modules/esm/module_job:137:49) {
code: 'ERR_MODULE_NOT_FOUND',
url: 'file:///opt/hostedtoolcache/node/22.16.0/x64/lib/node_modules/@node-core/utils/node_modules/css-what/dist/esm/index.js'
}

Node.js v22.16.0

https://github.com/nodejs/node/actions/runs/15943184073

Is commit queue broken 💀

@marco-ippolitomarco-ippolito added commit-queue Add this label to land a pull request using GitHub Actions. and removed commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels Jun 28, 2025
@nodejs-github-botnodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Jun 28, 2025
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator
Commit Queue failed
node:internal/modules/esm/resolve:275
throw new ERR_MODULE_NOT_FOUND(
^

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/opt/hostedtoolcache/node/22.16.0/x64/lib/node_modules/@node-core/utils/node_modules/css-what/dist/esm/index.js' imported from /opt/hostedtoolcache/node/22.16.0/x64/lib/node_modules/@node-core/utils/node_modules/cheerio-select/lib/esm/index.js
at finalizeResolution (node:internal/modules/esm/resolve:275:11)
at moduleResolve (node:internal/modules/esm/resolve:860:10)
at defaultResolve (node:internal/modules/esm/resolve:984:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:780:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:704:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:687:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:305:38)
at ModuleJob._link (node:internal/modules/esm/module_job:137:49) {
code: 'ERR_MODULE_NOT_FOUND',
url: 'file:///opt/hostedtoolcache/node/22.16.0/x64/lib/node_modules/@node-core/utils/node_modules/css-what/dist/esm/index.js'
}

Node.js v22.16.0

https://github.com/nodejs/node/actions/runs/15943356431

@legendecaslegendecas added commit-queue Add this label to land a pull request using GitHub Actions. and removed commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels Jun 28, 2025
@nodejs-github-botnodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Jun 28, 2025
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator
Commit Queue failed
node:internal/process/promises:394
triggerUncaughtException(err, true /* fromPromise */);
^

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/opt/hostedtoolcache/node/22.16.0/x64/lib/node_modules/@node-core/utils/node_modules/css-select/lib/esm/index.js' imported from /opt/hostedtoolcache/node/22.16.0/x64/lib/node_modules/@node-core/utils/node_modules/cheerio-select/lib/esm/index.js
Did you mean to import "css-select/lib/index.js"?
at finalizeResolution (node:internal/modules/esm/resolve:275:11)
at moduleResolve (node:internal/modules/esm/resolve:860:10)
at defaultResolve (node:internal/modules/esm/resolve:984:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:780:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:704:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:687:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:305:38)
at ModuleJob._link (node:internal/modules/esm/module_job:137:49) {
code: 'ERR_MODULE_NOT_FOUND',
url: 'file:///opt/hostedtoolcache/node/22.16.0/x64/lib/node_modules/@node-core/utils/node_modules/css-select/lib/esm/index.js'
}

Node.js v22.16.0

https://github.com/nodejs/node/actions/runs/15945000951

@aduh95aduh95 added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jun 28, 2025
@aduh95aduh95 added commit-queue Add this label to land a pull request using GitHub Actions. and removed commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels Jun 28, 2025
@nodejs-github-botnodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jun 28, 2025
@nodejs-github-bot
nodejs-github-bot merged commit 0f7e75f into nodejs:mainJun 28, 2025
84 checks passed
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in 0f7e75f

@legendecas
legendecas deleted the vm-modulerequests branch June 28, 2025 18:57
targos pushed a commit that referenced this pull request Jul 3, 2025
PR-URL: #58829
Refs: #37648
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
@aduh95aduh95 added the backport-requested-v22.x PRs awaiting manual backport to the v22.x-staging branch. label Jul 21, 2025
@aduh95

Copy link
Copy Markdown
Contributor

Trying to backport this to v22.x-staging causes out/Release/node test/parallel/test-vm-module-modulerequests.js to crash with node: bad option: --js-source-phase-imports. Feel free to mark it as dont-land if it's an unsolvable V8 version mismatch

@legendecaslegendecas added dont-land-on-v22.x PRs that should not land on the v22.x-staging branch and should not be released in v22.x. and removed backport-requested-v22.x PRs awaiting manual backport to the v22.x-staging branch. labels Sep 21, 2025
@legendecas

legendecas commented Sep 21, 2025

Copy link
Copy Markdown
MemberAuthor

--js-source-phase-imports requires v24. Adding dont-land-on-v22.x on this.

legendecas added a commit to legendecas/node that referenced this pull request Sep 21, 2025
PR-URL: nodejs#58829
Refs: nodejs#37648
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
@legendecaslegendecas added backport-open-v22.x Indicate that the PR has an open backport and removed dont-land-on-v22.x PRs that should not land on the v22.x-staging branch and should not be released in v22.x. labels Sep 21, 2025
@legendecas

Copy link
Copy Markdown
MemberAuthor

Actually, it is still worthwhile to backport vm.SourceTextModule.moduleRequests: #59962

richardlau pushed a commit that referenced this pull request Sep 22, 2025
PR-URL: #58829
Backport-PR-URL: #59962
Refs: #37648
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
@richardlaurichardlau added backported-to-v22.x PRs backported to the v22.x-staging branch. and removed backport-open-v22.x Indicate that the PR has an open backport labels Sep 24, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.backported-to-v22.xPRs backported to the v22.x-staging branch.c++Issues and PRs that require attention from people who are familiar with C++.needs-ciPRs that need a full CI run.vmIssues and PRs related to the vm subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@legendecas@nodejs-github-bot@marco-ippolito@aduh95@joyeecheung@richardlau