Unverified Commit 9959d7ef authored by Bogdan Chadkin's avatar Bogdan Chadkin Committed by GitHub

Use babel 7 jsx syntax (#17043)

For some reason babel-plugin-syntax-jsx of babel 6 was used instead of
babel 7 version.
parent 0f41062d
import { NodePath, PluginObj, types as BabelTypes } from '@babel/core' import { NodePath, PluginObj, types as BabelTypes } from '@babel/core'
import jsx from '@babel/plugin-syntax-jsx'
export default function ({ export default function ({
types: t, types: t,
...@@ -6,7 +7,7 @@ export default function ({ ...@@ -6,7 +7,7 @@ export default function ({
types: typeof BabelTypes types: typeof BabelTypes
}): PluginObj<any> { }): PluginObj<any> {
return { return {
inherits: require('babel-plugin-syntax-jsx'), inherits: jsx,
visitor: { visitor: {
JSXElement(_path, state) { JSXElement(_path, state) {
state.set('jsx', true) state.set('jsx', true)
......
...@@ -67,6 +67,7 @@ ...@@ -67,6 +67,7 @@
"@babel/plugin-proposal-object-rest-spread": "7.11.0", "@babel/plugin-proposal-object-rest-spread": "7.11.0",
"@babel/plugin-syntax-bigint": "7.8.3", "@babel/plugin-syntax-bigint": "7.8.3",
"@babel/plugin-syntax-dynamic-import": "7.8.3", "@babel/plugin-syntax-dynamic-import": "7.8.3",
"@babel/plugin-syntax-jsx": "7.10.4",
"@babel/plugin-transform-modules-commonjs": "7.10.4", "@babel/plugin-transform-modules-commonjs": "7.10.4",
"@babel/plugin-transform-runtime": "7.11.5", "@babel/plugin-transform-runtime": "7.11.5",
"@babel/preset-env": "7.11.5", "@babel/preset-env": "7.11.5",
...@@ -78,7 +79,6 @@ ...@@ -78,7 +79,6 @@
"@next/react-dev-overlay": "9.5.4-canary.14", "@next/react-dev-overlay": "9.5.4-canary.14",
"@next/react-refresh-utils": "9.5.4-canary.14", "@next/react-refresh-utils": "9.5.4-canary.14",
"ast-types": "0.13.2", "ast-types": "0.13.2",
"babel-plugin-syntax-jsx": "6.18.0",
"babel-plugin-transform-define": "2.0.0", "babel-plugin-transform-define": "2.0.0",
"babel-plugin-transform-react-remove-prop-types": "0.4.24", "babel-plugin-transform-react-remove-prop-types": "0.4.24",
"browserslist": "4.13.0", "browserslist": "4.13.0",
......
/* eslint-disable import/no-extraneous-dependencies */ /* eslint-disable import/no-extraneous-dependencies */
declare module '@babel/plugin-transform-modules-commonjs' declare module '@babel/plugin-transform-modules-commonjs'
declare module '@babel/plugin-syntax-jsx'
declare module 'browserslist' declare module 'browserslist'
declare module 'cssnano-simple' { declare module 'cssnano-simple' {
import { Plugin } from 'postcss' import { Plugin } from 'postcss'
......
...@@ -766,19 +766,13 @@ ...@@ -766,19 +766,13 @@
dependencies: dependencies:
"@babel/helper-plugin-utils" "^7.8.0" "@babel/helper-plugin-utils" "^7.8.0"
"@babel/plugin-syntax-jsx@^7.10.4": "@babel/plugin-syntax-jsx@7.10.4", "@babel/plugin-syntax-jsx@^7.10.4", "@babel/plugin-syntax-jsx@^7.2.0":
version "7.10.4" version "7.10.4"
resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.10.4.tgz#39abaae3cbf710c4373d8429484e6ba21340166c" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.10.4.tgz#39abaae3cbf710c4373d8429484e6ba21340166c"
integrity sha512-KCg9mio9jwiARCB7WAcQ7Y1q+qicILjoK8LP/VkPkEKaf5dkaZZK1EcTe91a3JJlZ3qy6L5s9X52boEYi8DM9g== integrity sha512-KCg9mio9jwiARCB7WAcQ7Y1q+qicILjoK8LP/VkPkEKaf5dkaZZK1EcTe91a3JJlZ3qy6L5s9X52boEYi8DM9g==
dependencies: dependencies:
"@babel/helper-plugin-utils" "^7.10.4" "@babel/helper-plugin-utils" "^7.10.4"
"@babel/plugin-syntax-jsx@^7.2.0":
version "7.7.4"
resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.7.4.tgz#dab2b56a36fb6c3c222a1fbc71f7bf97f327a9ec"
dependencies:
"@babel/helper-plugin-utils" "^7.0.0"
"@babel/plugin-syntax-logical-assignment-operators@^7.10.4": "@babel/plugin-syntax-logical-assignment-operators@^7.10.4":
version "7.10.4" version "7.10.4"
resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz#ca91ef46303530448b906652bac2e9fe9941f699" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz#ca91ef46303530448b906652bac2e9fe9941f699"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment