MagicOnion icon indicating copy to clipboard operation
MagicOnion copied to clipboard

Status of gRPC library for Unity

Open mayuki opened this issue 1 year ago • 7 comments

We are currently testing and experimenting with a solution to use grpc-dotnet (Grpc.Net.Client) on Unity. This includes Unity Editor support on Apple Silicon, which is currently lacking in the C-core gRPC library.

We apologize that we cannot announce this right now, but if all goes well, we expect to release a preview within a few months.

Update: July 28, 2023

Today, we have released a preview of the HTTP/2 handler that enables the use of grpc-dotnet. https://github.com/Cysharp/YetAnotherHttpHandler

Although this project is still in its early stages and rough around the edges, we believe it is an important step forward. Please try out this library, and we look forward to receiving your feedback.

When using Grpc.Net.Client with MagicOnion, please define the build constant USE_GRPC_NET_CLIENT. If you don't use C-core, also define USE_GRPC_NET_CLIENT_ONLY.

mayuki avatar Jun 26 '23 10:06 mayuki

Can I use your chatapp example first and then sync the new solution later

labyte avatar Jul 17 '23 01:07 labyte

Today, we have released a preview of the HTTP/2 handler that enables the use of grpc-dotnet. https://github.com/Cysharp/YetAnotherHttpHandler

Although this project is still in its early stages and rough around the edges, we believe it is an important step forward. Please try out this library, and we look forward to receiving your feedback.

When using Grpc.Net.Client with MagicOnion, please define the build constant USE_GRPC_NET_CLIENT. If you don't use C-core, also define USE_GRPC_NET_CLIENT_ONLY.

mayuki avatar Jul 28 '23 08:07 mayuki

@mayuki bugs related to protobuf-net + protobuf-net.gRPC affecting IL2CPP reported by me recently.

These libraries are used to follow a code first pattern without .proto files.

I see MagicOnion doesn't use them and I don't know if it is possible to use them but just in case I mention these threads:

https://forum.unity.com/threads/impossible-to-build-using-il2cpp-with-protobuf-net-grpc-library.1470681/

https://forum.unity.com/threads/unsupported-internal-call-for-il2cpp-parameterinfo-gettypemodifiers.1157522/#post-9204273

bdovaz avatar Aug 15 '23 14:08 bdovaz

Thank you for the information.

The former seems to be a problem due to IL2CPP code generation related to Volatile.Write, and the latter due to unsupported IL related to required or init. MagicOnion does not use these, so there are currently no affected parts.

mayuki avatar Aug 16 '23 05:08 mayuki

@mayuki Master is now quite ahead of 5.1 branch. Are there any plans to release all those changes soon? Thank you!

Rurouni avatar Dec 08 '23 19:12 Rurouni

Currently, we are incorporating updates for YetAnotherHttpHandler, and as soon as that stabilizes, we plan to release this library.

mayuki avatar Dec 11 '23 08:12 mayuki