feat(wasm): make trivial changes for wasm compatibility#1545
feat(wasm): make trivial changes for wasm compatibility#1545Aaalibaba42 wants to merge 2 commits intomainfrom
Conversation
bd9911a to
f978580
Compare
📚 Documentation Check Results📦
|
Clippy Allow Annotation ReportComparing clippy allow annotations between branches:
Summary by Rule
Annotation Counts by File
Annotation Stats by Crate
About This ReportThis 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. |
🔒 Cargo Deny Results📦
|
BenchmarksComparisonBenchmark execution time: 2026-02-10 13:28:14 Comparing candidate commit 7e5584e in PR branch Found 0 performance improvements and 12 performance regressions! Performance is the same for 45 metrics, 2 unstable metrics. scenario:credit_card/is_card_number/ 378282246310005
scenario:credit_card/is_card_number/378282246310005
scenario:credit_card/is_card_number/37828224631000521389798
scenario:credit_card/is_card_number_no_luhn/ 378282246310005
scenario:credit_card/is_card_number_no_luhn/378282246310005
scenario:credit_card/is_card_number_no_luhn/37828224631000521389798
CandidateCandidate benchmark detailsGroup 1
Group 2
Group 3
Group 4
Group 5
Group 6
Group 7
Group 8
Group 9
Group 10
Group 11
Group 12
Group 13
Group 14
Group 15
Group 16
Group 17
Group 18
Group 19
BaselineOmitted due to size. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1545 +/- ##
==========================================
- Coverage 71.80% 70.91% -0.89%
==========================================
Files 426 423 -3
Lines 70125 61653 -8472
==========================================
- Hits 50353 43722 -6631
+ Misses 19772 17931 -1841
🚀 New features to boost your workflow:
|
Artifact Size Benchmark Reportaarch64-alpine-linux-musl
aarch64-unknown-linux-gnu
libdatadog-x64-windows
libdatadog-x86-windows
x86_64-alpine-linux-musl
x86_64-unknown-linux-gnu
|
…h zero overhead if not compiling on wasm-unknown-unknown
What does this PR do?
Make getRandom use the "js" feature if we are targetting wasm32. Don't depend on
sys-infocrate if we compile to wasm. Use web_time instead of time (zero overhead on native, and works ootb withwasm32-unknown-unknownMotivation
Part of the effort to make libdatadog wasm-compatible (at least relevant parts of it).
Additional Notes
/
How to test the change?
It's hard to know exactly, for nothing compiles on wasm just yet. You can compare the kind of error before and after for each crate and see they are not the same, you can
cargo treeorcargo metadataand see if the crates we eliminated/consolidated on features flags indeed are etc.