Skip to content

Commit

Permalink
Build react-reconciler for FB builds (#28880)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sebmarkbage authored Apr 19, 2024
1 parent 0e0b693 commit 446aa9a
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/rollup/bundles.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
41 changes: 41 additions & 0 deletions scripts/rollup/wrappers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit 446aa9a

Please sign in to comment.