Skip to content

Commit

Permalink
[babel 8] Enable allowDeclareFields option by default with TS (#12461)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Jan 8, 2021
1 parent ff52ace commit 50462eb
Show file tree
Hide file tree
Showing 49 changed files with 557 additions and 426 deletions.
24 changes: 20 additions & 4 deletions .circleci/config.yml
Expand Up @@ -149,6 +149,14 @@ jobs:
at: /tmp/verdaccio-workspace
- run: ./scripts/integration-tests/e2e-babel.sh

e2e-babel-breaking:
executor: node-executor
steps:
- checkout
- attach_workspace:
at: /tmp/verdaccio-workspace
- run: BABEL_8_BREAKING=true ./scripts/integration-tests/e2e-babel.sh

e2e-babel-old-version:
executor: node-executor
steps:
Expand Down Expand Up @@ -185,6 +193,14 @@ jobs:
at: /tmp/verdaccio-workspace
- run: ./scripts/integration-tests/e2e-jest.sh

e2e-jest-breaking:
executor: node-python-executor
steps:
- checkout
- attach_workspace:
at: /tmp/verdaccio-workspace
- run: BABEL_8_BREAKING=true ./scripts/integration-tests/e2e-jest.sh

workflows:
version: 2
build-standalone:
Expand Down Expand Up @@ -247,7 +263,7 @@ workflows:
filters:
branches:
only: [main, next-8-dev, next-8-rebased]
- e2e-babel:
- e2e-babel-breaking:
requires:
- publish-verdaccio-babel-8-breaking
- e2e-create-react-app:
Expand All @@ -256,7 +272,7 @@ workflows:
- e2e-vue-cli:
requires:
- publish-verdaccio-babel-8-breaking
- e2e-jest:
- e2e-jest-breaking:
requires:
- publish-verdaccio-babel-8-breaking

Expand All @@ -270,7 +286,7 @@ workflows:
- publish-verdaccio-babel-8-breaking:
requires:
- approve-e2e-breaking-run
- e2e-babel:
- e2e-babel-breaking:
requires:
- publish-verdaccio-babel-8-breaking
- e2e-create-react-app:
Expand All @@ -279,7 +295,7 @@ workflows:
- e2e-vue-cli:
requires:
- publish-verdaccio-babel-8-breaking
- e2e-jest:
- e2e-jest-breaking:
requires:
- publish-verdaccio-babel-8-breaking

@@ -0,0 +1,6 @@
class C {
// Output should not use `_initialiseProps`
x: T;
y = 0;
constructor(T) {}
}
@@ -0,0 +1,4 @@
{
"BABEL_8_BREAKING": false,
"plugins": ["transform-typescript", "proposal-class-properties"]
}
@@ -1,8 +1,9 @@
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

class A {
constructor() {
_defineProperty(this, "y", void 0);
class C {
// Output should not use `_initialiseProps`
constructor(T) {
_defineProperty(this, "y", 0);
}

}
@@ -0,0 +1,6 @@
class C {
// Output should not use `_initialiseProps`
x: T;
y = 0;
constructor(T) {}
}
@@ -0,0 +1,7 @@
{
"BABEL_8_BREAKING": false,
"plugins": [
"transform-typescript",
["proposal-class-properties", { "loose": true }]
]
}
@@ -0,0 +1,7 @@
class C {
// Output should not use `_initialiseProps`
constructor(T) {
this.y = 0;
}

}
@@ -1,4 +1,5 @@
{
"BABEL_8_BREAKING": true,
"plugins": [
"transform-typescript",
["proposal-class-properties", { "loose": true }]
Expand Down
@@ -1,6 +1,7 @@
class C {
// Output should not use `_initialiseProps`
constructor(T) {
this.x = void 0;
this.y = 0;
}

Expand Down
@@ -1,3 +1,4 @@
{
"BABEL_8_BREAKING": true,
"plugins": ["transform-typescript", "proposal-class-properties"]
}
Expand Up @@ -3,6 +3,8 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
class C {
// Output should not use `_initialiseProps`
constructor(T) {
_defineProperty(this, "x", void 0);

_defineProperty(this, "y", 0);
}

Expand Down

0 comments on commit 50462eb

Please sign in to comment.