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
Instant is part of the public API of EventLoop 2.0, which makes sense but unfortunately Instant cannot be constructed on WASM. As of right now, wasm (via stdweb or wasm-bindgen) is essentially only able to access core and alloc.
One solution is to wait until Instant becomes available on wasm via the experimental system call interface. However, there is no timeline for this and it's not clear how long that will take.
What I propose is winit have its own Instant type, with an API identical to std::time::Instant, except it has a private constructor that allows wasm to construct instances of it from web time APIs. The upside is that the public API is more or less the same and fully compatible with wasm; the downside is that users may be confused about why winit has its own Instant type. A possible fix for that would be to intentionally change the type's name to a synonym like Timestamp, so that it is obviously distinct from the type in the standard library.
I would be willing to make the change as part of #797 as long as the maintainers of other platforms would be amenable to it.
The text was updated successfully, but these errors were encountered:
Instant is part of the public API of EventLoop 2.0, which makes sense but unfortunately Instant cannot be constructed on WASM. As of right now, wasm (via stdweb or wasm-bindgen) is essentially only able to access core and alloc.
One solution is to wait until Instant becomes available on wasm via the experimental system call interface. However, there is no timeline for this and it's not clear how long that will take.
What I propose is winit have its own Instant type, with an API identical to std::time::Instant, except it has a private constructor that allows wasm to construct instances of it from web time APIs. The upside is that the public API is more or less the same and fully compatible with wasm; the downside is that users may be confused about why winit has its own Instant type. A possible fix for that would be to intentionally change the type's name to a synonym like Timestamp, so that it is obviously distinct from the type in the standard library.
I would be willing to make the change as part of #797 as long as the maintainers of other platforms would be amenable to it.
The text was updated successfully, but these errors were encountered: