Build react-reconciler for FB builds (#28880)

Meta uses various tools built on top of the "react-reconciler" package
but that package needs to match the version of the "react" package.

This means that it should be synced at the same time. However, more than
that the feature flags between the "react" package and the
"react-reconciler" package needs to line up. Since FB has custom feature
flags, it can't use the OSS version of react-reconciler.
This commit is contained in:
Sebastian Markbåge
2024-04-19 18:06:01 -04:00
committed by GitHub
parent 0e0b69321a
commit 446aa9a632
2 changed files with 42 additions and 1 deletions

View File

@@ -782,7 +782,7 @@ const bundles = [
/******* React Reconciler *******/
{
bundleTypes: [NODE_DEV, NODE_PROD, NODE_PROFILING],
bundleTypes: [NODE_DEV, NODE_PROD, NODE_PROFILING, FB_WWW_DEV, FB_WWW_PROD],
moduleType: RECONCILER,
entry: 'react-reconciler',
global: 'ReactReconciler',

View File

@@ -204,6 +204,47 @@ module.exports.default = module.exports;
Object.defineProperty(module.exports, "__esModule", { value: true });
`;
},
/***************** FB_WWW_DEV (reconciler only) *****************/
[FB_WWW_DEV](source, globalName, filename, moduleType) {
return `'use strict';
if (__DEV__) {
module.exports = function $$$reconciler($$$config) {
var exports = {};
${source}
return exports;
};
module.exports.default = module.exports;
Object.defineProperty(module.exports, "__esModule", { value: true });
}
`;
},
/***************** FB_WWW_PROD (reconciler only) *****************/
[FB_WWW_PROD](source, globalName, filename, moduleType) {
return `module.exports = function $$$reconciler($$$config) {
var exports = {};
${source}
return exports;
};
module.exports.default = module.exports;
Object.defineProperty(module.exports, "__esModule", { value: true });
`;
},
/***************** FB_WWW_PROFILING (reconciler only) *****************/
[FB_WWW_PROFILING](source, globalName, filename, moduleType) {
return `module.exports = function $$$reconciler($$$config) {
var exports = {};
${source}
return exports;
};
module.exports.default = module.exports;
Object.defineProperty(module.exports, "__esModule", { value: true });
`;
},
};
const licenseHeaderWrappers = {