You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(wasm): add browser WASM build target with wasm-bindgen PupClient
Adds wasm32-unknown-unknown as a build target alongside the existing
native and WASI targets. The browser build produces an npm-ready package
with a PupClient JS class exposed via wasm-bindgen.
- Add [lib] section and `browser` feature flag to Cargo.toml
- Create src/lib.rs with PupClient + PupClientOptions wasm-bindgen exports
(18 typed methods + 5 raw HTTP methods, returns native JS objects)
- Gate env/fs APIs in config.rs behind #[cfg(not(feature = "browser"))],
add Config::from_params() for browser use
- Add LocalStorageBackend in auth/storage.rs for browser token persistence
- Make auth/crypto deps (rand, sha2, base64, aes-gcm, etc.) optional to
avoid getrandom v0.3 issues on wasm32-unknown-unknown
- Add getrandom_backend="wasm_js" rustflag in .cargo/config.toml
- Add browser-wasm-build CI job, add pkg/ to .gitignore
Build: wasm-pack build --target web --no-default-features --features browser
Output: 479KB .wasm + JS/TS bindings with full type definitions
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
0 commit comments