Skip to content

sea: support ESM entry point in SEA#61813

Open
joyeecheung wants to merge 1 commit intonodejs:mainfrom
joyeecheung:sea-esm
Open

sea: support ESM entry point in SEA#61813
joyeecheung wants to merge 1 commit intonodejs:mainfrom
joyeecheung:sea-esm

Conversation

@joyeecheung
Copy link
Member

@joyeecheung joyeecheung commented Feb 13, 2026

This uses the new StartExecutionCallbackWithModule embedder API added in #61548 to support ESM entrypoint in SEA via a new configuration field "mainFormat". The behavior currently aligns with the embedder API and is mostly in sync with the CommonJS entry point behavior, except that support for code caching and snapshot is left for follow-ups.

Note: for follow-ups:

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/single-executable

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. single-executable Issues and PRs related to single-executable applications labels Feb 13, 2026
The `node:sea` builtin allows interaction with the single-executable application
from the JavaScript main script embedded into the executable.

#### `sea.isSea()`
Copy link
Member Author

Choose a reason for hiding this comment

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

Drive-by: fixed this since it seems out of touch with other APIs below.

This uses the new StartExecutionCallbackWithModule embedder
API to support ESM entrypoint in SEA via a new configuration
field `"mainFormat"`. The behavior currently aligns with the
embedder API and is mostly in sync with the CommonJS entry
point behavior, except that support for code caching and
snapshot is left for follow-ups.
@codecov
Copy link

codecov bot commented Feb 14, 2026

Codecov Report

❌ Patch coverage is 52.17391% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.76%. Comparing base (37ff1ea) to head (9b56e66).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/node_sea.cc 51.11% 15 Missing and 7 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #61813      +/-   ##
==========================================
+ Coverage   89.74%   89.76%   +0.02%     
==========================================
  Files         675      675              
  Lines      204735   204775      +40     
  Branches    39348    39351       +3     
==========================================
+ Hits       183737   183821      +84     
+ Misses      13269    13225      -44     
  Partials     7729     7729              
Files with missing lines Coverage Δ
src/node_sea.h 100.00% <100.00%> (ø)
src/node_sea.cc 89.70% <51.11%> (-2.97%) ⬇️

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

Copy link
Member

@targos targos left a comment

Choose a reason for hiding this comment

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

RSLGTM on the C++.
I tested the PR on an existing app and it works well, thanks!

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

Labels

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