-
Notifications
You must be signed in to change notification settings - Fork 82
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
Allow a fetch override for connect-web #618
Conversation
it was unclear to me whether it was necessary to pull in `createFetchClient`, but this seems to do the trick in the most obvious possible way.
This reverts commit 5643542.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR allows for passing in a custom fetch implementation, such as that used by sveltekit (and Angular zones, so I have it).
Sweet!
To really test this, you need to actually use it with one of these libraries, so I have done so as a proof of concept in bufbuild/connect-es-integration@6ddf8e3.
It looks like we are providing the Svelte fetch function to a client that makes both a unary and a server-streaming call, with the Connect protocol with the JSON format. Do both calls happen server side with this call, and no RPC request happens after page load?
Does this work with gRPC-web as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM and follow up with a closer look at the constraints for SSR when we write the documentation.
Please have a look at CI first, though.
closes #403
This PR allows for passing in a custom fetch implementation, such as that used by sveltekit (and Angular zones, so I have it).
To really test this, you need to actually use it with one of these libraries, so I have done so as a proof of concept in connectrpc/examples-es@6ddf8e3.