mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
should fix fb and cjs bundles for ReactCurrentOwner
This commit is contained in:
@@ -147,7 +147,12 @@ function getCommonJsConfig(bundleType) {
|
||||
// ],
|
||||
// };
|
||||
// change of plan: let's bundle them again
|
||||
return {};
|
||||
return {
|
||||
ignore: [
|
||||
'react/lib/ReactCurrentOwner',
|
||||
'ReactCurrentOwner',
|
||||
],
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,14 +6,25 @@
|
||||
* 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-fb');
|
||||
/**
|
||||
* Keeps track of the current owner.
|
||||
*
|
||||
* The current owner is the component who should own any components that are
|
||||
* currently being constructed.
|
||||
*/
|
||||
var ReactCurrentOwner = {
|
||||
|
||||
module.exports = __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner;
|
||||
/**
|
||||
* @internal
|
||||
* @type {ReactComponent}
|
||||
*/
|
||||
current: null,
|
||||
|
||||
};
|
||||
|
||||
module.exports = ReactCurrentOwner;
|
||||
|
||||
+30
-12
@@ -40,18 +40,35 @@ function getExternalModules(bundleType) {
|
||||
}
|
||||
}
|
||||
|
||||
function getInternalModules() {
|
||||
return {
|
||||
// we tell Rollup where these files are located internally, otherwise
|
||||
// it doesn't pick them up and assumes they're external
|
||||
reactProdInvariant: resolve('./src/shared/utils/reactProdInvariant.js'),
|
||||
'ReactCurrentOwner': resolve('./src/isomorphic/classic/element/ReactCurrentOwner.js'),
|
||||
'ReactComponentTreeHook': resolve('./src/isomorphic/hooks/ReactComponentTreeHook.js'),
|
||||
'react/lib/ReactCurrentOwner': resolve('./src/isomorphic/classic/element/ReactCurrentOwner.js'),
|
||||
'react/lib/checkPropTypes': resolve('./src/isomorphic/classic/types/checkPropTypes.js'),
|
||||
'react/lib/ReactDebugCurrentFrame': resolve('./src/isomorphic/classic/element/ReactDebugCurrentFrame.js'),
|
||||
'react/lib/ReactComponentTreeHook': resolve('./src/isomorphic/hooks/ReactComponentTreeHook.js'),
|
||||
};
|
||||
function getInternalModules(bundleType) {
|
||||
switch (bundleType) {
|
||||
case bundleTypes.DEV:
|
||||
case bundleTypes.PROD:
|
||||
return {
|
||||
// we tell Rollup where these files are located internally, otherwise
|
||||
// it doesn't pick them up and assumes they're external
|
||||
'ReactCurrentOwner': resolve('./src/isomorphic/classic/element/ReactCurrentOwner.js'),
|
||||
'react/lib/ReactCurrentOwner': resolve('./src/isomorphic/classic/element/ReactCurrentOwner.js'),
|
||||
|
||||
//
|
||||
reactProdInvariant: resolve('./src/shared/utils/reactProdInvariant.js'),
|
||||
'ReactComponentTreeHook': resolve('./src/isomorphic/hooks/ReactComponentTreeHook.js'),
|
||||
'react/lib/checkPropTypes': resolve('./src/isomorphic/classic/types/checkPropTypes.js'),
|
||||
'react/lib/ReactDebugCurrentFrame': resolve('./src/isomorphic/classic/element/ReactDebugCurrentFrame.js'),
|
||||
'react/lib/ReactComponentTreeHook': resolve('./src/isomorphic/hooks/ReactComponentTreeHook.js'),
|
||||
};
|
||||
case bundleTypes.NODE:
|
||||
case bundleTypes.FB:
|
||||
return {
|
||||
// we tell Rollup where these files are located internally, otherwise
|
||||
// it doesn't pick them up and assumes they're external
|
||||
reactProdInvariant: resolve('./src/shared/utils/reactProdInvariant.js'),
|
||||
'ReactComponentTreeHook': resolve('./src/isomorphic/hooks/ReactComponentTreeHook.js'),
|
||||
'react/lib/checkPropTypes': resolve('./src/isomorphic/classic/types/checkPropTypes.js'),
|
||||
'react/lib/ReactDebugCurrentFrame': resolve('./src/isomorphic/classic/element/ReactDebugCurrentFrame.js'),
|
||||
'react/lib/ReactComponentTreeHook': resolve('./src/isomorphic/hooks/ReactComponentTreeHook.js'),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
function replaceInternalModules(bundleType) {
|
||||
@@ -128,6 +145,7 @@ function replaceFbjsModuleAliases(bundleType) {
|
||||
'fbjs/lib/ExecutionEnvironment': 'ExecutionEnvironment',
|
||||
'fbjs/lib/createNodesFromMarkup': 'createNodesFromMarkup',
|
||||
'fbjs/lib/performanceNow': 'performanceNow',
|
||||
'react/lib/ReactCurrentOwner': 'ReactCurrentOwner',
|
||||
"'react'": "'React'",
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user