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

Allow GrpcWebFetchTransport to receive a fetch function #504

Open
jaysonsantos opened this issue Mar 27, 2023 · 2 comments · May be fixed by #578
Open

Allow GrpcWebFetchTransport to receive a fetch function #504

jaysonsantos opened this issue Mar 27, 2023 · 2 comments · May be fixed by #578

Comments

@jaysonsantos
Copy link

Hey there first, thanks for this project!
I'd like to ask for the ability to construct GrpcWebFetchTransport with a fetch function.
The use case here would be when using svelte for example where the load (https://kit.svelte.dev/docs/load#making-fetch-requests) function receives an implementation, and it is safer to use it on SSR and on browser.
Is it something viable or, should I have been using another option for that?
Thanks in advance!

@jcready
Copy link
Contributor

jcready commented Aug 10, 2023

Even if there were an option to allow you to pass in your own fetch function I don't think it would help you with your svelte/SSR goal. In your link it says:

During server-side rendering, the response will be captured and inlined into the rendered HTML by hooking into the text and json methods of the Response object.

But the GrpcWebFetchTransport uses neither of those methods. Instead it reads from the Response.body which is a ReadableStream.

@Mr-EmPee
Copy link

Any news on this? I'm also interested

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 a pull request may close this issue.

3 participants