-
-
Notifications
You must be signed in to change notification settings - Fork 280
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
WASM support #491
WASM support #491
Conversation
Codecov Report
@@ Coverage Diff @@
## main #491 +/- ##
=======================================
Coverage 99.48% 99.48%
=======================================
Files 70 70
Lines 7219 7225 +6
=======================================
+ Hits 7182 7188 +6
Misses 37 37
Help us with your feedback. Take ten seconds to tell us how you rate us. |
c1a04b9
to
9750317
Compare
Thanks @xy2iii for putting this together! I have updated to try this out as I have some existing
Looking into this some more now. |
I think the issue is that I updated to this: let timestamp = (js_date.get_time() / 1000.0) as i64; And it should work as expected now. |
47f85d0
to
26cc74c
Compare
Hey @tmpfs, thank you for looking into it! Updated and co-authored you. The from impl works with every js date with this bug fixed. |
That is fantastic @xy2iii, thanks 🙏 A respectful nudge @jhpratt for a review please, would really like to see this land 🙌 |
I haven't forgotten about this. Just haven't had the time. |
5cee0b7
to
02cc91f
Compare
Co-authored-by: tmpfs <muji@tmpfs.org>
Massive thanks to both @xy2iii and @jhpratt for landing this so fast 🙌 My project's |
Not released yet, but it will be soon! There's at least one other thing I want to have land. If I can't get it reasonably quick, then I'll release as-is. |
This PR allows using
time
with WebAssembly, resolving #490.Concerns
Transitive dependecies
When on a wasm target,
js-sys
depends onwasm-bindgen
, which pullssyn
andquote
among others:Invalid JS dates
These dates are interpreted by
js-sys
as having timestamp 0, and will return a valid date (January 1, 1970).