Update connect-web-interceptor.js for v0.8.0 and later #166
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.
Summary
Update the connect-web-interceptor.js to be compatible with @buildbuild/connect-web >= v0.8.0 for server-streaming RPCs.
Problem description
Release v0.8.0 of @buildbuild/connect-web made a breaking change to interceptors. Unary RPCs are still compatible, but server-streaming RPCs no longer show up in the grpc-web-devtools.
With this change, server-streaming RPCs show up in the grpc-web-devtools again.
Other changes:
connectrpc.eliza.v1.ElizaService/Say
instead of justSay
.emitDefaultValues
for a more human-friendly representation.google.protobuf.Any
is present in the schema.Server-streaming and unary RPCs tested with Chrome and Firefox:
Errors in unary and server-streaming RPCs tested with Chrome and Firefox:
Pros/cons of approach implemented
The behavior for users of versions < 0.8.0 changes with this PR - they will no longer see server-streaming RPCs in the grpc-web-devtools. Since less than 2% of the downloads for of @bufbuild/connect-web are for older versions, this
It would ideal to support type registries for
google.protobuf.Any
, but swallowing seems better than crashing.Checklist
Code Review Guidelines for Reviewers