Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Stage 3 Decorators #48096

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

Closed
jpike88 opened this issue Nov 17, 2022 · 2 comments
Closed

Stage 3 Decorators #48096

jpike88 opened this issue Nov 17, 2022 · 2 comments
Labels
area: core Issues related to the framework runtime
Milestone

Comments

@jpike88
Copy link

jpike88 commented Nov 17, 2022

Which @angular/* package(s) are relevant/related to the feature request?

No response

Description

It looks like TS is going to be getting stage 3 decorators in 5.0:

microsoft/TypeScript#51362

Will angular need to make changes to how it defines decorators in order to keep up?

Proposed solution

Review the changes needed to be Stage 3 decorator compliant

Alternatives considered

none

@dylhunn dylhunn added the area: core Issues related to the framework runtime label Nov 17, 2022
@ngbot ngbot bot added this to the needsTriage milestone Nov 17, 2022
@alxhub
Copy link
Member

alxhub commented Nov 18, 2022

Good question!

At the moment, we won't be able to use ES decorators as defined by TC39. Angular relies heavily on parameter decorators for its DI system, which is not part of the v1 of the Decorators spec. It's being considered as a separate proposal but traction seems low. We'll continue to advocate for this in TC39.

The good news is that TypeScript will not remove support for its experimental implementation of decorators, which will continue to function when the --experimentalDecorators flag is set.

So in the short term, there's nothing we need to do - TS 5.0 won't break us. Longer term, if TC39 signals that they're not interested in standardizing parameter decorators, we will need to consider alternatives for DI. There are certain patterns around inject() that could work as alternatives.

@alxhub alxhub closed this as not planned Won't fix, can't repro, duplicate, stale Nov 18, 2022
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Dec 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: core Issues related to the framework runtime
Projects
None yet
Development

No branches or pull requests

3 participants