warn about class properties support in decorators readme and error messaging (#6196)

This commit is contained in:
Noah Lemen 2017-09-05 14:24:21 -04:00 committed by Henry Zhu
parent 3a2b7fe3cd
commit 777a9ae6e4
2 changed files with 6 additions and 2 deletions

View File

@ -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 }]
]
}
```

View File

@ -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.'
);
}
`);