Skip to content

fix(subsecond): gate browser deps on target_os = "unknown" so WASI builds#5602

Open
harryzz wants to merge 1 commit into
DioxusLabs:mainfrom
harryzz:wasip2-subsecond-cfg
Open

fix(subsecond): gate browser deps on target_os = "unknown" so WASI builds#5602
harryzz wants to merge 1 commit into
DioxusLabs:mainfrom
harryzz:wasip2-subsecond-cfg

Conversation

@harryzz
Copy link
Copy Markdown

@harryzz harryzz commented May 29, 2026

subsecond gates its browser deps (wasm-bindgen, js-sys, web-sys, wasm-bindgen-futures) and the apply_patch hot-reload path on cfg(target_arch = "wasm32"). That also matches non-browser wasm targets like wasm32-wasip2/wasm32-wasip1, where the web_sys::window().fetch(...) path is meaningless and wasm-bindgen's imports don't link — so anything depending on dioxus-core (which depends on subsecond) fails to build for WASI / component-model targets.

This narrows the gate to all(target_arch = "wasm32", target_os = "unknown") (browser only). On WASI, apply_patch falls through to its existing Ok(()) (hot-patch is a no-op there). No change for browser or native targets.

Tested: a dioxus 0.7 cdylib then builds as a valid wasm32-wasip2 component with no wasm-bindgen in the dependency tree.


This patch was written with Claude (AI assistant) and reviewed + explicitly approved by me before submitting.

…ilds

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@harryzz harryzz requested a review from a team as a code owner May 29, 2026 15:49
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