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

fix: disable experimental decorator flag #1828

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rix0rrr
Copy link
Contributor

@rix0rrr rix0rrr commented Mar 5, 2025

The experimentalDecorators flag is legacy from TypeScript 3.9.

Since then, decorators have gone through a large change and their new syntax, which is enabled by default in TypeScript 5+, looks very different.

Keeping this old flag enabled locks users into old decorator typings which are deprecated, plus because of the way our defaults are applied these flags are not overridable.

Instead, don't set experimentalDecorators at all, and have users opt in to legacy syntax if they must.

This is technically breaking, but I'm pretty sure this will affect such a negligible fraction of users that I think it's worth it.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

The `experimentalDecorators` flag is legacy from TypeScript 3.9.

Since then, decorators have gone through a large change and their new
syntax, which is enabled by default in TypeScript 5+, looks very
different.

Keeping this old flag enabled locks users into old decorator typings
which are deprecated, plus because of the way our defaults are applied
these flags are not overridable.

Instead, don't set `experimentalDecorators` at all, and have users opt
in to legacy syntax if they must.

This is technically breaking, but I'm pretty sure this will affect such
a negligible fraction of users that I think it's worth it.
@rix0rrr rix0rrr requested a review from a team March 5, 2025 18:36
@mrgrain mrgrain disabled auto-merge March 5, 2025 19:35
@rix0rrr
Copy link
Contributor Author

rix0rrr commented Mar 5, 2025

Let's be sure to merge this when we do TypeScript 5.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant