osaxma / FlutterWebLimitations

a list of Flutter web limitations
The Unlicense
4 stars 0 forks source link

dart-grpc #12

Open gedw99 opened 3 years ago

gedw99 commented 3 years ago

i have it working for flutter web and native.

there was nothing needed to make it work, except of course a server that can proxy the grpc like envoy, etc. its been working for over y year with flutter web.

here is a bit of info https://blog.envoyproxy.io/envoy-and-grpc-web-a-fresh-new-alternative-to-rest-6504ce7eb880

this is very standard grpc stuff..

so you might want to update the Readme with this info. Just saying.

osaxma commented 3 years ago

Hi @gedw99 Thanks for the heads up.

@iapicca Would you mind looking at this please? I'm not sure if you're aware of something specific about grpc that doesn't work with Flutter Web when the issue was added to the readme.

iapicca commented 3 years ago

@gedw99 for my understanding this is just grpc via js the issue for the missing dart implementation still stands imho

gedw99 commented 3 years ago

Hey @iapicca

Maybe we are not understanding each other, so best way is an example:

https://github.com/amplify-edge/main/tree/master/deploy/templates/maintemplatev2

A golang backend. A golang cli client calling the golang backend over grpc A flutter web client calling the golang backend over grpc web

Its heavily abstracted for reusability, but you can see what its doing i think.

iapicca commented 3 years ago

@gedw99 I'm not saying is a bad solution, I'm just saying that doesn't meet parity with mobile and desktop

gedw99 commented 3 years ago

Parity on what sense ?

iapicca commented 3 years ago

Parity on what sense ?

@gedw99 in the sense of using the same first party package on all supported platforms, to make an hypothetical example, imagine if grpc first party package worked on android, but not on ios using a platform channel to communicate with a native implementation this would be a solid solution, but definitely not define parity across platforms

personally I have the impression that web is seen by most, including flutter team as a "son of a lesser god" where mobile and desktop have or aim to have packages written in dart and therefore with a consistent behavior while for web is viewed as "ok" to rely on js invocation I strongly disagree with that view

gedw99 commented 3 years ago

Js invocation ?

the GRPC for web flutter is only dart based. No changes at all required between native ( desktop / Mobile ) and web, except for the GRPC web proxy in front.

Under the hood the imporobable GRPC proxy uses web sockets. You can swap out the proxy with envoy with no code changes also if you prefer envoy which gives you discovery, global load balancing etc

iapicca commented 3 years ago

the GRPC for web flutter is only dart based. No changes at all required between native ( desktop / Mobile ) and web, except for the GRPC web proxy in front.

I don't see web support in here https://pub.dev/packages/grpc using a js base implementation seems a workaround, a good one, but not a first party solution