Skip to content

Commit 446aa9a

Browse files
authoredApr 19, 2024··
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.
1 parent 0e0b693 commit 446aa9a

File tree

2 files changed

+42
-1
lines changed

2 files changed

+42
-1
lines changed
 

‎scripts/rollup/bundles.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,7 @@ const bundles = [
782782

783783
/******* React Reconciler *******/
784784
{
785-
bundleTypes: [NODE_DEV, NODE_PROD, NODE_PROFILING],
785+
bundleTypes: [NODE_DEV, NODE_PROD, NODE_PROFILING, FB_WWW_DEV, FB_WWW_PROD],
786786
moduleType: RECONCILER,
787787
entry: 'react-reconciler',
788788
global: 'ReactReconciler',

‎scripts/rollup/wrappers.js

+41
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,47 @@ module.exports.default = module.exports;
204204
Object.defineProperty(module.exports, "__esModule", { value: true });
205205
`;
206206
},
207+
208+
/***************** FB_WWW_DEV (reconciler only) *****************/
209+
[FB_WWW_DEV](source, globalName, filename, moduleType) {
210+
return `'use strict';
211+
212+
if (__DEV__) {
213+
module.exports = function $$$reconciler($$$config) {
214+
var exports = {};
215+
${source}
216+
return exports;
217+
};
218+
module.exports.default = module.exports;
219+
Object.defineProperty(module.exports, "__esModule", { value: true });
220+
}
221+
`;
222+
},
223+
224+
/***************** FB_WWW_PROD (reconciler only) *****************/
225+
[FB_WWW_PROD](source, globalName, filename, moduleType) {
226+
return `module.exports = function $$$reconciler($$$config) {
227+
228+
var exports = {};
229+
${source}
230+
return exports;
231+
};
232+
module.exports.default = module.exports;
233+
Object.defineProperty(module.exports, "__esModule", { value: true });
234+
`;
235+
},
236+
237+
/***************** FB_WWW_PROFILING (reconciler only) *****************/
238+
[FB_WWW_PROFILING](source, globalName, filename, moduleType) {
239+
return `module.exports = function $$$reconciler($$$config) {
240+
var exports = {};
241+
${source}
242+
return exports;
243+
};
244+
module.exports.default = module.exports;
245+
Object.defineProperty(module.exports, "__esModule", { value: true });
246+
`;
247+
},
207248
};
208249

209250
const licenseHeaderWrappers = {

0 commit comments

Comments
 (0)
Please sign in to comment.