Skip to content

feat: switch to component model for wit-bindgen-wasm#118

Merged
GordonSmith merged 1 commit intobytecodealliance:mainfrom
GordonSmith:DROP_WASM_BINDGEN
Mar 17, 2026
Merged

feat: switch to component model for wit-bindgen-wasm#118
GordonSmith merged 1 commit intobytecodealliance:mainfrom
GordonSmith:DROP_WASM_BINDGEN

Conversation

@GordonSmith
Copy link
Collaborator

Time to eat our own dog food

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-validator functions (no resource/class instance model).
  • Reworks the Rust implementation to use wit_bindgen::generate! + component exports, and updates dependencies accordingly.
  • Replaces wasm-pack build steps with a wasm-tools component … + npx jco transpile pipeline; 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.

@GordonSmith GordonSmith requested a review from Copilot March 17, 2026 10:14
@GordonSmith GordonSmith force-pushed the DROP_WASM_BINDGEN branch 2 times, most recently from ba365d6 to 33f24c7 Compare March 17, 2026 10:21
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-bindgen exports with wit-bindgen component exports derived from wit-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 witValidator API 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.

@GordonSmith GordonSmith force-pushed the DROP_WASM_BINDGEN branch 3 times, most recently from 352ae19 to 393f695 Compare March 17, 2026 11:34
@GordonSmith GordonSmith requested a review from Copilot March 17, 2026 11:34
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-bindgen exports with wit-bindgen component exports defined in wit-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 witValidator API 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.

Time to eat our own dog food

Signed-off-by: Gordon Smith <GordonJSmith@gmail.com>
@GordonSmith GordonSmith merged commit 53ef3f9 into bytecodealliance:main Mar 17, 2026
7 checks passed
@GordonSmith GordonSmith deleted the DROP_WASM_BINDGEN branch March 17, 2026 13:08
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.

2 participants