metro-bundler: downgrade block-scoping Babel plugin

Summary: Downgrade the locked version of Babel block scoping, kinda temporarily until we upgrade internally. This makes in on par with the version we use internally, so that the `basic_bundle` test had the same results on both infrastructures. This doesn't change a single thing for `metro-bundler` consumers, because this `yarn.lock` file is only used for testing/CI, not when the library is installed as part of a project.

Reviewed By: cpojer

Differential Revision: D5442368

fbshipit-source-id: f3033e450855f7d61ac775a46719d7b1743960c5
This commit is contained in:
Jean Lauliac 2017-07-18 07:57:43 -07:00 committed by Facebook Github Bot
parent 9815cd6e6f
commit e023fe12d2
2 changed files with 132 additions and 124 deletions

View File

@ -143,74 +143,78 @@ function moduleThrewError(id, error) {
}
if (__DEV__) {
_require.Systrace = { beginEvent: function beginEvent() {}, endEvent: function endEvent() {} };
var createHotReloadingObject;
var createHotReloadingObject = function createHotReloadingObject() {
var hot = {
acceptCallback: null,
accept: function accept(callback) {
hot.acceptCallback = callback;
}
(function () {
_require.Systrace = { beginEvent: function beginEvent() {}, endEvent: function endEvent() {} };
createHotReloadingObject = function createHotReloadingObject() {
var hot = {
acceptCallback: null,
accept: function accept(callback) {
hot.acceptCallback = callback;
}
};
return hot;
};
return hot;
};
var acceptAll = function acceptAll(dependentModules, inverseDependencies) {
if (!dependentModules || dependentModules.length === 0) {
return true;
}
var acceptAll = function acceptAll(dependentModules, inverseDependencies) {
if (!dependentModules || dependentModules.length === 0) {
return true;
}
var notAccepted = dependentModules.filter(function (module) {
return !_accept(module, undefined, inverseDependencies);
});
var notAccepted = dependentModules.filter(function (module) {
return !accept(module, undefined, inverseDependencies);
});
var parents = [];
for (var i = 0; i < notAccepted.length; i++) {
if (inverseDependencies[notAccepted[i]].length === 0) {
var parents = [];
for (var i = 0; i < notAccepted.length; i++) {
if (inverseDependencies[notAccepted[i]].length === 0) {
return false;
}
parents.push.apply(parents, babelHelpers.toConsumableArray(inverseDependencies[notAccepted[i]]));
}
return acceptAll(parents, inverseDependencies);
};
var accept = function accept(id, factory, inverseDependencies) {
var mod = modules[id];
if (!mod && factory) {
define(factory, id);
return true;
}
var hot = mod.hot;
if (!hot) {
console.warn('Cannot accept module because Hot Module Replacement ' + 'API was not installed.');
return false;
}
parents.push.apply(parents, babelHelpers.toConsumableArray(inverseDependencies[notAccepted[i]]));
}
return acceptAll(parents, inverseDependencies);
};
var _accept = function _accept(id, factory, inverseDependencies) {
var mod = modules[id];
if (!mod && factory) {
define(factory, id);
return true;
}
var hot = mod.hot;
if (!hot) {
console.warn('Cannot accept module because Hot Module Replacement ' + 'API was not installed.');
return false;
}
if (factory) {
mod.factory = factory;
}
mod.hasError = false;
mod.isInitialized = false;
_require(id);
if (hot.acceptCallback) {
hot.acceptCallback();
return true;
} else {
if (!inverseDependencies) {
throw new Error('Undefined \`inverseDependencies\`');
if (factory) {
mod.factory = factory;
}
mod.hasError = false;
mod.isInitialized = false;
_require(id);
return acceptAll(inverseDependencies[id], inverseDependencies);
}
};
if (hot.acceptCallback) {
hot.acceptCallback();
return true;
} else {
if (!inverseDependencies) {
throw new Error('Undefined \`inverseDependencies\`');
}
global.__accept = _accept;
return acceptAll(inverseDependencies[id], inverseDependencies);
}
};
global.__accept = accept;
})();
}
})(typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : this);
(function(global) {
@ -404,74 +408,78 @@ function moduleThrewError(id, error) {
}
if (__DEV__) {
_require.Systrace = { beginEvent: function beginEvent() {}, endEvent: function endEvent() {} };
var createHotReloadingObject;
var createHotReloadingObject = function createHotReloadingObject() {
var hot = {
acceptCallback: null,
accept: function accept(callback) {
hot.acceptCallback = callback;
}
(function () {
_require.Systrace = { beginEvent: function beginEvent() {}, endEvent: function endEvent() {} };
createHotReloadingObject = function createHotReloadingObject() {
var hot = {
acceptCallback: null,
accept: function accept(callback) {
hot.acceptCallback = callback;
}
};
return hot;
};
return hot;
};
var acceptAll = function acceptAll(dependentModules, inverseDependencies) {
if (!dependentModules || dependentModules.length === 0) {
return true;
}
var acceptAll = function acceptAll(dependentModules, inverseDependencies) {
if (!dependentModules || dependentModules.length === 0) {
return true;
}
var notAccepted = dependentModules.filter(function (module) {
return !_accept(module, undefined, inverseDependencies);
});
var notAccepted = dependentModules.filter(function (module) {
return !accept(module, undefined, inverseDependencies);
});
var parents = [];
for (var i = 0; i < notAccepted.length; i++) {
if (inverseDependencies[notAccepted[i]].length === 0) {
var parents = [];
for (var i = 0; i < notAccepted.length; i++) {
if (inverseDependencies[notAccepted[i]].length === 0) {
return false;
}
parents.push.apply(parents, babelHelpers.toConsumableArray(inverseDependencies[notAccepted[i]]));
}
return acceptAll(parents, inverseDependencies);
};
var accept = function accept(id, factory, inverseDependencies) {
var mod = modules[id];
if (!mod && factory) {
define(factory, id);
return true;
}
var hot = mod.hot;
if (!hot) {
console.warn('Cannot accept module because Hot Module Replacement ' + 'API was not installed.');
return false;
}
parents.push.apply(parents, babelHelpers.toConsumableArray(inverseDependencies[notAccepted[i]]));
}
return acceptAll(parents, inverseDependencies);
};
var _accept = function _accept(id, factory, inverseDependencies) {
var mod = modules[id];
if (!mod && factory) {
define(factory, id);
return true;
}
var hot = mod.hot;
if (!hot) {
console.warn('Cannot accept module because Hot Module Replacement ' + 'API was not installed.');
return false;
}
if (factory) {
mod.factory = factory;
}
mod.hasError = false;
mod.isInitialized = false;
_require(id);
if (hot.acceptCallback) {
hot.acceptCallback();
return true;
} else {
if (!inverseDependencies) {
throw new Error('Undefined \`inverseDependencies\`');
if (factory) {
mod.factory = factory;
}
mod.hasError = false;
mod.isInitialized = false;
_require(id);
return acceptAll(inverseDependencies[id], inverseDependencies);
}
};
if (hot.acceptCallback) {
hot.acceptCallback();
return true;
} else {
if (!inverseDependencies) {
throw new Error('Undefined \`inverseDependencies\`');
}
global.__accept = _accept;
return acceptAll(inverseDependencies[id], inverseDependencies);
}
};
global.__accept = accept;
})();
}
})(typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : this);
(function(global) {

View File

@ -305,13 +305,13 @@ babel-plugin-transform-es2015-block-scoped-functions@^6.8.0:
babel-runtime "^6.22.0"
babel-plugin-transform-es2015-block-scoping@^6.5.0, babel-plugin-transform-es2015-block-scoping@^6.8.0:
version "6.24.1"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.24.1.tgz#76c295dc3a4741b1665adfd3167215dcff32a576"
version "6.18.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoping-6.18.0.tgz#3bfdcfec318d46df22525cdea88f1978813653af"
dependencies:
babel-runtime "^6.22.0"
babel-template "^6.24.1"
babel-traverse "^6.24.1"
babel-types "^6.24.1"
babel-runtime "^6.9.0"
babel-template "^6.15.0"
babel-traverse "^6.18.0"
babel-types "^6.18.0"
lodash "^4.2.0"
babel-plugin-transform-es2015-classes@^6.5.0, babel-plugin-transform-es2015-classes@^6.8.0:
@ -582,14 +582,14 @@ babel-register@^6.24.1:
mkdirp "^0.5.1"
source-map-support "^0.4.2"
babel-runtime@^6.18.0, babel-runtime@^6.22.0:
babel-runtime@^6.18.0, babel-runtime@^6.22.0, babel-runtime@^6.9.0:
version "6.23.0"
resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.23.0.tgz#0a9489f144de70efb3ce4300accdb329e2fc543b"
dependencies:
core-js "^2.4.0"
regenerator-runtime "^0.10.0"
babel-template@^6.24.1:
babel-template@^6.15.0, babel-template@^6.24.1:
version "6.24.1"
resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.24.1.tgz#04ae514f1f93b3a2537f2a0f60a5a45fb8308333"
dependencies:
@ -599,7 +599,7 @@ babel-template@^6.24.1:
babylon "^6.11.0"
lodash "^4.2.0"
babel-traverse@^6.24.1:
babel-traverse@^6.18.0, babel-traverse@^6.24.1:
version "6.24.1"
resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.24.1.tgz#ab36673fd356f9a0948659e7b338d5feadb31695"
dependencies:
@ -613,7 +613,7 @@ babel-traverse@^6.24.1:
invariant "^2.2.0"
lodash "^4.2.0"
babel-types@^6.19.0, babel-types@^6.24.1:
babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.24.1:
version "6.24.1"
resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.24.1.tgz#a136879dc15b3606bda0d90c1fc74304c2ff0975"
dependencies: