From 72c8562cc9859106f89b12cca1016e5e1b2a8c78 Mon Sep 17 00:00:00 2001 From: Yamagishi Kazutoshi Date: Sun, 14 May 2017 20:47:31 +0900 Subject: [PATCH] Use babel-preset-env on Streaming Server (#2998) * Use babel-preset-env on Streaming Server Change the streaming server to use babel-preset-env as well as asset compilation. This shortens the load time at first boot. * remove babel-plugin-lodash --- package.json | 4 +-- streaming/.babelrc | 15 ++++++++++ yarn.lock | 68 ++-------------------------------------------- 3 files changed, 19 insertions(+), 68 deletions(-) create mode 100644 streaming/.babelrc diff --git a/package.json b/package.json index 78d8213e4..f19fa8d14 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "build:development": "NODE_ENV=development yarn webpack -- --config config/webpack/development.js", "build:production": "NODE_ENV=production yarn webpack -- --config config/webpack/production.js", "manage:translations": "node ./config/webpack/translationRunner.js", - "start": "babel-node ./streaming/index.js --presets es2015,stage-2", + "start": "babel-node ./streaming/index.js", "storybook": "start-storybook -p 9001 -c storybook", "test": "npm run test:lint && npm run test:mocha", "test:lint": "eslint -c .eslintrc.yml --ext=js --ext=jsx app/javascript/", @@ -34,9 +34,7 @@ "babel-plugin-transform-react-jsx-self": "^6.22.0", "babel-plugin-transform-react-jsx-source": "^6.22.0", "babel-preset-env": "^1.4.0", - "babel-preset-es2015": "^6.22.0", "babel-preset-react": "^6.11.1", - "babel-preset-stage-2": "^6.22.0", "coffee-loader": "^0.7.3", "coffee-script": "^1.12.5", "compression-webpack-plugin": "^0.4.0", diff --git a/streaming/.babelrc b/streaming/.babelrc new file mode 100644 index 000000000..dc1ec4303 --- /dev/null +++ b/streaming/.babelrc @@ -0,0 +1,15 @@ +{ + "presets": [ + [ + "env", + { + "targets": { + "node": "current" + } + } + ] + ], + "plugins": [ + "transform-object-rest-spread" + ] +} diff --git a/yarn.lock b/yarn.lock index 99cde63c6..03ca284d6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -470,14 +470,6 @@ babel-generator@^6.24.1: source-map "^0.5.0" trim-right "^1.0.1" -babel-helper-bindify-decorators@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-helper-bindify-decorators/-/babel-helper-bindify-decorators-6.22.0.tgz#d7f5bc261275941ac62acfc4e20dacfb8a3fe952" - dependencies: - babel-runtime "^6.22.0" - babel-traverse "^6.22.0" - babel-types "^6.22.0" - babel-helper-builder-binary-assignment-operator-visitor@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.22.0.tgz#29df56be144d81bdeac08262bfa41d2c5e91cdcd" @@ -521,15 +513,6 @@ babel-helper-explode-assignable-expression@^6.22.0: babel-traverse "^6.22.0" babel-types "^6.22.0" -babel-helper-explode-class@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-helper-explode-class/-/babel-helper-explode-class-6.22.0.tgz#646304924aa6388a516843ba7f1855ef8dfeb69b" - dependencies: - babel-helper-bindify-decorators "^6.22.0" - babel-runtime "^6.22.0" - babel-traverse "^6.22.0" - babel-types "^6.22.0" - babel-helper-function-name@^6.22.0, babel-helper-function-name@^6.24.1, babel-helper-function-name@^6.8.0: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz#d3475b8c03ed98242a25b48351ab18399d3580a9" @@ -658,18 +641,10 @@ babel-plugin-syntax-async-functions@^6.8.0: version "6.13.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz#cad9cad1191b5ad634bf30ae0872391e0647be95" -babel-plugin-syntax-async-generators@^6.5.0: - version "6.13.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-generators/-/babel-plugin-syntax-async-generators-6.13.0.tgz#6bc963ebb16eccbae6b92b596eb7f35c342a8b9a" - babel-plugin-syntax-class-properties@^6.8.0: version "6.13.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-class-properties/-/babel-plugin-syntax-class-properties-6.13.0.tgz#d7eb23b79a317f8543962c505b827c7d6cac27de" -babel-plugin-syntax-decorators@^6.13.0: - version "6.13.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-decorators/-/babel-plugin-syntax-decorators-6.13.0.tgz#312563b4dbde3cc806cee3e416cceeaddd11ac0b" - babel-plugin-syntax-dynamic-import@^6.18.0: version "6.18.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-dynamic-import/-/babel-plugin-syntax-dynamic-import-6.18.0.tgz#8d6a26229c83745a9982a441051572caa179b1da" @@ -694,14 +669,6 @@ babel-plugin-syntax-trailing-function-commas@^6.13.0, babel-plugin-syntax-traili version "6.22.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz#ba0360937f8d06e40180a43fe0d5616fff532cf3" -babel-plugin-transform-async-generator-functions@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-generator-functions/-/babel-plugin-transform-async-generator-functions-6.22.0.tgz#a720a98153a7596f204099cd5409f4b3c05bab46" - dependencies: - babel-helper-remap-async-to-generator "^6.22.0" - babel-plugin-syntax-async-generators "^6.5.0" - babel-runtime "^6.22.0" - babel-plugin-transform-async-to-generator@^6.22.0, babel-plugin-transform-async-to-generator@^6.8.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.22.0.tgz#194b6938ec195ad36efc4c33a971acf00d8cd35e" @@ -718,7 +685,7 @@ babel-plugin-transform-class-properties@6.16.0: babel-plugin-syntax-class-properties "^6.8.0" babel-runtime "^6.9.1" -babel-plugin-transform-class-properties@^6.22.0, babel-plugin-transform-class-properties@^6.24.1: +babel-plugin-transform-class-properties@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-class-properties/-/babel-plugin-transform-class-properties-6.24.1.tgz#6a79763ea61d33d36f37b611aa9def81a81b46ac" dependencies: @@ -727,16 +694,6 @@ babel-plugin-transform-class-properties@^6.22.0, babel-plugin-transform-class-pr babel-runtime "^6.22.0" babel-template "^6.24.1" -babel-plugin-transform-decorators@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-decorators/-/babel-plugin-transform-decorators-6.22.0.tgz#c03635b27a23b23b7224f49232c237a73988d27c" - dependencies: - babel-helper-explode-class "^6.22.0" - babel-plugin-syntax-decorators "^6.13.0" - babel-runtime "^6.22.0" - babel-template "^6.22.0" - babel-types "^6.22.0" - babel-plugin-transform-es2015-arrow-functions@^6.22.0, babel-plugin-transform-es2015-arrow-functions@^6.3.13: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz#452692cb711d5f79dc7f85e440ce41b9f244d221" @@ -952,7 +909,7 @@ babel-plugin-transform-object-rest-spread@6.16.0: babel-plugin-syntax-object-rest-spread "^6.8.0" babel-runtime "^6.0.0" -babel-plugin-transform-object-rest-spread@^6.22.0, babel-plugin-transform-object-rest-spread@^6.23.0: +babel-plugin-transform-object-rest-spread@^6.23.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.23.0.tgz#875d6bc9be761c58a2ae3feee5dc4895d8c7f921" dependencies: @@ -1109,7 +1066,7 @@ babel-preset-env@^1.4.0: browserslist "^1.4.0" invariant "^2.2.2" -babel-preset-es2015@^6.16.0, babel-preset-es2015@^6.22.0: +babel-preset-es2015@^6.16.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-preset-es2015/-/babel-preset-es2015-6.22.0.tgz#af5a98ecb35eb8af764ad8a5a05eb36dc4386835" dependencies: @@ -1189,25 +1146,6 @@ babel-preset-react@6.16.0, babel-preset-react@^6.11.1: babel-plugin-transform-react-jsx-self "^6.11.0" babel-plugin-transform-react-jsx-source "^6.3.13" -babel-preset-stage-2@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-preset-stage-2/-/babel-preset-stage-2-6.22.0.tgz#ccd565f19c245cade394b21216df704a73b27c07" - dependencies: - babel-plugin-syntax-dynamic-import "^6.18.0" - babel-plugin-transform-class-properties "^6.22.0" - babel-plugin-transform-decorators "^6.22.0" - babel-preset-stage-3 "^6.22.0" - -babel-preset-stage-3@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-preset-stage-3/-/babel-preset-stage-3-6.22.0.tgz#a4e92bbace7456fafdf651d7a7657ee0bbca9c2e" - dependencies: - babel-plugin-syntax-trailing-function-commas "^6.22.0" - babel-plugin-transform-async-generator-functions "^6.22.0" - babel-plugin-transform-async-to-generator "^6.22.0" - babel-plugin-transform-exponentiation-operator "^6.22.0" - babel-plugin-transform-object-rest-spread "^6.22.0" - babel-register@^6.23.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.23.0.tgz#c9aa3d4cca94b51da34826c4a0f9e08145d74ff3"