Skip to content

Commit

Permalink
React Native sync for revisions c0c71a8...c1220eb
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Andrei Shikov authored and facebook-github-bot committed Nov 29, 2021
1 parent e21f8ec commit a596e98
Show file tree
Hide file tree
Showing 8 changed files with 112 additions and 50 deletions.
2 changes: 1 addition & 1 deletion Libraries/Renderer/REVISION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
c0c71a868560b3042847722659579418bfe2d7e1
c1220ebdde506de91c8b9693b5cb67ac710c8c89
28 changes: 20 additions & 8 deletions Libraries/Renderer/implementations/ReactFabric-dev.fb.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<86bcbed641a7044e773a303487a93758>>
* @generated SignedSource<<c63c5718d1b40bee38ff92020247d874>>
*/

'use strict';
Expand Down Expand Up @@ -6008,7 +6008,7 @@ function flushSyncCallbacks() {
return null;
}

var ReactVersion = "18.0.0-c0c71a868-20211112";
var ReactVersion = "18.0.0-c1220ebdd-20211123";

var SCHEDULING_PROFILER_VERSION = 1;

Expand Down Expand Up @@ -9441,7 +9441,10 @@ function ChildReconciler(shouldTrackSideEffects) {
}

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

if (typeof newChild === "string" || typeof newChild === "number") {
if (
(typeof newChild === "string" && newChild !== "") ||
typeof newChild === "number"
) {
// Text nodes don't have keys. If the previous node is implicitly keyed
// we can continue to replace it without aborting even if it is not a text
// node.
Expand Down Expand Up @@ -9561,7 +9567,10 @@ function ChildReconciler(shouldTrackSideEffects) {
newChild,
lanes
) {
if (typeof newChild === "string" || typeof newChild === "number") {
if (
(typeof newChild === "string" && newChild !== "") ||
typeof newChild === "number"
) {
// Text nodes don't have keys, so we neither have to check the old nor
// new node for the key. If both are text nodes, they match.
var matchedFiber = existingChildren.get(newIdx) || null;
Expand Down Expand Up @@ -10246,7 +10255,10 @@ function ChildReconciler(shouldTrackSideEffects) {
throwOnInvalidObjectType(returnFiber, newChild);
}

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

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

Expand Down
24 changes: 17 additions & 7 deletions Libraries/Renderer/implementations/ReactFabric-prod.fb.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<b80a65da6d07065eb2cb1fb8dca0c565>>
* @generated SignedSource<<d2675ef49da99531a7fa8940f853bd5f>>
*/

"use strict";
Expand Down Expand Up @@ -2840,7 +2840,10 @@ function ChildReconciler(shouldTrackSideEffects) {
return current;
}
function createChild(returnFiber, newChild, lanes) {
if ("string" === typeof newChild || "number" === typeof newChild)
if (
("string" === typeof newChild && "" !== newChild) ||
"number" === typeof newChild
)
return (
(newChild = createFiberFromText(
"" + newChild,
Expand Down Expand Up @@ -2894,7 +2897,10 @@ function ChildReconciler(shouldTrackSideEffects) {
}
function updateSlot(returnFiber, oldFiber, newChild, lanes) {
var key = null !== oldFiber ? oldFiber.key : null;
if ("string" === typeof newChild || "number" === typeof newChild)
if (
("string" === typeof newChild && "" !== newChild) ||
"number" === typeof newChild
)
return null !== key
? null
: updateTextNode(returnFiber, oldFiber, "" + newChild, lanes);
Expand Down Expand Up @@ -2924,7 +2930,10 @@ function ChildReconciler(shouldTrackSideEffects) {
newChild,
lanes
) {
if ("string" === typeof newChild || "number" === typeof newChild)
if (
("string" === typeof newChild && "" !== newChild) ||
"number" === typeof newChild
)
return (
(existingChildren = existingChildren.get(newIdx) || null),
updateTextNode(returnFiber, existingChildren, "" + newChild, lanes)
Expand Down Expand Up @@ -3250,7 +3259,8 @@ function ChildReconciler(shouldTrackSideEffects) {
);
throwOnInvalidObjectType(returnFiber, newChild);
}
return "string" === typeof newChild || "number" === typeof newChild
return ("string" === typeof newChild && "" !== newChild) ||
"number" === typeof newChild
? ((newChild = "" + newChild),
null !== currentFirstChild && 6 === currentFirstChild.tag
? (deleteRemainingChildren(returnFiber, currentFirstChild.sibling),
Expand Down Expand Up @@ -8166,7 +8176,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_925 = {
findFiberByHostInstance: getInstanceFromInstance,
bundleType: 0,
version: "18.0.0-c0c71a868-20211112",
version: "18.0.0-c1220ebdd-20211123",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForViewTag: function() {
Expand Down Expand Up @@ -8208,7 +8218,7 @@ var internals$jscomp$inline_1179 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.0.0-c0c71a868-20211112"
reconcilerVersion: "18.0.0-c1220ebdd-20211123"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1180 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
26 changes: 18 additions & 8 deletions Libraries/Renderer/implementations/ReactFabric-profiling.fb.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<84b02666b89c30d381a8cdd2ef587911>>
* @generated SignedSource<<d9e820a361c20b62bc9a8c1f8ab34868>>
*/


Expand Down Expand Up @@ -3025,7 +3025,10 @@ function ChildReconciler(shouldTrackSideEffects) {
return current;
}
function createChild(returnFiber, newChild, lanes) {
if ("string" === typeof newChild || "number" === typeof newChild)
if (
("string" === typeof newChild && "" !== newChild) ||
"number" === typeof newChild
)
return (
(newChild = createFiberFromText(
"" + newChild,
Expand Down Expand Up @@ -3079,7 +3082,10 @@ function ChildReconciler(shouldTrackSideEffects) {
}
function updateSlot(returnFiber, oldFiber, newChild, lanes) {
var key = null !== oldFiber ? oldFiber.key : null;
if ("string" === typeof newChild || "number" === typeof newChild)
if (
("string" === typeof newChild && "" !== newChild) ||
"number" === typeof newChild
)
return null !== key
? null
: updateTextNode(returnFiber, oldFiber, "" + newChild, lanes);
Expand Down Expand Up @@ -3109,7 +3115,10 @@ function ChildReconciler(shouldTrackSideEffects) {
newChild,
lanes
) {
if ("string" === typeof newChild || "number" === typeof newChild)
if (
("string" === typeof newChild && "" !== newChild) ||
"number" === typeof newChild
)
return (
(existingChildren = existingChildren.get(newIdx) || null),
updateTextNode(returnFiber, existingChildren, "" + newChild, lanes)
Expand Down Expand Up @@ -3435,7 +3444,8 @@ function ChildReconciler(shouldTrackSideEffects) {
);
throwOnInvalidObjectType(returnFiber, newChild);
}
return "string" === typeof newChild || "number" === typeof newChild
return ("string" === typeof newChild && "" !== newChild) ||
"number" === typeof newChild
? ((newChild = "" + newChild),
null !== currentFirstChild && 6 === currentFirstChild.tag
? (deleteRemainingChildren(returnFiber, currentFirstChild.sibling),
Expand Down Expand Up @@ -7612,7 +7622,7 @@ function commitRootImpl(root, renderPriorityLevel) {
lanes = root.finishedLanes;
supportsUserTimingV3 &&
(markAndClear("--commit-start-" + lanes),
markAndClear("--react-version-18.0.0-c0c71a868-20211112"),
markAndClear("--react-version-18.0.0-c1220ebdd-20211123"),
markAndClear("--profiler-version-1"),
getLaneLabels(),
markAndClear("--react-lane-labels-" + laneLabels.join(",")),
Expand Down Expand Up @@ -8868,7 +8878,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1020 = {
findFiberByHostInstance: getInstanceFromInstance,
bundleType: 0,
version: "18.0.0-c0c71a868-20211112",
version: "18.0.0-c1220ebdd-20211123",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForViewTag: function() {
Expand Down Expand Up @@ -8910,7 +8920,7 @@ var internals$jscomp$inline_1308 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.0.0-c0c71a868-20211112"
reconcilerVersion: "18.0.0-c1220ebdd-20211123"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1309 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
28 changes: 20 additions & 8 deletions Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<74aab8e89c3a533591d19aa80a7790da>>
* @generated SignedSource<<8b128574fdea8d0a11f1cf1c1aefe59b>>
*/

'use strict';
Expand Down Expand Up @@ -6241,7 +6241,7 @@ function flushSyncCallbacks() {
return null;
}

var ReactVersion = "18.0.0-c0c71a868-20211112";
var ReactVersion = "18.0.0-c1220ebdd-20211123";

var SCHEDULING_PROFILER_VERSION = 1;

Expand Down Expand Up @@ -9674,7 +9674,10 @@ function ChildReconciler(shouldTrackSideEffects) {
}

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

if (typeof newChild === "string" || typeof newChild === "number") {
if (
(typeof newChild === "string" && newChild !== "") ||
typeof newChild === "number"
) {
// Text nodes don't have keys. If the previous node is implicitly keyed
// we can continue to replace it without aborting even if it is not a text
// node.
Expand Down Expand Up @@ -9794,7 +9800,10 @@ function ChildReconciler(shouldTrackSideEffects) {
newChild,
lanes
) {
if (typeof newChild === "string" || typeof newChild === "number") {
if (
(typeof newChild === "string" && newChild !== "") ||
typeof newChild === "number"
) {
// Text nodes don't have keys, so we neither have to check the old nor
// new node for the key. If both are text nodes, they match.
var matchedFiber = existingChildren.get(newIdx) || null;
Expand Down Expand Up @@ -10479,7 +10488,10 @@ function ChildReconciler(shouldTrackSideEffects) {
throwOnInvalidObjectType(returnFiber, newChild);
}

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

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

Expand Down
Loading

0 comments on commit a596e98

Please sign in to comment.