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.
Sebastian Markbåge committed
Apr 19, 2024 at 18:06 UTC
446aa9a632670eb9a373d897309452e24c10c55e
2 files changed
+42
-1
scripts/rollup/bundles.js
+1
-1
@@ -782,7 +782,7 @@ const bundles = [
782
783
/******* React Reconciler *******/
784
{
785
- bundleTypes: [NODE_DEV, NODE_PROD, NODE_PROFILING],
785
+ bundleTypes: [NODE_DEV, NODE_PROD, NODE_PROFILING, FB_WWW_DEV, FB_WWW_PROD],
786
moduleType: RECONCILER,
787
entry: 'react-reconciler',
788
global: 'ReactReconciler',
scripts/rollup/wrappers.js
+41
@@ -204,6 +204,47 @@ module.exports.default = module.exports;
204
Object.defineProperty(module.exports, "__esModule", { value: true });
205
`;
206
},
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
+ },
248
};
249
250
const licenseHeaderWrappers = {