Enable null coalescing operator
Summary: Enable using the `??` operator in plugin code Reviewed By: passy Differential Revision: D18906291 fbshipit-source-id: b0a9b29ebb2896ede10540ba2e4cfd937fb99c7d
This commit is contained in:
committed by
Facebook Github Bot
parent
382330bfaf
commit
16b2addbc2
@@ -8,6 +8,7 @@
|
||||
"@babel/generator": "^7.7.2",
|
||||
"@babel/parser": "^7.7.3",
|
||||
"@babel/plugin-proposal-class-properties": "^7.7.0",
|
||||
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.7.4",
|
||||
"@babel/plugin-proposal-object-rest-spread": "^7.6.2",
|
||||
"@babel/plugin-proposal-optional-chaining": "^7.6.0",
|
||||
"@babel/plugin-transform-flow-strip-types": "^7.6.3",
|
||||
@@ -24,7 +25,6 @@
|
||||
"xdg-basedir": "^4.0.0",
|
||||
"yargs": "^15.0.1"
|
||||
},
|
||||
"devDependencies": {},
|
||||
"resolutions": {
|
||||
"metro/temp": "0.9.0",
|
||||
"ws": "7.2.0"
|
||||
|
||||
@@ -22,13 +22,20 @@ function transform({filename, options, src}) {
|
||||
let ast = babylon.parse(src, {
|
||||
filename,
|
||||
plugins: isTypeScript
|
||||
? ['jsx', 'typescript', 'classProperties', 'optionalChaining']
|
||||
? [
|
||||
'jsx',
|
||||
'typescript',
|
||||
'classProperties',
|
||||
'optionalChaining',
|
||||
'nullishCoalescingOperator',
|
||||
]
|
||||
: [
|
||||
'jsx',
|
||||
['flow', {all: true}],
|
||||
'classProperties',
|
||||
'objectRestSpread',
|
||||
'optionalChaining',
|
||||
'nullishCoalescingOperator',
|
||||
],
|
||||
sourceType: 'module',
|
||||
});
|
||||
@@ -43,6 +50,7 @@ function transform({filename, options, src}) {
|
||||
require('../node_modules/@babel/plugin-proposal-class-properties'),
|
||||
require('../node_modules/@babel/plugin-transform-flow-strip-types'),
|
||||
require('../node_modules/@babel/plugin-proposal-optional-chaining'),
|
||||
require('../node_modules/@babel/plugin-proposal-nullish-coalescing-operator'),
|
||||
require('./dynamic-requires.js'),
|
||||
);
|
||||
} else {
|
||||
@@ -51,6 +59,7 @@ function transform({filename, options, src}) {
|
||||
require('../node_modules/@babel/plugin-proposal-class-properties'),
|
||||
require('../node_modules/@babel/plugin-transform-modules-commonjs'),
|
||||
require('../node_modules/@babel/plugin-proposal-optional-chaining'),
|
||||
require('../node_modules/@babel/plugin-proposal-nullish-coalescing-operator'),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -415,6 +415,14 @@
|
||||
"@babel/helper-plugin-utils" "^7.0.0"
|
||||
"@babel/plugin-syntax-nullish-coalescing-operator" "^7.2.0"
|
||||
|
||||
"@babel/plugin-proposal-nullish-coalescing-operator@^7.7.4":
|
||||
version "7.7.4"
|
||||
resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.7.4.tgz#7db302c83bc30caa89e38fee935635ef6bd11c28"
|
||||
integrity sha512-TbYHmr1Gl1UC7Vo2HVuj/Naci5BEGNZ0AJhzqD2Vpr6QPFWpUmBRLrIDjedzx7/CShq0bRDS2gI4FIs77VHLVQ==
|
||||
dependencies:
|
||||
"@babel/helper-plugin-utils" "^7.0.0"
|
||||
"@babel/plugin-syntax-nullish-coalescing-operator" "^7.7.4"
|
||||
|
||||
"@babel/plugin-proposal-object-rest-spread@^7.0.0":
|
||||
version "7.5.5"
|
||||
resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.5.5.tgz#61939744f71ba76a3ae46b5eea18a54c16d22e58"
|
||||
@@ -497,6 +505,13 @@
|
||||
dependencies:
|
||||
"@babel/helper-plugin-utils" "^7.0.0"
|
||||
|
||||
"@babel/plugin-syntax-nullish-coalescing-operator@^7.7.4":
|
||||
version "7.7.4"
|
||||
resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.7.4.tgz#e53b751d0c3061b1ba3089242524b65a7a9da12b"
|
||||
integrity sha512-XKh/yIRPiQTOeBg0QJjEus5qiSKucKAiApNtO1psqG7D17xmE+X2i5ZqBEuSvo0HRuyPaKaSN/Gy+Ha9KFQolw==
|
||||
dependencies:
|
||||
"@babel/helper-plugin-utils" "^7.0.0"
|
||||
|
||||
"@babel/plugin-syntax-object-rest-spread@^7.0.0", "@babel/plugin-syntax-object-rest-spread@^7.2.0":
|
||||
version "7.2.0"
|
||||
resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.2.0.tgz#3b7a3e733510c57e820b9142a6579ac8b0dfad2e"
|
||||
|
||||
Reference in New Issue
Block a user