◐ Shell
clean mode source ↗

sea: support code cache for ESM entrypoint in SEA by joyeecheung · Pull Request #62158 · nodejs/node

@nodejs-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.

single-executable

Issues and PRs related to single-executable applications

labels

Mar 8, 2026

joyeecheung

The initial support for ESM entrypoint in SEA didn't support
code cache. This patch implements that by following a path
similar to how code cache in CJS SEA entrypoint is supported:
at build time we generate the code cache from C++ and put it
into the sea blob, and at runtime we consume it via a special
case in compilation routines - for CJS this was
CompileFunctionForCJSLoader, in the case of SourceTextModule,
it's in Module::New.

mcollina

addaleax

@joyeecheung joyeecheung added the semver-minor

PRs that contain new features and should be released in the next minor version.

label

Mar 10, 2026

aduh95 pushed a commit that referenced this pull request

Mar 25, 2026
The initial support for ESM entrypoint in SEA didn't support
code cache. This patch implements that by following a path
similar to how code cache in CJS SEA entrypoint is supported:
at build time we generate the code cache from C++ and put it
into the sea blob, and at runtime we consume it via a special
case in compilation routines - for CJS this was
CompileFunctionForCJSLoader, in the case of SourceTextModule,
it's in Module::New.

PR-URL: #62158
Refs: #61813
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>

nodejs-github-bot added a commit that referenced this pull request

Mar 31, 2026
Notable changes:

async_hooks:
  * (SEMVER-MINOR) add using scopes to AsyncLocalStorage (Stephen Belanger) #61674
benchmark:
  * (SEMVER-MINOR) add benchmarks for experimental stream/iter (James M Snell) #62066
cli:
  * (SEMVER-MINOR) add --max-heap-size option (tannal) #58708
crypto:
  * (SEMVER-MINOR) add TurboSHAKE and KangarooTwelve Web Cryptography algorithms (Filip Skokan) #62183
repl:
  * (SEMVER-MINOR) add customizable error handling (Anna Henningsen) #62188
  * (SEMVER-MINOR) remove dependency on domain module (Matteo Collina) #61227
sea:
  * (SEMVER-MINOR) support code cache for ESM entrypoint in SEA (Joyee Cheung) #62158
stream:
  * (SEMVER-MINOR) add stream/iter Implementation (James M Snell) #62066
test:
  * (SEMVER-MINOR) add tests for experimental stream/iter implementation (James M Snell) #62066
test_runner:
  * add exports option for module mocks (sangwook) #61727

PR-URL: #62522

aduh95 added a commit that referenced this pull request

Mar 31, 2026
Notable changes:

async_hooks:
  * (SEMVER-MINOR) add using scopes to `AsyncLocalStorage` (Stephen Belanger) #61674
cli:
  * (SEMVER-MINOR) add `--max-heap-size` option (tannal) #58708
crypto:
  * (SEMVER-MINOR) add TurboSHAKE and KangarooTwelve Web Cryptography algorithms (Filip Skokan) #62183
repl:
  * (SEMVER-MINOR) add customizable error handling (Anna Henningsen) #62188
  * (SEMVER-MINOR) remove dependency on `node:domain` (Matteo Collina) #61227
sea:
  * (SEMVER-MINOR) support code cache for ESM entrypoint in SEA (Joyee Cheung) #62158
stream:
  * (SEMVER-MINOR) add stream/iter Implementation (James M Snell) #62066
test_runner:
  * add exports option for module mocks (sangwook) #61727

PR-URL: #62522

aduh95 added a commit that referenced this pull request

Mar 31, 2026
Notable changes:

async_hooks:
  * (SEMVER-MINOR) add using scopes to `AsyncLocalStorage` (Stephen Belanger) #61674
cli:
  * (SEMVER-MINOR) add `--max-heap-size` option (tannal) #58708
