Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core] Empty parameter visibility and visibility string deprecation #6088

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

witemple-msft
Copy link
Member

  • Makes the necessary core/http changes to deprecate
    • parameterVisibility/returnTypeVisibility with no arguments.
    • use of string visibility modifiers.
    • LegacyParameterVisibility HTTP flag.
  • Deprecations are raised as warnings visibility-legacy and will be converted to errors in 1.0-rc.
  • Numerous tests and samples have been updated to replace use of string visibility modifiers with Lifecycle modifiers.
  • Deprecation messages for deprecated APIs have been updated to indicate that they will be REMOVED in 1.0-rc.
  • Added PatchOptions/getPatchOptions which now controls Visibility.Patch.

WIP:

  • Replace uses of string-based visibility modifiers throughout Azure specs with Lifecycle modifiers (required to avoid breaking the specs repo).
  • Replace uses of empty parameter visibility constraints throughout Azure Specs with PatchOptions.
  • Remove uses of deprecated visibility analysis methods throughout Azure TypeSpec libraries/emitters (can be done between now and 1.0-rc if not before the next release).

@azure-sdk
Copy link
Collaborator

azure-sdk commented Feb 20, 2025

❌ There is undocummented changes. Run chronus add to add a changeset or click here.

The following packages have changes but are not documented.

  • @typespec/http-client-csharp

The following packages have already been documented:

  • @typespec/compiler
  • @typespec/http-specs
  • @typespec/http
  • @typespec/openapi
  • @typespec/rest
Show changes

@typespec/compiler - deprecation ✏️

Deprecate use of string-based visibility modifiers using warnings.

@typespec/http-specs - internal ✏️

Replace use of string-based visibility modifiers with enum-based Lifecycle modifiers in tests.

@typespec/http - internal ✏️

Replace use of string-based visibility modifiers with enum-based Lifecycle modifiers in tests.

@typespec/rest - internal ✏️

Replace use of string-based visibility modifiers with enum-based Lifecycle modifiers in tests.

@typespec/openapi - internal ✏️

Remove references to string-based visibility from function documentation.

@azure-sdk
Copy link
Collaborator

azure-sdk commented Feb 20, 2025

You can try these changes here

🛝 Playground 🌐 Website 📚 Next docs 🛝 VSCode Extension

- "@typespec/compiler"
---

Deprecate use of string-based visibility modifiers using warnings.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add some diff code block to show how to migrate

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. I think I'm also going to add a codefix if all the strings in the args are lifecycle strings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:core Issues for @typespec/compiler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants