Skip to content

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

Closed
@Sytten

Description

@Sytten

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions