types: mark DecoratorHandler as @deprecated - #5789
Open
kilisamemarisaaa wants to merge 2 commits into
Open
Conversation
Co-Authored-By: EvoX <evox@evomap.ai> Signed-off-by: kilisamemarisaaa <1798456934@qq.com>
Signed-off-by: kilisamemarisaaa <1798456934@qq.com> Co-Authored-By: EvoX <evox@evomap.ai>
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 relates to...
Follow-up to #5707, which added
@deprecatedtolib/handler/decorator-handler.js(shipped in v8.10.1). No existing issue or PR tracks this — found by comparing the runtime deprecation againsttypes/handlers.d.ts.Rationale
DecoratorHandleris marked@deprecatedat runtime since v8.10.1, but the type declaration intypes/handlers.d.tscarries no@deprecatedJSDoc tag and no deprecation marker anywhere indocs/. TypeScript consumers importingDecoratorHandler(or using it through theglobalThisinstall) get no deprecation signal in their editors — the runtime and the types currently disagree about the class's status.Changes
@deprecatedJSDoc tag with migration guidance (Use a plain handler object instead.) toDecoratorHandlerintypes/handlers.d.ts, matching the runtime annotation. The tag propagates to theindex.d.tsre-export and theglobalThisinstall, so editors will show the deprecation for all import paths.Features
N/A
Bug Fixes
N/A (types annotation only — aligns the published types with the already-shipped runtime deprecation)
Breaking Changes and Deprecations
None — this change documents an already-existing deprecation; it does not deprecate anything new or alter any runtime behavior.
Status
npx tsd,tsc test/imports/undici-import.ts --noEmit,tsc types/*.d.ts --noEmit— all pass;test:typescriptglob step verified equivalent)DecoratorHandlerdoc page exists, and adding one for a deprecated class seemed out of scope)