Report grammar errors for invalid decorator grammar#57749
Conversation
|
@typescript-bot test top400 @typescript-bot perf test this faster |
|
Hey @jakebailey, I've packed this into an installable tgz. You can install it for testing by referencing it in your and then running There is also a playground for this build and an npm module you can use via |
|
@jakebailey Here are the results of running the user test suite comparing There were infrastructure failures potentially unrelated to your change:
Otherwise... Something interesting changed - please have a look. Details
|
|
Hey @jakebailey, the results of running the DT tests are ready. |
|
@jakebailey Here they are:
tscComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
Developer Information: |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
@jakebailey Here are the results of running the top-repos suite comparing Everything looks good! |
weswigham
left a comment
There was a problem hiding this comment.
Should we also test @import.meta.decorator, since we have tests for super and this?
|
All of the user / top tests seem to be okay with this, which is good news. |
I'm not sure why we would. Those tests specifically test which |
|
@typescript-bot pack this |
|
Hey @rbuckton, I've packed this into an installable tgz. You can install it for testing by referencing it in your and then running There is also a playground for this build and an npm module you can use via |
That would be a lot better, speaking as a framework maintainer that's trying to help shepherd a big ecosystem of community maintained code across the migration from experimental decorators to stage3 decorators. As experimental decorators are clearly an end-of-the-road feature that's maintained only for compatibility, anything you can do to not destabilize them unnecessarily would be helpful. |
|
Why this touches legacy experimental decorators , despite PR's description was about "Stage 3 Decorators" ? |
This reports a grammar error when invalid syntax is used in a decorator expression that does not match the proposed syntax for Stage 3 Decorators. In addition, this adds quick fixes to add parentheses around the expression to make it valid.
This is a somewhat aggressive error as we previously were far more flexible for decorator expressions under
--experimentalDecorators, which could mean new errors reported in existing code. Since parse and emit do not change, and since there is a quick-fix available, I'd like to try to go ahead with this change as is. However, if we feel it is too much of break, I can change the grammar check to only apply when targeting ES decorators.Fixes #55336