grpc-dart icon indicating copy to clipboard operation
grpc-dart copied to clipboard

Support for http based grpc-web for mobile

Open otakuto opened this issue 2 years ago • 11 comments

https://github.com/grpc/grpc-dart/pull/287 https://github.com/grpc/grpc-dart/pull/351 This will be a re-attempting of the above.

Thanks for your review.

otakuto avatar Jun 03 '22 14:06 otakuto

CLA Signed

The committers listed above are authorized under a signed CLA.

  • :white_check_mark: login: otakuto (02bcae24b54c1bd478e58d378c4df42fd72073ca)

@sigurdm @mraleph - who would be best to review this?

devoncarew avatar Jun 06 '22 19:06 devoncarew

@otakuto thanks for taking your time to contribute. Could you try to fix EasyCLA check? We can't look at the code before it is fixed.

mraleph avatar Jun 07 '22 07:06 mraleph

@otakuto Could you outline a specific use case which makes you interested in using gRPC-Web from a mobile application? Any specific reason that prevents you from using the native gRPC protocol instead?

/cc @wenbozhu

mraleph avatar Jun 08 '22 07:06 mraleph

@otakuto thanks for taking your time to contribute. Could you try to fix EasyCLA check? We can't look at the code before it is fixed.

I fixed it.

otakuto avatar Jun 09 '22 02:06 otakuto

@otakuto Could you outline a specific use case which makes you interested in using gRPC-Web from a mobile application? Any specific reason that prevents you from using the native gRPC protocol instead?

/cc @wenbozhu

In this example, there is a reason why it is difficult for a microcontroller to support HTTP2 when communicating with a microcontroller such as ESP32 and mobile. Another advantage is that it is possible to implement a pure dart client for mobile and web respectively.

otakuto avatar Jun 09 '22 02:06 otakuto

@otakuto

In this example, there is a reason why it is difficult for a microcontroller to support HTTP2 when communicating with a microcontroller such as ESP32 and mobile.

Makes sense. HTTP2 stack might be quite large so it does not necessarily fit on a microcontroller.

Another advantage is that it is possible to implement a pure dart client for mobile and web respectively.

Could you elaborate what you mean by this?

One of the problems with merging this (and officially supporting gRPC-Web protocol on native targets) is that it would block us from migrating our gRPC-Web implementation to use official JavaScript implementation underneath, which is something that we have been considering to reduce our maintenance burden.

mraleph avatar Jun 09 '22 07:06 mraleph

Hello !

I want to share another use case for this feature.

As written in #216, another use case is to be able to use the gRPC-Web protocol to bypass the limitations of some cloud platforms, such as DigitalOcean's App Platform service which does not allow to expose a gRPC service.

For us, merging this PR would be extremely valuable.

ghost avatar Apr 13 '23 09:04 ghost

I'd like to add another vote in support of this PR. AWS lambda doesn't support HTTP2, and while I'm not familiar with other FaaS environments I expect lambda isn't the only one with this constraint. I appreciate the need to control your maintenance surface area but I think it would be a shame to commit to never supporting grpc-web on native targets.

For what it's worth I've locally rebased this PR on 3.1.0 and tested it for my use case, LGTM.

mreimer avatar Apr 15 '23 12:04 mreimer

Hello !

We have tested these changes on our API and everything seems OK on our side too.

Maybe another solution would be to export what is needed to be able to offer this functionality in another package?

ghost avatar May 03 '23 08:05 ghost

Any updates on this?

stonymahony avatar Feb 16 '24 10:02 stonymahony