Skip to content

feat(codegen): generate wasm bridge callbacks#265

Open
pgherveou wants to merge 11 commits into
rust-core/03-server-runtimefrom
rust-core/04-wasm-bridge-codegen
Open

feat(codegen): generate wasm bridge callbacks#265
pgherveou wants to merge 11 commits into
rust-core/03-server-runtimefrom
rust-core/04-wasm-bridge-codegen

Conversation

@pgherveou

@pgherveou pgherveou commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds the generated Rust wasm-bindgen platform bridge and derives host callback namespace/adapter names from truapi-platform trait 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, FlatHostCallbacks compatibility, RequiredHostCallbacks, and encoded platform-local bridge payloads.

Stack

Part of the Rust core runtime port umbrella #104. Full port sequence:

  1. feat(truapi): add testing API and versioned wiring #248 - layer 1/9, merged historical: truapi testing API and versioned wiring.
  2. feat(truapi-platform): add host capability traits #249 - layer 2/9, merged historical: truapi-platform host capability traits.
  3. feat(truapi-codegen): emit Rust dispatcher, wire table, and host callbacks #254 - layer 3/9, merged historical: codegen Rust dispatcher, wire table, and host callbacks.
  4. feat(truapi-server): add host logic primitives #255 - layer 4/9, merged historical: server host logic primitives.
  5. feat(truapi-server): add wire and chain infrastructure #256 - layer 5/9, merged historical: server wire and chain infrastructure.
  6. feat(truapi-server): add platform runtime and host bridge #250 - active layer 1/4: server runtime, permissions, lifecycle, and permission-flow docs.
  7. 👉 feat(codegen): generate wasm bridge callbacks #265 - active layer 2/4: generic wasm bridge/codegen layer. This PR.
  8. feat(host-wasm): add @parity/truapi-host-wasm runtime #252 - active layer 3/4: @parity/truapi-host-wasm namespaced callback consumer.
  9. chore: docs, CI, tooling, and dotli integration for the Rust core #253 - active layer 4/4, top: docs, CI/tooling, playground, and dotli integration.

Active child #253 is kept tree-equivalent with umbrella #104.

Validation

  • cargo fmt --all --check
  • cargo check -p truapi-codegen
  • cargo check -p truapi-server
  • cargo test -p truapi-codegen golden_
  • TRUAPI_SKIP_PACKAGE_BUILD=1 ./scripts/codegen.sh

pgherveou added 3 commits July 6, 2026 08:07
Derive namespaced host callback adapters and the Rust wasm bridge from platform trait metadata instead of hardcoding the existing traits.
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