feat(codegen): generate wasm bridge callbacks#265
Open
pgherveou wants to merge 7 commits into
Open
Conversation
Derive namespaced host callback adapters and the Rust wasm bridge from platform trait metadata instead of hardcoding the existing traits.
This was referenced Jul 6, 2026
…o rust-core/04-wasm-bridge-codegen
…o rust-core/04-wasm-bridge-codegen
…o rust-core/04-wasm-bridge-codegen # Conflicts: # rust/crates/truapi-codegen/tests/golden_rust_emit.rs # rust/crates/truapi-server/src/wasm.rs
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.
Summary
Adds the generated Rust wasm-bindgen platform bridge and derives host callback namespace/adapter names from
truapi-platformtrait metadata.The codegen pipeline no longer hardcodes the current platform trait set. Adding a new platform trait should only require providing the corresponding JS namespace/adapter implementation, not changing the Rust/TS codegen selection logic.
This layer also updates generated goldens for namespaced
HostCallbacks,FlatHostCallbackscompatibility,RequiredHostCallbacks, and encoded platform-local bridge payloads.Stack
Part of the Rust core runtime port umbrella #104. Full port sequence:
truapitesting API and versioned wiring.truapi-platformhost capability traits.@parity/truapi-host-wasmnamespaced callback consumer.Active child #253 is kept tree-equivalent with umbrella #104.
Validation
cargo fmt --all --checkcargo check -p truapi-codegencargo check -p truapi-servercargo test -p truapi-codegen golden_TRUAPI_SKIP_PACKAGE_BUILD=1 ./scripts/codegen.sh