Skip to content

Commit b29a80f

Browse files
committed
Add support for rendering BigInt (#24580)
DiffTrain build for [2f240c9](2f240c9)
1 parent 1c19e01 commit b29a80f

25 files changed

+345
-157
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6c3b8dbfed6f879440f484bd0bf801fac67ec684
1+
2f240c91ed54900adee213565cb2039e161629e9

compiled/facebook-www/React-dev.classic.js

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ if (__DEV__) {
2424
) {
2525
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
2626
}
27-
var ReactVersion = "18.3.0-www-classic-c6726149";
27+
var ReactVersion = "18.3.0-www-classic-cca960ca";
2828

2929
// ATTENTION
3030
// When adding new symbols to this file,
@@ -396,6 +396,15 @@ if (__DEV__) {
396396
return isArrayImpl(a);
397397
}
398398

399+
// Re-export dynamic flags from the www version.
400+
var dynamicFeatureFlags = require("ReactFeatureFlags");
401+
402+
var enableDebugTracing = dynamicFeatureFlags.enableDebugTracing,
403+
enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing,
404+
enableRefAsProp = dynamicFeatureFlags.enableRefAsProp;
405+
// On WWW, false is used for a new modern build.
406+
var enableRenderableContext = true;
407+
399408
/*
400409
* The `'' + value` pattern (used in perf-sensitive code) throws for Symbol
401410
* and Temporal.* types. See https://github.com/facebook/react/pull/22064.
@@ -470,15 +479,6 @@ if (__DEV__) {
470479
}
471480
}
472481

473-
// Re-export dynamic flags from the www version.
474-
var dynamicFeatureFlags = require("ReactFeatureFlags");
475-
476-
var enableDebugTracing = dynamicFeatureFlags.enableDebugTracing,
477-
enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing,
478-
enableRefAsProp = dynamicFeatureFlags.enableRefAsProp;
479-
// On WWW, false is used for a new modern build.
480-
var enableRenderableContext = true;
481-
482482
function getWrappedName(outerType, innerType, wrapperName) {
483483
var displayName = outerType.displayName;
484484

@@ -2348,6 +2348,12 @@ if (__DEV__) {
23482348
invokeCallback = true;
23492349
} else {
23502350
switch (type) {
2351+
case "bigint": {
2352+
break;
2353+
}
2354+
2355+
// fallthrough for enabled BigInt support
2356+
23512357
case "string":
23522358
case "number":
23532359
invokeCallback = true;

compiled/facebook-www/React-dev.modern.js

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ if (__DEV__) {
2424
) {
2525
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
2626
}
27-
var ReactVersion = "18.3.0-www-modern-91b2c91d";
27+
var ReactVersion = "18.3.0-www-modern-f3ad7d8a";
2828

2929
// ATTENTION
3030
// When adding new symbols to this file,
@@ -396,6 +396,15 @@ if (__DEV__) {
396396
return isArrayImpl(a);
397397
}
398398

399+
// Re-export dynamic flags from the www version.
400+
var dynamicFeatureFlags = require("ReactFeatureFlags");
401+
402+
var enableDebugTracing = dynamicFeatureFlags.enableDebugTracing,
403+
enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing,
404+
enableRefAsProp = dynamicFeatureFlags.enableRefAsProp;
405+
// On WWW, true is used for a new modern build.
406+
var enableRenderableContext = true;
407+
399408
/*
400409
* The `'' + value` pattern (used in perf-sensitive code) throws for Symbol
401410
* and Temporal.* types. See https://github.com/facebook/react/pull/22064.
@@ -470,15 +479,6 @@ if (__DEV__) {
470479
}
471480
}
472481

473-
// Re-export dynamic flags from the www version.
474-
var dynamicFeatureFlags = require("ReactFeatureFlags");
475-
476-
var enableDebugTracing = dynamicFeatureFlags.enableDebugTracing,
477-
enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing,
478-
enableRefAsProp = dynamicFeatureFlags.enableRefAsProp;
479-
// On WWW, true is used for a new modern build.
480-
var enableRenderableContext = true;
481-
482482
function getWrappedName(outerType, innerType, wrapperName) {
483483
var displayName = outerType.displayName;
484484

@@ -2304,6 +2304,12 @@ if (__DEV__) {
23042304
invokeCallback = true;
23052305
} else {
23062306
switch (type) {
2307+
case "bigint": {
2308+
break;
2309+
}
2310+
2311+
// fallthrough for enabled BigInt support
2312+
23072313
case "string":
23082314
case "number":
23092315
invokeCallback = true;

compiled/facebook-www/React-prod.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,4 +625,4 @@ exports.useSyncExternalStore = function (
625625
exports.useTransition = function () {
626626
return ReactCurrentDispatcher.current.useTransition();
627627
};
628-
exports.version = "18.3.0-www-classic-2523b446";
628+
exports.version = "18.3.0-www-classic-53c0b633";

compiled/facebook-www/React-prod.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,4 +617,4 @@ exports.useSyncExternalStore = function (
617617
exports.useTransition = function () {
618618
return ReactCurrentDispatcher.current.useTransition();
619619
};
620-
exports.version = "18.3.0-www-modern-cc766bda";
620+
exports.version = "18.3.0-www-modern-e541e76b";

compiled/facebook-www/React-profiling.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ exports.useSyncExternalStore = function (
629629
exports.useTransition = function () {
630630
return ReactCurrentDispatcher.current.useTransition();
631631
};
632-
exports.version = "18.3.0-www-classic-48808038";
632+
exports.version = "18.3.0-www-classic-f64bbc43";
633633
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
634634
"function" ===
635635
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/ReactART-dev.classic.js

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ if (__DEV__) {
6666
return self;
6767
}
6868

69-
var ReactVersion = "18.3.0-www-classic-361724d4";
69+
var ReactVersion = "18.3.0-www-classic-10cc6982";
7070

7171
var LegacyRoot = 0;
7272
var ConcurrentRoot = 1;
@@ -198,6 +198,7 @@ if (__DEV__) {
198198
var enableAsyncActions = true; // Logs additional User Timing API marks for use with an experimental profiling tool.
199199

200200
var enableSchedulingProfiler = dynamicFeatureFlags.enableSchedulingProfiler;
201+
var enableBigIntSupport = false; // Flow magic to verify the exports of this file match the original version.
201202

202203
var FunctionComponent = 0;
203204
var ClassComponent = 1;
@@ -6865,12 +6866,14 @@ if (__DEV__) {
68656866
function createChild(returnFiber, newChild, lanes, debugInfo) {
68666867
if (
68676868
(typeof newChild === "string" && newChild !== "") ||
6868-
typeof newChild === "number"
6869+
typeof newChild === "number" ||
6870+
enableBigIntSupport
68696871
) {
68706872
// Text nodes don't have keys. If the previous node is implicitly keyed
68716873
// we can continue to replace it without aborting even if it is not a text
68726874
// node.
68736875
var created = createFiberFromText(
6876+
// $FlowFixMe[unsafe-addition] Flow doesn't want us to use `+` operator with string and bigint
68746877
"" + newChild,
68756878
returnFiber.mode,
68766879
lanes
@@ -6998,7 +7001,8 @@ if (__DEV__) {
69987001

69997002
if (
70007003
(typeof newChild === "string" && newChild !== "") ||
7001-
typeof newChild === "number"
7004+
typeof newChild === "number" ||
7005+
enableBigIntSupport
70027006
) {
70037007
// Text nodes don't have keys. If the previous node is implicitly keyed
70047008
// we can continue to replace it without aborting even if it is not a text
@@ -7009,7 +7013,7 @@ if (__DEV__) {
70097013

70107014
return updateTextNode(
70117015
returnFiber,
7012-
oldFiber,
7016+
oldFiber, // $FlowFixMe[unsafe-addition] Flow doesn't want us to use `+` operator with string and bigint
70137017
"" + newChild,
70147018
lanes,
70157019
debugInfo
@@ -7124,14 +7128,15 @@ if (__DEV__) {
71247128
) {
71257129
if (
71267130
(typeof newChild === "string" && newChild !== "") ||
7127-
typeof newChild === "number"
7131+
typeof newChild === "number" ||
7132+
enableBigIntSupport
71287133
) {
71297134
// Text nodes don't have keys, so we neither have to check the old nor
71307135
// new node for the key. If both are text nodes, they match.
71317136
var matchedFiber = existingChildren.get(newIdx) || null;
71327137
return updateTextNode(
71337138
returnFiber,
7134-
matchedFiber,
7139+
matchedFiber, // $FlowFixMe[unsafe-addition] Flow doesn't want us to use `+` operator with string and bigint
71357140
"" + newChild,
71367141
lanes,
71377142
debugInfo
@@ -7972,12 +7977,13 @@ if (__DEV__) {
79727977

79737978
if (
79747979
(typeof newChild === "string" && newChild !== "") ||
7975-
typeof newChild === "number"
7980+
typeof newChild === "number" ||
7981+
enableBigIntSupport
79767982
) {
79777983
return placeSingleChild(
79787984
reconcileSingleTextNode(
79797985
returnFiber,
7980-
currentFirstChild,
7986+
currentFirstChild, // $FlowFixMe[unsafe-addition] Flow doesn't want us to use `+` operator with string and bigint
79817987
"" + newChild,
79827988
lanes
79837989
)

compiled/facebook-www/ReactART-dev.modern.js

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ if (__DEV__) {
6666
return self;
6767
}
6868

69-
var ReactVersion = "18.3.0-www-modern-1f3124f7";
69+
var ReactVersion = "18.3.0-www-modern-615fb07a";
7070

7171
var LegacyRoot = 0;
7272
var ConcurrentRoot = 1;
@@ -198,6 +198,7 @@ if (__DEV__) {
198198
var enableAsyncActions = true; // Logs additional User Timing API marks for use with an experimental profiling tool.
199199

200200
var enableSchedulingProfiler = dynamicFeatureFlags.enableSchedulingProfiler;
201+
var enableBigIntSupport = false; // Flow magic to verify the exports of this file match the original version.
201202

202203
var FunctionComponent = 0;
203204
var ClassComponent = 1;
@@ -6630,12 +6631,14 @@ if (__DEV__) {
66306631
function createChild(returnFiber, newChild, lanes, debugInfo) {
66316632
if (
66326633
(typeof newChild === "string" && newChild !== "") ||
6633-
typeof newChild === "number"
6634+
typeof newChild === "number" ||
6635+
enableBigIntSupport
66346636
) {
66356637
// Text nodes don't have keys. If the previous node is implicitly keyed
66366638
// we can continue to replace it without aborting even if it is not a text
66376639
// node.
66386640
var created = createFiberFromText(
6641+
// $FlowFixMe[unsafe-addition] Flow doesn't want us to use `+` operator with string and bigint
66396642
"" + newChild,
66406643
returnFiber.mode,
66416644
lanes
@@ -6763,7 +6766,8 @@ if (__DEV__) {
67636766

67646767
if (
67656768
(typeof newChild === "string" && newChild !== "") ||
6766-
typeof newChild === "number"
6769+
typeof newChild === "number" ||
6770+
enableBigIntSupport
67676771
) {
67686772
// Text nodes don't have keys. If the previous node is implicitly keyed
67696773
// we can continue to replace it without aborting even if it is not a text
@@ -6774,7 +6778,7 @@ if (__DEV__) {
67746778

67756779
return updateTextNode(
67766780
returnFiber,
6777-
oldFiber,
6781+
oldFiber, // $FlowFixMe[unsafe-addition] Flow doesn't want us to use `+` operator with string and bigint
67786782
"" + newChild,
67796783
lanes,
67806784
debugInfo
@@ -6889,14 +6893,15 @@ if (__DEV__) {
68896893
) {
68906894
if (
68916895
(typeof newChild === "string" && newChild !== "") ||
6892-
typeof newChild === "number"
6896+
typeof newChild === "number" ||
6897+
enableBigIntSupport
68936898
) {
68946899
// Text nodes don't have keys, so we neither have to check the old nor
68956900
// new node for the key. If both are text nodes, they match.
68966901
var matchedFiber = existingChildren.get(newIdx) || null;
68976902
return updateTextNode(
68986903
returnFiber,
6899-
matchedFiber,
6904+
matchedFiber, // $FlowFixMe[unsafe-addition] Flow doesn't want us to use `+` operator with string and bigint
69006905
"" + newChild,
69016906
lanes,
69026907
debugInfo
@@ -7737,12 +7742,13 @@ if (__DEV__) {
77377742

77387743
if (
77397744
(typeof newChild === "string" && newChild !== "") ||
7740-
typeof newChild === "number"
7745+
typeof newChild === "number" ||
7746+
enableBigIntSupport
77417747
) {
77427748
return placeSingleChild(
77437749
reconcileSingleTextNode(
77447750
returnFiber,
7745-
currentFirstChild,
7751+
currentFirstChild, // $FlowFixMe[unsafe-addition] Flow doesn't want us to use `+` operator with string and bigint
77467752
"" + newChild,
77477753
lanes
77487754
)

0 commit comments

Comments
 (0)