Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

Commit

Permalink
Fix the build. Add optional chaining transform. (#2363)
Browse files Browse the repository at this point in the history
Summary:
#2330 broke the build (_sigh_). CI was broken for a while, so it wasn't immediately obvious too. Internally, we have supported optional chaining for a while, so importing to Phabricator didn't surface the error either.

We need a babel transform for optional chaining.

## Test plan.

Build draft. Build succeeds. Open one of the examples. It works.
Pull Request resolved: #2363

Reviewed By: creedarky

Differential Revision: D20632298

Pulled By: mrkev

fbshipit-source-id: 7a591c376330ee31bac5546a765920833b6bac00
  • Loading branch information
mrkev authored and facebook-github-bot committed Mar 24, 2020
1 parent db3216d commit 9c32317
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 14 deletions.
10 changes: 8 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ var babelOptsJS = {
rewriteModules: {map: moduleMap},
}),
],
plugins: [require('@babel/plugin-proposal-nullish-coalescing-operator')],
plugins: [
require('@babel/plugin-proposal-nullish-coalescing-operator'),
require('@babel/plugin-proposal-optional-chaining'),
],
};

var babelOptsFlow = {
Expand All @@ -55,7 +58,10 @@ var babelOptsFlow = {
rewriteModules: {map: moduleMap},
}),
],
plugins: [require('@babel/plugin-proposal-nullish-coalescing-operator')],
plugins: [
require('@babel/plugin-proposal-nullish-coalescing-operator'),
require('@babel/plugin-proposal-optional-chaining'),
],
};

var COPYRIGHT_HEADER = `/**
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"devDependencies": {
"@babel/core": "^7.6.4",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.4.4",
"@babel/plugin-proposal-optional-chaining": "^7.6.0",
"@babel/plugin-proposal-optional-chaining": "^7.9.0",
"alex": "^8.0.0",
"babel-eslint": "^10.0.3",
"babel-preset-fbjs": "^3.3.0",
Expand Down
27 changes: 16 additions & 11 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,11 @@
resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.0.0.tgz#bbb3fbee98661c569034237cc03967ba99b4f250"
integrity sha512-CYAOUCARwExnEixLdB6sDm2dIJ/YgEAKDM1MOeMeZu9Ld/bDgVo8aiWrXwcY7OBh+1Ea2uUcVRcxKk0GJvW7QA==

"@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3":
version "7.8.3"
resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz#9ea293be19babc0f52ff8ca88b34c3611b208670"
integrity sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==

"@babel/helper-replace-supers@^7.1.0", "@babel/helper-replace-supers@^7.3.4":
version "7.3.4"
resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.3.4.tgz#a795208e9b911a6eeb08e5891faacf06e7013e13"
Expand Down Expand Up @@ -276,13 +281,13 @@
"@babel/helper-plugin-utils" "^7.0.0"
"@babel/plugin-syntax-object-rest-spread" "^7.2.0"

"@babel/plugin-proposal-optional-chaining@^7.6.0":
version "7.6.0"
resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.6.0.tgz#e9bf1f9b9ba10c77c033082da75f068389041af8"
integrity sha512-kj4gkZ6qUggkprRq3Uh5KP8XnE1MdIO0J7MhdDX8+rAbB6dJ2UrensGIS+0NPZAaaJ1Vr0PN6oLUgXMU1uMcSg==
"@babel/plugin-proposal-optional-chaining@^7.9.0":
version "7.9.0"
resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.9.0.tgz#31db16b154c39d6b8a645292472b98394c292a58"
integrity sha512-NDn5tu3tcv4W30jNhmc2hyD5c56G6cXx4TesJubhxrJeCvuuMpttxr0OnNCqbZGhFjLrg+NIhxxC+BK5F6yS3w==
dependencies:
"@babel/helper-plugin-utils" "^7.0.0"
"@babel/plugin-syntax-optional-chaining" "^7.2.0"
"@babel/helper-plugin-utils" "^7.8.3"
"@babel/plugin-syntax-optional-chaining" "^7.8.0"

"@babel/plugin-syntax-class-properties@^7.0.0":
version "7.2.0"
Expand Down Expand Up @@ -319,12 +324,12 @@
dependencies:
"@babel/helper-plugin-utils" "^7.0.0"

"@babel/plugin-syntax-optional-chaining@^7.2.0":
version "7.2.0"
resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.2.0.tgz#a59d6ae8c167e7608eaa443fda9fa8fa6bf21dff"
integrity sha512-HtGCtvp5Uq/jH/WNUPkK6b7rufnCPLLlDAFN7cmACoIjaOOiXxUt3SswU5loHqrhtqTsa/WoLQ1OQ1AGuZqaWA==
"@babel/plugin-syntax-optional-chaining@^7.8.0":
version "7.8.3"
resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz#4f69c2ab95167e0180cd5336613f8c5788f7d48a"
integrity sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==
dependencies:
"@babel/helper-plugin-utils" "^7.0.0"
"@babel/helper-plugin-utils" "^7.8.0"

"@babel/plugin-transform-arrow-functions@^7.0.0":
version "7.2.0"
Expand Down

0 comments on commit 9c32317

Please sign in to comment.