Microsoft will provide experimental gRPC-Web support to .NET
Microsoft will start a pilot program to provide support for gRPC-Web in .Net Core and ASP.Net Core. The program will allow .Net Core gRPC client’s and ASP.NET Core gRPC apps’ to call directly the gRPC-Web, which is a significant advancement for developers. Let’s see some of the features and pros this may bring for IT teams.
Google originally developed gRPC. It is a remote call system that has been officially endorsed by Microsoft to replace WCF in .NET Core. Even as the new .NET support is merely experimental, gRPC-Web is not new. It was initially released in 2018 as a JavaScript client library to allow web apps to get in touch directly with gRPC services without needing an HTTP server proxy.
In a similar fashion to gRPC, gRPC-Web makes use of predetermined contacts between the web client and the gRPC services. That means gRPC-Web is a JavaScript client library that is compatible with HTTP/1 and HTTP/2. It supports the same API as gRPC-Node to be able to gain access to a gRPC service, where the gRPC serves as an open-source RPC framework. This allows the client and server apps to communicate efficiently and transparently.
The fact that it is merely experimental means that Microsoft is not committing to developing a full product. Instead, the company is testing the market and the features of this beta client library. About this, James Newton-King, one of the head software engineers of ASP.NET said in a statement that “We want to test that our approach to implementing gRPC-Web works, and get feedback on whether this approach is useful to .NET developers compared to the traditional way of setting up gRPC-Web via a proxy.”
So, what are the advantages of Microsoft’s experimental program of gRPC-Web for .NET? Basically, the company seeks to bring server streaming, compact Protobuf messages, and strong code-generated clients to browser apps. That means the ASP.Net Core app can support gRPC-Web without needing a proxy and letting the .NET Core gRPC client communicate with gRPC Web Services, which is pretty nice for Blazor WebAssembly apps.
However, this isn’t it. Aside from this feature, the experimental program will also allow calling gRPC from different platforms like Blazon WebAssembly and Xamarin and will enable Azure App Services and IIS to ASP.NET Core gRPC apps. gRPC web will provide a stable client for JavaScript and a proxy for translation between gRPC and gRPC-Web. Microsoft said that gRPC-Web will suffer a minor performance cost and that a couple of gRPC features, in particular, client streaming and bidirectional streaming, will not be supported anymore.
Microsoft published a tutorial for the creation of a gRPC client and server in ASP.NET Core, so people get acquainted with gRPC in .NET (check it right here). gRPC-Web does not require changes to services as it only changes the startup configuration.
That Microsoft turns its gRPC-Web support to .NET experiment into a final product depends on the reception of the testers and the ASP.NET team feedback. If this happens, it could mean a significant overhaul for developers. Let’s see how it goes.