Skip to content

Commit d2778ef

Browse files
committed
Add support for rendering BigInt (#24580)
DiffTrain build for commit 2f240c9.
1 parent 908dcaf commit d2778ef

File tree

9 files changed

+75
-51
lines changed

9 files changed

+75
-51
lines changed

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-dev.js

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<cef9df27ccdfbbffd9d4f74c26147558>>
10+
* @generated SignedSource<<2e02ad0f633511d087c31638317ef702>>
1111
*/
1212

1313
"use strict";
@@ -148,6 +148,7 @@ if (__DEV__) {
148148
var enableLegacyHidden = false;
149149
var enableAsyncActions = true;
150150
var alwaysThrottleRetries = true;
151+
var enableBigIntSupport = false; // Flow magic to verify the exports of this file match the original version.
151152

152153
var FunctionComponent = 0;
153154
var ClassComponent = 1;
@@ -5538,12 +5539,14 @@ if (__DEV__) {
55385539
function createChild(returnFiber, newChild, lanes, debugInfo) {
55395540
if (
55405541
(typeof newChild === "string" && newChild !== "") ||
5541-
typeof newChild === "number"
5542+
typeof newChild === "number" ||
5543+
enableBigIntSupport
55425544
) {
55435545
// Text nodes don't have keys. If the previous node is implicitly keyed
55445546
// we can continue to replace it without aborting even if it is not a text
55455547
// node.
55465548
var created = createFiberFromText(
5549+
// $FlowFixMe[unsafe-addition] Flow doesn't want us to use `+` operator with string and bigint
55475550
"" + newChild,
55485551
returnFiber.mode,
55495552
lanes
@@ -5671,7 +5674,8 @@ if (__DEV__) {
56715674

56725675
if (
56735676
(typeof newChild === "string" && newChild !== "") ||
5674-
typeof newChild === "number"
5677+
typeof newChild === "number" ||
5678+
enableBigIntSupport
56755679
) {
56765680
// Text nodes don't have keys. If the previous node is implicitly keyed
56775681
// we can continue to replace it without aborting even if it is not a text
@@ -5682,7 +5686,7 @@ if (__DEV__) {
56825686

56835687
return updateTextNode(
56845688
returnFiber,
5685-
oldFiber,
5689+
oldFiber, // $FlowFixMe[unsafe-addition] Flow doesn't want us to use `+` operator with string and bigint
56865690
"" + newChild,
56875691
lanes,
56885692
debugInfo
@@ -5797,14 +5801,15 @@ if (__DEV__) {
57975801
) {
57985802
if (
57995803
(typeof newChild === "string" && newChild !== "") ||
5800-
typeof newChild === "number"
5804+
typeof newChild === "number" ||
5805+
enableBigIntSupport
58015806
) {
58025807
// Text nodes don't have keys, so we neither have to check the old nor
58035808
// new node for the key. If both are text nodes, they match.
58045809
var matchedFiber = existingChildren.get(newIdx) || null;
58055810
return updateTextNode(
58065811
returnFiber,
5807-
matchedFiber,
5812+
matchedFiber, // $FlowFixMe[unsafe-addition] Flow doesn't want us to use `+` operator with string and bigint
58085813
"" + newChild,
58095814
lanes,
58105815
debugInfo
@@ -6645,12 +6650,13 @@ if (__DEV__) {
66456650

66466651
if (
66476652
(typeof newChild === "string" && newChild !== "") ||
6648-
typeof newChild === "number"
6653+
typeof newChild === "number" ||
6654+
enableBigIntSupport
66496655
) {
66506656
return placeSingleChild(
66516657
reconcileSingleTextNode(
66526658
returnFiber,
6653-
currentFirstChild,
6659+
currentFirstChild, // $FlowFixMe[unsafe-addition] Flow doesn't want us to use `+` operator with string and bigint
66546660
"" + newChild,
66556661
lanes
66566662
)
@@ -25727,7 +25733,7 @@ if (__DEV__) {
2572725733
return root;
2572825734
}
2572925735

25730-
var ReactVersion = "18.3.0-canary-6c3b8dbfe-20240226";
25736+
var ReactVersion = "18.3.0-canary-2f240c91e-20240226";
2573125737

2573225738
// Might add PROFILE later.
2573325739

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-prod.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9171,7 +9171,7 @@ var devToolsConfig$jscomp$inline_1014 = {
91719171
throw Error("TestRenderer does not support findFiberByHostInstance()");
91729172
},
91739173
bundleType: 0,
9174-
version: "18.3.0-canary-6c3b8dbfe-20240226",
9174+
version: "18.3.0-canary-2f240c91e-20240226",
91759175
rendererPackageName: "react-test-renderer"
91769176
};
91779177
var internals$jscomp$inline_1195 = {
@@ -9202,7 +9202,7 @@ var internals$jscomp$inline_1195 = {
92029202
scheduleRoot: null,
92039203
setRefreshHandler: null,
92049204
getCurrentFiber: null,
9205-
reconcilerVersion: "18.3.0-canary-6c3b8dbfe-20240226"
9205+
reconcilerVersion: "18.3.0-canary-2f240c91e-20240226"
92069206
};
92079207
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
92089208
var hook$jscomp$inline_1196 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-profiling.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9599,7 +9599,7 @@ var devToolsConfig$jscomp$inline_1056 = {
95999599
throw Error("TestRenderer does not support findFiberByHostInstance()");
96009600
},
96019601
bundleType: 0,
9602-
version: "18.3.0-canary-6c3b8dbfe-20240226",
9602+
version: "18.3.0-canary-2f240c91e-20240226",
96039603
rendererPackageName: "react-test-renderer"
96049604
};
96059605
var internals$jscomp$inline_1236 = {
@@ -9630,7 +9630,7 @@ var internals$jscomp$inline_1236 = {
96309630
scheduleRoot: null,
96319631
setRefreshHandler: null,
96329632
getCurrentFiber: null,
9633-
reconcilerVersion: "18.3.0-canary-6c3b8dbfe-20240226"
9633+
reconcilerVersion: "18.3.0-canary-2f240c91e-20240226"
96349634
};
96359635
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
96369636
var hook$jscomp$inline_1237 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-dev.js

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<44c5c601c5193aa81af150ccb4208604>>
10+
* @generated SignedSource<<11b286062c8512965799ad8e36092d6b>>
1111
*/
1212

1313
"use strict";
@@ -26,7 +26,7 @@ if (__DEV__) {
2626
}
2727
var dynamicFlags = require("ReactNativeInternalFeatureFlags");
2828

29-
var ReactVersion = "18.3.0-canary-6c3b8dbfe-20240226";
29+
var ReactVersion = "18.3.0-canary-2f240c91e-20240226";
3030

3131
// ATTENTION
3232
// When adding new symbols to this file,
@@ -490,6 +490,21 @@ if (__DEV__) {
490490
return isArrayImpl(a);
491491
}
492492

493+
// NOTE: There are no flags, currently. Uncomment the stuff below if we add one.
494+
// the exports object every time a flag is read.
495+
496+
var enableComponentStackLocations =
497+
dynamicFlags.enableComponentStackLocations;
498+
// The rest of the flags are static for better dead code elimination.
499+
var enableDebugTracing = false;
500+
var enableScopeAPI = false;
501+
var enableRenderableContext = false;
502+
var enableLegacyHidden = false;
503+
var enableTransitionTracing = false;
504+
// because JSX is an extremely hot path.
505+
506+
var enableRefAsProp = false;
507+
493508
/*
494509
* The `'' + value` pattern (used in perf-sensitive code) throws for Symbol
495510
* and Temporal.* types. See https://github.com/facebook/react/pull/22064.
@@ -564,21 +579,6 @@ if (__DEV__) {
564579
}
565580
}
566581

567-
// NOTE: There are no flags, currently. Uncomment the stuff below if we add one.
568-
// the exports object every time a flag is read.
569-
570-
var enableComponentStackLocations =
571-
dynamicFlags.enableComponentStackLocations;
572-
// The rest of the flags are static for better dead code elimination.
573-
var enableDebugTracing = false;
574-
var enableScopeAPI = false;
575-
var enableRenderableContext = false;
576-
var enableLegacyHidden = false;
577-
var enableTransitionTracing = false;
578-
// because JSX is an extremely hot path.
579-
580-
var enableRefAsProp = false;
581-
582582
function getWrappedName(outerType, innerType, wrapperName) {
583583
var displayName = outerType.displayName;
584584

@@ -2309,6 +2309,12 @@ if (__DEV__) {
23092309
invokeCallback = true;
23102310
} else {
23112311
switch (type) {
2312+
case "bigint": {
2313+
break;
2314+
}
2315+
2316+
// fallthrough for enabled BigInt support
2317+
23122318
case "string":
23132319
case "number":
23142320
invokeCallback = true;

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-prod.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,4 +598,4 @@ exports.useSyncExternalStore = function (
598598
exports.useTransition = function () {
599599
return ReactCurrentDispatcher.current.useTransition();
600600
};
601-
exports.version = "18.3.0-canary-6c3b8dbfe-20240226";
601+
exports.version = "18.3.0-canary-2f240c91e-20240226";

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-profiling.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ exports.useSyncExternalStore = function (
594594
exports.useTransition = function () {
595595
return ReactCurrentDispatcher.current.useTransition();
596596
};
597-
exports.version = "18.3.0-canary-6c3b8dbfe-20240226";
597+
exports.version = "18.3.0-canary-2f240c91e-20240226";
598598
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
599599
"function" ===
600600
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6c3b8dbfed6f879440f484bd0bf801fac67ec684
1+
2f240c91ed54900adee213565cb2039e161629e9

compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-dev.fb.js

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<575cc3b40a7c3dee749cf6fb176a4449>>
10+
* @generated SignedSource<<36563f58fdb8036d760d09bb1e80c450>>
1111
*/
1212

1313
"use strict";
@@ -3248,6 +3248,7 @@ to return true:wantsResponderID| |
32483248
var enableLazyContextPropagation = false;
32493249
var enableLegacyHidden = false;
32503250
var enableAsyncActions = false;
3251+
var enableBigIntSupport = false; // Flow magic to verify the exports of this file match the original version.
32513252

32523253
var NoFlags$1 =
32533254
/* */
@@ -9445,12 +9446,14 @@ to return true:wantsResponderID| |
94459446
function createChild(returnFiber, newChild, lanes, debugInfo) {
94469447
if (
94479448
(typeof newChild === "string" && newChild !== "") ||
9448-
typeof newChild === "number"
9449+
typeof newChild === "number" ||
9450+
enableBigIntSupport
94499451
) {
94509452
// Text nodes don't have keys. If the previous node is implicitly keyed
94519453
// we can continue to replace it without aborting even if it is not a text
94529454
// node.
94539455
var created = createFiberFromText(
9456+
// $FlowFixMe[unsafe-addition] Flow doesn't want us to use `+` operator with string and bigint
94549457
"" + newChild,
94559458
returnFiber.mode,
94569459
lanes
@@ -9578,7 +9581,8 @@ to return true:wantsResponderID| |
95789581

95799582
if (
95809583
(typeof newChild === "string" && newChild !== "") ||
9581-
typeof newChild === "number"
9584+
typeof newChild === "number" ||
9585+
enableBigIntSupport
95829586
) {
95839587
// Text nodes don't have keys. If the previous node is implicitly keyed
95849588
// we can continue to replace it without aborting even if it is not a text
@@ -9589,7 +9593,7 @@ to return true:wantsResponderID| |
95899593

95909594
return updateTextNode(
95919595
returnFiber,
9592-
oldFiber,
9596+
oldFiber, // $FlowFixMe[unsafe-addition] Flow doesn't want us to use `+` operator with string and bigint
95939597
"" + newChild,
95949598
lanes,
95959599
debugInfo
@@ -9704,14 +9708,15 @@ to return true:wantsResponderID| |
97049708
) {
97059709
if (
97069710
(typeof newChild === "string" && newChild !== "") ||
9707-
typeof newChild === "number"
9711+
typeof newChild === "number" ||
9712+
enableBigIntSupport
97089713
) {
97099714
// Text nodes don't have keys, so we neither have to check the old nor
97109715
// new node for the key. If both are text nodes, they match.
97119716
var matchedFiber = existingChildren.get(newIdx) || null;
97129717
return updateTextNode(
97139718
returnFiber,
9714-
matchedFiber,
9719+
matchedFiber, // $FlowFixMe[unsafe-addition] Flow doesn't want us to use `+` operator with string and bigint
97159720
"" + newChild,
97169721
lanes,
97179722
debugInfo
@@ -10552,12 +10557,13 @@ to return true:wantsResponderID| |
1055210557

1055310558
if (
1055410559
(typeof newChild === "string" && newChild !== "") ||
10555-
typeof newChild === "number"
10560+
typeof newChild === "number" ||
10561+
enableBigIntSupport
1055610562
) {
1055710563
return placeSingleChild(
1055810564
reconcileSingleTextNode(
1055910565
returnFiber,
10560-
currentFirstChild,
10566+
currentFirstChild, // $FlowFixMe[unsafe-addition] Flow doesn't want us to use `+` operator with string and bigint
1056110567
"" + newChild,
1056210568
lanes
1056310569
)
@@ -28034,7 +28040,7 @@ to return true:wantsResponderID| |
2803428040
return root;
2803528041
}
2803628042

28037-
var ReactVersion = "18.3.0-canary-6032fc8f";
28043+
var ReactVersion = "18.3.0-canary-49d61be7";
2803828044

2803928045
function createPortal$1(
2804028046
children,

0 commit comments

Comments
 (0)