-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v0.6 WASM runtime error: 'time not implemented on this platform' #52
Comments
Please try v1.0. If that still doesn't work, sticking with v0.5 should be fine as there are no known issues there. |
1.0 does not work unfortunately.
This means that I have to disable std in order to run on wasm. |
The grafbase fork looks like it may have a fix: https://github.com/grafbase/ulid-rs/tree/wasm32-unknown-unknown-js-sys-time |
Looks promising. It would be great to see these commits upstreamed to this crate! |
@dylanhart WDYT about upstreaming master...grafbase:ulid-rs:wasm32-unknown-unknown-js-sys-time ? The changes seem simple enough, and could help quite nicely with using this crate on wasm32 |
Actually better than this: Using This would better match the intent of the spec at least (though it does not seem to actually enforce UTC), as this way the ULIDs would actually be universally lexicographically sortable. Edit: I now notice how stupid I am to have forgotten that |
@lpotthast @dylanhart @Ekleog I opened a PR that does this a bit nicer than what we did in the branch that you had found. 🙂 |
WASM users, is there a good method of checking WASM support? I'd like to add something to the presubmit CI to check that support doesn't break again in the future. |
@dylanhart a test compiled to wasm32-wasi and run with https://github.com/bytecodealliance/wasmtime should be short and simple. I can do it tomorrow if you could wait. 🙂 |
@dylanhart actually, I managed to do it now, these days it's simpler than I thought. Here's the PR. |
Awesome, thank you! :D |
When using v0.5 everything runs fine in my Yew-WASM-applications, targeting wasm32-unknown-unknown and the web. So the chrono implementation works.
When using v0.6 (with default features), creating a Ulid panics with 'time not implemented on this platform', as the time crate seems to call std::time functions.
Should I use a different set of features? I were not able to find anything to control this. Neither here nor in the time crate..
The text was updated successfully, but these errors were encountered: