-
-
Notifications
You must be signed in to change notification settings - Fork 102
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
Add wasm support #127
Add wasm support #127
Conversation
Interesting, what was the impact of not having this feature enabled? I would have assumed the WASM CI build step would have failed |
Codecov ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## main #127 +/- ##
==========================================
- Coverage 52.01% 51.60% -0.42%
==========================================
Files 16 16
Lines 2059 2056 -3
==========================================
- Hits 1071 1061 -10
- Misses 988 995 +7 ☔ View full report in Codecov by Sentry. |
I ran into openidconnect-rs/src/verification.rs Line 552 in 414eb35
I noticed that the implementation of now() used wasn't the correct one (this one which uses the std implementation of now which doesn't support wasm was used instead of this one) because of the feature flag
|
Oh ok, thanks! It looks this will require an update to the MSRV Cargo.lock file to get the 1.65 build to pass:
Once that passes, I'll happily merge.
That would be greatly appreciated 🙏 |
This should pass now, I'll make the PR for oauth2-rs tomorrow, it's 1 AM where I live 😪 |
This is now released in 3.3.1 |
Thank you for the fast response and fast release of a new version! |
std::time::SystemTime::now() panics in WASM environments other than Emscripten (i.e., wasm32-unknown-emscripten) and WASI (e.g., wasm32-wasi). Since compilation errors are preferable to unexpected runtime panics, this PR removes the `Utc::now()` function from this crate's public interface altogether in unsupported WASM environments unless the `wasmbind` feature is enabled. This catches the case in which a user of the crate forgets to enable the `wasmbind` feature (see ramosbugs/openidconnect-rs#127 and ramosbugs/oauth2-rs#230) in build targets that require it. Fixes chronotope#1301.
`std::time::SystemTime::now()` panics in WASM environments other than Emscripten (i.e., wasm32-unknown-emscripten) or WASI (e.g., wasm32-wasi). Since compilation errors are preferable to unexpected runtime panics, this PR removes the `Utc::now()` function from this crate's public interface altogether in unsupported WASM environments unless the `wasmbind` feature is enabled. This catches the case in which a user of the crate forgets to enable the `wasmbind` feature (see ramosbugs/openidconnect-rs#127 and ramosbugs/oauth2-rs#230) in build targets that require it. Fixes chronotope#1301.
`std::time::SystemTime::now()` panics in WASM environments other than Emscripten (i.e., wasm32-unknown-emscripten) or WASI (e.g., wasm32-wasi). Since compilation errors are preferable to unexpected runtime panics, this PR removes the `Utc::now()` function from this crate's public interface altogether in unsupported WASM environments unless the `wasmbind` feature is enabled. This catches the case in which a user of the crate forgets to enable the `wasmbind` feature (see ramosbugs/openidconnect-rs#127 and ramosbugs/oauth2-rs#230) in build targets that require it. Fixes chronotope#1301.
Chrono's wasm support wasn't enabled, probably because the docs were outdated and it is currently not listed in the crate's default features but is present in the README .
chronotope/chrono#1260 updates the docs on their side. I can also make a PR for oauth2-rs if you want.