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

Add docs for the new decorators transform #2614

Merged
merged 2 commits into from Feb 2, 2022

Conversation

nicolo-ribaudo
Copy link
Member

Babel PR: babel/babel#13827

cc @pzuraq

@nicolo-ribaudo nicolo-ribaudo added this to the v7.17.0 milestone Jan 31, 2022
@netlify
Copy link

netlify bot commented Jan 31, 2022

✔️ 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`.
Copy link
Member Author

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 Show resolved Hide resolved
`"2021-12"`, `"2018-09"` or `"legacy"`. Defaults to `"2018-09"`.

Selects the decorators proposal to use:
- `legacy` is the original Stage 1 one
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).
Copy link
Contributor

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.

@@ -40,8 +40,26 @@ require("@babel/core").transformSync("code", {

## Options

<details>
Copy link
Contributor

@JLHwung JLHwung Feb 1, 2022

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.

@nicolo-ribaudo nicolo-ribaudo merged commit b0f4bc0 into babel:main Feb 2, 2022
@nicolo-ribaudo nicolo-ribaudo deleted the decorators-docs branch February 2, 2022 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants