From 5f994ee71b7ad2ad9643c88a80b900cb57a24f30 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Mon, 27 Mar 2017 15:23:24 +0100 Subject: [PATCH] Remove deps on specific builds from shims --- .../facebook-www/ReactFiberErrorLogger.js | 13 ++++++++-- .../rollup/shims/facebook-www/ReactPerf.js | 25 +++++++++++++++++-- 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/scripts/rollup/shims/facebook-www/ReactFiberErrorLogger.js b/scripts/rollup/shims/facebook-www/ReactFiberErrorLogger.js index 771d62ddea..f6a78cbc83 100644 --- a/scripts/rollup/shims/facebook-www/ReactFiberErrorLogger.js +++ b/scripts/rollup/shims/facebook-www/ReactFiberErrorLogger.js @@ -13,6 +13,15 @@ const { __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, -} = require('ReactDOMFiber-build'); // It doesn't exist in Stack +} = require('ReactDOM-fb'); -module.exports = __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactFiberErrorLogger; +// TODO: remove this when we delete Stack +const ReactFiberErrorLoggerStackShim = { + injection: { + injectDialog() {}, + }, +}; + +module.exports = + __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactFiberErrorLogger || + ReactFiberErrorLoggerStackShim; diff --git a/scripts/rollup/shims/facebook-www/ReactPerf.js b/scripts/rollup/shims/facebook-www/ReactPerf.js index 75835df0fa..699d6a35b1 100644 --- a/scripts/rollup/shims/facebook-www/ReactPerf.js +++ b/scripts/rollup/shims/facebook-www/ReactPerf.js @@ -11,8 +11,29 @@ 'use strict'; +const emptyFunction = require('fbjs/lib/emptyFunction'); const { __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, -} = require('ReactDOMStack-build'); // It doesn't exist in Fiber +} = require('ReactDOM-fb'); -module.exports = __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactPerf; +// TODO: remove this whole module when we delete Stack +const ReactPerfFiberShim = { + getLastMeasurements: emptyFunction, + getExclusive: emptyFunction, + getInclusive: emptyFunction, + getWasted: emptyFunction, + getOperations: emptyFunction, + printExclusive: emptyFunction, + printInclusive: emptyFunction, + printWasted: emptyFunction, + printOperations: emptyFunction, + start: emptyFunction, + stop: emptyFunction, + isRunning: emptyFunction, + printDOM: emptyFunction, + getMeasurementsSummaryMap: emptyFunction, +}; + +module.exports = + __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactPerf || + ReactPerfFiberShim;