-
Notifications
You must be signed in to change notification settings - Fork 271
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
Implement fetch based transport #549
base: master
Are you sure you want to change the base?
Conversation
…s a Uint8Array to support values larger than 127 which string encoding was messing up.
…nd marshal to javascript Uint8Array.
…aborted so that we stop reading gracefully.
…h some minor changes because of the events. Also made some minor tweaks to fetch to have a String response for the tests like xhr.
…ut not with 2.16 which is what I was using during development.
…an iterable type. This apparently changed with flutter 3.0.
…namic javascript types because the resulting code does not work when building web in release mode.
I created an issue for the dart SDK with my last change (5a8818b): |
@jbrownsw I just tested this branch today (had to add one no-op implementation for the updated main branch) and it seems to work well in debug and release mode. Perhaps your original issues have been since resolved? Or maybe I'm not hitting the repro condition? For me, it makes my jpeg video stream actually usable in grpc-web, so would love to see it merged :) |
I don't work at the company that I developed this for so I can't test it, but perhaps @gawmanarnar can get someone to confirm. |
This is essentially to resolve issue #511. It's designed to be very similar to the existing xhr transport, but with my own
FetchHttpRequest
to replace theHttpRequest
type. I was a little lazy on the events so they differ a bit, but I could change them to match those used by xhr to make them even more similar. I could also remove some of the code duplication and the transport stream and connection could be shared with only FetchHttpRequest or HttpRequest being the difference and that could be passed in as a function or a generic type parameter. Finally the last thing I wasn't sure of is if you would want this as a complete replacement for xhr or if you'd rather them coexist so people can switch between them etc. So web_channel.dart will need to be updated based on what route you want to go there.I'm already using this as a drop in replacement for our app and haven't noticed any differences other than the memory growth for streams disappearing.