simd-json icon indicating copy to clipboard operation
simd-json copied to clipboard

Consider using a feature for wasm support instead of a target dependency

Open Sytten opened this issue 1 year ago • 0 comments

Hi! Cargo is notorious for not pruning the dependencies for target_family. That currently means that a user of simd-json that will never compiler for wasm will still have js_sys in its lockfile because of:

[target.'cfg(target_family = "wasm")'.dependencies]
getrandom = { version = "0.2", features = ["js"] }

A common way to get around that is to create a feature wasm and put the getrandom as optional. This is really a cargo problem, but until they fix it that is what is usually recommended.

Sytten avatar Oct 23 '24 20:10 Sytten