warn about class properties support in decorators readme and error messaging (#6196)
This commit is contained in:
parent
3a2b7fe3cd
commit
777a9ae6e4
@ -66,6 +66,8 @@ Add the following line to your .babelrc file:
|
||||
|
||||
If you are including your plugins manually and using `transform-class-properties`, make sure that `transform-decorators` comes *before* `transform-class-properties`.
|
||||
|
||||
Currently, `transform-class-properties` must be used in `loose` mode to support the `transform-decorators`. To use `transform-class-properties` in spec mode with decorators, wait for the next major version of decorators (Stage 2).
|
||||
|
||||
Wrong:
|
||||
|
||||
```json
|
||||
@ -83,7 +85,7 @@ Right:
|
||||
{
|
||||
"plugins": [
|
||||
"transform-decorators",
|
||||
"transform-class-properties"
|
||||
["transform-class-properties", { "loose" : true }]
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
@ -30,7 +30,9 @@ const buildInitializerWarningHelper = template(`
|
||||
function NAME(descriptor, context){
|
||||
throw new Error(
|
||||
'Decorating class property failed. Please ensure that ' +
|
||||
'transform-class-properties is enabled.'
|
||||
'transform-class-properties is enabled and set to use loose mode. ' +
|
||||
'To use transform-class-properties in spec mode with decorators, wait for ' +
|
||||
'the next major version of decorators in stage 2.'
|
||||
);
|
||||
}
|
||||
`);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user