Browse files

packager: introducing async/await, return of the yarn

The first time I tried to commit this changeset, it was causing many new packages to be installed, because the dependency would depend on newer versions that what we have installed. So, I had made a diff so upgrade all the babel packages. Unfortunately this caused some problem as the newer versions of Babel are more strict on some syntaxes. Of course, these have to be addressed, but I don't want this changeset to be coupled with Babel upgrades and the issues that arise from it.

So instead, I decided to install the slightly older version of the async-to-generator module. At first I tried with just doing:

    yarn add babel-plugin-transform-async-to-generator@6.16.0

But, `yarn` is stubborn: because this module depends on a caret version of `babel-helper-remap-async-to-generator`, it installs the very last version of it, that itself needs more recent versions of other Babel modules. So, instead, I add to install a slightly older version of the dependency manually, then then the plugin:

    yarn add babel-helper-remap-async-to-generator@6.16.0
    yarn add babel-plugin-transform-async-to-generator@6.16.0

This allows us to have a `yarn.lock` with only a minimal amount of changes, and uncouple this change from any Babel upgrades. Because we only have a few new modules, the `node_modules` folder also stays the same, 133M, and it gives us confidence this will not cause significant startup time regressions.

Reviewed By: cpojer

Differential Revision: D4578733

fbshipit-source-id: deb0f720b895b7196aaf432adec3e56f18663940
  • Loading branch information...
jeanlauliac authored and facebook-github-bot committed Feb 20, 2017
1 parent 6ac6bf0 commit 1a5b56d07095fc49cc6cfe4e711f70bdb54757b2
Showing with 2 additions and 0 deletions.
  1. +1 −0 package.json
  2. +1 −0 packager/babelRegisterOnly.js
@@ -128,6 +128,7 @@
"babel-generator": "^6.21.0",
"babel-plugin-external-helpers": "^6.18.0",
"babel-plugin-syntax-trailing-function-commas": "^6.20.0",
"babel-plugin-transform-async-to-generator": "6.16.0",
"babel-plugin-transform-flow-strip-types": "^6.21.0",
"babel-plugin-transform-object-rest-spread": "^6.20.2",
"babel-polyfill": "^6.20.0",
@@ -26,6 +26,7 @@ function config(onlyList) {
only: _only,
retainLines: true,

0 comments on commit 1a5b56d

Please sign in to comment.