Skip to content
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

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

Open
Sytten opened this issue Oct 23, 2024 · 0 comments
Open

Comments

@Sytten
Copy link

Sytten commented Oct 23, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant