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

WASM support with grpc-web #88

Closed
wants to merge 8 commits into from
Closed

Conversation

shravanshetty1
Copy link

Regenerated files by disabling the "transport" feature in tonic, this will allow "cosmos-sdk-proto" to be imported into wasm based applications.

@tony-iqlusion
Copy link
Member

We already support WASM and test it in CI:

https://github.com/cosmos/cosmos-rust/blob/main/.github/workflows/cosmos-sdk-proto.yml#L20-L38

Perhaps we need to better document it.

To support WASM, add default-features = "false" to the cosmos-sdk-proto requirement in your Cargo.toml:

[dependencies.cosmos-sdk-proto]
version = "0.5"
default-features = false

@shravanshetty1
Copy link
Author

shravanshetty1 commented Jun 22, 2021

We already support WASM and test it in CI:

https://github.com/cosmos/cosmos-rust/blob/main/.github/workflows/cosmos-sdk-proto.yml#L20-L38

Perhaps we need to better document it.

To support WASM, add default-features = "false" to the cosmos-sdk-proto requirement in your Cargo.toml:

[dependencies.cosmos-sdk-proto]
version = "0.5"
default-features = false

Yes but this will disable grpc, this pr is to support grpc-web - which requires tonic

Edit:

Renamed misleading heading

@shravanshetty1 shravanshetty1 changed the title WASM support WASM support with grpc-web Jun 22, 2021
@shravanshetty1
Copy link
Author

People can use https://github.com/titanous/grpc-web-client along with this to support grpc-web in wasm. Eventually tonic will have this builtin in some way which is tracked in this issue hyperium/tonic#645

@tony-iqlusion
Copy link
Member

tony-iqlusion commented Jun 22, 2021

Aha! In that case, can you remove the grpc feature, as grpc will otherwise be always available (and your code changes have removed the feature gating anyway)

It's a breaking change, but tendermint-rs v0.20 is about to be released and that's a breaking change as well.

@shravanshetty1 shravanshetty1 changed the title WASM support with grpc-web [WIP] WASM support with grpc-web Jun 22, 2021
@tony-iqlusion
Copy link
Member

@shravanshetty1 mind rebasing?

@shravanshetty1 shravanshetty1 changed the title [WIP] WASM support with grpc-web WASM support with grpc-web Jun 23, 2021
@shravanshetty1
Copy link
Author

#90

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

Successfully merging this pull request may close these issues.

2 participants