Add wasmJs and wasmWasi targets to wire-grpc-client - #3696
Open
oldergod wants to merge 2 commits into
Open
Conversation
Modules that declare gRPC services generate Kotlin code which depends on wire-grpc-client. wire-grpc-client did not target wasmWasi, so those modules could not compile for wasmWasi even though wire-runtime already supports it. Add a wasmWasi target to wire-grpc-client. The target is gated behind the kwasm system property, the same way wire-runtime gates its wasm targets. The new wasmWasiMain source set holds TODO stub actuals, the same approach the js target uses. Co-authored-by: Benoît Quenaudon <benoit@quenaudon.com> Signed-off-by: Benoît Quenaudon <benoit@quenaudon.com>
The js, native, and wasmWasi targets each held their own copy of the same 8 TODO stub actuals. Create an intermediate nonJvmMain source set that holds the stubs once, and attach the js, native, wasmJs, and wasmWasi targets to it. This follows the guidance in PR 3152 and mirrors the nonJvmMain wiring wire-runtime already uses. Add the wasmJs target, gated behind the kwasm system property like the other wasm targets. The gzip exception messages no longer name a single platform because one file now serves several platforms. Co-authored-by: Benoît Quenaudon <benoit@quenaudon.com> Signed-off-by: Benoît Quenaudon <benoit@quenaudon.com>
oldergod
marked this pull request as ready for review
August 27, 2026 16:12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3695.
What changed
wire-grpc-clientnow declareswasmJsandwasmWasitargets. Modules that declare gRPCservices generate Kotlin code that depends onwire-grpc-client. Those modules can now compile for both wasm targets, like they already could withwire-runtimealone.kwasmsystem property. This mirrors howwire-runtimegates its wasm targets.nonJvmMainintermediate source set. Thejs,native,wasmJs, andwasmWasitargets all attach to it. Before this change, thejs,native, andwasmWasisource sets each held their own copy of the same 8 TODO stub files. This follows the guidance in Add wasmJs support #3152 (comment) and mirrors thenonJvmMainwiringwire-runtimealready uses.