Add diagnostic metadata to @experimental - #11684
Merged
JoshLove-msft merged 2 commits intoAug 17, 2026
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: f0e7f0ac-c4b6-47e3-a4fc-430ff8f883c6
JoshLove-msft
requested review from
catalinaperalta,
iscai-msft,
Mark Cowlishaw (markcowl),
Timothee Guerin (timotheeguerin) and
Jeff Fisher (xirzec)
as code owners
August 14, 2026 23:22
commit: |
Contributor
|
All changed packages have been documented.
Show changes
|
|
You can try these changes here
|
6 tasks
Jorge Rangel (jorgerangel-msft)
approved these changes
Aug 17, 2026
iscai-msft
approved these changes
Aug 17, 2026
6 tasks
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.
Motivation
@experimentalcurrently records only that a TypeSpec declaration is experimental. That is enough for emitters that need a boolean lifecycle flag, but it does not describe how an emitter should identify the experiment or whether the generated implementation relies on other experimental features.A generated API can be a distinct public experiment while being composed from several lower-level experiments. For example, an operation tracked as experiment
Cmay internally use experimental featuresAandB. Consumers should seeC, while an emitter may needAandBto generate warning suppressions around implementation code.Usage
Scenarios
diagnosticIdwhen an emitter needs a stable identifier for the experimental API.dependsOnwhen the generated implementation consumes other independently experimental features.emitterScopewhen identifiers are meaningful only to a particular emitter or target language.API changes
diagnosticIdanddependsOnfields toFeatureLifecycleOptions.getFeatureLifecycleDetails, returning:getFeatureLifecycleAPI and its"Experimental" | undefinedbehavior for compatibility.Emitter behavior
The metadata is descriptive rather than prescriptive. Each emitter decides how to represent it. The C# companion implementation in #11685 maps
diagnosticIdtoExperimentalAttributeanddependsOnto scoped warning suppressions.Related work
Validation
@typespec/http-clientbuild and full test suite