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
Client-side stats span concentrator, stats exporter, and all surrounding state management is now compiled and active on wasm32 targets.
Why?
Previously, most of the stats code was gated behind #[cfg(not(target_arch = "wasm32"))], so wasm builds silently skipped stats computation. As we expand wasm support, CSS should work the same as on native.
How?
The root blocker was std::time::SystemTime, which panics on wasm32-unknown-unknown. Replacing it with web_time::SystemTime (which delegates to Date.now() in a browser/WASI context) unblocks compilation. Once that was fixed, the cfg guards on stats functions, structs, and module re-exports were no longer needed and were removed.
Additional Notes
Duration is left as std::time::Duration — it's purely arithmetic and has no platform dependency. Only SystemTime/UNIX_EPOCH needed to be swapped.
This report tracks Clippy allow annotations for specific rules, showing how they've changed in this PR. Decreasing the number of these annotations generally improves code quality.
The reason will be displayed to describe this comment to others. Learn more.
Although it could be handy to be able to trace every deps to it's usage, I think this kind of comment can become stale very fast, I'd rather have explanation live in code directly or be very generic in toml: wasm-compatible std::time drop-in replacement.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Client-side stats span concentrator, stats exporter, and all surrounding state management is now compiled and active on
wasm32targets.Why?
Previously, most of the stats code was gated behind
#[cfg(not(target_arch = "wasm32"))], so wasm builds silently skipped stats computation. As we expand wasm support, CSS should work the same as on native.How?
The root blocker was
std::time::SystemTime, which panics onwasm32-unknown-unknown. Replacing it withweb_time::SystemTime(which delegates toDate.now()in a browser/WASI context) unblocks compilation. Once that was fixed, thecfgguards on stats functions, structs, and module re-exports were no longer needed and were removed.Additional Notes
Durationis left asstd::time::Duration— it's purely arithmetic and has no platform dependency. OnlySystemTime/UNIX_EPOCHneeded to be swapped.