Skip to content

Commit

Permalink
Upgrade to Babel 7
Browse files Browse the repository at this point in the history
Babel 7 is required to build the upcoming versions of React Native,
while still compatible with the current version.

This PR consists of:
1. Upgrade `babel-core`. The next version has changed names, so
use the different package.
2. Upgrade `babel-preset-react-native`
3. Change `generate-webview-js` script to use Babel 7.
  • Loading branch information
borisyankov committed Oct 14, 2018
1 parent c5a4a2a commit 3af731e
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 35 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"zulip-markdown-parser": "^1.0.5"
},
"devDependencies": {
"babel-core": "^6.26.3",
"@babel/core": "^7.1.0",
"babel-eslint": "^8.2.3",
"babel-jest": "^23.6.0",
"babel-plugin-transform-remove-console": "^6.9.4",
Expand Down
3 changes: 2 additions & 1 deletion tools/generate-webview-js.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/* eslint-env node */

const fs = require('fs');
const babel = require('babel-core');

const babel = require('@babel/core');

const sourceFilename = 'src/webview/js/js.js';
const outputFilename = 'src/webview/js/generatedEs3.js';
Expand Down
99 changes: 66 additions & 33 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,25 @@
semver "^5.4.1"
source-map "^0.5.0"

"@babel/core@^7.1.0":
version "7.1.0"
resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.1.0.tgz#08958f1371179f62df6966d8a614003d11faeb04"
dependencies:
"@babel/code-frame" "^7.0.0"
"@babel/generator" "^7.0.0"
"@babel/helpers" "^7.1.0"
"@babel/parser" "^7.1.0"
"@babel/template" "^7.1.0"
"@babel/traverse" "^7.1.0"
"@babel/types" "^7.0.0"
convert-source-map "^1.1.0"
debug "^3.1.0"
json5 "^0.5.0"
lodash "^4.17.10"
resolve "^1.3.2"
semver "^5.4.1"
source-map "^0.5.0"

"@babel/[email protected]":
version "7.0.0-beta.44"
resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.0.0-beta.44.tgz#c7e67b9b5284afcf69b309b50d7d37f3e5033d42"
Expand Down Expand Up @@ -120,6 +139,14 @@
"@babel/template" "^7.0.0"
"@babel/types" "^7.0.0"

"@babel/helper-function-name@^7.1.0":
version "7.1.0"
resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.1.0.tgz#a0ceb01685f73355d4360c1247f582bfafc8ff53"
dependencies:
"@babel/helper-get-function-arity" "^7.0.0"
"@babel/template" "^7.1.0"
"@babel/types" "^7.0.0"

"@babel/[email protected]":
version "7.0.0-beta.44"
resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.44.tgz#d03ca6dd2b9f7b0b1e6b32c56c72836140db3a15"
Expand Down Expand Up @@ -232,6 +259,14 @@
"@babel/traverse" "^7.0.0"
"@babel/types" "^7.0.0"

"@babel/helpers@^7.1.0":
version "7.1.0"
resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.1.0.tgz#429bf0f0020be56a4242883432084e3d70a8a141"
dependencies:
"@babel/template" "^7.1.0"
"@babel/traverse" "^7.1.0"
"@babel/types" "^7.0.0"

"@babel/[email protected]":
version "7.0.0-beta.44"
resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0-beta.44.tgz#18c94ce543916a80553edcdcf681890b200747d5"
Expand All @@ -252,6 +287,10 @@
version "7.0.0"
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.0.0.tgz#697655183394facffb063437ddf52c0277698775"

"@babel/parser@^7.1.0":
version "7.1.0"
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.1.0.tgz#a7cd42cb3c12aec52e24375189a47b39759b783e"

"@babel/plugin-external-helpers@^7.0.0":
version "7.0.0"
resolved "https://registry.yarnpkg.com/@babel/plugin-external-helpers/-/plugin-external-helpers-7.0.0.tgz#61ee7ba5dba27d7cad72a13d46bec23c060b762e"
Expand Down Expand Up @@ -562,6 +601,14 @@
"@babel/parser" "^7.0.0"
"@babel/types" "^7.0.0"

"@babel/template@^7.1.0":
version "7.1.0"
resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.1.0.tgz#58cc9572e1bfe24fe1537fdf99d839d53e517e22"
dependencies:
"@babel/code-frame" "^7.0.0"
"@babel/parser" "^7.1.0"
"@babel/types" "^7.0.0"

"@babel/[email protected]":
version "7.0.0-beta.44"
resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.0.0-beta.44.tgz#a970a2c45477ad18017e2e465a0606feee0d2966"
Expand Down Expand Up @@ -591,6 +638,20 @@
globals "^11.1.0"
lodash "^4.17.10"

"@babel/traverse@^7.1.0":
version "7.1.0"
resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.1.0.tgz#503ec6669387efd182c3888c4eec07bcc45d91b2"
dependencies:
"@babel/code-frame" "^7.0.0"
"@babel/generator" "^7.0.0"
"@babel/helper-function-name" "^7.1.0"
"@babel/helper-split-export-declaration" "^7.0.0"
"@babel/parser" "^7.1.0"
"@babel/types" "^7.0.0"
debug "^3.1.0"
globals "^11.1.0"
lodash "^4.17.10"

"@babel/[email protected]":
version "7.0.0-beta.44"
resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.0.0-beta.44.tgz#6b1b164591f77dec0a0342aca995f2d046b3a757"
Expand Down Expand Up @@ -1019,30 +1080,6 @@ babel-core@^6.0.0, babel-core@^6.26.0, babel-core@^6.7.2:
slash "^1.0.0"
source-map "^0.5.6"

babel-core@^6.26.3:
version "6.26.3"
resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.3.tgz#b2e2f09e342d0f0c88e2f02e067794125e75c207"
dependencies:
babel-code-frame "^6.26.0"
babel-generator "^6.26.0"
babel-helpers "^6.24.1"
babel-messages "^6.23.0"
babel-register "^6.26.0"
babel-runtime "^6.26.0"
babel-template "^6.26.0"
babel-traverse "^6.26.0"
babel-types "^6.26.0"
babylon "^6.18.0"
convert-source-map "^1.5.1"
debug "^2.6.9"
json5 "^0.5.1"
lodash "^4.17.4"
minimatch "^3.0.4"
path-is-absolute "^1.0.1"
private "^0.1.8"
slash "^1.0.0"
source-map "^0.5.7"

babel-eslint@^8.2.3:
version "8.2.3"
resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-8.2.3.tgz#1a2e6681cc9bc4473c32899e59915e19cd6733cf"
Expand Down Expand Up @@ -2069,7 +2106,7 @@ content-type-parser@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/content-type-parser/-/content-type-parser-1.0.1.tgz#c3e56988c53c65127fb46d4032a3a900246fdc94"

convert-source-map@^1.1.0, convert-source-map@^1.5.1:
convert-source-map@^1.1.0:
version "1.5.1"
resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.1.tgz#b8278097b9bc229365de5c62cf5fcaed8b5599e5"

Expand Down Expand Up @@ -2190,7 +2227,7 @@ dateformat@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-2.0.0.tgz#2743e3abb5c3fc2462e527dca445e04e9f4dee17"

[email protected], debug@^2.3.3, debug@^2.6.9:
[email protected], debug@^2.3.3:
version "2.6.9"
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
dependencies:
Expand Down Expand Up @@ -5239,8 +5276,8 @@ lodash@^3.3.1:
resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.10.1.tgz#5bf45e8e49ba4189e17d482789dfd15bd140b7b6"

lodash@^4.17.10:
version "4.17.10"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7"
version "4.17.11"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d"

lodash@^4.17.5:
version "4.17.5"
Expand Down Expand Up @@ -6300,10 +6337,6 @@ private@^0.1.6, private@^0.1.7:
version "0.1.7"
resolved "https://registry.yarnpkg.com/private/-/private-0.1.7.tgz#68ce5e8a1ef0a23bb570cc28537b5332aba63ef1"

private@^0.1.8:
version "0.1.8"
resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff"

process-nextick-args@~1.0.6:
version "1.0.7"
resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3"
Expand Down Expand Up @@ -7453,7 +7486,7 @@ source-map@^0.4.4:
dependencies:
amdefine ">=0.0.4"

source-map@^0.5.0, source-map@^0.5.7, source-map@~0.5.6:
source-map@^0.5.0, source-map@~0.5.6:
version "0.5.7"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc"

Expand Down

0 comments on commit 3af731e

Please sign in to comment.