diff --git a/Libraries/Renderer/REVISION b/Libraries/Renderer/REVISION index d4d3fc3d90454c..7dc1929d242bd6 100644 --- a/Libraries/Renderer/REVISION +++ b/Libraries/Renderer/REVISION @@ -1 +1 @@ -4de99b3ca689e8f995f90f199cd8d7bfb4b35eca \ No newline at end of file +17806594cc28284fe195f918e8d77de3516848ec \ No newline at end of file diff --git a/Libraries/Renderer/implementations/ReactFabric-dev.fb.js b/Libraries/Renderer/implementations/ReactFabric-dev.fb.js index 11dc6ff58ceede..76f2b59ab09264 100644 --- a/Libraries/Renderer/implementations/ReactFabric-dev.fb.js +++ b/Libraries/Renderer/implementations/ReactFabric-dev.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<6d80dd918594e27535a434318a0b1bb0>> + * @generated SignedSource<<4e8d31482697cd46d1558cbff98e79aa>> */ 'use strict'; @@ -577,7 +577,8 @@ function hasDispatches(event) { return !!event._dispatchListeners; } -/* eslint valid-typeof: 0 */ +var assign = Object.assign; + var EVENT_POOL_SIZE = 10; /** * @interface Event @@ -686,7 +687,7 @@ function SyntheticEvent( return this; } -Object.assign(SyntheticEvent.prototype, { +assign(SyntheticEvent.prototype, { preventDefault: function() { this.defaultPrevented = true; var event = this.nativeEvent; @@ -816,10 +817,10 @@ SyntheticEvent.extend = function(Interface) { return Super.apply(this, arguments); } - Object.assign(prototype, Class.prototype); + assign(prototype, Class.prototype); Class.prototype = prototype; Class.prototype.constructor = Class; - Class.Interface = Object.assign({}, Super.Interface, Interface); + Class.Interface = assign({}, Super.Interface, Interface); Class.extend = Super.extend; addEventPoolingTo(Class); return Class; @@ -2596,50 +2597,26 @@ function set(key, value) { // ATTENTION // When adding new symbols to this file, // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' -// The Symbol used to tag the ReactElement-like types. If there is no native Symbol -// nor polyfill, then a plain number is used for performance. -var REACT_ELEMENT_TYPE = 0xeac7; -var REACT_PORTAL_TYPE = 0xeaca; -var REACT_FRAGMENT_TYPE = 0xeacb; -var REACT_STRICT_MODE_TYPE = 0xeacc; -var REACT_PROFILER_TYPE = 0xead2; -var REACT_PROVIDER_TYPE = 0xeacd; -var REACT_CONTEXT_TYPE = 0xeace; -var REACT_FORWARD_REF_TYPE = 0xead0; -var REACT_SUSPENSE_TYPE = 0xead1; -var REACT_SUSPENSE_LIST_TYPE = 0xead8; -var REACT_MEMO_TYPE = 0xead3; -var REACT_LAZY_TYPE = 0xead4; -var REACT_SCOPE_TYPE = 0xead7; -var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1; -var REACT_OFFSCREEN_TYPE = 0xeae2; -var REACT_LEGACY_HIDDEN_TYPE = 0xeae3; -var REACT_CACHE_TYPE = 0xeae4; -var REACT_TRACING_MARKER_TYPE = 0xeae5; - -if (typeof Symbol === "function" && Symbol.for) { - var symbolFor = Symbol.for; - REACT_ELEMENT_TYPE = symbolFor("react.element"); - REACT_PORTAL_TYPE = symbolFor("react.portal"); - REACT_FRAGMENT_TYPE = symbolFor("react.fragment"); - REACT_STRICT_MODE_TYPE = symbolFor("react.strict_mode"); - REACT_PROFILER_TYPE = symbolFor("react.profiler"); - REACT_PROVIDER_TYPE = symbolFor("react.provider"); - REACT_CONTEXT_TYPE = symbolFor("react.context"); - REACT_FORWARD_REF_TYPE = symbolFor("react.forward_ref"); - REACT_SUSPENSE_TYPE = symbolFor("react.suspense"); - REACT_SUSPENSE_LIST_TYPE = symbolFor("react.suspense_list"); - REACT_MEMO_TYPE = symbolFor("react.memo"); - REACT_LAZY_TYPE = symbolFor("react.lazy"); - REACT_SCOPE_TYPE = symbolFor("react.scope"); - REACT_DEBUG_TRACING_MODE_TYPE = symbolFor("react.debug_trace_mode"); - REACT_OFFSCREEN_TYPE = symbolFor("react.offscreen"); - REACT_LEGACY_HIDDEN_TYPE = symbolFor("react.legacy_hidden"); - REACT_CACHE_TYPE = symbolFor("react.cache"); - REACT_TRACING_MARKER_TYPE = symbolFor("react.tracing_marker"); -} - -var MAYBE_ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator; +// The Symbol used to tag the ReactElement-like types. +var REACT_ELEMENT_TYPE = Symbol.for("react.element"); +var REACT_PORTAL_TYPE = Symbol.for("react.portal"); +var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"); +var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"); +var REACT_PROFILER_TYPE = Symbol.for("react.profiler"); +var REACT_PROVIDER_TYPE = Symbol.for("react.provider"); +var REACT_CONTEXT_TYPE = Symbol.for("react.context"); +var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"); +var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"); +var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"); +var REACT_MEMO_TYPE = Symbol.for("react.memo"); +var REACT_LAZY_TYPE = Symbol.for("react.lazy"); +var REACT_SCOPE_TYPE = Symbol.for("react.scope"); +var REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"); +var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"); +var REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"); +var REACT_CACHE_TYPE = Symbol.for("react.cache"); +var REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker"); +var MAYBE_ITERATOR_SYMBOL = Symbol.iterator; var FAUX_ITERATOR_SYMBOL = "@@iterator"; function getIteratorFn(maybeIterable) { if (maybeIterable === null || typeof maybeIterable !== "object") { @@ -2876,7 +2853,6 @@ var enableProfilerTimer = true; var enableProfilerCommitHooks = true; var enableLazyElements = false; var warnAboutStringRefs = false; -var warnOnSubscriptionInsideStartTransition = false; var enableSuspenseAvoidThisFallback = false; var enableNewReconciler = false; var enableLazyContextPropagation = false; @@ -4009,25 +3985,25 @@ function reenableLogs() { }; // $FlowFixMe Flow thinks console is immutable. Object.defineProperties(console, { - log: Object.assign({}, props, { + log: assign({}, props, { value: prevLog }), - info: Object.assign({}, props, { + info: assign({}, props, { value: prevInfo }), - warn: Object.assign({}, props, { + warn: assign({}, props, { value: prevWarn }), - error: Object.assign({}, props, { + error: assign({}, props, { value: prevError }), - group: Object.assign({}, props, { + group: assign({}, props, { value: prevGroup }), - groupCollapsed: Object.assign({}, props, { + groupCollapsed: assign({}, props, { value: prevGroupCollapsed }), - groupEnd: Object.assign({}, props, { + groupEnd: assign({}, props, { value: prevGroupEnd }) }); @@ -4080,7 +4056,7 @@ function injectInternals(internals) { // Conditionally inject these hooks only if Timeline profiler is supported by this build. // This gives DevTools a way to feature detect that isn't tied to version number // (since profiling and timeline are controlled by different feature flags). - internals = Object.assign({}, internals, { + internals = assign({}, internals, { getLaneLabelMap: getLaneLabelMap, injectProfilingHooks: injectProfilingHooks }); @@ -6142,7 +6118,7 @@ function processChildContext(fiber, type, parentContext) { checkPropTypes(childContextTypes, childContext, "child context", name); } - return Object.assign({}, parentContext, childContext); + return assign({}, parentContext, childContext); } } @@ -6910,7 +6886,7 @@ function checkPropStringCoercion(value, propName) { function resolveDefaultProps(Component, baseProps) { if (Component && Component.defaultProps) { // Resolve default props. Taken from ReactElement - var props = Object.assign({}, baseProps); + var props = assign({}, baseProps); var defaultProps = Component.defaultProps; for (var propName in defaultProps) { @@ -7549,7 +7525,7 @@ function getStateFromUpdate( return prevState; } // Merge the partial state and the previous state. - return Object.assign({}, prevState, partialState); + return assign({}, prevState, partialState); } case ForceUpdate: { @@ -7899,7 +7875,7 @@ function applyDerivedStateFromProps( var memoizedState = partialState === null || partialState === undefined ? prevState - : Object.assign({}, prevState, partialState); + : assign({}, prevState, partialState); workInProgress.memoizedState = memoizedState; // Once the update queue is empty, persist the derived state onto the // base state. @@ -8965,7 +8941,7 @@ function popTreeContext(workInProgress) { } } -var isHydrating = false; // Hydration errors that were thrown inside this boundary +var isHydrating = false; function enterHydrationState(fiber) { { @@ -12106,7 +12082,7 @@ function rerenderDeferredValue(value) { return prevValue; } -function startTransition(setPending, callback) { +function startTransition(setPending, callback, options) { var previousPriority = getCurrentUpdatePriority(); setCurrentUpdatePriority( higherEventPriority(previousPriority, ContinuousEventPriority) @@ -12128,11 +12104,7 @@ function startTransition(setPending, callback) { ReactCurrentBatchConfig$1.transition = prevTransition; { - if ( - prevTransition === null && - warnOnSubscriptionInsideStartTransition && - currentTransition._updatedFibers - ) { + if (prevTransition === null && currentTransition._updatedFibers) { var updatedFibersCount = currentTransition._updatedFibers.size; if (updatedFibersCount > 10) { @@ -12199,7 +12171,7 @@ function mountId() { { // Use a lowercase r prefix for client-generated ids. var globalClientId = globalClientIdCounter++; - id = identifierPrefix + "r:" + globalClientId.toString(32); + id = ":" + identifierPrefix + "r" + globalClientId.toString(32) + ":"; } hook.memoizedState = id; @@ -13937,15 +13909,12 @@ function throwException( } // This is a sync/discrete update. We treat this case like an error // because discrete renders are expected to produce a complete tree // synchronously to maintain consistency with external state. - // TODO: We should never call getComponentNameFromFiber in production. - // Log a warning or something to prevent us from accidentally bundling it. var uncaughtSuspenseError = new Error( - (getComponentNameFromFiber(sourceFiber) || "A React component") + - " suspended while rendering, but no fallback UI was specified.\n" + - "\n" + - "Add a component higher in the tree to " + - "provide a loading indicator or placeholder to display." + "A component suspended while responding to synchronous input. This " + + "will cause the UI to be replaced with a loading indicator. To " + + "fix, updates that suspend should be wrapped " + + "with startTransition." ); // If we're outside a transition, fall through to the regular error path. // The error will be caught by the nearest suspense boundary. @@ -15069,6 +15038,14 @@ function completeWork(current, workInProgress, renderLanes) { return null; } + + case CacheComponent: { + return null; + } + + case TracingMarkerComponent: { + return null; + } } throw new Error( @@ -17662,6 +17639,7 @@ function attemptEarlyBailoutIfNoScheduledUpdate( switch (workInProgress.tag) { case HostRoot: pushHostRootContext(workInProgress); + var root = workInProgress.stateNode; break; case HostComponent: @@ -19000,8 +18978,9 @@ function commitLayoutEffectOnFiber( case IncompleteClassComponent: case ScopeComponent: case OffscreenComponent: - case LegacyHiddenComponent: + case LegacyHiddenComponent: { break; + } default: throw new Error( @@ -19475,12 +19454,12 @@ function commitMutationEffects(root, firstChild, committedLanes) { inProgressLanes = committedLanes; inProgressRoot = root; nextEffect = firstChild; - commitMutationEffects_begin(root); + commitMutationEffects_begin(root, committedLanes); inProgressLanes = null; inProgressRoot = null; } -function commitMutationEffects_begin(root) { +function commitMutationEffects_begin(root, lanes) { while (nextEffect !== null) { var fiber = nextEffect; // TODO: Should wrap this in flags check, too, as optimization @@ -19505,18 +19484,18 @@ function commitMutationEffects_begin(root) { ensureCorrectReturnPointer(child, fiber); nextEffect = child; } else { - commitMutationEffects_complete(root); + commitMutationEffects_complete(root, lanes); } } } -function commitMutationEffects_complete(root) { +function commitMutationEffects_complete(root, lanes) { while (nextEffect !== null) { var fiber = nextEffect; setCurrentFiber(fiber); try { - commitMutationEffectsOnFiber(fiber, root); + commitMutationEffectsOnFiber(fiber, root, lanes); } catch (error) { reportUncaughtErrorInDEV(error); captureCommitPhaseError(fiber, fiber.return, error); @@ -19535,7 +19514,7 @@ function commitMutationEffects_complete(root) { } } -function commitMutationEffectsOnFiber(finishedWork, root) { +function commitMutationEffectsOnFiber(finishedWork, root, lanes) { // TODO: The factoring of this phase could probably be improved. Consider // switching on the type of work before checking the flags. That's what // we do in all the other phases. I think this one is only different @@ -20083,12 +20062,12 @@ var TEST_NAME_TYPE = 3; var TEXT_TYPE = 4; if (typeof Symbol === "function" && Symbol.for) { - var symbolFor$1 = Symbol.for; - COMPONENT_TYPE = symbolFor$1("selector.component"); - HAS_PSEUDO_CLASS_TYPE = symbolFor$1("selector.has_pseudo_class"); - ROLE_TYPE = symbolFor$1("selector.role"); - TEST_NAME_TYPE = symbolFor$1("selector.test_id"); - TEXT_TYPE = symbolFor$1("selector.text"); + var symbolFor = Symbol.for; + COMPONENT_TYPE = symbolFor("selector.component"); + HAS_PSEUDO_CLASS_TYPE = symbolFor("selector.has_pseudo_class"); + ROLE_TYPE = symbolFor("selector.role"); + TEST_NAME_TYPE = symbolFor("selector.test_id"); + TEXT_TYPE = symbolFor("selector.text"); } var ReactCurrentActQueue = ReactSharedInternals.ReactCurrentActQueue; @@ -20265,6 +20244,15 @@ function requestUpdateLane(fiber) { var isTransition = requestCurrentTransition() !== NoTransition; if (isTransition) { + if (ReactCurrentBatchConfig$2.transition !== null) { + var transition = ReactCurrentBatchConfig$2.transition; + + if (!transition._updatedFibers) { + transition._updatedFibers = new Set(); + } + + transition._updatedFibers.add(fiber); + } // The algorithm for assigning an update to a lane should be stable for all // updates at the same priority within the same event. To do this, the // inputs to the algorithm must be the same. // @@ -21327,7 +21315,6 @@ function renderRootSync(root, lanes) { movePendingFibersToMemoized(root, lanes); } } - prepareFreshStack(root, lanes); } @@ -21396,7 +21383,6 @@ function renderRootConcurrent(root, lanes) { movePendingFibersToMemoized(root, lanes); } } - resetRenderTimer(); prepareFreshStack(root, lanes); } @@ -21996,7 +21982,11 @@ function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error$1) { return; } - var fiber = nearestMountedAncestor; + var fiber = null; + + { + fiber = sourceFiber.return; + } while (fiber !== null) { if (fiber.tag === HostRoot) { @@ -22030,9 +22020,14 @@ function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error$1) { } { + // TODO: Until we re-land skipUnmountedBoundaries (see #20147), this warning + // will fire for errors that are thrown by destroy functions inside deleted + // trees. What it should instead do is propagate the error to the parent of + // the deleted tree. In the meantime, do not add this warning to the + // allowlist; this is only for our internal use. error( "Internal React error: Attempted to capture a commit phase error " + - "inside a detached tree. This indicates a bug in React. Potential " + + "inside a detached tree. This indicates a bug in React. Likely " + "causes include deleting the same fiber more than once, committing an " + "already-finished tree, or an inconsistent return pointer.\n\n" + "Error message:\n\n%s", @@ -23666,7 +23661,7 @@ function FiberRootNode( this.memoizedUpdaters = new Set(); var pendingUpdatersLaneMap = (this.pendingUpdatersLaneMap = []); - for (var i = 0; i < TotalLanes; i++) { + for (var _i = 0; _i < TotalLanes; _i++) { pendingUpdatersLaneMap.push(new Set()); } } @@ -23717,7 +23712,9 @@ function createFiberRoot( { var _initialState = { - element: null + element: null, + cache: null, + transitions: null }; uninitializedFiber.memoizedState = _initialState; } @@ -23726,7 +23723,7 @@ function createFiberRoot( return root; } -var ReactVersion = "18.0.0-rc.0-4de99b3ca-20220221"; +var ReactVersion = "18.0.0-rc.1-17806594c-20220301"; function createPortal( children, @@ -23980,7 +23977,7 @@ var setSuspenseHandler = null; { var copyWithDeleteImpl = function(obj, path, index) { var key = path[index]; - var updated = isArray(obj) ? obj.slice() : Object.assign({}, obj); + var updated = isArray(obj) ? obj.slice() : assign({}, obj); if (index + 1 === path.length) { if (isArray(updated)) { @@ -24002,7 +23999,7 @@ var setSuspenseHandler = null; var copyWithRenameImpl = function(obj, oldPath, newPath, index) { var oldKey = oldPath[index]; - var updated = isArray(obj) ? obj.slice() : Object.assign({}, obj); + var updated = isArray(obj) ? obj.slice() : assign({}, obj); if (index + 1 === oldPath.length) { var newKey = newPath[index]; // $FlowFixMe number or string is fine here @@ -24054,7 +24051,7 @@ var setSuspenseHandler = null; } var key = path[index]; - var updated = isArray(obj) ? obj.slice() : Object.assign({}, obj); // $FlowFixMe number or string is fine here + var updated = isArray(obj) ? obj.slice() : assign({}, obj); // $FlowFixMe number or string is fine here updated[key] = copyWithSetImpl(obj[key], path, index + 1, value); return updated; @@ -24089,7 +24086,7 @@ var setSuspenseHandler = null; // As a result though, React will see the scheduled update as a noop and bailout. // Shallow cloning props works as a workaround for now to bypass the bailout check. - fiber.memoizedProps = Object.assign({}, fiber.memoizedProps); + fiber.memoizedProps = assign({}, fiber.memoizedProps); scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp); } }; @@ -24106,7 +24103,7 @@ var setSuspenseHandler = null; // As a result though, React will see the scheduled update as a noop and bailout. // Shallow cloning props works as a workaround for now to bypass the bailout check. - fiber.memoizedProps = Object.assign({}, fiber.memoizedProps); + fiber.memoizedProps = assign({}, fiber.memoizedProps); scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp); } }; @@ -24123,7 +24120,7 @@ var setSuspenseHandler = null; // As a result though, React will see the scheduled update as a noop and bailout. // Shallow cloning props works as a workaround for now to bypass the bailout check. - fiber.memoizedProps = Object.assign({}, fiber.memoizedProps); + fiber.memoizedProps = assign({}, fiber.memoizedProps); scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp); } }; // Support DevTools props for function components, forwardRef, memo, host components, etc. @@ -24405,7 +24402,7 @@ var getInspectorDataForViewAtPoint; function(internalInstanceHandle) { if (internalInstanceHandle == null) { callback( - Object.assign( + assign( { pointerY: locationY, frame: { @@ -24432,7 +24429,7 @@ var getInspectorDataForViewAtPoint; closestInstance ); callback( - Object.assign({}, inspectorData, { + assign({}, inspectorData, { pointerY: locationY, frame: { left: pageX, @@ -24457,7 +24454,7 @@ var getInspectorDataForViewAtPoint; getInstanceFromTag(nativeViewTag) ); callback( - Object.assign({}, inspectorData, { + assign({}, inspectorData, { pointerY: locationY, frame: { left: left, diff --git a/Libraries/Renderer/implementations/ReactFabric-prod.fb.js b/Libraries/Renderer/implementations/ReactFabric-prod.fb.js index 9c9d4e2cc67258..75a8da3ddb6271 100644 --- a/Libraries/Renderer/implementations/ReactFabric-prod.fb.js +++ b/Libraries/Renderer/implementations/ReactFabric-prod.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<9d64ad4ce3ec89212953470f0d425676>> + * @generated SignedSource<<7389c5406141344364bedc0bb9bbd92e>> */ "use strict"; @@ -87,6 +87,7 @@ function executeDirectDispatch(event) { event._dispatchInstances = null; return dispatchListener; } +var assign = Object.assign; function functionThatReturnsTrue() { return !0; } @@ -119,7 +120,7 @@ function SyntheticEvent( this.isPropagationStopped = functionThatReturnsFalse; return this; } -Object.assign(SyntheticEvent.prototype, { +assign(SyntheticEvent.prototype, { preventDefault: function() { this.defaultPrevented = !0; var event = this.nativeEvent; @@ -173,10 +174,10 @@ SyntheticEvent.extend = function(Interface) { var Super = this; E.prototype = Super.prototype; var prototype = new E(); - Object.assign(prototype, Class.prototype); + assign(prototype, Class.prototype); Class.prototype = prototype; Class.prototype.constructor = Class; - Class.Interface = Object.assign({}, Super.Interface, Interface); + Class.Interface = assign({}, Super.Interface, Interface); Class.extend = Super.extend; addEventPoolingTo(Class); return Class; @@ -1028,45 +1029,25 @@ ResponderEventPlugin.injection.injectGlobalResponderHandler({ }); var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, - REACT_ELEMENT_TYPE = 60103, - REACT_PORTAL_TYPE = 60106, - REACT_FRAGMENT_TYPE = 60107, - REACT_STRICT_MODE_TYPE = 60108, - REACT_PROFILER_TYPE = 60114, - REACT_PROVIDER_TYPE = 60109, - REACT_CONTEXT_TYPE = 60110, - REACT_FORWARD_REF_TYPE = 60112, - REACT_SUSPENSE_TYPE = 60113, - REACT_SUSPENSE_LIST_TYPE = 60120, - REACT_MEMO_TYPE = 60115, - REACT_LAZY_TYPE = 60116, - REACT_DEBUG_TRACING_MODE_TYPE = 60129, - REACT_OFFSCREEN_TYPE = 60130, - REACT_LEGACY_HIDDEN_TYPE = 60131, - REACT_CACHE_TYPE = 60132, - REACT_TRACING_MARKER_TYPE = 60133; -if ("function" === typeof Symbol && Symbol.for) { - var symbolFor = Symbol.for; - REACT_ELEMENT_TYPE = symbolFor("react.element"); - REACT_PORTAL_TYPE = symbolFor("react.portal"); - REACT_FRAGMENT_TYPE = symbolFor("react.fragment"); - REACT_STRICT_MODE_TYPE = symbolFor("react.strict_mode"); - REACT_PROFILER_TYPE = symbolFor("react.profiler"); - REACT_PROVIDER_TYPE = symbolFor("react.provider"); - REACT_CONTEXT_TYPE = symbolFor("react.context"); - REACT_FORWARD_REF_TYPE = symbolFor("react.forward_ref"); - REACT_SUSPENSE_TYPE = symbolFor("react.suspense"); - REACT_SUSPENSE_LIST_TYPE = symbolFor("react.suspense_list"); - REACT_MEMO_TYPE = symbolFor("react.memo"); - REACT_LAZY_TYPE = symbolFor("react.lazy"); - symbolFor("react.scope"); - REACT_DEBUG_TRACING_MODE_TYPE = symbolFor("react.debug_trace_mode"); - REACT_OFFSCREEN_TYPE = symbolFor("react.offscreen"); - REACT_LEGACY_HIDDEN_TYPE = symbolFor("react.legacy_hidden"); - REACT_CACHE_TYPE = symbolFor("react.cache"); - REACT_TRACING_MARKER_TYPE = symbolFor("react.tracing_marker"); -} -var MAYBE_ITERATOR_SYMBOL = "function" === typeof Symbol && Symbol.iterator; + REACT_ELEMENT_TYPE = Symbol.for("react.element"), + REACT_PORTAL_TYPE = Symbol.for("react.portal"), + REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), + REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), + REACT_PROFILER_TYPE = Symbol.for("react.profiler"), + REACT_PROVIDER_TYPE = Symbol.for("react.provider"), + REACT_CONTEXT_TYPE = Symbol.for("react.context"), + REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), + REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), + REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), + REACT_MEMO_TYPE = Symbol.for("react.memo"), + REACT_LAZY_TYPE = Symbol.for("react.lazy"); +Symbol.for("react.scope"); +var REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"), + REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), + REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"), + REACT_CACHE_TYPE = Symbol.for("react.cache"), + REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker"), + MAYBE_ITERATOR_SYMBOL = Symbol.iterator; function getIteratorFn(maybeIterable) { if (null === maybeIterable || "object" !== typeof maybeIterable) return null; maybeIterable = @@ -2053,7 +2034,7 @@ function processChildContext(fiber, type, parentContext) { contextKey + '" is not defined in childContextTypes.' ); - return Object.assign({}, parentContext, instance); + return assign({}, parentContext, instance); } function pushContextProvider(workInProgress) { workInProgress = @@ -2163,7 +2144,7 @@ function describeFiber(fiber) { } function resolveDefaultProps(Component, baseProps) { if (Component && Component.defaultProps) { - baseProps = Object.assign({}, baseProps); + baseProps = assign({}, baseProps); Component = Component.defaultProps; for (var propName in Component) void 0 === baseProps[propName] && @@ -2408,7 +2389,7 @@ function processUpdateQueue( ? workInProgress.call(updateEventTime, newState, updateLane) : workInProgress; if (null === updateLane || void 0 === updateLane) break a; - newState = Object.assign({}, newState, updateLane); + newState = assign({}, newState, updateLane); break a; case 2: hasForceUpdate = !0; @@ -2495,7 +2476,7 @@ function applyDerivedStateFromProps( getDerivedStateFromProps = null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps ? ctor - : Object.assign({}, ctor, getDerivedStateFromProps); + : assign({}, ctor, getDerivedStateFromProps); workInProgress.memoizedState = getDerivedStateFromProps; 0 === workInProgress.lanes && (workInProgress.updateQueue.baseState = getDerivedStateFromProps); @@ -4110,7 +4091,8 @@ var ContextOnlyDispatcher = { var hook = mountWorkInProgressHook(), identifierPrefix = workInProgressRoot.identifierPrefix, globalClientId = globalClientIdCounter++; - identifierPrefix = identifierPrefix + "r:" + globalClientId.toString(32); + identifierPrefix = + ":" + identifierPrefix + "r" + globalClientId.toString(32) + ":"; return (hook.memoizedState = identifierPrefix); }, unstable_isNewReconciler: !1 @@ -4792,6 +4774,10 @@ function completeWork(current, workInProgress, renderLanes) { : bubbleProperties(workInProgress), null ); + case 24: + return null; + case 25: + return null; } throw Error( "Unknown unit of work tag (" + @@ -6869,8 +6855,7 @@ function handleError(root$jscomp$0, thrownValue) { break a; } value = Error( - (getComponentNameFromFiber(sourceFiber) || "A React component") + - " suspended while rendering, but no fallback UI was specified.\n\nAdd a component higher in the tree to provide a loading indicator or placeholder to display." + "A component suspended while responding to synchronous input. This will cause the UI to be replaced with a loading indicator. To fix, updates that suspend should be wrapped with startTransition." ); } } @@ -7081,7 +7066,7 @@ function commitRootImpl(root, recoverableErrors, renderPriorityLevel) { executionContext |= 4; ReactCurrentOwner$2.current = null; commitBeforeMutationEffects(root, finishedWork); - commitMutationEffects(root, finishedWork); + commitMutationEffects(root, finishedWork, lanes); root.current = finishedWork; commitLayoutEffects(finishedWork, root, lanes); requestPaint(); @@ -7280,7 +7265,11 @@ function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error) { if (3 === sourceFiber.tag) captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error); else - for (; null !== nearestMountedAncestor; ) { + for ( + nearestMountedAncestor = sourceFiber.return; + null !== nearestMountedAncestor; + + ) { if (3 === nearestMountedAncestor.tag) { captureCommitPhaseErrorOnRoot( nearestMountedAncestor, @@ -8208,10 +8197,10 @@ batchedUpdatesImpl = function(fn, a) { } }; var roots = new Map(), - devToolsConfig$jscomp$inline_930 = { + devToolsConfig$jscomp$inline_932 = { findFiberByHostInstance: getInstanceFromInstance, bundleType: 0, - version: "18.0.0-rc.0-4de99b3ca-20220221", + version: "18.0.0-rc.1-17806594c-20220301", rendererPackageName: "react-native-renderer", rendererConfig: { getInspectorDataForViewTag: function() { @@ -8226,11 +8215,11 @@ var roots = new Map(), }.bind(null, findNodeHandle) } }; -var internals$jscomp$inline_1178 = { - bundleType: devToolsConfig$jscomp$inline_930.bundleType, - version: devToolsConfig$jscomp$inline_930.version, - rendererPackageName: devToolsConfig$jscomp$inline_930.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_930.rendererConfig, +var internals$jscomp$inline_1181 = { + bundleType: devToolsConfig$jscomp$inline_932.bundleType, + version: devToolsConfig$jscomp$inline_932.version, + rendererPackageName: devToolsConfig$jscomp$inline_932.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_932.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -8246,26 +8235,26 @@ var internals$jscomp$inline_1178 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_930.findFiberByHostInstance || + devToolsConfig$jscomp$inline_932.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.0.0-rc.0-4de99b3ca-20220221" + reconcilerVersion: "18.0.0-rc.1-17806594c-20220301" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1179 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1182 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1179.isDisabled && - hook$jscomp$inline_1179.supportsFiber + !hook$jscomp$inline_1182.isDisabled && + hook$jscomp$inline_1182.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1179.inject( - internals$jscomp$inline_1178 + (rendererID = hook$jscomp$inline_1182.inject( + internals$jscomp$inline_1181 )), - (injectedHook = hook$jscomp$inline_1179); + (injectedHook = hook$jscomp$inline_1182); } catch (err) {} } exports.createPortal = function(children, containerTag) { @@ -8315,7 +8304,7 @@ exports.render = function(element, containerTag, callback, concurrentRoot) { (root = createFiber(3, null, null, 1 === root ? 1 : 0)), (concurrentRoot.current = root), (root.stateNode = concurrentRoot), - (root.memoizedState = { element: null }), + (root.memoizedState = { element: null, cache: null, transitions: null }), initializeUpdateQueue(root), (root = concurrentRoot), roots.set(containerTag, root)); diff --git a/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js b/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js index a387877055742e..083e36592307a1 100644 --- a/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js +++ b/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<5ba9e2059ecc2a06c22933fa3c732fc7>> + * @generated SignedSource<> */ @@ -98,6 +98,7 @@ function executeDirectDispatch(event) { event._dispatchInstances = null; return dispatchListener; } +var assign = Object.assign; function functionThatReturnsTrue() { return !0; } @@ -130,7 +131,7 @@ function SyntheticEvent( this.isPropagationStopped = functionThatReturnsFalse; return this; } -Object.assign(SyntheticEvent.prototype, { +assign(SyntheticEvent.prototype, { preventDefault: function() { this.defaultPrevented = !0; var event = this.nativeEvent; @@ -184,10 +185,10 @@ SyntheticEvent.extend = function(Interface) { var Super = this; E.prototype = Super.prototype; var prototype = new E(); - Object.assign(prototype, Class.prototype); + assign(prototype, Class.prototype); Class.prototype = prototype; Class.prototype.constructor = Class; - Class.Interface = Object.assign({}, Super.Interface, Interface); + Class.Interface = assign({}, Super.Interface, Interface); Class.extend = Super.extend; addEventPoolingTo(Class); return Class; @@ -1039,45 +1040,25 @@ ResponderEventPlugin.injection.injectGlobalResponderHandler({ }); var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, - REACT_ELEMENT_TYPE = 60103, - REACT_PORTAL_TYPE = 60106, - REACT_FRAGMENT_TYPE = 60107, - REACT_STRICT_MODE_TYPE = 60108, - REACT_PROFILER_TYPE = 60114, - REACT_PROVIDER_TYPE = 60109, - REACT_CONTEXT_TYPE = 60110, - REACT_FORWARD_REF_TYPE = 60112, - REACT_SUSPENSE_TYPE = 60113, - REACT_SUSPENSE_LIST_TYPE = 60120, - REACT_MEMO_TYPE = 60115, - REACT_LAZY_TYPE = 60116, - REACT_DEBUG_TRACING_MODE_TYPE = 60129, - REACT_OFFSCREEN_TYPE = 60130, - REACT_LEGACY_HIDDEN_TYPE = 60131, - REACT_CACHE_TYPE = 60132, - REACT_TRACING_MARKER_TYPE = 60133; -if ("function" === typeof Symbol && Symbol.for) { - var symbolFor = Symbol.for; - REACT_ELEMENT_TYPE = symbolFor("react.element"); - REACT_PORTAL_TYPE = symbolFor("react.portal"); - REACT_FRAGMENT_TYPE = symbolFor("react.fragment"); - REACT_STRICT_MODE_TYPE = symbolFor("react.strict_mode"); - REACT_PROFILER_TYPE = symbolFor("react.profiler"); - REACT_PROVIDER_TYPE = symbolFor("react.provider"); - REACT_CONTEXT_TYPE = symbolFor("react.context"); - REACT_FORWARD_REF_TYPE = symbolFor("react.forward_ref"); - REACT_SUSPENSE_TYPE = symbolFor("react.suspense"); - REACT_SUSPENSE_LIST_TYPE = symbolFor("react.suspense_list"); - REACT_MEMO_TYPE = symbolFor("react.memo"); - REACT_LAZY_TYPE = symbolFor("react.lazy"); - symbolFor("react.scope"); - REACT_DEBUG_TRACING_MODE_TYPE = symbolFor("react.debug_trace_mode"); - REACT_OFFSCREEN_TYPE = symbolFor("react.offscreen"); - REACT_LEGACY_HIDDEN_TYPE = symbolFor("react.legacy_hidden"); - REACT_CACHE_TYPE = symbolFor("react.cache"); - REACT_TRACING_MARKER_TYPE = symbolFor("react.tracing_marker"); -} -var MAYBE_ITERATOR_SYMBOL = "function" === typeof Symbol && Symbol.iterator; + REACT_ELEMENT_TYPE = Symbol.for("react.element"), + REACT_PORTAL_TYPE = Symbol.for("react.portal"), + REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), + REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), + REACT_PROFILER_TYPE = Symbol.for("react.profiler"), + REACT_PROVIDER_TYPE = Symbol.for("react.provider"), + REACT_CONTEXT_TYPE = Symbol.for("react.context"), + REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), + REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), + REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), + REACT_MEMO_TYPE = Symbol.for("react.memo"), + REACT_LAZY_TYPE = Symbol.for("react.lazy"); +Symbol.for("react.scope"); +var REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"), + REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), + REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"), + REACT_CACHE_TYPE = Symbol.for("react.cache"), + REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker"), + MAYBE_ITERATOR_SYMBOL = Symbol.iterator; function getIteratorFn(maybeIterable) { if (null === maybeIterable || "object" !== typeof maybeIterable) return null; maybeIterable = @@ -2180,7 +2161,7 @@ function processChildContext(fiber, type, parentContext) { contextKey + '" is not defined in childContextTypes.' ); - return Object.assign({}, parentContext, instance); + return assign({}, parentContext, instance); } function pushContextProvider(workInProgress) { workInProgress = @@ -2290,7 +2271,7 @@ function describeFiber(fiber) { } function resolveDefaultProps(Component, baseProps) { if (Component && Component.defaultProps) { - baseProps = Object.assign({}, baseProps); + baseProps = assign({}, baseProps); Component = Component.defaultProps; for (var propName in Component) void 0 === baseProps[propName] && @@ -2535,7 +2516,7 @@ function processUpdateQueue( ? workInProgress.call(updateEventTime, newState, updateLane) : workInProgress; if (null === updateLane || void 0 === updateLane) break a; - newState = Object.assign({}, newState, updateLane); + newState = assign({}, newState, updateLane); break a; case 2: hasForceUpdate = !0; @@ -2622,7 +2603,7 @@ function applyDerivedStateFromProps( getDerivedStateFromProps = null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps ? ctor - : Object.assign({}, ctor, getDerivedStateFromProps); + : assign({}, ctor, getDerivedStateFromProps); workInProgress.memoizedState = getDerivedStateFromProps; 0 === workInProgress.lanes && (workInProgress.updateQueue.baseState = getDerivedStateFromProps); @@ -4244,7 +4225,8 @@ var ContextOnlyDispatcher = { var hook = mountWorkInProgressHook(), identifierPrefix = workInProgressRoot.identifierPrefix, globalClientId = globalClientIdCounter++; - identifierPrefix = identifierPrefix + "r:" + globalClientId.toString(32); + identifierPrefix = + ":" + identifierPrefix + "r" + globalClientId.toString(32) + ":"; return (hook.memoizedState = identifierPrefix); }, unstable_isNewReconciler: !1 @@ -5034,6 +5016,10 @@ function completeWork(current, workInProgress, renderLanes) { : bubbleProperties(workInProgress), null ); + case 24: + return null; + case 25: + return null; } throw Error( "Unknown unit of work tag (" + @@ -7367,8 +7353,7 @@ function handleError(root, thrownValue) { break a; } value = Error( - (getComponentNameFromFiber(sourceFiber) || "A React component") + - " suspended while rendering, but no fallback UI was specified.\n\nAdd a component higher in the tree to provide a loading indicator or placeholder to display." + "A component suspended while responding to synchronous input. This will cause the UI to be replaced with a loading indicator. To fix, updates that suspend should be wrapped with startTransition." ); } } @@ -7896,7 +7881,11 @@ function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error) { if (3 === sourceFiber.tag) captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error); else - for (; null !== nearestMountedAncestor; ) { + for ( + nearestMountedAncestor = sourceFiber.return; + null !== nearestMountedAncestor; + + ) { if (3 === nearestMountedAncestor.tag) { captureCommitPhaseErrorOnRoot( nearestMountedAncestor, @@ -8853,10 +8842,10 @@ batchedUpdatesImpl = function(fn, a) { } }; var roots = new Map(), - devToolsConfig$jscomp$inline_1007 = { + devToolsConfig$jscomp$inline_1009 = { findFiberByHostInstance: getInstanceFromInstance, bundleType: 0, - version: "18.0.0-rc.0-4de99b3ca-20220221", + version: "18.0.0-rc.1-17806594c-20220301", rendererPackageName: "react-native-renderer", rendererConfig: { getInspectorDataForViewTag: function() { @@ -8876,7 +8865,7 @@ var roots = new Map(), var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__; if (hook.isDisabled || !hook.supportsFiber) return !0; try { - (internals = Object.assign({}, internals, { + (internals = assign({}, internals, { getLaneLabelMap: getLaneLabelMap, injectProfilingHooks: injectProfilingHooks })), @@ -8885,10 +8874,10 @@ var roots = new Map(), } catch (err) {} return hook.checkDCE ? !0 : !1; })({ - bundleType: devToolsConfig$jscomp$inline_1007.bundleType, - version: devToolsConfig$jscomp$inline_1007.version, - rendererPackageName: devToolsConfig$jscomp$inline_1007.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1007.rendererConfig, + bundleType: devToolsConfig$jscomp$inline_1009.bundleType, + version: devToolsConfig$jscomp$inline_1009.version, + rendererPackageName: devToolsConfig$jscomp$inline_1009.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1009.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -8904,14 +8893,14 @@ var roots = new Map(), return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1007.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1009.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.0.0-rc.0-4de99b3ca-20220221" + reconcilerVersion: "18.0.0-rc.1-17806594c-20220301" }); exports.createPortal = function(children, containerTag) { return createPortal( @@ -8962,7 +8951,7 @@ exports.render = function(element, containerTag, callback, concurrentRoot) { (root = createFiber(3, null, null, root)), (concurrentRoot.current = root), (root.stateNode = concurrentRoot), - (root.memoizedState = { element: null }), + (root.memoizedState = { element: null, cache: null, transitions: null }), initializeUpdateQueue(root), (root = concurrentRoot), roots.set(containerTag, root)); diff --git a/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js b/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js index 7d4b813f6e1cc7..0ea8e1d92c8693 100644 --- a/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js +++ b/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<352e7339901c7a326f6e97b0faea7ffa>> + * @generated SignedSource<> */ 'use strict'; @@ -577,7 +577,8 @@ function hasDispatches(event) { return !!event._dispatchListeners; } -/* eslint valid-typeof: 0 */ +var assign = Object.assign; + var EVENT_POOL_SIZE = 10; /** * @interface Event @@ -686,7 +687,7 @@ function SyntheticEvent( return this; } -Object.assign(SyntheticEvent.prototype, { +assign(SyntheticEvent.prototype, { preventDefault: function() { this.defaultPrevented = true; var event = this.nativeEvent; @@ -816,10 +817,10 @@ SyntheticEvent.extend = function(Interface) { return Super.apply(this, arguments); } - Object.assign(prototype, Class.prototype); + assign(prototype, Class.prototype); Class.prototype = prototype; Class.prototype.constructor = Class; - Class.Interface = Object.assign({}, Super.Interface, Interface); + Class.Interface = assign({}, Super.Interface, Interface); Class.extend = Super.extend; addEventPoolingTo(Class); return Class; @@ -2884,50 +2885,26 @@ function set(key, value) { // ATTENTION // When adding new symbols to this file, // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' -// The Symbol used to tag the ReactElement-like types. If there is no native Symbol -// nor polyfill, then a plain number is used for performance. -var REACT_ELEMENT_TYPE = 0xeac7; -var REACT_PORTAL_TYPE = 0xeaca; -var REACT_FRAGMENT_TYPE = 0xeacb; -var REACT_STRICT_MODE_TYPE = 0xeacc; -var REACT_PROFILER_TYPE = 0xead2; -var REACT_PROVIDER_TYPE = 0xeacd; -var REACT_CONTEXT_TYPE = 0xeace; -var REACT_FORWARD_REF_TYPE = 0xead0; -var REACT_SUSPENSE_TYPE = 0xead1; -var REACT_SUSPENSE_LIST_TYPE = 0xead8; -var REACT_MEMO_TYPE = 0xead3; -var REACT_LAZY_TYPE = 0xead4; -var REACT_SCOPE_TYPE = 0xead7; -var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1; -var REACT_OFFSCREEN_TYPE = 0xeae2; -var REACT_LEGACY_HIDDEN_TYPE = 0xeae3; -var REACT_CACHE_TYPE = 0xeae4; -var REACT_TRACING_MARKER_TYPE = 0xeae5; - -if (typeof Symbol === "function" && Symbol.for) { - var symbolFor = Symbol.for; - REACT_ELEMENT_TYPE = symbolFor("react.element"); - REACT_PORTAL_TYPE = symbolFor("react.portal"); - REACT_FRAGMENT_TYPE = symbolFor("react.fragment"); - REACT_STRICT_MODE_TYPE = symbolFor("react.strict_mode"); - REACT_PROFILER_TYPE = symbolFor("react.profiler"); - REACT_PROVIDER_TYPE = symbolFor("react.provider"); - REACT_CONTEXT_TYPE = symbolFor("react.context"); - REACT_FORWARD_REF_TYPE = symbolFor("react.forward_ref"); - REACT_SUSPENSE_TYPE = symbolFor("react.suspense"); - REACT_SUSPENSE_LIST_TYPE = symbolFor("react.suspense_list"); - REACT_MEMO_TYPE = symbolFor("react.memo"); - REACT_LAZY_TYPE = symbolFor("react.lazy"); - REACT_SCOPE_TYPE = symbolFor("react.scope"); - REACT_DEBUG_TRACING_MODE_TYPE = symbolFor("react.debug_trace_mode"); - REACT_OFFSCREEN_TYPE = symbolFor("react.offscreen"); - REACT_LEGACY_HIDDEN_TYPE = symbolFor("react.legacy_hidden"); - REACT_CACHE_TYPE = symbolFor("react.cache"); - REACT_TRACING_MARKER_TYPE = symbolFor("react.tracing_marker"); -} - -var MAYBE_ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator; +// The Symbol used to tag the ReactElement-like types. +var REACT_ELEMENT_TYPE = Symbol.for("react.element"); +var REACT_PORTAL_TYPE = Symbol.for("react.portal"); +var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"); +var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"); +var REACT_PROFILER_TYPE = Symbol.for("react.profiler"); +var REACT_PROVIDER_TYPE = Symbol.for("react.provider"); +var REACT_CONTEXT_TYPE = Symbol.for("react.context"); +var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"); +var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"); +var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"); +var REACT_MEMO_TYPE = Symbol.for("react.memo"); +var REACT_LAZY_TYPE = Symbol.for("react.lazy"); +var REACT_SCOPE_TYPE = Symbol.for("react.scope"); +var REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"); +var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"); +var REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"); +var REACT_CACHE_TYPE = Symbol.for("react.cache"); +var REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker"); +var MAYBE_ITERATOR_SYMBOL = Symbol.iterator; var FAUX_ITERATOR_SYMBOL = "@@iterator"; function getIteratorFn(maybeIterable) { if (maybeIterable === null || typeof maybeIterable !== "object") { @@ -3164,7 +3141,6 @@ var enableProfilerTimer = true; var enableProfilerCommitHooks = true; var enableLazyElements = false; var warnAboutStringRefs = false; -var warnOnSubscriptionInsideStartTransition = false; var enableSuspenseAvoidThisFallback = false; var enableNewReconciler = false; var enableLazyContextPropagation = false; @@ -4225,25 +4201,25 @@ function reenableLogs() { }; // $FlowFixMe Flow thinks console is immutable. Object.defineProperties(console, { - log: Object.assign({}, props, { + log: assign({}, props, { value: prevLog }), - info: Object.assign({}, props, { + info: assign({}, props, { value: prevInfo }), - warn: Object.assign({}, props, { + warn: assign({}, props, { value: prevWarn }), - error: Object.assign({}, props, { + error: assign({}, props, { value: prevError }), - group: Object.assign({}, props, { + group: assign({}, props, { value: prevGroup }), - groupCollapsed: Object.assign({}, props, { + groupCollapsed: assign({}, props, { value: prevGroupCollapsed }), - groupEnd: Object.assign({}, props, { + groupEnd: assign({}, props, { value: prevGroupEnd }) }); @@ -4296,7 +4272,7 @@ function injectInternals(internals) { // Conditionally inject these hooks only if Timeline profiler is supported by this build. // This gives DevTools a way to feature detect that isn't tied to version number // (since profiling and timeline are controlled by different feature flags). - internals = Object.assign({}, internals, { + internals = assign({}, internals, { getLaneLabelMap: getLaneLabelMap, injectProfilingHooks: injectProfilingHooks }); @@ -5539,7 +5515,6 @@ var isSuspenseInstanceFallback = shim$1; var hydrateTextInstance = shim$1; var errorHydratingContainer = shim$1; -// Modules provided by RN: var getViewConfigForType = ReactNativePrivateInterface.ReactNativeViewConfigRegistry.get; var UPDATE_SIGNAL = {}; @@ -5874,7 +5849,7 @@ function hideTextInstance(textInstance) { function unhideInstance(instance, props) { var viewConfig = instance.viewConfig; var updatePayload = diff( - Object.assign({}, props, { + assign({}, props, { style: [ props.style, { @@ -6349,7 +6324,7 @@ function processChildContext(fiber, type, parentContext) { checkPropTypes(childContextTypes, childContext, "child context", name); } - return Object.assign({}, parentContext, childContext); + return assign({}, parentContext, childContext); } } @@ -7117,7 +7092,7 @@ function checkPropStringCoercion(value, propName) { function resolveDefaultProps(Component, baseProps) { if (Component && Component.defaultProps) { // Resolve default props. Taken from ReactElement - var props = Object.assign({}, baseProps); + var props = assign({}, baseProps); var defaultProps = Component.defaultProps; for (var propName in defaultProps) { @@ -7756,7 +7731,7 @@ function getStateFromUpdate( return prevState; } // Merge the partial state and the previous state. - return Object.assign({}, prevState, partialState); + return assign({}, prevState, partialState); } case ForceUpdate: { @@ -8106,7 +8081,7 @@ function applyDerivedStateFromProps( var memoizedState = partialState === null || partialState === undefined ? prevState - : Object.assign({}, prevState, partialState); + : assign({}, prevState, partialState); workInProgress.memoizedState = memoizedState; // Once the update queue is empty, persist the derived state onto the // base state. @@ -9172,7 +9147,7 @@ function popTreeContext(workInProgress) { } } -var isHydrating = false; // Hydration errors that were thrown inside this boundary +var isHydrating = false; function enterHydrationState(fiber) { { @@ -12313,7 +12288,7 @@ function rerenderDeferredValue(value) { return prevValue; } -function startTransition(setPending, callback) { +function startTransition(setPending, callback, options) { var previousPriority = getCurrentUpdatePriority(); setCurrentUpdatePriority( higherEventPriority(previousPriority, ContinuousEventPriority) @@ -12335,11 +12310,7 @@ function startTransition(setPending, callback) { ReactCurrentBatchConfig$1.transition = prevTransition; { - if ( - prevTransition === null && - warnOnSubscriptionInsideStartTransition && - currentTransition._updatedFibers - ) { + if (prevTransition === null && currentTransition._updatedFibers) { var updatedFibersCount = currentTransition._updatedFibers.size; if (updatedFibersCount > 10) { @@ -12406,7 +12377,7 @@ function mountId() { { // Use a lowercase r prefix for client-generated ids. var globalClientId = globalClientIdCounter++; - id = identifierPrefix + "r:" + globalClientId.toString(32); + id = ":" + identifierPrefix + "r" + globalClientId.toString(32) + ":"; } hook.memoizedState = id; @@ -14125,15 +14096,12 @@ function throwException( } // This is a sync/discrete update. We treat this case like an error // because discrete renders are expected to produce a complete tree // synchronously to maintain consistency with external state. - // TODO: We should never call getComponentNameFromFiber in production. - // Log a warning or something to prevent us from accidentally bundling it. var uncaughtSuspenseError = new Error( - (getComponentNameFromFiber(sourceFiber) || "A React component") + - " suspended while rendering, but no fallback UI was specified.\n" + - "\n" + - "Add a component higher in the tree to " + - "provide a loading indicator or placeholder to display." + "A component suspended while responding to synchronous input. This " + + "will cause the UI to be replaced with a loading indicator. To " + + "fix, updates that suspend should be wrapped " + + "with startTransition." ); // If we're outside a transition, fall through to the regular error path. // The error will be caught by the nearest suspense boundary. @@ -15092,6 +15060,14 @@ function completeWork(current, workInProgress, renderLanes) { return null; } + + case CacheComponent: { + return null; + } + + case TracingMarkerComponent: { + return null; + } } throw new Error( @@ -17667,6 +17643,7 @@ function attemptEarlyBailoutIfNoScheduledUpdate( switch (workInProgress.tag) { case HostRoot: pushHostRootContext(workInProgress); + var root = workInProgress.stateNode; break; case HostComponent: @@ -19009,8 +18986,9 @@ function commitLayoutEffectOnFiber( case IncompleteClassComponent: case ScopeComponent: case OffscreenComponent: - case LegacyHiddenComponent: + case LegacyHiddenComponent: { break; + } default: throw new Error( @@ -19845,12 +19823,12 @@ function commitMutationEffects(root, firstChild, committedLanes) { inProgressLanes = committedLanes; inProgressRoot = root; nextEffect = firstChild; - commitMutationEffects_begin(root); + commitMutationEffects_begin(root, committedLanes); inProgressLanes = null; inProgressRoot = null; } -function commitMutationEffects_begin(root) { +function commitMutationEffects_begin(root, lanes) { while (nextEffect !== null) { var fiber = nextEffect; // TODO: Should wrap this in flags check, too, as optimization @@ -19875,18 +19853,18 @@ function commitMutationEffects_begin(root) { ensureCorrectReturnPointer(child, fiber); nextEffect = child; } else { - commitMutationEffects_complete(root); + commitMutationEffects_complete(root, lanes); } } } -function commitMutationEffects_complete(root) { +function commitMutationEffects_complete(root, lanes) { while (nextEffect !== null) { var fiber = nextEffect; setCurrentFiber(fiber); try { - commitMutationEffectsOnFiber(fiber, root); + commitMutationEffectsOnFiber(fiber, root, lanes); } catch (error) { reportUncaughtErrorInDEV(error); captureCommitPhaseError(fiber, fiber.return, error); @@ -19905,7 +19883,7 @@ function commitMutationEffects_complete(root) { } } -function commitMutationEffectsOnFiber(finishedWork, root) { +function commitMutationEffectsOnFiber(finishedWork, root, lanes) { // TODO: The factoring of this phase could probably be improved. Consider // switching on the type of work before checking the flags. That's what // we do in all the other phases. I think this one is only different @@ -20470,12 +20448,12 @@ var TEST_NAME_TYPE = 3; var TEXT_TYPE = 4; if (typeof Symbol === "function" && Symbol.for) { - var symbolFor$1 = Symbol.for; - COMPONENT_TYPE = symbolFor$1("selector.component"); - HAS_PSEUDO_CLASS_TYPE = symbolFor$1("selector.has_pseudo_class"); - ROLE_TYPE = symbolFor$1("selector.role"); - TEST_NAME_TYPE = symbolFor$1("selector.test_id"); - TEXT_TYPE = symbolFor$1("selector.text"); + var symbolFor = Symbol.for; + COMPONENT_TYPE = symbolFor("selector.component"); + HAS_PSEUDO_CLASS_TYPE = symbolFor("selector.has_pseudo_class"); + ROLE_TYPE = symbolFor("selector.role"); + TEST_NAME_TYPE = symbolFor("selector.test_id"); + TEXT_TYPE = symbolFor("selector.text"); } var ReactCurrentActQueue = ReactSharedInternals.ReactCurrentActQueue; @@ -20654,6 +20632,15 @@ function requestUpdateLane(fiber) { var isTransition = requestCurrentTransition() !== NoTransition; if (isTransition) { + if (ReactCurrentBatchConfig$2.transition !== null) { + var transition = ReactCurrentBatchConfig$2.transition; + + if (!transition._updatedFibers) { + transition._updatedFibers = new Set(); + } + + transition._updatedFibers.add(fiber); + } // The algorithm for assigning an update to a lane should be stable for all // updates at the same priority within the same event. To do this, the // inputs to the algorithm must be the same. // @@ -21716,7 +21703,6 @@ function renderRootSync(root, lanes) { movePendingFibersToMemoized(root, lanes); } } - prepareFreshStack(root, lanes); } @@ -21785,7 +21771,6 @@ function renderRootConcurrent(root, lanes) { movePendingFibersToMemoized(root, lanes); } } - resetRenderTimer(); prepareFreshStack(root, lanes); } @@ -22385,7 +22370,11 @@ function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error$1) { return; } - var fiber = nearestMountedAncestor; + var fiber = null; + + { + fiber = sourceFiber.return; + } while (fiber !== null) { if (fiber.tag === HostRoot) { @@ -22419,9 +22408,14 @@ function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error$1) { } { + // TODO: Until we re-land skipUnmountedBoundaries (see #20147), this warning + // will fire for errors that are thrown by destroy functions inside deleted + // trees. What it should instead do is propagate the error to the parent of + // the deleted tree. In the meantime, do not add this warning to the + // allowlist; this is only for our internal use. error( "Internal React error: Attempted to capture a commit phase error " + - "inside a detached tree. This indicates a bug in React. Potential " + + "inside a detached tree. This indicates a bug in React. Likely " + "causes include deleting the same fiber more than once, committing an " + "already-finished tree, or an inconsistent return pointer.\n\n" + "Error message:\n\n%s", @@ -24051,7 +24045,7 @@ function FiberRootNode( this.memoizedUpdaters = new Set(); var pendingUpdatersLaneMap = (this.pendingUpdatersLaneMap = []); - for (var i = 0; i < TotalLanes; i++) { + for (var _i = 0; _i < TotalLanes; _i++) { pendingUpdatersLaneMap.push(new Set()); } } @@ -24102,7 +24096,9 @@ function createFiberRoot( { var _initialState = { - element: null + element: null, + cache: null, + transitions: null }; uninitializedFiber.memoizedState = _initialState; } @@ -24111,7 +24107,7 @@ function createFiberRoot( return root; } -var ReactVersion = "18.0.0-rc.0-4de99b3ca-20220221"; +var ReactVersion = "18.0.0-rc.1-17806594c-20220301"; function createPortal( children, @@ -24365,7 +24361,7 @@ var setSuspenseHandler = null; { var copyWithDeleteImpl = function(obj, path, index) { var key = path[index]; - var updated = isArray(obj) ? obj.slice() : Object.assign({}, obj); + var updated = isArray(obj) ? obj.slice() : assign({}, obj); if (index + 1 === path.length) { if (isArray(updated)) { @@ -24387,7 +24383,7 @@ var setSuspenseHandler = null; var copyWithRenameImpl = function(obj, oldPath, newPath, index) { var oldKey = oldPath[index]; - var updated = isArray(obj) ? obj.slice() : Object.assign({}, obj); + var updated = isArray(obj) ? obj.slice() : assign({}, obj); if (index + 1 === oldPath.length) { var newKey = newPath[index]; // $FlowFixMe number or string is fine here @@ -24439,7 +24435,7 @@ var setSuspenseHandler = null; } var key = path[index]; - var updated = isArray(obj) ? obj.slice() : Object.assign({}, obj); // $FlowFixMe number or string is fine here + var updated = isArray(obj) ? obj.slice() : assign({}, obj); // $FlowFixMe number or string is fine here updated[key] = copyWithSetImpl(obj[key], path, index + 1, value); return updated; @@ -24474,7 +24470,7 @@ var setSuspenseHandler = null; // As a result though, React will see the scheduled update as a noop and bailout. // Shallow cloning props works as a workaround for now to bypass the bailout check. - fiber.memoizedProps = Object.assign({}, fiber.memoizedProps); + fiber.memoizedProps = assign({}, fiber.memoizedProps); scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp); } }; @@ -24491,7 +24487,7 @@ var setSuspenseHandler = null; // As a result though, React will see the scheduled update as a noop and bailout. // Shallow cloning props works as a workaround for now to bypass the bailout check. - fiber.memoizedProps = Object.assign({}, fiber.memoizedProps); + fiber.memoizedProps = assign({}, fiber.memoizedProps); scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp); } }; @@ -24508,7 +24504,7 @@ var setSuspenseHandler = null; // As a result though, React will see the scheduled update as a noop and bailout. // Shallow cloning props works as a workaround for now to bypass the bailout check. - fiber.memoizedProps = Object.assign({}, fiber.memoizedProps); + fiber.memoizedProps = assign({}, fiber.memoizedProps); scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp); } }; // Support DevTools props for function components, forwardRef, memo, host components, etc. @@ -24784,7 +24780,7 @@ var getInspectorDataForViewAtPoint; function(internalInstanceHandle) { if (internalInstanceHandle == null) { callback( - Object.assign( + assign( { pointerY: locationY, frame: { @@ -24811,7 +24807,7 @@ var getInspectorDataForViewAtPoint; closestInstance ); callback( - Object.assign({}, inspectorData, { + assign({}, inspectorData, { pointerY: locationY, frame: { left: pageX, @@ -24836,7 +24832,7 @@ var getInspectorDataForViewAtPoint; getInstanceFromTag(nativeViewTag) ); callback( - Object.assign({}, inspectorData, { + assign({}, inspectorData, { pointerY: locationY, frame: { left: left, diff --git a/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js b/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js index 5b7b2c20947bf5..f2d9eec20b2987 100644 --- a/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js +++ b/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<4999d18c1629b3657b9e8453167861e8>> + * @generated SignedSource<<6651d2ebcfa980e47a4f9e360ac450de>> */ "use strict"; @@ -86,6 +86,7 @@ function executeDirectDispatch(event) { event._dispatchInstances = null; return dispatchListener; } +var assign = Object.assign; function functionThatReturnsTrue() { return !0; } @@ -118,7 +119,7 @@ function SyntheticEvent( this.isPropagationStopped = functionThatReturnsFalse; return this; } -Object.assign(SyntheticEvent.prototype, { +assign(SyntheticEvent.prototype, { preventDefault: function() { this.defaultPrevented = !0; var event = this.nativeEvent; @@ -172,10 +173,10 @@ SyntheticEvent.extend = function(Interface) { var Super = this; E.prototype = Super.prototype; var prototype = new E(); - Object.assign(prototype, Class.prototype); + assign(prototype, Class.prototype); Class.prototype = prototype; Class.prototype.constructor = Class; - Class.Interface = Object.assign({}, Super.Interface, Interface); + Class.Interface = assign({}, Super.Interface, Interface); Class.extend = Super.extend; addEventPoolingTo(Class); return Class; @@ -1131,45 +1132,25 @@ ResponderEventPlugin.injection.injectGlobalResponderHandler({ }); var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, - REACT_ELEMENT_TYPE = 60103, - REACT_PORTAL_TYPE = 60106, - REACT_FRAGMENT_TYPE = 60107, - REACT_STRICT_MODE_TYPE = 60108, - REACT_PROFILER_TYPE = 60114, - REACT_PROVIDER_TYPE = 60109, - REACT_CONTEXT_TYPE = 60110, - REACT_FORWARD_REF_TYPE = 60112, - REACT_SUSPENSE_TYPE = 60113, - REACT_SUSPENSE_LIST_TYPE = 60120, - REACT_MEMO_TYPE = 60115, - REACT_LAZY_TYPE = 60116, - REACT_DEBUG_TRACING_MODE_TYPE = 60129, - REACT_OFFSCREEN_TYPE = 60130, - REACT_LEGACY_HIDDEN_TYPE = 60131, - REACT_CACHE_TYPE = 60132, - REACT_TRACING_MARKER_TYPE = 60133; -if ("function" === typeof Symbol && Symbol.for) { - var symbolFor = Symbol.for; - REACT_ELEMENT_TYPE = symbolFor("react.element"); - REACT_PORTAL_TYPE = symbolFor("react.portal"); - REACT_FRAGMENT_TYPE = symbolFor("react.fragment"); - REACT_STRICT_MODE_TYPE = symbolFor("react.strict_mode"); - REACT_PROFILER_TYPE = symbolFor("react.profiler"); - REACT_PROVIDER_TYPE = symbolFor("react.provider"); - REACT_CONTEXT_TYPE = symbolFor("react.context"); - REACT_FORWARD_REF_TYPE = symbolFor("react.forward_ref"); - REACT_SUSPENSE_TYPE = symbolFor("react.suspense"); - REACT_SUSPENSE_LIST_TYPE = symbolFor("react.suspense_list"); - REACT_MEMO_TYPE = symbolFor("react.memo"); - REACT_LAZY_TYPE = symbolFor("react.lazy"); - symbolFor("react.scope"); - REACT_DEBUG_TRACING_MODE_TYPE = symbolFor("react.debug_trace_mode"); - REACT_OFFSCREEN_TYPE = symbolFor("react.offscreen"); - REACT_LEGACY_HIDDEN_TYPE = symbolFor("react.legacy_hidden"); - REACT_CACHE_TYPE = symbolFor("react.cache"); - REACT_TRACING_MARKER_TYPE = symbolFor("react.tracing_marker"); -} -var MAYBE_ITERATOR_SYMBOL = "function" === typeof Symbol && Symbol.iterator; + REACT_ELEMENT_TYPE = Symbol.for("react.element"), + REACT_PORTAL_TYPE = Symbol.for("react.portal"), + REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), + REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), + REACT_PROFILER_TYPE = Symbol.for("react.profiler"), + REACT_PROVIDER_TYPE = Symbol.for("react.provider"), + REACT_CONTEXT_TYPE = Symbol.for("react.context"), + REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), + REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), + REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), + REACT_MEMO_TYPE = Symbol.for("react.memo"), + REACT_LAZY_TYPE = Symbol.for("react.lazy"); +Symbol.for("react.scope"); +var REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"), + REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), + REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"), + REACT_CACHE_TYPE = Symbol.for("react.cache"), + REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker"), + MAYBE_ITERATOR_SYMBOL = Symbol.iterator; function getIteratorFn(maybeIterable) { if (null === maybeIterable || "object" !== typeof maybeIterable) return null; maybeIterable = @@ -2018,7 +1999,7 @@ function processChildContext(fiber, type, parentContext) { contextKey + '" is not defined in childContextTypes.' ); - return Object.assign({}, parentContext, instance); + return assign({}, parentContext, instance); } function pushContextProvider(workInProgress) { workInProgress = @@ -2140,7 +2121,7 @@ function getStackByFiberInDevAndProd(workInProgress) { } function resolveDefaultProps(Component, baseProps) { if (Component && Component.defaultProps) { - baseProps = Object.assign({}, baseProps); + baseProps = assign({}, baseProps); Component = Component.defaultProps; for (var propName in Component) void 0 === baseProps[propName] && @@ -2385,7 +2366,7 @@ function processUpdateQueue( ? workInProgress.call(updateEventTime, newState, updateLane) : workInProgress; if (null === updateLane || void 0 === updateLane) break a; - newState = Object.assign({}, newState, updateLane); + newState = assign({}, newState, updateLane); break a; case 2: hasForceUpdate = !0; @@ -2472,7 +2453,7 @@ function applyDerivedStateFromProps( getDerivedStateFromProps = null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps ? ctor - : Object.assign({}, ctor, getDerivedStateFromProps); + : assign({}, ctor, getDerivedStateFromProps); workInProgress.memoizedState = getDerivedStateFromProps; 0 === workInProgress.lanes && (workInProgress.updateQueue.baseState = getDerivedStateFromProps); @@ -4087,7 +4068,8 @@ var ContextOnlyDispatcher = { var hook = mountWorkInProgressHook(), identifierPrefix = workInProgressRoot.identifierPrefix, globalClientId = globalClientIdCounter++; - identifierPrefix = identifierPrefix + "r:" + globalClientId.toString(32); + identifierPrefix = + ":" + identifierPrefix + "r" + globalClientId.toString(32) + ":"; return (hook.memoizedState = identifierPrefix); }, unstable_isNewReconciler: !1 @@ -4637,6 +4619,10 @@ function completeWork(current, workInProgress, renderLanes) { : bubbleProperties(workInProgress), null ); + case 24: + return null; + case 25: + return null; } throw Error( "Unknown unit of work tag (" + @@ -6157,7 +6143,7 @@ function commitMutationEffects(root, firstChild) { var instance$jscomp$1 = childToDelete.stateNode, props = childToDelete.memoizedProps, viewConfig$jscomp$0 = instance$jscomp$1.viewConfig, - prevProps = Object.assign({}, props, { + prevProps = assign({}, props, { style: [props.style, { display: "none" }] }); var updatePayload$jscomp$0 = diffProperties( @@ -6959,8 +6945,7 @@ function handleError(root$jscomp$0, thrownValue) { break a; } value = Error( - (getComponentNameFromFiber(sourceFiber) || "A React component") + - " suspended while rendering, but no fallback UI was specified.\n\nAdd a component higher in the tree to provide a loading indicator or placeholder to display." + "A component suspended while responding to synchronous input. This will cause the UI to be replaced with a loading indicator. To fix, updates that suspend should be wrapped with startTransition." ); } } @@ -7171,7 +7156,7 @@ function commitRootImpl(root, recoverableErrors, renderPriorityLevel) { executionContext |= 4; ReactCurrentOwner$2.current = null; commitBeforeMutationEffects(root, finishedWork); - commitMutationEffects(root, finishedWork); + commitMutationEffects(root, finishedWork, lanes); root.current = finishedWork; commitLayoutEffects(finishedWork, root, lanes); requestPaint(); @@ -7370,7 +7355,11 @@ function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error) { if (3 === sourceFiber.tag) captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error); else - for (; null !== nearestMountedAncestor; ) { + for ( + nearestMountedAncestor = sourceFiber.return; + null !== nearestMountedAncestor; + + ) { if (3 === nearestMountedAncestor.tag) { captureCommitPhaseErrorOnRoot( nearestMountedAncestor, @@ -8298,10 +8287,10 @@ batchedUpdatesImpl = function(fn, a) { } }; var roots = new Map(), - devToolsConfig$jscomp$inline_971 = { + devToolsConfig$jscomp$inline_973 = { findFiberByHostInstance: getInstanceFromTag, bundleType: 0, - version: "18.0.0-rc.0-4de99b3ca-20220221", + version: "18.0.0-rc.1-17806594c-20220301", rendererPackageName: "react-native-renderer", rendererConfig: { getInspectorDataForViewTag: function() { @@ -8316,11 +8305,11 @@ var roots = new Map(), }.bind(null, findNodeHandle) } }; -var internals$jscomp$inline_1229 = { - bundleType: devToolsConfig$jscomp$inline_971.bundleType, - version: devToolsConfig$jscomp$inline_971.version, - rendererPackageName: devToolsConfig$jscomp$inline_971.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_971.rendererConfig, +var internals$jscomp$inline_1232 = { + bundleType: devToolsConfig$jscomp$inline_973.bundleType, + version: devToolsConfig$jscomp$inline_973.version, + rendererPackageName: devToolsConfig$jscomp$inline_973.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_973.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -8336,26 +8325,26 @@ var internals$jscomp$inline_1229 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_971.findFiberByHostInstance || + devToolsConfig$jscomp$inline_973.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.0.0-rc.0-4de99b3ca-20220221" + reconcilerVersion: "18.0.0-rc.1-17806594c-20220301" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1230 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1233 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1230.isDisabled && - hook$jscomp$inline_1230.supportsFiber + !hook$jscomp$inline_1233.isDisabled && + hook$jscomp$inline_1233.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1230.inject( - internals$jscomp$inline_1229 + (rendererID = hook$jscomp$inline_1233.inject( + internals$jscomp$inline_1232 )), - (injectedHook = hook$jscomp$inline_1230); + (injectedHook = hook$jscomp$inline_1233); } catch (err) {} } exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = { @@ -8405,7 +8394,11 @@ exports.render = function(element, containerTag, callback) { var JSCompiler_inline_result = createFiber(3, null, null, 0); root.current = JSCompiler_inline_result; JSCompiler_inline_result.stateNode = root; - JSCompiler_inline_result.memoizedState = { element: null }; + JSCompiler_inline_result.memoizedState = { + element: null, + cache: null, + transitions: null + }; initializeUpdateQueue(JSCompiler_inline_result); roots.set(containerTag, root); } diff --git a/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js b/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js index 8a48388f0f6eb5..648012194609fb 100644 --- a/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js +++ b/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<3509fb902c15e4c5d01b428ac9a79cbc>> + * @generated SignedSource<<7974d5af58e80b0a31d749a65d04a0a8>> */ @@ -97,6 +97,7 @@ function executeDirectDispatch(event) { event._dispatchInstances = null; return dispatchListener; } +var assign = Object.assign; function functionThatReturnsTrue() { return !0; } @@ -129,7 +130,7 @@ function SyntheticEvent( this.isPropagationStopped = functionThatReturnsFalse; return this; } -Object.assign(SyntheticEvent.prototype, { +assign(SyntheticEvent.prototype, { preventDefault: function() { this.defaultPrevented = !0; var event = this.nativeEvent; @@ -183,10 +184,10 @@ SyntheticEvent.extend = function(Interface) { var Super = this; E.prototype = Super.prototype; var prototype = new E(); - Object.assign(prototype, Class.prototype); + assign(prototype, Class.prototype); Class.prototype = prototype; Class.prototype.constructor = Class; - Class.Interface = Object.assign({}, Super.Interface, Interface); + Class.Interface = assign({}, Super.Interface, Interface); Class.extend = Super.extend; addEventPoolingTo(Class); return Class; @@ -1142,45 +1143,25 @@ ResponderEventPlugin.injection.injectGlobalResponderHandler({ }); var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, - REACT_ELEMENT_TYPE = 60103, - REACT_PORTAL_TYPE = 60106, - REACT_FRAGMENT_TYPE = 60107, - REACT_STRICT_MODE_TYPE = 60108, - REACT_PROFILER_TYPE = 60114, - REACT_PROVIDER_TYPE = 60109, - REACT_CONTEXT_TYPE = 60110, - REACT_FORWARD_REF_TYPE = 60112, - REACT_SUSPENSE_TYPE = 60113, - REACT_SUSPENSE_LIST_TYPE = 60120, - REACT_MEMO_TYPE = 60115, - REACT_LAZY_TYPE = 60116, - REACT_DEBUG_TRACING_MODE_TYPE = 60129, - REACT_OFFSCREEN_TYPE = 60130, - REACT_LEGACY_HIDDEN_TYPE = 60131, - REACT_CACHE_TYPE = 60132, - REACT_TRACING_MARKER_TYPE = 60133; -if ("function" === typeof Symbol && Symbol.for) { - var symbolFor = Symbol.for; - REACT_ELEMENT_TYPE = symbolFor("react.element"); - REACT_PORTAL_TYPE = symbolFor("react.portal"); - REACT_FRAGMENT_TYPE = symbolFor("react.fragment"); - REACT_STRICT_MODE_TYPE = symbolFor("react.strict_mode"); - REACT_PROFILER_TYPE = symbolFor("react.profiler"); - REACT_PROVIDER_TYPE = symbolFor("react.provider"); - REACT_CONTEXT_TYPE = symbolFor("react.context"); - REACT_FORWARD_REF_TYPE = symbolFor("react.forward_ref"); - REACT_SUSPENSE_TYPE = symbolFor("react.suspense"); - REACT_SUSPENSE_LIST_TYPE = symbolFor("react.suspense_list"); - REACT_MEMO_TYPE = symbolFor("react.memo"); - REACT_LAZY_TYPE = symbolFor("react.lazy"); - symbolFor("react.scope"); - REACT_DEBUG_TRACING_MODE_TYPE = symbolFor("react.debug_trace_mode"); - REACT_OFFSCREEN_TYPE = symbolFor("react.offscreen"); - REACT_LEGACY_HIDDEN_TYPE = symbolFor("react.legacy_hidden"); - REACT_CACHE_TYPE = symbolFor("react.cache"); - REACT_TRACING_MARKER_TYPE = symbolFor("react.tracing_marker"); -} -var MAYBE_ITERATOR_SYMBOL = "function" === typeof Symbol && Symbol.iterator; + REACT_ELEMENT_TYPE = Symbol.for("react.element"), + REACT_PORTAL_TYPE = Symbol.for("react.portal"), + REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), + REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), + REACT_PROFILER_TYPE = Symbol.for("react.profiler"), + REACT_PROVIDER_TYPE = Symbol.for("react.provider"), + REACT_CONTEXT_TYPE = Symbol.for("react.context"), + REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), + REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), + REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), + REACT_MEMO_TYPE = Symbol.for("react.memo"), + REACT_LAZY_TYPE = Symbol.for("react.lazy"); +Symbol.for("react.scope"); +var REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"), + REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), + REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"), + REACT_CACHE_TYPE = Symbol.for("react.cache"), + REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker"), + MAYBE_ITERATOR_SYMBOL = Symbol.iterator; function getIteratorFn(maybeIterable) { if (null === maybeIterable || "object" !== typeof maybeIterable) return null; maybeIterable = @@ -2145,7 +2126,7 @@ function processChildContext(fiber, type, parentContext) { contextKey + '" is not defined in childContextTypes.' ); - return Object.assign({}, parentContext, instance); + return assign({}, parentContext, instance); } function pushContextProvider(workInProgress) { workInProgress = @@ -2267,7 +2248,7 @@ function getStackByFiberInDevAndProd(workInProgress) { } function resolveDefaultProps(Component, baseProps) { if (Component && Component.defaultProps) { - baseProps = Object.assign({}, baseProps); + baseProps = assign({}, baseProps); Component = Component.defaultProps; for (var propName in Component) void 0 === baseProps[propName] && @@ -2512,7 +2493,7 @@ function processUpdateQueue( ? workInProgress.call(updateEventTime, newState, updateLane) : workInProgress; if (null === updateLane || void 0 === updateLane) break a; - newState = Object.assign({}, newState, updateLane); + newState = assign({}, newState, updateLane); break a; case 2: hasForceUpdate = !0; @@ -2599,7 +2580,7 @@ function applyDerivedStateFromProps( getDerivedStateFromProps = null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps ? ctor - : Object.assign({}, ctor, getDerivedStateFromProps); + : assign({}, ctor, getDerivedStateFromProps); workInProgress.memoizedState = getDerivedStateFromProps; 0 === workInProgress.lanes && (workInProgress.updateQueue.baseState = getDerivedStateFromProps); @@ -4221,7 +4202,8 @@ var ContextOnlyDispatcher = { var hook = mountWorkInProgressHook(), identifierPrefix = workInProgressRoot.identifierPrefix, globalClientId = globalClientIdCounter++; - identifierPrefix = identifierPrefix + "r:" + globalClientId.toString(32); + identifierPrefix = + ":" + identifierPrefix + "r" + globalClientId.toString(32) + ":"; return (hook.memoizedState = identifierPrefix); }, unstable_isNewReconciler: !1 @@ -4879,6 +4861,10 @@ function completeWork(current, workInProgress, renderLanes) { : bubbleProperties(workInProgress), null ); + case 24: + return null; + case 25: + return null; } throw Error( "Unknown unit of work tag (" + @@ -6520,7 +6506,7 @@ function commitMutationEffects(root, firstChild, committedLanes) { var instance$jscomp$1 = childToDelete.stateNode, props = childToDelete.memoizedProps, viewConfig$jscomp$0 = instance$jscomp$1.viewConfig, - prevProps = Object.assign({}, props, { + prevProps = assign({}, props, { style: [props.style, { display: "none" }] }); var updatePayload$jscomp$0 = diffProperties( @@ -7449,8 +7435,7 @@ function handleError(root, thrownValue) { break a; } value = Error( - (getComponentNameFromFiber(sourceFiber) || "A React component") + - " suspended while rendering, but no fallback UI was specified.\n\nAdd a component higher in the tree to provide a loading indicator or placeholder to display." + "A component suspended while responding to synchronous input. This will cause the UI to be replaced with a loading indicator. To fix, updates that suspend should be wrapped with startTransition." ); } } @@ -7978,7 +7963,11 @@ function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error) { if (3 === sourceFiber.tag) captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error); else - for (; null !== nearestMountedAncestor; ) { + for ( + nearestMountedAncestor = sourceFiber.return; + null !== nearestMountedAncestor; + + ) { if (3 === nearestMountedAncestor.tag) { captureCommitPhaseErrorOnRoot( nearestMountedAncestor, @@ -8935,10 +8924,10 @@ batchedUpdatesImpl = function(fn, a) { } }; var roots = new Map(), - devToolsConfig$jscomp$inline_1048 = { + devToolsConfig$jscomp$inline_1050 = { findFiberByHostInstance: getInstanceFromTag, bundleType: 0, - version: "18.0.0-rc.0-4de99b3ca-20220221", + version: "18.0.0-rc.1-17806594c-20220301", rendererPackageName: "react-native-renderer", rendererConfig: { getInspectorDataForViewTag: function() { @@ -8958,7 +8947,7 @@ var roots = new Map(), var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__; if (hook.isDisabled || !hook.supportsFiber) return !0; try { - (internals = Object.assign({}, internals, { + (internals = assign({}, internals, { getLaneLabelMap: getLaneLabelMap, injectProfilingHooks: injectProfilingHooks })), @@ -8967,10 +8956,10 @@ var roots = new Map(), } catch (err) {} return hook.checkDCE ? !0 : !1; })({ - bundleType: devToolsConfig$jscomp$inline_1048.bundleType, - version: devToolsConfig$jscomp$inline_1048.version, - rendererPackageName: devToolsConfig$jscomp$inline_1048.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1048.rendererConfig, + bundleType: devToolsConfig$jscomp$inline_1050.bundleType, + version: devToolsConfig$jscomp$inline_1050.version, + rendererPackageName: devToolsConfig$jscomp$inline_1050.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1050.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -8986,14 +8975,14 @@ var roots = new Map(), return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1048.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1050.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.0.0-rc.0-4de99b3ca-20220221" + reconcilerVersion: "18.0.0-rc.1-17806594c-20220301" }); exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = { computeComponentStackForErrorReporting: function(reactTag) { @@ -9049,7 +9038,11 @@ exports.render = function(element, containerTag, callback) { ); root.current = JSCompiler_inline_result; JSCompiler_inline_result.stateNode = root; - JSCompiler_inline_result.memoizedState = { element: null }; + JSCompiler_inline_result.memoizedState = { + element: null, + cache: null, + transitions: null + }; initializeUpdateQueue(JSCompiler_inline_result); roots.set(containerTag, root); }