Expand description
Step-file front-end: rolldown bundle + tree-shake + TypeScript ->
one ESM module -> compiled to QuickJS bytecode once.
rolldown (built on oxc) resolves the whole import graph including
node_modules, transpiles .ts/.tsx, tree-shakes, and emits a
single ESM chunk. That chunk is compiled to bytecode a single time;
every per-worker session links the bytecode (one Module::load, no
parse, no resolver). A hidden source map is kept so a JS error in
the bundled output is reported at the original .ts/.js location.
Structs§
- Compiled
Bundle - One bundled+tree-shaken step graph compiled to
QuickJSbytecode, plus the source map to translate bundled positions back to source. - Compiled
Plugin - One plugin file: rolldown-bundled (TypeScript, plugin-local imports,
tree-shaking) and compiled to
QuickJSbytecode, with its manifests extracted straight from the compiled module — no separate throwaway runtime per file.
Functions§
- bundle_
and_ compile - Bundle the step entry files (TypeScript ok;
node_modulesand shared utils resolved + tree-shaken) into one ESM module and compile it to bytecode. Done once, before workers spawn. - bundle_
source - rolldown-bundle + tree-shake + transpile the step entry files (and
their
node_modules/shared imports) into a single ESM module. Returns the bundled code and the (hidden) source map JSON. Exposed for diagnostics/tests; production usesbundle_and_compile. - compile_
and_ extract_ plugins - Bundle + compile + extract every plugin file. The expensive per-file rolldown bundles run concurrently; bytecode compile + extraction share ONE throwaway runtime for the whole batch (the pre-migration path spun one full engine per file for extraction and one per file for bytecode). Unchanged files are served from the process content-hash cache with no bundle and no compile.
- eval_
bundle - Link + evaluate the bundled step module from precompiled bytecode in
the given session. Top-level
Given/When/Thenrun here.