Repository navigation
feat(transpile): load components at runtime with jit and binding plans - #2599
Open
vados-cosmonic wants to merge 16 commits into
Open
vados-cosmonic wants to merge 16 commits into
vados-cosmonic wants to merge 16 commits into
Conversation
vados-cosmonic
force-pushed
the
feat/transpile-jit
branch
from
December 2, 2026 10:15
8764376 to
e33e4d7
Compare
The mapping of transpile options to bindgen options moves to a module without Node.js dependencies, so that bindings can be generated where Node.js built-ins are not available.
`@bytecodealliance/jco-transpile/jit` reads a component as it downloads, compiling each core module it embeds as soon as its bytes arrive, then generates bindings with the bindgen of `jco transpile`. The bindings import the shared Component Model runtime, reuse the modules compiled during the download, and can be cached so that a component loaded again skips the bindgen.
With `bindingPlan`, the streaming decoder reads the same chunks as the download. A component that a version 1 plan describes is instantiated from that plan and the modules compiled while streaming, without importing the bindgen. Any other component gets generated bindings.
vados-cosmonic
force-pushed
the
feat/transpile-jit
branch
from
December 2, 2026 12:50
e33e4d7 to
8a08e86
Compare
vados-cosmonic
force-pushed
the
feat/transpile-jit
branch
from
December 2, 2026 13:19
5d11ecf to
d6be132
Compare
vados-cosmonic
marked this pull request as ready for review
December 2, 2026 14:09
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on #2600: the first five commits are that PR's, and this one starts at
refactor(transpile): build bindgen options in a browser-safe module.Adds
@bytecodealliance/jco-transpile/jit, which loads a component at runtime ("just in time") instead of transpiling it in a build step:streamComponentwalks the component's sections as bytes arrive (including nested components) and pipes each core module intoWebAssembly.compileStreamingas soon as its section starts, so compiling overlaps the download.jco transpile. Bindings come from the existing bindgen, lazily imported, with--instantiation asyncsemantics. They import@bytecodealliance/jco-cm-runtimerather than embedding it, and get the streamed modules throughgetCoreModule, because guest modules are emitted byte-identical to their range of the input.bindingPlan: true, the streaming decoder from feat(bindgen): add experimental component binding plans #2600 reads the same chunks as the download. A component within plan version 1 runs from its plan and the modules compiled while streaming, without importing the bindgen, and keeps the export names generated bindings use. Any other component falls back to generated bindings./jitis ~3.9 KB gzipped before the decoder or the bindgen is needed.To share option handling with
transpile, the mapping of transpile options to bindgen options moves into a module without Node.js dependencies.Not in this PR yet
/jit, and thejco-transpileversion in the bindings cache key.