Skip to content

feat: use @bytecodealliance/jco-transpile for component encoding while pinning the jco Preview 1 adapter - #366

Open
philippedev101 wants to merge 1 commit into
bytecodealliance:mainfrom
philippedev101:feat/separate-async-component-encoder
Open

philippedev101 wants to merge 1 commit into
bytecodealliance:mainfrom
philippedev101:feat/separate-async-component-encoder

Conversation

@philippedev101

Copy link
Copy Markdown

This moves componentNew and metadataAdd to @bytecodealliance/jco-transpile/wasm-tools (0.24.0) while pinning @bytecodealliance/jco at 1.15.1 for preview1AdapterReactorPath. Component encoding now uses a current wasm-tools build that supports newer Component Model encodings (including async function type opcode 0x43) without breaking HTTP world compatibility with the bundled StarlingMonkey embedding.

Right now src/componentize.js imports all three helpers from @bytecodealliance/jco, and package.json uses "@bytecodealliance/jco": "^1.15.1". That couples the encoder version to the Preview 1 reactor adapter version. Upgrading @bytecodealliance/jco directly (for example to 1.42.0) pulls in a newer Preview 1 adapter that imports wasi:sockets/network@0.2.10::network-error-code, which fails component encoding in test/bindings.js (http-request) against the bundled embedding. Keeping the adapter pinned at 1.15.1 avoids that mismatch while letting componentNew and metadataAdd stay current.

Added an offline regression test in test/http-encoding.js that componentizes the HTTP world without running network calls so future encoder or adapter updates catch drift deterministically. Verified with npm run test:release (80 passed, 1 skipped, including http-request and test/http-encoding.js) and npm audit --omit=dev (0 vulnerabilities).

Import componentNew and metadataAdd from @bytecodealliance/jco-transpile/wasm-tools (0.24.0) while pinning @bytecodealliance/jco at 1.15.1 for preview1AdapterReactorPath.

Upgrading @bytecodealliance/jco directly pulls in a newer Preview 1 adapter that imports wasi:sockets/network@0.2.10::network-error-code, which breaks HTTP world encoding against the bundled StarlingMonkey embedding. Keeping the adapter pinned while moving component encoding to @bytecodealliance/jco-transpile gives componentize() a current wasm-tools encoder (including Component Model async type opcode 0x43) without regressing HTTP compatibility.

Add an offline Vitest regression in test/http-encoding.js covering HTTP world encoding against the bundled adapter.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant