feat: switch to component model for wit-bindgen-wasm#118
feat: switch to component model for wit-bindgen-wasm#118GordonSmith merged 1 commit intobytecodealliance:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR migrates the wit-bindgen-wasm subproject from a wasm-bindgen-style JS module to a WebAssembly Component Model build/output, and updates the VS Code extension’s runtime integration and tests to use the new jco-transpiled API.
Changes:
- Redefines the WIT surface as a component world exporting
wit-validatorfunctions (no resource/class instance model). - Reworks the Rust implementation to use
wit_bindgen::generate!+ component exports, and updates dependencies accordingly. - Replaces
wasm-packbuild steps with awasm-tools component …+npx jco transpilepipeline; updates TypeScript integration and unit tests.
Reviewed changes
Copilot reviewed 10 out of 12 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| wit-bindgen-wasm/wit/wit-bindgen.wit | Updates WIT to a component-exported interface/world and adds component extraction functions. |
| wit-bindgen-wasm/src/lib.rs | Switches Rust exports from wasm-bindgen to component-model exports and refactors binding generation helpers. |
| wit-bindgen-wasm/create_component.sh | Removes the old component-creation helper script. |
| wit-bindgen-wasm/Cargo.toml | Drops wasm-bindgen deps and adds wit-bindgen (component bindings) + updates crate descriptions/tooling config. |
| wit-bindgen-wasm/Cargo.lock | Updates lockfile to reflect new Rust deps and removed wasm-bindgen ecosystem crates. |
| src/wasmUtils.ts | Updates runtime loading to the jco-transpiled witValidator API (no explicit .wasm initialization via VS Code FS). |
| tests/wasmUtils.test.ts | Updates mocks/tests to reflect the new module-level witValidator API. |
| tests/bindings-generation.test.ts | Updates integration-style binding generation tests to use witValidator.generateBindings. |
| scripts/setup-wasm.sh | Changes setup to focus on wasm-tools + jco availability (instead of wasm-pack). |
| scripts/build-wasm.sh | Adds a new component build script (core wasm → embed types → component → jco transpile). |
| package.json | Switches build scripts from wasm-pack to scripts/build-wasm.sh and updates WASM verification target file. |
| package-lock.json | Removes wasm-pack and its transitive deps from the Node dependency graph. |
You can also share your feedback on Copilot code review. Take the survey.
a28278b to
62e82ab
Compare
ba365d6 to
33f24c7
Compare
There was a problem hiding this comment.
Pull request overview
This PR migrates the wit-bindgen-wasm subproject from a wasm-bindgen JS-module style interface to a WebAssembly Component Model interface, and updates the extension build/test pipeline to consume the jco-transpiled component API.
Changes:
- Replace
wasm-bindgenexports withwit-bindgencomponent exports derived fromwit-bindgen-wasm/wit/wit-bindgen.wit. - Introduce a new build pipeline (
wasm-tools component ...+jco transpile) and update setup/version-sync scripts accordingly. - Update TypeScript utilities and tests to use the new
witValidatorAPI surface.
Reviewed changes
Copilot reviewed 14 out of 16 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| wit-bindgen-wasm/wit/wit-bindgen.wit | Redefines the exported surface as a component world + interface (adds component/core-wasm extraction APIs). |
| wit-bindgen-wasm/src/lib.rs | Implements the component Guest exports and removes wasm-bindgen glue code. |
| wit-bindgen-wasm/create_component.sh | Removes the previous (wasm-bindgen–oriented) component creation helper script. |
| wit-bindgen-wasm/README.md | Updates build instructions to use the new setup/build scripts. |
| wit-bindgen-wasm/Cargo.toml | Switches dependencies from wasm-bindgen to wit-bindgen (component model) and updates related crates. |
| wit-bindgen-wasm/Cargo.lock | Locks updated Rust dependency graph (adds wit-bindgen macro crates, removes wasm-bindgen stack). |
| src/wasmUtils.ts | Switches runtime integration to the jco-transpiled witValidator API and simplifies initialization. |
| tests/wasmUtils.test.ts | Updates mocks/tests for the new witValidator API shape; removes instance-creation tests. |
| tests/bindings-generation.test.ts | Updates integration tests to call witValidator.generateBindings(...) directly. |
| scripts/setup-wasm.sh | Updates dev setup to install wasm-tools and validate jco availability. |
| scripts/build-wasm.sh | New script that builds core wasm, embeds WIT, creates a component, and transpiles it via jco. |
| scripts/update-wasm-tools-version.sh | New helper to sync pinned wasm-tools CLI version with wit-component crate version. |
| package.json | Replaces wasm-pack build scripts with the new component build scripts and adds wasm-tools update hook. |
| package-lock.json | Reflects dependency graph changes (notably tool/dependency placement updates). |
| README.md | Updates top-level build prerequisites from wasm-pack to wasm-tools. |
You can also share your feedback on Copilot code review. Take the survey.
352ae19 to
393f695
Compare
There was a problem hiding this comment.
Pull request overview
This PR migrates the wit-bindgen-wasm subproject from a wasm-bindgen JS-focused module to a WebAssembly Component Model build, and updates the VS Code extension to call into the generated witValidator interface (via jco-transpiled bindings).
Changes:
- Replace
wasm-bindgenexports withwit-bindgencomponent exports defined inwit-bindgen.wit. - Add new component-based build pipeline (
wasm-tools component embed/new+jco transpile) and update docs/CI/scripts accordingly. - Update extension WASM integration and tests to use the new
witValidatorAPI shape.
Reviewed changes
Copilot reviewed 14 out of 16 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| wit-bindgen-wasm/wit/wit-bindgen.wit | Switches API surface to component exports and adds component extraction functions. |
| wit-bindgen-wasm/src/lib.rs | Replaces wasm-bindgen bindings with component-model guest implementation and wiring. |
| wit-bindgen-wasm/create_component.sh | Removes old exploratory component-creation script. |
| wit-bindgen-wasm/README.md | Updates build instructions to use the new component build scripts. |
| wit-bindgen-wasm/Cargo.toml | Drops wasm-bindgen deps and adds wit-bindgen component bindings. |
| wit-bindgen-wasm/Cargo.lock | Updates lockfile to match new Rust dependency graph. |
| src/wasmUtils.ts | Updates extension runtime to import and call witValidator from the component bindings. |
| tests/wasmUtils.test.ts | Updates unit tests/mocks for the new WASM API entrypoint and adds extraction tests. |
| tests/bindings-generation.test.ts | Updates integration test to use the jco-transpiled API directly. |
| scripts/setup-wasm.sh | Switches setup from wasm-pack to wasm-tools + jco expectations. |
| scripts/build-wasm.sh | New build script: core wasm → embedded → component → jco JS output. |
| scripts/update-wasm-tools-version.sh | New helper to keep wasm-tools CLI version aligned with wit-component. |
| package.json | Replaces wasm-pack build scripts with component build scripts and adds wasm-tools update hook. |
| package-lock.json | Reflects dependency graph changes and removal of wasm-pack. |
| README.md | Updates top-level build prereqs from wasm-pack to wasm-tools. |
| .github/workflows/ci.yml | Ensures wasm build tools are set up before running tests in CI. |
You can also share your feedback on Copilot code review. Take the survey.
393f695 to
ba9ed28
Compare
Time to eat our own dog food Signed-off-by: Gordon Smith <GordonJSmith@gmail.com>
ba9ed28 to
2386c78
Compare
Time to eat our own dog food