-
Notifications
You must be signed in to change notification settings - Fork 44
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
[FEATURE-REQUEST] Way to disable transport feature for tonic_build #42
Comments
At the current moment, no, unfortunately, because I cannot conditionally enable a dependency's features at runtime. (Though I could duplicate a If you wanted to give this a test, you could pull down the repository, add a Once a new version of Tonic releases with this new functionality, I'd be happy to merge in a PR for this, or update it myself when I have the next opportunity. |
ok sure. i will have a go |
43: [protoc-gen-tonic] Add option to disable transport generation r=neoeinstein a=stan-irl ## Background - #42 - Currently, transport is always generated for tonic grpc services which is a problem for consumers who want to compile for wasm. The latest version `tonic-build="0.8.4"` allows us to disable this ## Changes - Update tonic-build to v0.8.4 - Add `tonic_opt` option `no_transport` - Migrate from deprecated `generate` APIs to `tonic_build::CodeGenBuilder` - Update `prost-build` ti 0.11.4 in all crates - This was required for cargo crate resolution to succeed - Update README ## Tests -[x] `cargo test` - everything is passing -[x] Used this package to regenerate my own protos - [x] Confirmed that the `connect()` function wasnt generated - Just an FYI that there is now `#[allow(clippy::derive_partial_eq_without_eq)]` macros in the generated code Co-authored-by: Stan Tsouvallas <[email protected]> Co-authored-by: Marcus Griep <[email protected]>
Hi!
I want to compile my generated rust protos to
wasm-unknown-unknown
but the generate::connect()
method doesn't compile to wasm. The connect method can be omitted by disabling thetransport
feature oftonic_build
as documented here and I've tested that this works as expected by usingtonic_build
directly.@neoeinstein do you have any idea how I can disable this? Is it possible in the current implementation of
protoc-gen-tonic
?The text was updated successfully, but these errors were encountered: