Skip to content

src: support import() and import.meta in embedder-run modules#61654

Open
joyeecheung wants to merge 3 commits intonodejs:mainfrom
joyeecheung:api-import-meta
Open

src: support import() and import.meta in embedder-run modules#61654
joyeecheung wants to merge 3 commits intonodejs:mainfrom
joyeecheung:api-import-meta

Conversation

@joyeecheung
Copy link
Member

This adds a embedder_module_hdo for identifying embedder-run modules in the dynamic import handler and import.meta initializer, and a SourceTextModuleTypes for customizing source text module compilation in the JS land via compileSourceTextModule(). Also, refactors the existing embedder module compilation code to reuse the builtin resolution logic.

This adds a embedder_module_hdo for identifying embedder-run
modules in the dynamic import handler and import.meta initializer,
and a SourceTextModuleTypes for customizing source text module
compilation in the JS land via compileSourceTextModule().
Also, refactors the existing embedder module compilation code
to reuse the builtin resolution logic.
@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/loaders
  • @nodejs/vm

@nodejs-github-bot nodejs-github-bot added lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. labels Feb 3, 2026
@codecov
Copy link

codecov bot commented Feb 3, 2026

Codecov Report

❌ Patch coverage is 98.61111% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.74%. Comparing base (8e41b8d) to head (85ed146).
⚠️ Report is 26 commits behind head on main.

Files with missing lines Patch % Lines
lib/internal/modules/esm/utils.js 96.96% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #61654      +/-   ##
==========================================
- Coverage   89.74%   89.74%   -0.01%     
==========================================
  Files         674      674              
  Lines      204348   204465     +117     
  Branches    39271    39287      +16     
==========================================
+ Hits       183396   183492      +96     
- Misses      13262    13263       +1     
- Partials     7690     7710      +20     
Files with missing lines Coverage Δ
lib/internal/main/embedding.js 87.50% <100.00%> (+2.41%) ⬆️
lib/internal/modules/esm/create_dynamic_module.js 96.00% <100.00%> (+0.08%) ⬆️
lib/internal/modules/esm/loader.js 96.97% <100.00%> (+<0.01%) ⬆️
lib/internal/modules/esm/translators.js 92.37% <100.00%> (-0.21%) ⬇️
lib/internal/modules/helpers.js 98.49% <100.00%> (+0.32%) ⬆️
src/module_wrap.cc 74.23% <100.00%> (+0.02%) ⬆️
src/node_contextify.cc 82.63% <100.00%> (+0.17%) ⬆️
lib/internal/modules/esm/utils.js 99.50% <96.96%> (-0.50%) ⬇️

... and 48 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.

@nodejs-github-bot
Copy link
Collaborator

Copy link
Contributor

@Aditi-1400 Aditi-1400 left a comment

Choose a reason for hiding this comment

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

Should we add a rejection test for non-builtin imports? 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants