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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: enable all babel syntax plugins #9774

Merged
merged 8 commits into from Apr 7, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,7 @@

### Features

- `[babel-preset-jest]` Enable all syntax plugins not enabled by default ([#9774](https://github.com/facebook/jest/pull/9774))
- `[babel-jest]` Support passing `supportsDynamicImport` and `supportsStaticESM` ([#9766](https://github.com/facebook/jest/pull/9766))
- `[jest-runtime, @jest/transformer]` Support passing `supportsDynamicImport` and `supportsStaticESM` ([#9597](https://github.com/facebook/jest/pull/9597))

Expand Down
4 changes: 2 additions & 2 deletions packages/babel-jest/package.json
Expand Up @@ -27,10 +27,10 @@
"slash": "^3.0.0"
},
"devDependencies": {
"@babel/core": "^7.1.0"
"@babel/core": "^7.8.0"
},
"peerDependencies": {
"@babel/core": "^7.0.0"
"@babel/core": "^7.8.0"
},
"engines": {
"node": ">= 8.3"
Expand Down
3 changes: 1 addition & 2 deletions packages/babel-preset-jest/index.js
Expand Up @@ -8,7 +8,6 @@
module.exports = () => ({
plugins: [
require.resolve('babel-plugin-jest-hoist'),
require.resolve('@babel/plugin-syntax-object-rest-spread'),
require.resolve('@babel/plugin-syntax-bigint'),
require.resolve('babel-preset-current-node-syntax'),
Copy link
Member Author

Choose a reason for hiding this comment

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

we could add the 3 the new preset adds manually, then replace all the plugins we add with this new preset in 26. We already add bigint and object spread anyways, so there's precedence

Copy link
Member Author

Choose a reason for hiding this comment

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

opened #9775 with that

],
});
7 changes: 3 additions & 4 deletions packages/babel-preset-jest/package.json
Expand Up @@ -9,12 +9,11 @@
"license": "MIT",
"main": "index.js",
"dependencies": {
"@babel/plugin-syntax-bigint": "^7.0.0",
"@babel/plugin-syntax-object-rest-spread": "^7.0.0",
"babel-plugin-jest-hoist": "^25.2.6"
"babel-plugin-jest-hoist": "^25.2.6",
"babel-preset-current-node-syntax": "^0.1.0"
},
"peerDependencies": {
"@babel/core": "^7.0.0"
"@babel/core": "^7.8.0"
},
"engines": {
"node": ">= 8.3"
Expand Down
27 changes: 18 additions & 9 deletions yarn.lock
Expand Up @@ -55,7 +55,7 @@
invariant "^2.2.4"
semver "^5.5.0"

"@babel/core@*", "@babel/core@^7.0.0", "@babel/core@^7.1.0", "@babel/core@^7.3.4", "@babel/core@^7.7.4", "@babel/core@^7.7.5":
"@babel/core@*", "@babel/core@^7.0.0", "@babel/core@^7.1.0", "@babel/core@^7.3.4", "@babel/core@^7.7.4", "@babel/core@^7.7.5", "@babel/core@^7.8.0":
version "7.9.0"
resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.9.0.tgz#ac977b538b77e132ff706f3b8a4dbad09c03c56e"
integrity sha512-kWc7L0fw1xwvI0zi8OKVBuxRVefwGOrKSQMvrQ3dW+bIIavBY3/NpXmpjMy7bQnLgwgzWQZ8TlM57YHpHNHz4w==
Expand Down Expand Up @@ -423,14 +423,7 @@
dependencies:
"@babel/helper-plugin-utils" "^7.8.0"

"@babel/plugin-syntax-bigint@^7.0.0":
version "7.8.3"
resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz#4c9a6f669f5d0cdf1b90a1671e9a146be5300cea"
integrity sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==
dependencies:
"@babel/helper-plugin-utils" "^7.8.0"

"@babel/plugin-syntax-class-properties@^7.0.0":
"@babel/plugin-syntax-class-properties@^7.0.0", "@babel/plugin-syntax-class-properties@^7.8.3":
version "7.8.3"
resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.8.3.tgz#6cb933a8872c8d359bfde69bbeaae5162fd1e8f7"
integrity sha512-UcAyQWg2bAN647Q+O811tG9MrJ38Z10jjhQdKNAL8fsyPzE3cCN/uT+f55cFVY4aGO4jqJAvmqsuY3GQDwAoXg==
Expand Down Expand Up @@ -479,6 +472,13 @@
dependencies:
"@babel/helper-plugin-utils" "^7.8.3"

"@babel/plugin-syntax-logical-assignment-operators@^7.8.3":
version "7.8.3"
resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.8.3.tgz#3995d7d7ffff432f6ddc742b47e730c054599897"
integrity sha512-Zpg2Sgc++37kuFl6ppq2Q7Awc6E6AIW671x5PY8E/f7MCIyPPGK/EoeZXvvY3P42exZ3Q4/t3YOzP/HiN79jDg==
dependencies:
"@babel/helper-plugin-utils" "^7.8.3"

"@babel/plugin-syntax-nullish-coalescing-operator@^7.8.0":
version "7.8.3"
resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz#167ed70368886081f74b5c36c65a88c03b66d1a9"
Expand Down Expand Up @@ -3443,6 +3443,15 @@ babel-polyfill@6.23.0:
core-js "^2.4.0"
regenerator-runtime "^0.10.0"

babel-preset-current-node-syntax@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-0.1.0.tgz#744b43eda7a164e5f90ad416dcd9615e8b7842c1"
integrity sha512-gVdIosHhVr8ZFaMo8FVOihafV0UOj26/v4A1etZAPy/XqrJO5dvTLfxGaIApumZ66n7AEkFy3e+SPGOv46YhKQ==
dependencies:
"@babel/plugin-syntax-class-properties" "^7.8.3"
"@babel/plugin-syntax-logical-assignment-operators" "^7.8.3"
"@babel/plugin-syntax-numeric-separator" "^7.8.3"

babel-preset-fbjs@^3.1.2, babel-preset-fbjs@^3.2.0:
version "3.3.0"
resolved "https://registry.yarnpkg.com/babel-preset-fbjs/-/babel-preset-fbjs-3.3.0.tgz#a6024764ea86c8e06a22d794ca8b69534d263541"
Expand Down