Skip to content

Minimal XetRuntime for WASM#873

Open
seanses wants to merge 5 commits into
feat/wasm-xet-pkg-compilefrom
di/xetruntime-for-wasm
Open

Minimal XetRuntime for WASM#873
seanses wants to merge 5 commits into
feat/wasm-xet-pkg-compilefrom
di/xetruntime-for-wasm

Conversation

@seanses

@seanses seanses commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

XetRuntime only needs to be a extremely simple wrapper around tokio_with_wasm for WASM target. This PR

  • moves the original runtime.rs to runtime_native.rs and removing all cfg-gated code for WASM target,
  • implement a minimal XetRuntime for WASM, and
  • add a runtime.rs to expose either the native XetRuntime or the WASM XetRuntime through cfg-gate.

Note

Medium Risk
Touches core async execution and session bootstrap on both native and WASM; behavior should be equivalent on native after a large file move, but WASM/runtime wiring errors could break browser builds or bridging.

Overview
Splits XetRuntime into target-specific modules: runtime/native.rs holds the full Tokio-backed implementation (moved out of the monolithic runtime.rs), runtime/wasm.rs exposes a minimal stub (no Tokio handle, no-op SIGINT/shutdown, spawn_blocking via tokio_with_wasm), and runtime.rs only defines RuntimeMode and re-exports the right XetRuntime per cfg.

XetContext and XetSessionBuilder::build now use #[cfg] so WASM always constructs the stub via XetContext::with_config and never tries external-handle detection or from_external. Native-only APIs (handle_meets_requirements, from_external) and related session tests are gated off on WASM.

Also ignores .superpowers/ and switches xet_data’s optional pyo3 dep to the workspace definition.

Reviewed by Cursor Bugbot for commit 56de726. Bugbot is set up for automated code reviews on this repo. Configure here.

@seanses seanses changed the base branch from main to feat/wasm-xet-pkg-compile June 15, 2026 15:13
@seanses seanses marked this pull request as ready for review June 15, 2026 16:00
@seanses seanses requested a review from assafvayner June 15, 2026 16:00
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