crypto:
  * (SEMVER-MINOR) add TurboSHAKE and KangarooTwelve Web Cryptography algorithms (Filip Skokan) #62183
repl:
  * (SEMVER-MINOR) add customizable error handling (Anna Henningsen) #62188
  * (SEMVER-MINOR) remove dependency on `node:domain` (Matteo Collina) #61227
sea:
  * (SEMVER-MINOR) support code cache for ESM entrypoint in SEA (Joyee Cheung) #62158
stream:
  * (SEMVER-MINOR) add stream/iter Implementation (James M Snell) #62066
test_runner:
  * add exports option for module mocks (sangwook) #61727

PR-URL: #62522

aduh95 added a commit that referenced this pull request

Apr 1, 2026
Notable changes:

async_hooks:
  * (SEMVER-MINOR) add using scopes to `AsyncLocalStorage` (Stephen Belanger) #61674
cli:
  * (SEMVER-MINOR) add `--max-heap-size` option (tannal) #58708
crypto:
  * (SEMVER-MINOR) add TurboSHAKE and KangarooTwelve Web Cryptography algorithms (Filip Skokan) #62183
repl:
  * (SEMVER-MINOR) add customizable error handling (Anna Henningsen) #62188
  * (SEMVER-MINOR) remove dependency on `node:domain` (Matteo Collina) #61227
sea:
  * (SEMVER-MINOR) support code cache for ESM entrypoint in SEA (Joyee Cheung) #62158
stream:
  * (SEMVER-MINOR) add stream/iter Implementation (James M Snell) #62066
test_runner:
  * add exports option for module mocks (sangwook) #61727

PR-URL: #62522

tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request

Apr 2, 2026

karan-lrn pushed a commit to karan-lrn/node that referenced this pull request

Apr 2, 2026
Notable changes:

async_hooks:
  * (SEMVER-MINOR) add using scopes to `AsyncLocalStorage` (Stephen Belanger) nodejs#61674
cli:
  * (SEMVER-MINOR) add `--max-heap-size` option (tannal) nodejs#58708
crypto:
  * (SEMVER-MINOR) add TurboSHAKE and KangarooTwelve Web Cryptography algorithms (Filip Skokan) nodejs#62183
repl:
  * (SEMVER-MINOR) add customizable error handling (Anna Henningsen) nodejs#62188
  * (SEMVER-MINOR) remove dependency on `node:domain` (Matteo Collina) nodejs#61227
sea:
  * (SEMVER-MINOR) support code cache for ESM entrypoint in SEA (Joyee Cheung) nodejs#62158
stream:
  * (SEMVER-MINOR) add stream/iter Implementation (James M Snell) nodejs#62066
test_runner:
  * add exports option for module mocks (sangwook) nodejs#61727

PR-URL: nodejs#62522

This was referenced

Apr 4, 2026

aduh95 pushed a commit to himself65/node that referenced this pull request

Apr 5, 2026
The initial support for ESM entrypoint in SEA didn't support
code cache. This patch implements that by following a path
similar to how code cache in CJS SEA entrypoint is supported:
at build time we generate the code cache from C++ and put it
into the sea blob, and at runtime we consume it via a special
case in compilation routines - for CJS this was
CompileFunctionForCJSLoader, in the case of SourceTextModule,
it's in Module::New.

PR-URL: nodejs#62158
Refs: nodejs#61813
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>

aduh95 pushed a commit to himself65/node that referenced this pull request

Apr 5, 2026
The initial support for ESM entrypoint in SEA didn't support
code cache. This patch implements that by following a path
similar to how code cache in CJS SEA entrypoint is supported:
at build time we generate the code cache from C++ and put it
into the sea blob, and at runtime we consume it via a special
case in compilation routines - for CJS this was
CompileFunctionForCJSLoader, in the case of SourceTextModule,
it's in Module::New.

PR-URL: nodejs#62158
Refs: nodejs#61813
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>