Skip to content

sea: add allowDynamicImportFromFileSystem config option#62771

Open
thisalihassan wants to merge 1 commit intonodejs:mainfrom
thisalihassan:sea-allow-dynamic-import-from-fs
Open

sea: add allowDynamicImportFromFileSystem config option#62771
thisalihassan wants to merge 1 commit intonodejs:mainfrom
thisalihassan:sea-allow-dynamic-import-from-fs

Conversation

@thisalihassan
Copy link
Copy Markdown
Contributor

Adds an explicit allowDynamicImportFromFileSystem config option for SEA. When set to true, import() from the injected main script can load modules from the file system. Default remains sealed (built-ins only), matching the current behavior.

This enables the common SEA pattern where a small bootstrap hands off to a user entrypoint on disk via dynamic import.
Refs: #62726

@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/loaders
  • @nodejs/single-executable

@nodejs-github-bot nodejs-github-bot added esm Issues and PRs related to the ECMAScript Modules implementation. needs-ci PRs that need a full CI run. single-executable Issues and PRs related to single-executable applications labels Apr 16, 2026
@thisalihassan thisalihassan force-pushed the sea-allow-dynamic-import-from-fs branch from 86f8733 to ff08042 Compare April 16, 2026 07:58
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 16, 2026

Codecov Report

❌ Patch coverage is 97.43590% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 89.68%. Comparing base (978a8c4) to head (9d3200d).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/node_sea.cc 95.23% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #62771      +/-   ##
==========================================
- Coverage   89.69%   89.68%   -0.01%     
==========================================
  Files         706      706              
  Lines      218222   218258      +36     
  Branches    41766    41768       +2     
==========================================
+ Hits       195726   195749      +23     
- Misses      14419    14425       +6     
- Partials     8077     8084       +7     
Files with missing lines Coverage Δ
lib/internal/modules/esm/utils.js 99.51% <100.00%> (+0.01%) ⬆️
src/node_sea.h 100.00% <ø> (ø)
src/node_sea.cc 89.71% <95.23%> (+0.18%) ⬆️

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

@joyeecheung joyeecheung added the request-ci Add this label to start a Jenkins CI on a PR. label Apr 18, 2026
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 18, 2026
@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

Signed-off-by: Ali Hassan <ali-hassan27@outlook.com>
@thisalihassan thisalihassan force-pushed the sea-allow-dynamic-import-from-fs branch from ff08042 to 9d3200d Compare April 18, 2026 18:36
@thisalihassan
Copy link
Copy Markdown
Contributor Author

@joyeecheung rebased! can we re-run CI please?

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

Labels

esm Issues and PRs related to the ECMAScript Modules implementation. needs-ci PRs that need a full CI run. single-executable Issues and PRs related to single-executable applications

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants