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
Add docs for the new decorators transform #2614
Conversation
✔️ Deploy Preview for babel ready! 🔨 Explore the source changes: 0f39afa 🔍 Inspect the deploy log: https://app.netlify.com/sites/babel/deploys/61f962c69dc9fa0008e83490 😎 Browse the preview: https://deploy-preview-2614--babel.netlify.app |
@@ -114,15 +130,13 @@ Use the legacy (stage 1) decorators syntax and behavior. | |||
|
|||
If you are including your plugins manually and using `@babel/plugin-proposal-class-properties`, make sure that `@babel/plugin-proposal-decorators` comes _before_ `@babel/plugin-proposal-class-properties`. | |||
|
|||
When using the `legacy: true` mode, the [`setPublicClassFields` assumption](assumptions.md#setpublicclassfields) must be enabled to support the `@babel/plugin-proposal-decorators`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has not been necessary for years - babel/babel#14133
docs/plugin-proposal-decorators.md
Outdated
`"2021-12"`, `"2018-09"` or `"legacy"`. Defaults to `"2018-09"`. | ||
|
||
Selects the decorators proposal to use: | ||
- `legacy` is the original Stage 1 one |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For reference here is the stage 1 spec: https://github.com/wycats/javascript-decorators/blob/e1bf8d41bfa2591d949dd3bbf013514c8904b913/README.md
docs/plugin-proposal-decorators.md
Outdated
Selects the decorators proposal to use: | ||
- `legacy` is the original Stage 1 one | ||
- `"2018-09"` is the proposal version that was initially promoted to Stage 2 presented to TO39 in Sept 2018. You can read more about it at [`tc39/proposal-decorators@7fa580b40f`](https://github.com/tc39/proposal-decorators/tree/7fa580b40f2c19c561511ea2c978e307ae689a1b) | ||
- `"2021-12"` is the proposal version as it was presented to TC39 in Dec 2021. You can read more about it at [`tc39/proposal-decorators@d6c056fa06`](https://github.com/tc39/proposal-decorators/tree/d6c056fa061646178c34f361bad33d583316dc85). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I would prefer we sort the version
candidates from latest to oldest.
docs/plugin-syntax-decorators.md
Outdated
@@ -40,8 +40,26 @@ require("@babel/core").transformSync("code", { | |||
|
|||
## Options | |||
|
|||
<details> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the usage of syntax-decorators
is rare, we can just leave a "see also" redirect link to the transform plugin and remove the whole "Options" section, so we don't have to maintain them at all.
Babel PR: babel/babel#13827
cc @pzuraq