Comments (3)
I don't think it was a good idea to deprecate Dial
and DialContext
. They are not niche APIs. They are used by literally every grpc-go client implementation; you can't implement a gRPC client without it dialing a gRPC server. By marking them deprecated you are asking every user to evaluate every use of Dial, see how it should be updated, and submit a patch to make the change. This is not a trivial amount of work when you consider the wide use of gRPC.
There are 178,000 open source imports of grpc and countless more inside proprietary code bases and basically all of them are using Dial
, either because they provide a grpc client, or a grpc server and they have end-to-end testing. For any of those projects using standard linting tools their CI's are blowing up with deprecation warnings. My one organization's codebase has over 300 calls to Dial, mostly in test cases.
What I would rather see is continued support for Dial with perhaps a doc comment on why a user might prefer to use NewClient
instead.
from grpc-go.
What I would rather see is continued support for Dial
Dial
support isn't going away, by the way. It will stick around.
Yes, there will be a linter warning if you run a linter that complains about your use of deprecated features. You should have a way to silence linters that you disagree with. That's a tooling problem, not a problem with our decision to deprecate this API. New users need to be funneled to NewClient
instead, and Deprecated
tags are how that is done.
from grpc-go.
https://go.dev/wiki/Deprecated
Sometimes an API feature such as a struct field, function, type, or even a whole package becomes redundant or unnecessary. When we want to discourage new programs from using it, we mark that feature “deprecated”.
In contrast to some other systems, an API feature being deprecated does not mean it is going to be removed in the future. On the contrary, Go 1 compatibility means the feature will be preserved in its deprecated form to keep existing programs running.
This all sounds WAI.
One thing we did get wrong according to this recommendation was to release NewClient
at the same time as deprecating Dial
/DialContext
. We can un-deprecate for one release if it helps, but the decision is to call it deprecated to encourage the use of the new API.
from grpc-go.
Related Issues (20)
- Update docs and examples and tests to use `NewClient` instead of `Dial` HOT 14
- How can the client automate the handling of the GOAWAY signal? HOT 5
- protoc-gen-go-grpc: empty const block causing `gofmt` failure
- failed to listen: listen tcp :50051: bind: address already in use exit status 1 HOT 3
- Add support for using zap.Object HOT 2
- protoc-gen-go-grpc: support proto edition HOT 4
- The API Gateway vision HOT 4
- Issue creating a ENUM with "name" field HOT 2
- metadata validation disallows UTF-8/ISO-8859-1 characters in headers HOT 6
- Possible regression when using NewClient instead of Dial HOT 1
- Is dynamic routing currently supported in grpc-go or how can i achieve it? HOT 7
- Is it possible to split service implementaion? HOT 3
- bufnet not supported by NewClient() ? HOT 5
- Please release upgrade /cmd/protoc-gen-go-grpc /go.mod to security fixed protobuf v1.33.0 HOT 2
- Confusing for NewClient in 1.63 HOT 4
- Deprecate WithBlock and WithReturnConnectionError HOT 3
- gRPC casing looks really ugly [Serious] HOT 2
- resolver.Address's BalancerAttributes update will not reflect in Balancer HOT 3
- How to modify the returned metadata HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grpc-go.