Skip to content

Commit 1fef292

Browse files
rubysclaude
andcommitted
wasm: migrate to upstream ruby-rbs on all targets; land Phase 0 browser spike
Drop the rubys/rbs-rust fork: roundhouse now depends on the published ruby-rbs = "0.3" on every target. wasm only needs ruby-rbs-sys built for wasm32 — its vendored RBS C parser compiled by the WASI-SDK clang, and its bindgen run against the host target (#[repr(C)] is layout-portable), sidestepping the libclang-version-fragile bindgen-against-wasm failures. That build.rs support is upstreamed as ruby/rbs#2992; until it publishes, wasm/Cargo.toml carries a temporary [patch.crates-io] ruby-rbs-sys local path (repin once merged). Build requires WASI_SDK_PATH=/opt/wasi-sdk. Also lands the rung-A Phase 0 browser spike (wasm/browser-spike/): a shared wasi-shim.mjs + transpile.mjs driving both the Node validator and a static browser page — proving the compiler transpiles real-blog in a real tab with no WebContainer/npm/bundler. Plus docs/browser-demo-plan.md. Verified: native cargo check --lib clean; wasm build clean (3.2 MB); node round-trip OK. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent c3a6531 commit 1fef292

16 files changed

Lines changed: 1064 additions & 41 deletions

Cargo.lock

Lines changed: 1 addition & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ serde_json = "1"
1616
serde_yaml_ng = "0.10"
1717
indexmap = { version = "2", features = ["serde"] }
1818
ruby-prism = "1.9.0"
19+
ruby-rbs = "0.3"
1920

2021
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
2122
# (none yet)
@@ -35,9 +36,3 @@ version = "1"
3536
version = "2"
3637
default-features = false
3738
features = ["deflate"]
38-
39-
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
40-
ruby-rbs = "0.3"
41-
42-
[target.'cfg(target_arch = "wasm32")'.dependencies]
43-
ruby-rbs-local = { package = "ruby-rbs", git = "https://github.com/rubys/rbs-rust" }

docs/browser-demo-plan.md

Lines changed: 349 additions & 0 deletions
Large diffs are not rendered by default.

src/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
//! serializable core with a Rails dialect layered on top. The IR is the
55
//! deliverable; ingesters produce it, emitters consume it.
66
7-
#[cfg(target_arch = "wasm32")]
8-
extern crate ruby_rbs_local as ruby_rbs;
9-
107
pub mod adapter;
118
pub mod analyze;
129
pub mod app;

0 commit comments

Comments
 (0)