grpc / grpc/grpc-dotnet

Enable referencing proto files in NuGet packages

Open
#183 46 comments 34 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
4.5k
Forks
836
Avg merge
6d 3h
Merged PRs (30d)
7

Description

A common pattern in other languages is that your proto files are not part of your project, especially if you are a client but ofter also when you are a server.

Certainly in enterprises that have their stack build on gRPC. What you see is that the proto's are managed in a common mono repo for all contracts (were talking **mono-repo for the proto** files only here). What you then often see is that contract repo has a language specific distribution step. This do not create client libraries, they just _publish the proto files in a package format idiomatic to the language_ (an example is Java: they package the proto files in a jar package and publish them to a maven repo, in general a private one of the company).

What I like to see is that the .NET implementation would be able to reference **proto in NuGet** that it can fetch from a NuGet repository. That will make it easier for enterprises to adapt gRPC in .NET. They only need to add the NuGet distribution step in one place and a project just need to references NuGet as an **external** dependency.

Let me also stress that this is distributing the proto files and **not client libraries**. You want to _avoid_ distribution of clients that are build with an older version of proto as the one you are using in your project.

And example how this works in Java (using gradle):

```
dependencies {
compile("com.google.protobuf:protobuf-java:3.6.1")
compile("io.grpc:grpc-protobuf:1.18.0")
protobuf('io.anemos:protobeam-options-proto:0.0.3-SNAPSHOT')
}
```

The 3th dependency points to an artifact just containing proto, gradle will make sure that client/server stubs are generate with the same version of gRPC and protobuf as the project is.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.