Skip to content

Removed wasm feature bypassing cyclic dependencies #723

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

Merged
merged 1 commit into from
Aug 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions clients/webassembly/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ rand = { version = "0.7.3", features = ["wasm-bindgen"] }
crypto = { path = "../../common/crypto" }
nymsphinx = { path = "../../common/nymsphinx" }
topology = { path = "../../common/topology" }
gateway-client = { path = "../../common/client-libs/gateway-client", features = ["wasm"] }
validator-client = { path = "../../common/client-libs/validator-client", features = ["wasm"] }
gateway-client = { path = "../../common/client-libs/gateway-client" }
validator-client = { path = "../../common/client-libs/validator-client" }
wasm-utils = { path = "../../common/wasm-utils" }

# The `console_error_panic_hook` crate provides better debugging of panics by
Expand Down
11 changes: 1 addition & 10 deletions common/client-libs/gateway-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,16 @@ version = "0.14"

# wasm-only dependencies
[target."cfg(target_arch = \"wasm32\")".dependencies.wasm-bindgen]
optional = true
version = "0.2"

[target."cfg(target_arch = \"wasm32\")".dependencies.wasm-bindgen-futures]
optional = true
version = "0.4"

[target."cfg(target_arch = \"wasm32\")".dependencies.wasm-utils]
optional = true
path = "../../wasm-utils"

# only import it in wasm. Prefer proper tokio timer in non-wasm
[target."cfg(target_arch = \"wasm32\")".dependencies.wasm-timer]
optional = true
version = "0.2"

# this is due to tungstenite using `rand` 0.8 and associated changes in `getrandom` crate
Expand All @@ -54,14 +50,9 @@ version = "0.2"
# containing javascript (such as a web browser or node.js).
# refer to https://docs.rs/getrandom/0.2.2/getrandom/#webassembly-support for more information
[target."cfg(target_arch = \"wasm32\")".dependencies.getrandom]
optional = true
version = "0.2"
features = ["js"]

[dev-dependencies]
# for tests
#url = "2.1"

[features]
# the reason for introducing additional features is to let cargo know we don't want anything to do with "getrandom/js"
# by default as it messes up with cyclic dependencies for ahash that's indirectly used by sqlx in validator-api
wasm = ["getrandom/js", "wasm-timer", "wasm-utils", "wasm-bindgen-futures", "wasm-bindgen"]
6 changes: 1 addition & 5 deletions common/client-libs/validator-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,5 @@ wasm-timer = "0.2"

[target."cfg(target_arch = \"wasm32\")".dependencies.getrandom]
version = "0.2"
optional = true
features = ["js"]

[features]
# the reason for introducing additional features is to let cargo know we don't want anything to do with "getrandom/js"
# by default as it messes up with cyclic dependencies for ahash that's indirectly used by sqlx in validator-api
wasm = ["getrandom/js"]