React Native sync for revisions c1220eb...a049aa0

Summary:
This sync includes the following changes:
- **[f2a59df48](https://github.com/facebook/react/commit/f2a59df48 )**: Remove unstableAvoidThisFallback from OSS ([#22884](https://github.com/facebook/react/pull/22884)) //<salazarm>//
- **[24dd07bd2](https://github.com/facebook/react/commit/24dd07bd2 )**: Add custom element property support behind a flag ([#22184](https://github.com/facebook/react/pull/22184)) //<Joey Arhar>//
- **[72e48b8e1](https://github.com/facebook/react/commit/72e48b8e1 )**: Fix: Don't skip writing updated package.json //<Andrew Clark>//
- **[e39b2c899](https://github.com/facebook/react/commit/e39b2c899 )**: Fix peer deps for use-sync-external-store //<Andrew Clark>//
- **[ec78b135f](https://github.com/facebook/react/commit/ec78b135f )**: Don't override use-sync-external-store peerDeps ([#22882](https://github.com/facebook/react/pull/22882)) //<Andrew Clark>//
- **[5041c37d2](https://github.com/facebook/react/commit/5041c37d2 )**: Remove hydrate option from createRoot ([#22878](https://github.com/facebook/react/pull/22878)) //<salazarm>//
- **[3f9480f0f](https://github.com/facebook/react/commit/3f9480f0f )**: enable continuous replay flag ([#22863](https://github.com/facebook/react/pull/22863)) //<salazarm>//
- **[4729ff6d1](https://github.com/facebook/react/commit/4729ff6d1 )**: Implement identifierPrefix option for useId ([#22855](https://github.com/facebook/react/pull/22855)) //<Andrew Clark>//
- **[ed00d2c3d](https://github.com/facebook/react/commit/ed00d2c3d )**: Remove unused flag ([#22854](https://github.com/facebook/react/pull/22854)) //<Dan Abramov>//
- **[0cc724c77](https://github.com/facebook/react/commit/0cc724c77 )**: update ReactFlightWebpackPlugin to be compatiable with webpack v5 ([#22739](https://github.com/facebook/react/pull/22739)) //<Michelle Chen>//
- **[4e6eec69b](https://github.com/facebook/react/commit/4e6eec69b )**: fix: document can be `null`, not just `undefined` ([#22695](https://github.com/facebook/react/pull/22695)) //<Simen Bekkhus>//

Changelog:
[General][Changed] - React Native sync for revisions c1220eb...a049aa0

jest_e2e[run_all_tests]

Reviewed By: rickhanlonii

Differential Revision: D33062386

fbshipit-source-id: 37e497947efad5696c251096da8a92ccdc6dcea7
This commit is contained in:
Kacie Bawiec 2021-12-14 09:22:31 -08:00 коммит произвёл Facebook GitHub Bot
Родитель 102b9f3256
Коммит 312efd01c8
7 изменённых файлов: 155 добавлений и 192 удалений

Просмотреть файл

@ -1 +1 @@
c1220ebdde506de91c8b9693b5cb67ac710c8c89
a049aa015563c2e50f44214c28d186c0bae09ba6

Просмотреть файл

@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<c63c5718d1b40bee38ff92020247d874>>
* @generated SignedSource<<4b47cfe3313108f4cdeb2cfc4dfea2e5>>
*/
'use strict';
@ -156,7 +156,7 @@ var invokeGuardedCallbackImpl = invokeGuardedCallbackProd;
// when we call document.createEvent(). However this can cause confusing
// errors: https://github.com/facebook/create-react-app/issues/3482
// So we preemptively throw with a better message instead.
if (typeof document === "undefined") {
if (typeof document === "undefined" || document === null) {
throw new Error(
"The `document` global was defined when React was initialized, but is not " +
"defined anymore. This can happen in a test environment if a component " +
@ -2868,6 +2868,7 @@ var enableProfilerCommitHooks = true;
var enableLazyElements = false;
var warnAboutStringRefs = false;
var warnOnSubscriptionInsideStartTransition = false;
var enableSuspenseAvoidThisFallback = false;
var enableNewReconciler = false;
var enableLazyContextPropagation = false;
@ -6008,7 +6009,7 @@ function flushSyncCallbacks() {
return null;
}
var ReactVersion = "18.0.0-c1220ebdd-20211123";
var ReactVersion = "18.0.0-rc.0-a049aa015-20211213";
var SCHEDULING_PROFILER_VERSION = 1;
@ -10448,16 +10449,9 @@ function shouldCaptureSuspense(workInProgress, hasInvisibleParent) {
var props = workInProgress.memoizedProps; // Regular boundaries always capture.
if (props.unstable_avoidThisFallback !== true) {
{
return true;
} // If it's a boundary we should avoid, then we prefer to bubble up to the
// parent boundary if it is currently invisible.
if (hasInvisibleParent) {
return false;
} // If the parent is not able to handle it, we must handle it.
return true;
}
function findFirstSuspended(row) {
var node = row;
@ -12206,12 +12200,19 @@ function getIsUpdatingOpaqueValueInRenderPhaseInDEV() {
function mountId() {
var hook = mountWorkInProgressHook();
var root = getWorkInProgressRoot(); // TODO: In Fizz, id generation is specific to each server config. Maybe we
// should do this in Fiber, too? Deferring this decision for now because
// there's no other place to store the prefix except for an internal field on
// the public createRoot object, which the fiber tree does not currently have
// a reference to.
var identifierPrefix = root.identifierPrefix;
var id;
{
// Use a lowercase r prefix for client-generated ids.
var globalClientId = globalClientIdCounter++;
id = "r:" + globalClientId.toString(32);
id = identifierPrefix + "r:" + globalClientId.toString(32);
}
hook.memoizedState = id;
@ -13742,16 +13743,9 @@ function resetSuspendedComponent(sourceFiber, rootRenderLanes) {
function getNearestSuspenseBoundaryToCapture(returnFiber) {
var node = returnFiber;
var hasInvisibleParentBoundary = hasSuspenseContext(
suspenseStackCursor.current,
InvisibleParentSuspenseContext
);
do {
if (
node.tag === SuspenseComponent &&
shouldCaptureSuspense(node, hasInvisibleParentBoundary)
) {
if (node.tag === SuspenseComponent && shouldCaptureSuspense(node)) {
return node;
} // This boundary already captured during this render. Continue to the next
// boundary.
@ -14743,7 +14737,8 @@ function completeWork(current, workInProgress, renderLanes) {
// should be able to immediately restart from within throwException.
var hasInvisibleChildContext =
current === null &&
workInProgress.memoizedProps.unstable_avoidThisFallback !== true;
(workInProgress.memoizedProps.unstable_avoidThisFallback !== true ||
!enableSuspenseAvoidThisFallback);
if (
hasInvisibleChildContext ||
@ -16566,7 +16561,7 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) {
// Mark this subtree context as having at least one invisible parent that could
// handle the fallback state.
// Avoided boundaries are not considered since they cannot handle preferred fallback states.
if (nextProps.unstable_avoidThisFallback !== true) {
{
suspenseContext = addSubtreeSuspenseContext(
suspenseContext,
InvisibleParentSuspenseContext
@ -23531,7 +23526,7 @@ function assignFiberPropertiesInDEV(target, source) {
return target;
}
function FiberRootNode(containerInfo, tag, hydrate) {
function FiberRootNode(containerInfo, tag, hydrate, identifierPrefix) {
this.tag = tag;
this.containerInfo = containerInfo;
this.pendingChildren = null;
@ -23554,6 +23549,7 @@ function FiberRootNode(containerInfo, tag, hydrate) {
this.finishedLanes = NoLanes;
this.entangledLanes = NoLanes;
this.entanglements = createLaneMap(NoLanes);
this.identifierPrefix = identifierPrefix;
{
this.effectDuration = 0;
@ -23588,9 +23584,10 @@ function createFiberRoot(
hydrate,
hydrationCallbacks,
isStrictMode,
concurrentUpdatesByDefaultOverride
concurrentUpdatesByDefaultOverride,
identifierPrefix
) {
var root = new FiberRootNode(containerInfo, tag, hydrate);
var root = new FiberRootNode(containerInfo, tag, hydrate, identifierPrefix);
// stateNode is any.
var uninitializedFiber = createHostRootFiber(
@ -23737,7 +23734,8 @@ function createContainer(
hydrate,
hydrationCallbacks,
isStrictMode,
concurrentUpdatesByDefaultOverride
concurrentUpdatesByDefaultOverride,
identifierPrefix
) {
return createFiberRoot(
containerInfo,
@ -23745,7 +23743,8 @@ function createContainer(
hydrate,
hydrationCallbacks,
isStrictMode,
concurrentUpdatesByDefaultOverride
concurrentUpdatesByDefaultOverride,
identifierPrefix
);
}
function updateContainer(element, container, parentComponent, callback) {
@ -24539,7 +24538,8 @@ function render(element, containerTag, callback, concurrentRoot) {
false,
null,
false,
null
null,
""
);
roots.set(containerTag, root);
}

Просмотреть файл

@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<d2675ef49da99531a7fa8940f853bd5f>>
* @generated SignedSource<<91162956144e0110fdc5f76b4de6f80e>>
*/
"use strict";
@ -4076,9 +4076,11 @@ var ContextOnlyDispatcher = {
},
useSyncExternalStore: mountSyncExternalStore,
useId: function() {
var hook = mountWorkInProgressHook();
var id = "r:" + (globalClientIdCounter++).toString(32);
return (hook.memoizedState = id);
var hook = mountWorkInProgressHook(),
identifierPrefix = workInProgressRoot.identifierPrefix,
globalClientId = globalClientIdCounter++;
identifierPrefix = identifierPrefix + "r:" + globalClientId.toString(32);
return (hook.memoizedState = identifierPrefix);
},
unstable_isNewReconciler: !1
},
@ -4620,11 +4622,7 @@ function completeWork(current, workInProgress, renderLanes) {
!renderLanes &&
((workInProgress.child.flags |= 8192), 0 !== (workInProgress.mode & 1))
)
if (
(null === current &&
!0 !== workInProgress.memoizedProps.unstable_avoidThisFallback) ||
0 !== (suspenseStackCursor.current & 1)
)
if (null === current || 0 !== (suspenseStackCursor.current & 1))
0 === workInProgressRootExitStatus &&
(workInProgressRootExitStatus = 3);
else {
@ -5321,11 +5319,9 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) {
null !== current && null === current.memoizedState
? !1
: 0 !== (suspenseContext & 2));
JSCompiler_temp
? ((showFallback = !0), (workInProgress.flags &= -129))
: (null !== current && null === current.memoizedState) ||
!0 === nextProps.unstable_avoidThisFallback ||
(suspenseContext |= 1);
if (JSCompiler_temp) (showFallback = !0), (workInProgress.flags &= -129);
else if (null === current || null !== current.memoizedState)
suspenseContext |= 1;
push(suspenseStackCursor, suspenseContext & 1);
if (null === current) {
current = nextProps.children;
@ -6782,8 +6778,6 @@ function handleError(root$jscomp$0, thrownValue) {
}
b: {
sourceFiber$jscomp$0 = returnFiber;
var hasInvisibleParentBoundary =
0 !== (suspenseStackCursor.current & 1);
do {
var JSCompiler_temp;
if ((JSCompiler_temp = 13 === sourceFiber$jscomp$0.tag)) {
@ -6793,12 +6787,6 @@ function handleError(root$jscomp$0, thrownValue) {
? null !== nextState.dehydrated
? !0
: !1
: !0 !==
sourceFiber$jscomp$0.memoizedProps
.unstable_avoidThisFallback
? !0
: hasInvisibleParentBoundary
? !1
: !0;
}
if (JSCompiler_temp) {
@ -7957,7 +7945,7 @@ function createFiberFromPortal(portal, mode, lanes) {
};
return mode;
}
function FiberRootNode(containerInfo, tag, hydrate) {
function FiberRootNode(containerInfo, tag, hydrate, identifierPrefix) {
this.tag = tag;
this.containerInfo = containerInfo;
this.finishedWork = this.pingCache = this.current = this.pendingChildren = null;
@ -7970,6 +7958,7 @@ function FiberRootNode(containerInfo, tag, hydrate) {
this.expirationTimes = createLaneMap(-1);
this.entangledLanes = this.finishedLanes = this.mutableReadLanes = this.expiredLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = 0;
this.entanglements = createLaneMap(0);
this.identifierPrefix = identifierPrefix;
}
function createPortal(children, containerInfo, implementation) {
var key =
@ -8176,7 +8165,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_925 = {
findFiberByHostInstance: getInstanceFromInstance,
bundleType: 0,
version: "18.0.0-c1220ebdd-20211123",
version: "18.0.0-rc.0-a049aa015-20211213",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForViewTag: function() {
@ -8191,7 +8180,7 @@ var roots = new Map(),
}.bind(null, findNodeHandle)
}
};
var internals$jscomp$inline_1179 = {
var internals$jscomp$inline_1178 = {
bundleType: devToolsConfig$jscomp$inline_925.bundleType,
version: devToolsConfig$jscomp$inline_925.version,
rendererPackageName: devToolsConfig$jscomp$inline_925.rendererPackageName,
@ -8218,19 +8207,19 @@ var internals$jscomp$inline_1179 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.0.0-c1220ebdd-20211123"
reconcilerVersion: "18.0.0-rc.0-a049aa015-20211213"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1180 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
var hook$jscomp$inline_1179 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
if (
!hook$jscomp$inline_1180.isDisabled &&
hook$jscomp$inline_1180.supportsFiber
!hook$jscomp$inline_1179.isDisabled &&
hook$jscomp$inline_1179.supportsFiber
)
try {
(rendererID = hook$jscomp$inline_1180.inject(
internals$jscomp$inline_1179
(rendererID = hook$jscomp$inline_1179.inject(
internals$jscomp$inline_1178
)),
(injectedHook = hook$jscomp$inline_1180);
(injectedHook = hook$jscomp$inline_1179);
} catch (err) {}
}
exports.createPortal = function(children, containerTag) {
@ -8270,7 +8259,7 @@ exports.render = function(element, containerTag, callback, concurrentRoot) {
var root = roots.get(containerTag);
root ||
((root = concurrentRoot ? 1 : 0),
(concurrentRoot = new FiberRootNode(containerTag, root, !1)),
(concurrentRoot = new FiberRootNode(containerTag, root, !1, "")),
(root = createFiber(3, null, null, 1 === root ? 1 : 0)),
(concurrentRoot.current = root),
(root.stateNode = concurrentRoot),

Просмотреть файл

@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<d9e820a361c20b62bc9a8c1f8ab34868>>
* @generated SignedSource<<7638d79ef666eac85302b8ce3706cab0>>
*/
@ -4263,9 +4263,11 @@ var ContextOnlyDispatcher = {
},
useSyncExternalStore: mountSyncExternalStore,
useId: function() {
var hook = mountWorkInProgressHook();
var id = "r:" + (globalClientIdCounter++).toString(32);
return (hook.memoizedState = id);
var hook = mountWorkInProgressHook(),
identifierPrefix = workInProgressRoot.identifierPrefix,
globalClientId = globalClientIdCounter++;
identifierPrefix = identifierPrefix + "r:" + globalClientId.toString(32);
return (hook.memoizedState = identifierPrefix);
},
unstable_isNewReconciler: !1
},
@ -4907,11 +4909,7 @@ function completeWork(current, workInProgress, renderLanes) {
!renderLanes &&
((workInProgress.child.flags |= 8192), 0 !== (workInProgress.mode & 1))
)
if (
(null === current &&
!0 !== workInProgress.memoizedProps.unstable_avoidThisFallback) ||
0 !== (suspenseStackCursor.current & 1)
)
if (null === current || 0 !== (suspenseStackCursor.current & 1))
0 === workInProgressRootExitStatus &&
(workInProgressRootExitStatus = 3);
else {
@ -5626,11 +5624,9 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) {
null !== current && null === current.memoizedState
? !1
: 0 !== (suspenseContext & 2));
JSCompiler_temp
? ((showFallback = !0), (workInProgress.flags &= -129))
: (null !== current && null === current.memoizedState) ||
!0 === nextProps.unstable_avoidThisFallback ||
(suspenseContext |= 1);
if (JSCompiler_temp) (showFallback = !0), (workInProgress.flags &= -129);
else if (null === current || null !== current.memoizedState)
suspenseContext |= 1;
push(suspenseStackCursor, suspenseContext & 1);
if (null === current) {
current = nextProps.children;
@ -7337,8 +7333,6 @@ function handleError(root, thrownValue$jscomp$0) {
}
b: {
sourceFiber$jscomp$0 = returnFiber;
var hasInvisibleParentBoundary =
0 !== (suspenseStackCursor.current & 1);
do {
var JSCompiler_temp;
if ((JSCompiler_temp = 13 === sourceFiber$jscomp$0.tag)) {
@ -7348,12 +7342,6 @@ function handleError(root, thrownValue$jscomp$0) {
? null !== nextState.dehydrated
? !0
: !1
: !0 !==
sourceFiber$jscomp$0.memoizedProps
.unstable_avoidThisFallback
? !0
: hasInvisibleParentBoundary
? !1
: !0;
}
if (JSCompiler_temp) {
@ -7622,7 +7610,7 @@ function commitRootImpl(root, renderPriorityLevel) {
lanes = root.finishedLanes;
supportsUserTimingV3 &&
(markAndClear("--commit-start-" + lanes),
markAndClear("--react-version-18.0.0-c1220ebdd-20211123"),
markAndClear("--react-version-18.0.0-rc.0-a049aa015-20211213"),
markAndClear("--profiler-version-1"),
getLaneLabels(),
markAndClear("--react-lane-labels-" + laneLabels.join(",")),
@ -8654,7 +8642,7 @@ function createFiberFromPortal(portal, mode, lanes) {
};
return mode;
}
function FiberRootNode(containerInfo, tag, hydrate) {
function FiberRootNode(containerInfo, tag, hydrate, identifierPrefix) {
this.tag = tag;
this.containerInfo = containerInfo;
this.finishedWork = this.pingCache = this.current = this.pendingChildren = null;
@ -8667,6 +8655,7 @@ function FiberRootNode(containerInfo, tag, hydrate) {
this.expirationTimes = createLaneMap(-1);
this.entangledLanes = this.finishedLanes = this.mutableReadLanes = this.expiredLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = 0;
this.entanglements = createLaneMap(0);
this.identifierPrefix = identifierPrefix;
this.passiveEffectDuration = this.effectDuration = 0;
this.memoizedUpdaters = new Set();
containerInfo = this.pendingUpdatersLaneMap = [];
@ -8878,7 +8867,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1020 = {
findFiberByHostInstance: getInstanceFromInstance,
bundleType: 0,
version: "18.0.0-c1220ebdd-20211123",
version: "18.0.0-rc.0-a049aa015-20211213",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForViewTag: function() {
@ -8893,7 +8882,7 @@ var roots = new Map(),
}.bind(null, findNodeHandle)
}
};
var internals$jscomp$inline_1308 = {
var internals$jscomp$inline_1307 = {
bundleType: devToolsConfig$jscomp$inline_1020.bundleType,
version: devToolsConfig$jscomp$inline_1020.version,
rendererPackageName: devToolsConfig$jscomp$inline_1020.rendererPackageName,
@ -8920,19 +8909,19 @@ var internals$jscomp$inline_1308 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.0.0-c1220ebdd-20211123"
reconcilerVersion: "18.0.0-rc.0-a049aa015-20211213"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1309 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
var hook$jscomp$inline_1308 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
if (
!hook$jscomp$inline_1309.isDisabled &&
hook$jscomp$inline_1309.supportsFiber
!hook$jscomp$inline_1308.isDisabled &&
hook$jscomp$inline_1308.supportsFiber
)
try {
(rendererID = hook$jscomp$inline_1309.inject(
internals$jscomp$inline_1308
(rendererID = hook$jscomp$inline_1308.inject(
internals$jscomp$inline_1307
)),
(injectedHook = hook$jscomp$inline_1309);
(injectedHook = hook$jscomp$inline_1308);
} catch (err) {}
}
exports.createPortal = function(children, containerTag) {
@ -8972,7 +8961,7 @@ exports.render = function(element, containerTag, callback, concurrentRoot) {
var root = roots.get(containerTag);
root ||
((root = concurrentRoot ? 1 : 0),
(concurrentRoot = new FiberRootNode(containerTag, root, !1)),
(concurrentRoot = new FiberRootNode(containerTag, root, !1, "")),
(root = 1 === root ? 1 : 0),
isDevToolsPresent && (root |= 2),
(root = createFiber(3, null, null, root)),

Просмотреть файл

@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<8b128574fdea8d0a11f1cf1c1aefe59b>>
* @generated SignedSource<<b669579a231fa2a949698a91b71718b9>>
*/
'use strict';
@ -156,7 +156,7 @@ var invokeGuardedCallbackImpl = invokeGuardedCallbackProd;
// when we call document.createEvent(). However this can cause confusing
// errors: https://github.com/facebook/create-react-app/issues/3482
// So we preemptively throw with a better message instead.
if (typeof document === "undefined") {
if (typeof document === "undefined" || document === null) {
throw new Error(
"The `document` global was defined when React was initialized, but is not " +
"defined anymore. This can happen in a test environment if a component " +
@ -3156,6 +3156,7 @@ var enableProfilerCommitHooks = true;
var enableLazyElements = false;
var warnAboutStringRefs = false;
var warnOnSubscriptionInsideStartTransition = false;
var enableSuspenseAvoidThisFallback = false;
var enableNewReconciler = false;
var enableLazyContextPropagation = false;
@ -6241,7 +6242,7 @@ function flushSyncCallbacks() {
return null;
}
var ReactVersion = "18.0.0-c1220ebdd-20211123";
var ReactVersion = "18.0.0-rc.0-a049aa015-20211213";
var SCHEDULING_PROFILER_VERSION = 1;
@ -10681,16 +10682,9 @@ function shouldCaptureSuspense(workInProgress, hasInvisibleParent) {
var props = workInProgress.memoizedProps; // Regular boundaries always capture.
if (props.unstable_avoidThisFallback !== true) {
{
return true;
} // If it's a boundary we should avoid, then we prefer to bubble up to the
// parent boundary if it is currently invisible.
if (hasInvisibleParent) {
return false;
} // If the parent is not able to handle it, we must handle it.
return true;
}
function findFirstSuspended(row) {
var node = row;
@ -12439,12 +12433,19 @@ function getIsUpdatingOpaqueValueInRenderPhaseInDEV() {
function mountId() {
var hook = mountWorkInProgressHook();
var root = getWorkInProgressRoot(); // TODO: In Fizz, id generation is specific to each server config. Maybe we
// should do this in Fiber, too? Deferring this decision for now because
// there's no other place to store the prefix except for an internal field on
// the public createRoot object, which the fiber tree does not currently have
// a reference to.
var identifierPrefix = root.identifierPrefix;
var id;
{
// Use a lowercase r prefix for client-generated ids.
var globalClientId = globalClientIdCounter++;
id = "r:" + globalClientId.toString(32);
id = identifierPrefix + "r:" + globalClientId.toString(32);
}
hook.memoizedState = id;
@ -13975,16 +13976,9 @@ function resetSuspendedComponent(sourceFiber, rootRenderLanes) {
function getNearestSuspenseBoundaryToCapture(returnFiber) {
var node = returnFiber;
var hasInvisibleParentBoundary = hasSuspenseContext(
suspenseStackCursor.current,
InvisibleParentSuspenseContext
);
do {
if (
node.tag === SuspenseComponent &&
shouldCaptureSuspense(node, hasInvisibleParentBoundary)
) {
if (node.tag === SuspenseComponent && shouldCaptureSuspense(node)) {
return node;
} // This boundary already captured during this render. Continue to the next
// boundary.
@ -14779,7 +14773,8 @@ function completeWork(current, workInProgress, renderLanes) {
// should be able to immediately restart from within throwException.
var hasInvisibleChildContext =
current === null &&
workInProgress.memoizedProps.unstable_avoidThisFallback !== true;
(workInProgress.memoizedProps.unstable_avoidThisFallback !== true ||
!enableSuspenseAvoidThisFallback);
if (
hasInvisibleChildContext ||
@ -16605,7 +16600,7 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) {
// Mark this subtree context as having at least one invisible parent that could
// handle the fallback state.
// Avoided boundaries are not considered since they cannot handle preferred fallback states.
if (nextProps.unstable_avoidThisFallback !== true) {
{
suspenseContext = addSubtreeSuspenseContext(
suspenseContext,
InvisibleParentSuspenseContext
@ -23942,7 +23937,7 @@ function assignFiberPropertiesInDEV(target, source) {
return target;
}
function FiberRootNode(containerInfo, tag, hydrate) {
function FiberRootNode(containerInfo, tag, hydrate, identifierPrefix) {
this.tag = tag;
this.containerInfo = containerInfo;
this.pendingChildren = null;
@ -23965,6 +23960,7 @@ function FiberRootNode(containerInfo, tag, hydrate) {
this.finishedLanes = NoLanes;
this.entangledLanes = NoLanes;
this.entanglements = createLaneMap(NoLanes);
this.identifierPrefix = identifierPrefix;
{
this.effectDuration = 0;
@ -23999,9 +23995,10 @@ function createFiberRoot(
hydrate,
hydrationCallbacks,
isStrictMode,
concurrentUpdatesByDefaultOverride
concurrentUpdatesByDefaultOverride,
identifierPrefix
) {
var root = new FiberRootNode(containerInfo, tag, hydrate);
var root = new FiberRootNode(containerInfo, tag, hydrate, identifierPrefix);
// stateNode is any.
var uninitializedFiber = createHostRootFiber(
@ -24148,7 +24145,8 @@ function createContainer(
hydrate,
hydrationCallbacks,
isStrictMode,
concurrentUpdatesByDefaultOverride
concurrentUpdatesByDefaultOverride,
identifierPrefix
) {
return createFiberRoot(
containerInfo,
@ -24156,7 +24154,8 @@ function createContainer(
hydrate,
hydrationCallbacks,
isStrictMode,
concurrentUpdatesByDefaultOverride
concurrentUpdatesByDefaultOverride,
identifierPrefix
);
}
function updateContainer(element, container, parentComponent, callback) {
@ -24935,7 +24934,15 @@ function render(element, containerTag, callback) {
if (!root) {
// TODO (bvaughn): If we decide to keep the wrapper component,
// We could create a wrapper for containerTag as well to reduce special casing.
root = createContainer(containerTag, LegacyRoot, false, null, false, null);
root = createContainer(
containerTag,
LegacyRoot,
false,
null,
false,
null,
""
);
roots.set(containerTag, root);
}

Просмотреть файл

@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<c587a7b3e41dfa079412f1481033cff7>>
* @generated SignedSource<<e78790b1fea52e4a08e0efaf4b202318>>
*/
"use strict";
@ -4047,9 +4047,11 @@ var ContextOnlyDispatcher = {
},
useSyncExternalStore: mountSyncExternalStore,
useId: function() {
var hook = mountWorkInProgressHook();
var id = "r:" + (globalClientIdCounter++).toString(32);
return (hook.memoizedState = id);
var hook = mountWorkInProgressHook(),
identifierPrefix = workInProgressRoot.identifierPrefix,
globalClientId = globalClientIdCounter++;
identifierPrefix = identifierPrefix + "r:" + globalClientId.toString(32);
return (hook.memoizedState = identifierPrefix);
},
unstable_isNewReconciler: !1
},
@ -4455,11 +4457,7 @@ function completeWork(current, workInProgress, renderLanes) {
!renderLanes &&
((workInProgress.child.flags |= 8192), 0 !== (workInProgress.mode & 1))
)
if (
(null === current &&
!0 !== workInProgress.memoizedProps.unstable_avoidThisFallback) ||
0 !== (suspenseStackCursor.current & 1)
)
if (null === current || 0 !== (suspenseStackCursor.current & 1))
0 === workInProgressRootExitStatus &&
(workInProgressRootExitStatus = 3);
else {
@ -5121,11 +5119,9 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) {
null !== current && null === current.memoizedState
? !1
: 0 !== (suspenseContext & 2));
JSCompiler_temp
? ((showFallback = !0), (workInProgress.flags &= -129))
: (null !== current && null === current.memoizedState) ||
!0 === nextProps.unstable_avoidThisFallback ||
(suspenseContext |= 1);
if (JSCompiler_temp) (showFallback = !0), (workInProgress.flags &= -129);
else if (null === current || null !== current.memoizedState)
suspenseContext |= 1;
push(suspenseStackCursor, suspenseContext & 1);
if (null === current) {
current = nextProps.children;
@ -6883,8 +6879,6 @@ function handleError(root$jscomp$0, thrownValue) {
}
b: {
sourceFiber$jscomp$0 = returnFiber;
var hasInvisibleParentBoundary =
0 !== (suspenseStackCursor.current & 1);
do {
var JSCompiler_temp;
if ((JSCompiler_temp = 13 === sourceFiber$jscomp$0.tag)) {
@ -6894,12 +6888,6 @@ function handleError(root$jscomp$0, thrownValue) {
? null !== nextState.dehydrated
? !0
: !1
: !0 !==
sourceFiber$jscomp$0.memoizedProps
.unstable_avoidThisFallback
? !0
: hasInvisibleParentBoundary
? !1
: !0;
}
if (JSCompiler_temp) {
@ -8037,7 +8025,7 @@ function createFiberFromPortal(portal, mode, lanes) {
};
return mode;
}
function FiberRootNode(containerInfo, tag, hydrate) {
function FiberRootNode(containerInfo, tag, hydrate, identifierPrefix) {
this.tag = tag;
this.containerInfo = containerInfo;
this.finishedWork = this.pingCache = this.current = this.pendingChildren = null;
@ -8050,6 +8038,7 @@ function FiberRootNode(containerInfo, tag, hydrate) {
this.expirationTimes = createLaneMap(-1);
this.entangledLanes = this.finishedLanes = this.mutableReadLanes = this.expiredLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = 0;
this.entanglements = createLaneMap(0);
this.identifierPrefix = identifierPrefix;
}
function createPortal(children, containerInfo, implementation) {
var key =
@ -8263,7 +8252,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_966 = {
findFiberByHostInstance: getInstanceFromTag,
bundleType: 0,
version: "18.0.0-c1220ebdd-20211123",
version: "18.0.0-rc.0-a049aa015-20211213",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForViewTag: function() {
@ -8278,7 +8267,7 @@ var roots = new Map(),
}.bind(null, findNodeHandle)
}
};
var internals$jscomp$inline_1230 = {
var internals$jscomp$inline_1229 = {
bundleType: devToolsConfig$jscomp$inline_966.bundleType,
version: devToolsConfig$jscomp$inline_966.version,
rendererPackageName: devToolsConfig$jscomp$inline_966.rendererPackageName,
@ -8305,19 +8294,19 @@ var internals$jscomp$inline_1230 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.0.0-c1220ebdd-20211123"
reconcilerVersion: "18.0.0-rc.0-a049aa015-20211213"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1231 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
var hook$jscomp$inline_1230 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
if (
!hook$jscomp$inline_1231.isDisabled &&
hook$jscomp$inline_1231.supportsFiber
!hook$jscomp$inline_1230.isDisabled &&
hook$jscomp$inline_1230.supportsFiber
)
try {
(rendererID = hook$jscomp$inline_1231.inject(
internals$jscomp$inline_1230
(rendererID = hook$jscomp$inline_1230.inject(
internals$jscomp$inline_1229
)),
(injectedHook = hook$jscomp$inline_1231);
(injectedHook = hook$jscomp$inline_1230);
} catch (err) {}
}
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = {
@ -8363,7 +8352,7 @@ exports.findNodeHandle = findNodeHandle;
exports.render = function(element, containerTag, callback) {
var root = roots.get(containerTag);
if (!root) {
root = new FiberRootNode(containerTag, 0, !1);
root = new FiberRootNode(containerTag, 0, !1, "");
var JSCompiler_inline_result = createFiber(3, null, null, 0);
root.current = JSCompiler_inline_result;
JSCompiler_inline_result.stateNode = root;

Просмотреть файл

@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<d52f24e9901f9340c97ef19e63d99705>>
* @generated SignedSource<<62369d90367239846ffa76aa77ae7e87>>
*/
@ -4234,9 +4234,11 @@ var ContextOnlyDispatcher = {
},
useSyncExternalStore: mountSyncExternalStore,
useId: function() {
var hook = mountWorkInProgressHook();
var id = "r:" + (globalClientIdCounter++).toString(32);
return (hook.memoizedState = id);
var hook = mountWorkInProgressHook(),
identifierPrefix = workInProgressRoot.identifierPrefix,
globalClientId = globalClientIdCounter++;
identifierPrefix = identifierPrefix + "r:" + globalClientId.toString(32);
return (hook.memoizedState = identifierPrefix);
},
unstable_isNewReconciler: !1
},
@ -4742,11 +4744,7 @@ function completeWork(current, workInProgress, renderLanes) {
!renderLanes &&
((workInProgress.child.flags |= 8192), 0 !== (workInProgress.mode & 1))
)
if (
(null === current &&
!0 !== workInProgress.memoizedProps.unstable_avoidThisFallback) ||
0 !== (suspenseStackCursor.current & 1)
)
if (null === current || 0 !== (suspenseStackCursor.current & 1))
0 === workInProgressRootExitStatus &&
(workInProgressRootExitStatus = 3);
else {
@ -5426,11 +5424,9 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) {
null !== current && null === current.memoizedState
? !1
: 0 !== (suspenseContext & 2));
JSCompiler_temp
? ((showFallback = !0), (workInProgress.flags &= -129))
: (null !== current && null === current.memoizedState) ||
!0 === nextProps.unstable_avoidThisFallback ||
(suspenseContext |= 1);
if (JSCompiler_temp) (showFallback = !0), (workInProgress.flags &= -129);
else if (null === current || null !== current.memoizedState)
suspenseContext |= 1;
push(suspenseStackCursor, suspenseContext & 1);
if (null === current) {
current = nextProps.children;
@ -7430,8 +7426,6 @@ function handleError(root, thrownValue$jscomp$0) {
}
b: {
sourceFiber$jscomp$0 = returnFiber;
var hasInvisibleParentBoundary =
0 !== (suspenseStackCursor.current & 1);
do {
var JSCompiler_temp;
if ((JSCompiler_temp = 13 === sourceFiber$jscomp$0.tag)) {
@ -7441,12 +7435,6 @@ function handleError(root, thrownValue$jscomp$0) {
? null !== nextState.dehydrated
? !0
: !1
: !0 !==
sourceFiber$jscomp$0.memoizedProps
.unstable_avoidThisFallback
? !0
: hasInvisibleParentBoundary
? !1
: !0;
}
if (JSCompiler_temp) {
@ -7701,7 +7689,7 @@ function commitRootImpl(root, renderPriorityLevel) {
lanes = root.finishedLanes;
supportsUserTimingV3 &&
(markAndClear("--commit-start-" + lanes),
markAndClear("--react-version-18.0.0-c1220ebdd-20211123"),
markAndClear("--react-version-18.0.0-rc.0-a049aa015-20211213"),
markAndClear("--profiler-version-1"),
getLaneLabels(),
markAndClear("--react-lane-labels-" + laneLabels.join(",")),
@ -8726,7 +8714,7 @@ function createFiberFromPortal(portal, mode, lanes) {
};
return mode;
}
function FiberRootNode(containerInfo, tag, hydrate) {
function FiberRootNode(containerInfo, tag, hydrate, identifierPrefix) {
this.tag = tag;
this.containerInfo = containerInfo;
this.finishedWork = this.pingCache = this.current = this.pendingChildren = null;
@ -8739,6 +8727,7 @@ function FiberRootNode(containerInfo, tag, hydrate) {
this.expirationTimes = createLaneMap(-1);
this.entangledLanes = this.finishedLanes = this.mutableReadLanes = this.expiredLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = 0;
this.entanglements = createLaneMap(0);
this.identifierPrefix = identifierPrefix;
this.passiveEffectDuration = this.effectDuration = 0;
this.memoizedUpdaters = new Set();
containerInfo = this.pendingUpdatersLaneMap = [];
@ -8957,7 +8946,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1061 = {
findFiberByHostInstance: getInstanceFromTag,
bundleType: 0,
version: "18.0.0-c1220ebdd-20211123",
version: "18.0.0-rc.0-a049aa015-20211213",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForViewTag: function() {
@ -8972,7 +8961,7 @@ var roots = new Map(),
}.bind(null, findNodeHandle)
}
};
var internals$jscomp$inline_1359 = {
var internals$jscomp$inline_1358 = {
bundleType: devToolsConfig$jscomp$inline_1061.bundleType,
version: devToolsConfig$jscomp$inline_1061.version,
rendererPackageName: devToolsConfig$jscomp$inline_1061.rendererPackageName,
@ -8999,19 +8988,19 @@ var internals$jscomp$inline_1359 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.0.0-c1220ebdd-20211123"
reconcilerVersion: "18.0.0-rc.0-a049aa015-20211213"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1360 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
var hook$jscomp$inline_1359 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
if (
!hook$jscomp$inline_1360.isDisabled &&
hook$jscomp$inline_1360.supportsFiber
!hook$jscomp$inline_1359.isDisabled &&
hook$jscomp$inline_1359.supportsFiber
)
try {
(rendererID = hook$jscomp$inline_1360.inject(
internals$jscomp$inline_1359
(rendererID = hook$jscomp$inline_1359.inject(
internals$jscomp$inline_1358
)),
(injectedHook = hook$jscomp$inline_1360);
(injectedHook = hook$jscomp$inline_1359);
} catch (err) {}
}
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = {
@ -9057,7 +9046,7 @@ exports.findNodeHandle = findNodeHandle;
exports.render = function(element, containerTag, callback) {
var root = roots.get(containerTag);
if (!root) {
root = new FiberRootNode(containerTag, 0, !1);
root = new FiberRootNode(containerTag, 0, !1, "");
var JSCompiler_inline_result = 0;
isDevToolsPresent && (JSCompiler_inline_result |= 2);
JSCompiler_inline_result = createFiber(