Skip to content

Conversation

Wonshtrum
Copy link

Trying to embed biscuit-auth compiled to wasm32 is a pain outside of JavaScript due to wasmbindgen.
It generates a lot of boilerplate, which is tedious and error-prone to mock correctly.
In this PR I propose to make the old wasm feature optional for the wasm32-unknown-unknown target and rename it wasm-bindgen to avoid confusion.
The only necessary import is for time, which is implemented through performance_now with wasmbindgen. I propose, for a pure wasm32 target, to create a simple instant_now symbol returning a u64, meant to represent a monotonic timestamp, and let the user provide the right implementation in their environment.

note: we could keep the name wasm for the feature making it a non breaking change, but I find it pretty confusing.

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