Open
Conversation
When -deprecatedincluded is used, emit /** @deprecated message */ JSDoc annotations in generated .d.ts files for: - Deprecated types (classes, interfaces, enums, delegates) - Deprecated enum values (with parent type propagation) - Deprecated methods and constructors - Deprecated properties and fields - Deprecated event listeners Added get_deprecated_message() helper to MetadataHelpers.h to extract the deprecation message string from DeprecatedAttribute metadata. Note: Uses ^@ escape for @ in TextWriter format strings to avoid TextWriter interpreting @ as a format placeholder. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- tests/TestArtifacts/verify_deprecated.ps1: Runs rnwinrt against system WinMD and verifies @deprecated JSDoc annotations on deprecated types, enums, methods, and properties (10/10 checks pass) - docs/deprecated.md: Documents the deprecated annotation feature Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
When DeprecatedAttribute has DeprecationType.Remove (arg[1]==1), the type or member is completely hidden from the generated TypeScript declarations. Added is_removed() helper to MetadataHelpers.h. Checks applied to delegates, enums, enum fields, classes/interfaces, fields, properties, methods, and event listeners in TypescriptWriter.h. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- verify_removed.ps1 validates deprecated/removed support: * DeprecationType enum has both deprecate(0) and remove(1) * is_removed(), is_deprecated(), get_deprecated_message() helpers exist * TypescriptWriter has is_removed() checks and WriteDeprecatedJsdoc() * Generated .d.ts artifacts have content Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Bug fixes in TypescriptWriter.h: - Property deprecation: check is_removed(getter) instead of is_removed(prop), since MIDL places DeprecatedAttribute on the getter method, not the Property metadata row - Guard all is_removed() checks with !settings.IncludeDeprecated so that -deprecatedincluded mode shows removed items with @deprecated annotations (previously still filtered them out) verify_removed.ps1: Rewrote with WinMD-based generation tests (40 checks) - Mode 1 (no deprecated): Verifies removed types, methods, properties, static properties, events, and constructors are excluded - Mode 2 (deprecated included): Verifies all items present with @deprecated JSDoc annotations Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…on tests - Settings.cpp: unconditional is_removed() in is_type_allowed() - TypescriptWriter.h: change 9 conditional is_removed() checks to unconditional (removed items are always filtered, even with -deprecatedincluded) - ReactFileGenerator.cpp: is_removed() guards in class iteration loops - verify_removed.ps1: 47 regression tests for source guards, TS output, C++ bridge Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
This implements the deprecated attribute as described here: https://learn.microsoft.com/en-us/uwp/api/windows.foundation.metadata.deprecatedattribute?view=winrt-26100
Along with the DeprecationType enum as described here: https://learn.microsoft.com/en-us/uwp/api/windows.foundation.metadata.deprecationtype?view=winrt-26100
Fixes: WinRT Deprecation, that right now does not do anything.