Plugins order are incorrect: proposal-decorators compatibility with proposal-class-properties
- Dominant language
- JavaScript
- Stars
- 1.3k
- Forks
- 53
- PR merge metrics
- No merged PRs in 30d
Description
> NOTE: Compatibility with `@babel/plugin-proposal-class-properties`
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`.
https://babeljs.io/docs/en/babel-plugin-proposal-decorators#note-compatibility-with-babel-plugin-proposal-class-properties
```
$ npx babel-upgrade
npx: installed 192 in 54.298s
🙌 Thanks for trying out https://github.com/babel/babel-upgrade!
Updating .babelrc config at .babelrc
Index: .babelrc
===================================================================
--- .babelrc Before Upgrade
+++ .babelrc After Upgrade
@@ -15,10 +15,9 @@
"useBuiltIns": "entry",
"modules": false
}
],
- "@babel/preset-react",
- "@babel/preset-stage-0"
+ "@babel/preset-react"
],
"env": {
"development": {
"plugins": [
@@ -48,7 +47,33 @@
{
"libraryName": "antd",
"libraryDirectory": "lib"
}
- ]
+ ],
+ "@babel/plugin-syntax-dynamic-import",
+ "@babel/plugin-syntax-import-meta",
+ "@babel/plugin-proposal-class-properties",
+ "@babel/plugin-proposal-json-strings",
+ [
+ "@babel/plugin-proposal-decorators",
+ {
+ "legacy": true
+ }
+ ],
+ "@babel/plugin-proposal-function-sent",
+ "@babel/plugin-proposal-export-namespace-from",
+ "@babel/plugin-proposal-numeric-separator",
+ "@babel/plugin-proposal-throw-expressions",
+ "@babel/plugin-proposal-export-default-from",
+ "@babel/plugin-proposal-logical-assignment-operators",
+ "@babel/plugin-proposal-optional-chaining",
+ [
+ "@babel/plugin-proposal-pipeline-operator",
+ {
+ "proposal": "minimal"
+ }
+ ],
+ "@babel/plugin-proposal-nullish-coalescing-operator",
+ "@babel/plugin-proposal-do-expressions",
+ "@babel/plugin-proposal-function-bind"
]
}
\ No newline at end of file
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the report with the shown .babelrc by running npx babel-upgrade and inspect the generated plugin order. Compare the result with Babel's compatibility note: @babel/plugin-proposal-decorators must precede @babel/plugin-proposal-class-properties. Done means the upgrade output preserves that ordering without changing the other listed plugins.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100