diff --git a/scripts/rollup/modules.js b/scripts/rollup/modules.js index 4a028e5e06..0a476bd094 100644 --- a/scripts/rollup/modules.js +++ b/scripts/rollup/modules.js @@ -75,13 +75,9 @@ function getNodeModules(bundleType) { function ignoreFBModules() { return [ - // Shared mutable state. - // We forked an implementation of this into forwarding/. // At FB, we don't know them statically: 'ReactFeatureFlags', 'ReactDOMFeatureFlags', - // At FB, we fork this module for custom reporting flow: - 'ReactErrorUtils', ]; } @@ -201,7 +197,7 @@ function replaceFbjsModuleAliases(bundleType) { // on the React bundle itself rather than require module directly. // For the React bundle, ReactCurrentOwner should be bundled as part of the bundle // itself and exposed on __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED -const shimReactCurrentOwner = resolve('./scripts/rollup/shims/ReactCurrentOwnerRollupShim.js'); +const shimReactCurrentOwner = resolve('./scripts/rollup/shims/rollup/ReactCurrentOwnerRollupShim.js'); const realReactCurrentOwner = resolve('./src/isomorphic/classic/element/ReactCurrentOwner.js') function getReactCurrentOwnerModuleAlias(bundleType, isRenderer) { @@ -219,7 +215,7 @@ function getReactCurrentOwnerModuleAlias(bundleType, isRenderer) { } // this works almost identically to the ReactCurrentOwner shim above -const shimReactCheckPropTypes = resolve('./scripts/rollup/shims/ReactCheckPropTypesRollupShim.js'); +const shimReactCheckPropTypes = resolve('./scripts/rollup/shims/rollup/ReactCheckPropTypesRollupShim.js'); const realCheckPropTypes = resolve('./src/isomorphic/classic/types/checkPropTypes.js') function getReactCheckPropTypesModuleAlias(bundleType, isRenderer) { @@ -237,7 +233,7 @@ function getReactCheckPropTypesModuleAlias(bundleType, isRenderer) { } // this works almost identically to the ReactCurrentOwner shim above -const shimReactComponentTreeHook = resolve('./scripts/rollup/shims/ReactComponentTreeHookRollupShim.js'); +const shimReactComponentTreeHook = resolve('./scripts/rollup/shims/rollup/ReactComponentTreeHookRollupShim.js'); const realReactComponentTreeHook = resolve('./src/isomorphic/hooks/ReactComponentTreeHook.js'); function getReactComponentTreeHookModuleAlias(bundleType, isRenderer) { diff --git a/scripts/rollup/forwarding-dom/DOMProperty.js b/scripts/rollup/shims/facebook-www/DOMProperty.js similarity index 100% rename from scripts/rollup/forwarding-dom/DOMProperty.js rename to scripts/rollup/shims/facebook-www/DOMProperty.js diff --git a/scripts/rollup/forwarding-dom/EventPluginHub.js b/scripts/rollup/shims/facebook-www/EventPluginHub.js similarity index 100% rename from scripts/rollup/forwarding-dom/EventPluginHub.js rename to scripts/rollup/shims/facebook-www/EventPluginHub.js diff --git a/scripts/rollup/forwarding-dom/EventPluginUtils.js b/scripts/rollup/shims/facebook-www/EventPluginUtils.js similarity index 100% rename from scripts/rollup/forwarding-dom/EventPluginUtils.js rename to scripts/rollup/shims/facebook-www/EventPluginUtils.js diff --git a/scripts/rollup/forwarding-dom/EventPropagators.js b/scripts/rollup/shims/facebook-www/EventPropagators.js similarity index 100% rename from scripts/rollup/forwarding-dom/EventPropagators.js rename to scripts/rollup/shims/facebook-www/EventPropagators.js diff --git a/scripts/rollup/forwarding-dom/PooledClass.js b/scripts/rollup/shims/facebook-www/PooledClass.js similarity index 100% rename from scripts/rollup/forwarding-dom/PooledClass.js rename to scripts/rollup/shims/facebook-www/PooledClass.js diff --git a/scripts/rollup/forwarding-dom/ReactBrowserEventEmitter.js b/scripts/rollup/shims/facebook-www/ReactBrowserEventEmitter.js similarity index 100% rename from scripts/rollup/forwarding-dom/ReactBrowserEventEmitter.js rename to scripts/rollup/shims/facebook-www/ReactBrowserEventEmitter.js diff --git a/scripts/rollup/forwarding-dom/ReactChildren.js b/scripts/rollup/shims/facebook-www/ReactChildren.js similarity index 96% rename from scripts/rollup/forwarding-dom/ReactChildren.js rename to scripts/rollup/shims/facebook-www/ReactChildren.js index e31708fa72..0cfe8cf6be 100644 --- a/scripts/rollup/forwarding-dom/ReactChildren.js +++ b/scripts/rollup/shims/facebook-www/ReactChildren.js @@ -14,7 +14,7 @@ const { __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, -} = require('React-fb'); +} = require('React'); // TODO: can't reexport public API because of // mapIntoWithKeyPrefixInternal() dependency in an addon. diff --git a/scripts/rollup/shims/facebook-www/ReactCurrentOwner.js b/scripts/rollup/shims/facebook-www/ReactCurrentOwner.js new file mode 100644 index 0000000000..b7ae3ad863 --- /dev/null +++ b/scripts/rollup/shims/facebook-www/ReactCurrentOwner.js @@ -0,0 +1,19 @@ +/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactCurrentOwner + * @flow + */ + +'use strict'; + +const { + __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, +} = require('React'); + +module.exports = __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner; diff --git a/scripts/rollup/forwarding-dom/ReactDOMComponentTree.js b/scripts/rollup/shims/facebook-www/ReactDOMComponentTree.js similarity index 100% rename from scripts/rollup/forwarding-dom/ReactDOMComponentTree.js rename to scripts/rollup/shims/facebook-www/ReactDOMComponentTree.js diff --git a/scripts/rollup/forwarding-dom/ReactDOMInputSelection.js b/scripts/rollup/shims/facebook-www/ReactDOMInputSelection.js similarity index 100% rename from scripts/rollup/forwarding-dom/ReactDOMInputSelection.js rename to scripts/rollup/shims/facebook-www/ReactDOMInputSelection.js diff --git a/scripts/rollup/forwarding-dom/ReactDOMSelection.js b/scripts/rollup/shims/facebook-www/ReactDOMSelection.js similarity index 100% rename from scripts/rollup/forwarding-dom/ReactDOMSelection.js rename to scripts/rollup/shims/facebook-www/ReactDOMSelection.js diff --git a/scripts/rollup/forwarding-dom/ReactElement.js b/scripts/rollup/shims/facebook-www/ReactElement.js similarity index 95% rename from scripts/rollup/forwarding-dom/ReactElement.js rename to scripts/rollup/shims/facebook-www/ReactElement.js index ca533ae09c..1b866f9c9e 100644 --- a/scripts/rollup/forwarding-dom/ReactElement.js +++ b/scripts/rollup/shims/facebook-www/ReactElement.js @@ -14,7 +14,7 @@ const { createElement, createFactory, isValidElement, -} = require('React-fb'); +} = require('React'); module.exports = { createElement, diff --git a/scripts/rollup/forwarding-dom/ReactFiberErrorLogger.js b/scripts/rollup/shims/facebook-www/ReactFiberErrorLogger.js similarity index 89% rename from scripts/rollup/forwarding-dom/ReactFiberErrorLogger.js rename to scripts/rollup/shims/facebook-www/ReactFiberErrorLogger.js index d427e3b803..9f051514cc 100644 --- a/scripts/rollup/forwarding-dom/ReactFiberErrorLogger.js +++ b/scripts/rollup/shims/facebook-www/ReactFiberErrorLogger.js @@ -14,6 +14,6 @@ const { __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, -} = require('ReactDOMFiber-fb'); // It doesn't exist in Stack +} = require('ReactDOMFiber-build'); // It doesn't exist in Stack module.exports = __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactFiberErrorLogger; diff --git a/scripts/rollup/forwarding-dom/ReactInputSelection.js b/scripts/rollup/shims/facebook-www/ReactInputSelection.js similarity index 100% rename from scripts/rollup/forwarding-dom/ReactInputSelection.js rename to scripts/rollup/shims/facebook-www/ReactInputSelection.js diff --git a/scripts/rollup/forwarding-dom/ReactInstanceMap.js b/scripts/rollup/shims/facebook-www/ReactInstanceMap.js similarity index 100% rename from scripts/rollup/forwarding-dom/ReactInstanceMap.js rename to scripts/rollup/shims/facebook-www/ReactInstanceMap.js diff --git a/scripts/rollup/forwarding-dom/ReactPerf.js b/scripts/rollup/shims/facebook-www/ReactPerf.js similarity index 88% rename from scripts/rollup/forwarding-dom/ReactPerf.js rename to scripts/rollup/shims/facebook-www/ReactPerf.js index 188737496e..1d777ddf14 100644 --- a/scripts/rollup/forwarding-dom/ReactPerf.js +++ b/scripts/rollup/shims/facebook-www/ReactPerf.js @@ -14,6 +14,6 @@ const { __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, -} = require('ReactDOMStack-fb'); // It doesn't exist in Fiber +} = require('ReactDOMStack-build'); // It doesn't exist in Fiber module.exports = __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactPerf; diff --git a/scripts/rollup/forwarding-dom/ReactTestUtils.js b/scripts/rollup/shims/facebook-www/ReactTestUtils.js similarity index 100% rename from scripts/rollup/forwarding-dom/ReactTestUtils.js rename to scripts/rollup/shims/facebook-www/ReactTestUtils.js diff --git a/scripts/rollup/forwarding-dom/SyntheticEvent.js b/scripts/rollup/shims/facebook-www/SyntheticEvent.js similarity index 100% rename from scripts/rollup/forwarding-dom/SyntheticEvent.js rename to scripts/rollup/shims/facebook-www/SyntheticEvent.js diff --git a/scripts/rollup/forwarding-dom/SyntheticKeyboardEvent.js b/scripts/rollup/shims/facebook-www/SyntheticKeyboardEvent.js similarity index 100% rename from scripts/rollup/forwarding-dom/SyntheticKeyboardEvent.js rename to scripts/rollup/shims/facebook-www/SyntheticKeyboardEvent.js diff --git a/scripts/rollup/forwarding-dom/SyntheticMouseEvent.js b/scripts/rollup/shims/facebook-www/SyntheticMouseEvent.js similarity index 100% rename from scripts/rollup/forwarding-dom/SyntheticMouseEvent.js rename to scripts/rollup/shims/facebook-www/SyntheticMouseEvent.js diff --git a/scripts/rollup/forwarding-dom/SyntheticUIEvent.js b/scripts/rollup/shims/facebook-www/SyntheticUIEvent.js similarity index 100% rename from scripts/rollup/forwarding-dom/SyntheticUIEvent.js rename to scripts/rollup/shims/facebook-www/SyntheticUIEvent.js diff --git a/scripts/rollup/forwarding-dom/ViewportMetrics.js b/scripts/rollup/shims/facebook-www/ViewportMetrics.js similarity index 100% rename from scripts/rollup/forwarding-dom/ViewportMetrics.js rename to scripts/rollup/shims/facebook-www/ViewportMetrics.js diff --git a/scripts/rollup/forwarding-dom/adler32.js b/scripts/rollup/shims/facebook-www/adler32.js similarity index 100% rename from scripts/rollup/forwarding-dom/adler32.js rename to scripts/rollup/shims/facebook-www/adler32.js diff --git a/scripts/rollup/forwarding-dom/findDOMNode.js b/scripts/rollup/shims/facebook-www/findDOMNode.js similarity index 100% rename from scripts/rollup/forwarding-dom/findDOMNode.js rename to scripts/rollup/shims/facebook-www/findDOMNode.js diff --git a/scripts/rollup/forwarding-dom/flattenChildren.js b/scripts/rollup/shims/facebook-www/flattenChildren.js similarity index 95% rename from scripts/rollup/forwarding-dom/flattenChildren.js rename to scripts/rollup/shims/facebook-www/flattenChildren.js index 5e14769f7b..a728fd79d1 100644 --- a/scripts/rollup/forwarding-dom/flattenChildren.js +++ b/scripts/rollup/shims/facebook-www/flattenChildren.js @@ -14,6 +14,6 @@ const { __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, -} = require('React-fb'); +} = require('React'); module.exports = __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.flattenChildren; diff --git a/scripts/rollup/forwarding-dom/getComponentName.js b/scripts/rollup/shims/facebook-www/getComponentName.js similarity index 95% rename from scripts/rollup/forwarding-dom/getComponentName.js rename to scripts/rollup/shims/facebook-www/getComponentName.js index d14f0644df..fbad677f55 100644 --- a/scripts/rollup/forwarding-dom/getComponentName.js +++ b/scripts/rollup/shims/facebook-www/getComponentName.js @@ -14,6 +14,6 @@ const { __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, -} = require('React-fb'); +} = require('React'); module.exports = __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.getComponentName; diff --git a/scripts/rollup/forwarding-dom/getEventCharCode.js b/scripts/rollup/shims/facebook-www/getEventCharCode.js similarity index 100% rename from scripts/rollup/forwarding-dom/getEventCharCode.js rename to scripts/rollup/shims/facebook-www/getEventCharCode.js diff --git a/scripts/rollup/forwarding-dom/getEventKey.js b/scripts/rollup/shims/facebook-www/getEventKey.js similarity index 100% rename from scripts/rollup/forwarding-dom/getEventKey.js rename to scripts/rollup/shims/facebook-www/getEventKey.js diff --git a/scripts/rollup/forwarding-dom/getEventTarget.js b/scripts/rollup/shims/facebook-www/getEventTarget.js similarity index 100% rename from scripts/rollup/forwarding-dom/getEventTarget.js rename to scripts/rollup/shims/facebook-www/getEventTarget.js diff --git a/scripts/rollup/forwarding-dom/getVendorPrefixedEventName.js b/scripts/rollup/shims/facebook-www/getVendorPrefixedEventName.js similarity index 100% rename from scripts/rollup/forwarding-dom/getVendorPrefixedEventName.js rename to scripts/rollup/shims/facebook-www/getVendorPrefixedEventName.js diff --git a/scripts/rollup/forwarding-dom/isEventSupported.js b/scripts/rollup/shims/facebook-www/isEventSupported.js similarity index 100% rename from scripts/rollup/forwarding-dom/isEventSupported.js rename to scripts/rollup/shims/facebook-www/isEventSupported.js diff --git a/scripts/rollup/forwarding-dom/onlyChild.js b/scripts/rollup/shims/facebook-www/onlyChild.js similarity index 90% rename from scripts/rollup/forwarding-dom/onlyChild.js rename to scripts/rollup/shims/facebook-www/onlyChild.js index 7b8a6f9b2f..b615a22330 100644 --- a/scripts/rollup/forwarding-dom/onlyChild.js +++ b/scripts/rollup/shims/facebook-www/onlyChild.js @@ -10,6 +10,6 @@ */ 'use strict'; -var { Children } = require('React-fb'); +var { Children } = require('React'); module.exports = Children.only; diff --git a/scripts/rollup/forwarding-dom/renderSubtreeIntoContainer.js b/scripts/rollup/shims/facebook-www/renderSubtreeIntoContainer.js similarity index 100% rename from scripts/rollup/forwarding-dom/renderSubtreeIntoContainer.js rename to scripts/rollup/shims/facebook-www/renderSubtreeIntoContainer.js diff --git a/scripts/rollup/forwarding-dom/setInnerHTML.js b/scripts/rollup/shims/facebook-www/setInnerHTML.js similarity index 100% rename from scripts/rollup/forwarding-dom/setInnerHTML.js rename to scripts/rollup/shims/facebook-www/setInnerHTML.js diff --git a/scripts/rollup/forwarding-dom/setTextContent.js b/scripts/rollup/shims/facebook-www/setTextContent.js similarity index 100% rename from scripts/rollup/forwarding-dom/setTextContent.js rename to scripts/rollup/shims/facebook-www/setTextContent.js diff --git a/scripts/rollup/forwarding-native/NativeMethodsMixin.js b/scripts/rollup/shims/react-native/NativeMethodsMixin.js similarity index 100% rename from scripts/rollup/forwarding-native/NativeMethodsMixin.js rename to scripts/rollup/shims/react-native/NativeMethodsMixin.js diff --git a/scripts/rollup/forwarding-native/ReactDebugTool.js b/scripts/rollup/shims/react-native/ReactDebugTool.js similarity index 100% rename from scripts/rollup/forwarding-native/ReactDebugTool.js rename to scripts/rollup/shims/react-native/ReactDebugTool.js diff --git a/scripts/rollup/forwarding-native/ReactErrorUtils.js b/scripts/rollup/shims/react-native/ReactErrorUtils.js similarity index 100% rename from scripts/rollup/forwarding-native/ReactErrorUtils.js rename to scripts/rollup/shims/react-native/ReactErrorUtils.js diff --git a/scripts/rollup/forwarding-native/ReactNativeComponentTree.js b/scripts/rollup/shims/react-native/ReactNativeComponentTree.js similarity index 100% rename from scripts/rollup/forwarding-native/ReactNativeComponentTree.js rename to scripts/rollup/shims/react-native/ReactNativeComponentTree.js diff --git a/scripts/rollup/forwarding-native/ReactNativePropRegistry.js b/scripts/rollup/shims/react-native/ReactNativePropRegistry.js similarity index 100% rename from scripts/rollup/forwarding-native/ReactNativePropRegistry.js rename to scripts/rollup/shims/react-native/ReactNativePropRegistry.js diff --git a/scripts/rollup/forwarding-native/ReactPerf.js b/scripts/rollup/shims/react-native/ReactPerf.js similarity index 100% rename from scripts/rollup/forwarding-native/ReactPerf.js rename to scripts/rollup/shims/react-native/ReactPerf.js diff --git a/scripts/rollup/forwarding-native/TouchHistoryMath.js b/scripts/rollup/shims/react-native/TouchHistoryMath.js similarity index 100% rename from scripts/rollup/forwarding-native/TouchHistoryMath.js rename to scripts/rollup/shims/react-native/TouchHistoryMath.js diff --git a/scripts/rollup/forwarding-native/createReactNativeComponentClass.js b/scripts/rollup/shims/react-native/createReactNativeComponentClass.js similarity index 100% rename from scripts/rollup/forwarding-native/createReactNativeComponentClass.js rename to scripts/rollup/shims/react-native/createReactNativeComponentClass.js diff --git a/scripts/rollup/forwarding-native/findNodeHandle.js b/scripts/rollup/shims/react-native/findNodeHandle.js similarity index 100% rename from scripts/rollup/forwarding-native/findNodeHandle.js rename to scripts/rollup/shims/react-native/findNodeHandle.js diff --git a/scripts/rollup/shims/ReactCheckPropTypesRollupShim.js b/scripts/rollup/shims/rollup/ReactCheckPropTypesRollupShim.js similarity index 100% rename from scripts/rollup/shims/ReactCheckPropTypesRollupShim.js rename to scripts/rollup/shims/rollup/ReactCheckPropTypesRollupShim.js diff --git a/scripts/rollup/shims/ReactComponentTreeHookRollupShim.js b/scripts/rollup/shims/rollup/ReactComponentTreeHookRollupShim.js similarity index 100% rename from scripts/rollup/shims/ReactComponentTreeHookRollupShim.js rename to scripts/rollup/shims/rollup/ReactComponentTreeHookRollupShim.js diff --git a/scripts/rollup/shims/ReactCurrentOwnerRollupShim.js b/scripts/rollup/shims/rollup/ReactCurrentOwnerRollupShim.js similarity index 100% rename from scripts/rollup/shims/ReactCurrentOwnerRollupShim.js rename to scripts/rollup/shims/rollup/ReactCurrentOwnerRollupShim.js