grpc: expose unstable APIs behind __unstable feature#2728
Open
dfawley wants to merge 2 commits into
Open
Conversation
gu0keno0
approved these changes
Jul 9, 2026
gu0keno0
left a comment
Contributor
There was a problem hiding this comment.
Some nits / clarification questions.
Contributor
|
Thanks, it will be great if we can make grpc-xds cleanly separated. My intuition is that it might make 3rd party customization (e.g. custom LB) as capable as the built-in LBs -- great! |
ejona86
approved these changes
Jul 10, 2026
ejona86
left a comment
Member
There was a problem hiding this comment.
This doesn't seem too hard to reason about, as there are clear groupings that are pretty easy to remember ("the things that are unstable in any language that exposes them"; name resolver, lb, lower-level transport details aka runtime)
gu0keno0
approved these changes
Jul 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We'd like to implement our own features outside of the grpc crate that require unstable APIs in the grpc crate. If we don't implement them in foreign crates, then the situation quickly devolves into "all things must be inside the grpc crate behind feature flags".
This PR introduces an
__unstablefeature flag that publicly re-exports the runtime, LB policy, name resolver, and service config modules, but under a top-level__unstablemodule path to make it as obvious as possible that these features are unstable and should not be relied upon by end users. It also doc-hides them for two purposes:check-external-typeschecker we run automatically ignores doc-hidden symbols.)This PR then makes public many symbols that were previously private or pub(crate), so that they can be exported via the
__unstablemodule.cc @gu0keno0 - I think your xds protos change (#2723) should just go ahead and put the protos into a new
grpc-xdscrate which will subsequently be free to use these unstable APIs.