Skip to content

Commit a596e98

Browse files
Andrei Shikovfacebook-github-bot
Andrei Shikov
authored andcommitted
React Native sync for revisions c0c71a8...c1220eb
Summary: This sync includes the following changes: - **[c1220ebdd](facebook/react@c1220ebdd )**: treat empty string as null ([#22807](facebook/react#22807)) //<salazarm>// - **[09d9b1775](facebook/react@09d9b1775 )**: Update deprecated features in ESLint configuration files. ([#22767](facebook/react#22767)) //<Esteban>// - **[bddbfb86d](facebook/react@bddbfb86d )**: Revert "Fix Node package.json ./ exports deprecation warning ([#22783](facebook/react#22783))" ([#22792](facebook/react#22792)) //<Sebastian Silbermann>// - **[b831aec48](facebook/react@b831aec48 )**: chore(fast-refresh): double check wasMounted ([#22740](facebook/react#22740)) //<anc95>// - **[8edeb787b](facebook/react@8edeb787b )**: Fix Node package.json ./ exports deprecation warning ([#22783](facebook/react#22783)) //<Rin Arakaki>// - **[fdc1d617a](facebook/react@fdc1d617a )**: Flag for client render fallback behavior on hydration mismatch ([#22787](facebook/react#22787)) //<salazarm>// - **[aa19d569b](facebook/react@aa19d569b )**: Add test selectors to experimental build ([#22760](facebook/react#22760)) //<Brian Vaughn>// - **[520ffc77a](facebook/react@520ffc77a )**: Use globalThis if possible for native fetch in browser build ([#22777](facebook/react#22777)) //<Jiachi Liu>// - **[afbc2d08f](facebook/react@afbc2d08f )**: Remove unused react-internal/invariant-args ESLint rule. ([#22778](facebook/react#22778)) //<Esteban>// - **[ca94e2680](facebook/react@ca94e2680 )**: Remove 'packages/shared/invariant.js' ([#22779](facebook/react#22779)) //<Esteban>// - **[83564712b](facebook/react@83564712b )**: Move SuspenseList to experimental channel ([#22765](facebook/react#22765)) //<Andrew Clark>// - **[d4144e6e5](facebook/react@d4144e6e5 )**: fix : grammatical typo for test description ([#22764](facebook/react#22764)) //<Brijesh Prasad>// - **[0b329511b](facebook/react@0b329511b )**: chore: fix comment typo ([#22657](facebook/react#22657)) //<Han Han>// - **[e6f60d2ad](facebook/react@e6f60d2ad )**: fix typos ([#22715](facebook/react#22715)) //<180909>// Changelog: [General][Changed] - React Native sync for revisions c0c71a8...c1220eb jest_e2e[run_all_tests] Reviewed By: yungsters Differential Revision: D32646433 fbshipit-source-id: c534ee7a17141634700c90fc2c7b34bfbe17887a
1 parent e21f8ec commit a596e98

8 files changed

+112
-50
lines changed

Libraries/Renderer/REVISION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
c0c71a868560b3042847722659579418bfe2d7e1
1+
c1220ebdde506de91c8b9693b5cb67ac710c8c89

Libraries/Renderer/implementations/ReactFabric-dev.fb.js

+20-8
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<86bcbed641a7044e773a303487a93758>>
10+
* @generated SignedSource<<c63c5718d1b40bee38ff92020247d874>>
1111
*/
1212

1313
'use strict';
@@ -6008,7 +6008,7 @@ function flushSyncCallbacks() {
60086008
return null;
60096009
}
60106010

6011-
var ReactVersion = "18.0.0-c0c71a868-20211112";
6011+
var ReactVersion = "18.0.0-c1220ebdd-20211123";
60126012

60136013
var SCHEDULING_PROFILER_VERSION = 1;
60146014

@@ -9441,7 +9441,10 @@ function ChildReconciler(shouldTrackSideEffects) {
94419441
}
94429442

94439443
function createChild(returnFiber, newChild, lanes) {
9444-
if (typeof newChild === "string" || typeof newChild === "number") {
9444+
if (
9445+
(typeof newChild === "string" && newChild !== "") ||
9446+
typeof newChild === "number"
9447+
) {
94459448
// Text nodes don't have keys. If the previous node is implicitly keyed
94469449
// we can continue to replace it without aborting even if it is not a text
94479450
// node.
@@ -9504,7 +9507,10 @@ function ChildReconciler(shouldTrackSideEffects) {
95049507
// Update the fiber if the keys match, otherwise return null.
95059508
var key = oldFiber !== null ? oldFiber.key : null;
95069509

9507-
if (typeof newChild === "string" || typeof newChild === "number") {
9510+
if (
9511+
(typeof newChild === "string" && newChild !== "") ||
9512+
typeof newChild === "number"
9513+
) {
95089514
// Text nodes don't have keys. If the previous node is implicitly keyed
95099515
// we can continue to replace it without aborting even if it is not a text
95109516
// node.
@@ -9561,7 +9567,10 @@ function ChildReconciler(shouldTrackSideEffects) {
95619567
newChild,
95629568
lanes
95639569
) {
9564-
if (typeof newChild === "string" || typeof newChild === "number") {
9570+
if (
9571+
(typeof newChild === "string" && newChild !== "") ||
9572+
typeof newChild === "number"
9573+
) {
95659574
// Text nodes don't have keys, so we neither have to check the old nor
95669575
// new node for the key. If both are text nodes, they match.
95679576
var matchedFiber = existingChildren.get(newIdx) || null;
@@ -10246,7 +10255,10 @@ function ChildReconciler(shouldTrackSideEffects) {
1024610255
throwOnInvalidObjectType(returnFiber, newChild);
1024710256
}
1024810257

10249-
if (typeof newChild === "string" || typeof newChild === "number") {
10258+
if (
10259+
(typeof newChild === "string" && newChild !== "") ||
10260+
typeof newChild === "number"
10261+
) {
1025010262
return placeSingleChild(
1025110263
reconcileSingleTextNode(
1025210264
returnFiber,
@@ -14562,7 +14574,7 @@ function completeWork(current, workInProgress, renderLanes) {
1456214574
// Schedule an effect to clear this container at the start of the next commit.
1456314575
// This handles the case of React rendering into a container with previous children.
1456414576
// It's also safe to do for updates too, because current.child would only be null
14565-
// if the previous render was null (so the the container would already be empty).
14577+
// if the previous render was null (so the container would already be empty).
1456614578
workInProgress.flags |= Snapshot;
1456714579
}
1456814580
}
@@ -20817,7 +20829,7 @@ function finishConcurrentRender(root, exitStatus, lanes) {
2081720829

2081820830
function isRenderConsistentWithExternalStores(finishedWork) {
2081920831
// Search the rendered tree for external store reads, and check whether the
20820-
// stores were mutated in a concurrent event. Intentionally using a iterative
20832+
// stores were mutated in a concurrent event. Intentionally using an iterative
2082120833
// loop instead of recursion so we can exit early.
2082220834
var node = finishedWork;
2082320835

Libraries/Renderer/implementations/ReactFabric-prod.fb.js

+17-7
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<b80a65da6d07065eb2cb1fb8dca0c565>>
10+
* @generated SignedSource<<d2675ef49da99531a7fa8940f853bd5f>>
1111
*/
1212

1313
"use strict";
@@ -2840,7 +2840,10 @@ function ChildReconciler(shouldTrackSideEffects) {
28402840
return current;
28412841
}
28422842
function createChild(returnFiber, newChild, lanes) {
2843-
if ("string" === typeof newChild || "number" === typeof newChild)
2843+
if (
2844+
("string" === typeof newChild && "" !== newChild) ||
2845+
"number" === typeof newChild
2846+
)
28442847
return (
28452848
(newChild = createFiberFromText(
28462849
"" + newChild,
@@ -2894,7 +2897,10 @@ function ChildReconciler(shouldTrackSideEffects) {
28942897
}
28952898
function updateSlot(returnFiber, oldFiber, newChild, lanes) {
28962899
var key = null !== oldFiber ? oldFiber.key : null;
2897-
if ("string" === typeof newChild || "number" === typeof newChild)
2900+
if (
2901+
("string" === typeof newChild && "" !== newChild) ||
2902+
"number" === typeof newChild
2903+
)
28982904
return null !== key
28992905
? null
29002906
: updateTextNode(returnFiber, oldFiber, "" + newChild, lanes);
@@ -2924,7 +2930,10 @@ function ChildReconciler(shouldTrackSideEffects) {
29242930
newChild,
29252931
lanes
29262932
) {
2927-
if ("string" === typeof newChild || "number" === typeof newChild)
2933+
if (
2934+
("string" === typeof newChild && "" !== newChild) ||
2935+
"number" === typeof newChild
2936+
)
29282937
return (
29292938
(existingChildren = existingChildren.get(newIdx) || null),
29302939
updateTextNode(returnFiber, existingChildren, "" + newChild, lanes)
@@ -3250,7 +3259,8 @@ function ChildReconciler(shouldTrackSideEffects) {
32503259
);
32513260
throwOnInvalidObjectType(returnFiber, newChild);
32523261
}
3253-
return "string" === typeof newChild || "number" === typeof newChild
3262+
return ("string" === typeof newChild && "" !== newChild) ||
3263+
"number" === typeof newChild
32543264
? ((newChild = "" + newChild),
32553265
null !== currentFirstChild && 6 === currentFirstChild.tag
32563266
? (deleteRemainingChildren(returnFiber, currentFirstChild.sibling),
@@ -8166,7 +8176,7 @@ var roots = new Map(),
81668176
devToolsConfig$jscomp$inline_925 = {
81678177
findFiberByHostInstance: getInstanceFromInstance,
81688178
bundleType: 0,
8169-
version: "18.0.0-c0c71a868-20211112",
8179+
version: "18.0.0-c1220ebdd-20211123",
81708180
rendererPackageName: "react-native-renderer",
81718181
rendererConfig: {
81728182
getInspectorDataForViewTag: function() {
@@ -8208,7 +8218,7 @@ var internals$jscomp$inline_1179 = {
82088218
scheduleRoot: null,
82098219
setRefreshHandler: null,
82108220
getCurrentFiber: null,
8211-
reconcilerVersion: "18.0.0-c0c71a868-20211112"
8221+
reconcilerVersion: "18.0.0-c1220ebdd-20211123"
82128222
};
82138223
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
82148224
var hook$jscomp$inline_1180 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

Libraries/Renderer/implementations/ReactFabric-profiling.fb.js

+18-8
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<84b02666b89c30d381a8cdd2ef587911>>
10+
* @generated SignedSource<<d9e820a361c20b62bc9a8c1f8ab34868>>
1111
*/
1212

1313

@@ -3025,7 +3025,10 @@ function ChildReconciler(shouldTrackSideEffects) {
30253025
return current;
30263026
}
30273027
function createChild(returnFiber, newChild, lanes) {
3028-
if ("string" === typeof newChild || "number" === typeof newChild)
3028+
if (
3029+
("string" === typeof newChild && "" !== newChild) ||
3030+
"number" === typeof newChild
3031+
)
30293032
return (
30303033
(newChild = createFiberFromText(
30313034
"" + newChild,
@@ -3079,7 +3082,10 @@ function ChildReconciler(shouldTrackSideEffects) {
30793082
}
30803083
function updateSlot(returnFiber, oldFiber, newChild, lanes) {
30813084
var key = null !== oldFiber ? oldFiber.key : null;
3082-
if ("string" === typeof newChild || "number" === typeof newChild)
3085+
if (
3086+
("string" === typeof newChild && "" !== newChild) ||
3087+
"number" === typeof newChild
3088+
)
30833089
return null !== key
30843090
? null
30853091
: updateTextNode(returnFiber, oldFiber, "" + newChild, lanes);
@@ -3109,7 +3115,10 @@ function ChildReconciler(shouldTrackSideEffects) {
31093115
newChild,
31103116
lanes
31113117
) {
3112-
if ("string" === typeof newChild || "number" === typeof newChild)
3118+
if (
3119+
("string" === typeof newChild && "" !== newChild) ||
3120+
"number" === typeof newChild
3121+
)
31133122
return (
31143123
(existingChildren = existingChildren.get(newIdx) || null),
31153124
updateTextNode(returnFiber, existingChildren, "" + newChild, lanes)
@@ -3435,7 +3444,8 @@ function ChildReconciler(shouldTrackSideEffects) {
34353444
);
34363445
throwOnInvalidObjectType(returnFiber, newChild);
34373446
}
3438-
return "string" === typeof newChild || "number" === typeof newChild
3447+
return ("string" === typeof newChild && "" !== newChild) ||
3448+
"number" === typeof newChild
34393449
? ((newChild = "" + newChild),
34403450
null !== currentFirstChild && 6 === currentFirstChild.tag
34413451
? (deleteRemainingChildren(returnFiber, currentFirstChild.sibling),
@@ -7612,7 +7622,7 @@ function commitRootImpl(root, renderPriorityLevel) {
76127622
lanes = root.finishedLanes;
76137623
supportsUserTimingV3 &&
76147624
(markAndClear("--commit-start-" + lanes),
7615-
markAndClear("--react-version-18.0.0-c0c71a868-20211112"),
7625+
markAndClear("--react-version-18.0.0-c1220ebdd-20211123"),
76167626
markAndClear("--profiler-version-1"),
76177627
getLaneLabels(),
76187628
markAndClear("--react-lane-labels-" + laneLabels.join(",")),
@@ -8868,7 +8878,7 @@ var roots = new Map(),
88688878
devToolsConfig$jscomp$inline_1020 = {
88698879
findFiberByHostInstance: getInstanceFromInstance,
88708880
bundleType: 0,
8871-
version: "18.0.0-c0c71a868-20211112",
8881+
version: "18.0.0-c1220ebdd-20211123",
88728882
rendererPackageName: "react-native-renderer",
88738883
rendererConfig: {
88748884
getInspectorDataForViewTag: function() {
@@ -8910,7 +8920,7 @@ var internals$jscomp$inline_1308 = {
89108920
scheduleRoot: null,
89118921
setRefreshHandler: null,
89128922
getCurrentFiber: null,
8913-
reconcilerVersion: "18.0.0-c0c71a868-20211112"
8923+
reconcilerVersion: "18.0.0-c1220ebdd-20211123"
89148924
};
89158925
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
89168926
var hook$jscomp$inline_1309 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js

+20-8
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<74aab8e89c3a533591d19aa80a7790da>>
10+
* @generated SignedSource<<8b128574fdea8d0a11f1cf1c1aefe59b>>
1111
*/
1212

1313
'use strict';
@@ -6241,7 +6241,7 @@ function flushSyncCallbacks() {
62416241
return null;
62426242
}
62436243

6244-
var ReactVersion = "18.0.0-c0c71a868-20211112";
6244+
var ReactVersion = "18.0.0-c1220ebdd-20211123";
62456245

62466246
var SCHEDULING_PROFILER_VERSION = 1;
62476247

@@ -9674,7 +9674,10 @@ function ChildReconciler(shouldTrackSideEffects) {
96749674
}
96759675

96769676
function createChild(returnFiber, newChild, lanes) {
9677-
if (typeof newChild === "string" || typeof newChild === "number") {
9677+
if (
9678+
(typeof newChild === "string" && newChild !== "") ||
9679+
typeof newChild === "number"
9680+
) {
96789681
// Text nodes don't have keys. If the previous node is implicitly keyed
96799682
// we can continue to replace it without aborting even if it is not a text
96809683
// node.
@@ -9737,7 +9740,10 @@ function ChildReconciler(shouldTrackSideEffects) {
97379740
// Update the fiber if the keys match, otherwise return null.
97389741
var key = oldFiber !== null ? oldFiber.key : null;
97399742

9740-
if (typeof newChild === "string" || typeof newChild === "number") {
9743+
if (
9744+
(typeof newChild === "string" && newChild !== "") ||
9745+
typeof newChild === "number"
9746+
) {
97419747
// Text nodes don't have keys. If the previous node is implicitly keyed
97429748
// we can continue to replace it without aborting even if it is not a text
97439749
// node.
@@ -9794,7 +9800,10 @@ function ChildReconciler(shouldTrackSideEffects) {
97949800
newChild,
97959801
lanes
97969802
) {
9797-
if (typeof newChild === "string" || typeof newChild === "number") {
9803+
if (
9804+
(typeof newChild === "string" && newChild !== "") ||
9805+
typeof newChild === "number"
9806+
) {
97989807
// Text nodes don't have keys, so we neither have to check the old nor
97999808
// new node for the key. If both are text nodes, they match.
98009809
var matchedFiber = existingChildren.get(newIdx) || null;
@@ -10479,7 +10488,10 @@ function ChildReconciler(shouldTrackSideEffects) {
1047910488
throwOnInvalidObjectType(returnFiber, newChild);
1048010489
}
1048110490

10482-
if (typeof newChild === "string" || typeof newChild === "number") {
10491+
if (
10492+
(typeof newChild === "string" && newChild !== "") ||
10493+
typeof newChild === "number"
10494+
) {
1048310495
return placeSingleChild(
1048410496
reconcileSingleTextNode(
1048510497
returnFiber,
@@ -14592,7 +14604,7 @@ function completeWork(current, workInProgress, renderLanes) {
1459214604
// Schedule an effect to clear this container at the start of the next commit.
1459314605
// This handles the case of React rendering into a container with previous children.
1459414606
// It's also safe to do for updates too, because current.child would only be null
14595-
// if the previous render was null (so the the container would already be empty).
14607+
// if the previous render was null (so the container would already be empty).
1459614608
workInProgress.flags |= Snapshot;
1459714609
}
1459814610
}
@@ -21232,7 +21244,7 @@ function finishConcurrentRender(root, exitStatus, lanes) {
2123221244

2123321245
function isRenderConsistentWithExternalStores(finishedWork) {
2123421246
// Search the rendered tree for external store reads, and check whether the
21235-
// stores were mutated in a concurrent event. Intentionally using a iterative
21247+
// stores were mutated in a concurrent event. Intentionally using an iterative
2123621248
// loop instead of recursion so we can exit early.
2123721249
var node = finishedWork;
2123821250

0 commit comments

Comments
 (0)