From 0da70b0db6f4cb7dc7ac57cc55bc8ca4d9b288a0 Mon Sep 17 00:00:00 2001 From: sebmarkbage Date: Mon, 22 Apr 2024 17:29:55 +0000 Subject: [PATCH] [Fiber/Fizz] Support AsyncIterable as Children and AsyncGenerator Client Components (#28868) Stacked on #28849, #28854, #28853. Behind a flag. If you're following along from the side-lines. This is probably not what you think it is. It's NOT a way to get updates to a component over time. The AsyncIterable works like an Iterable already works in React which is how an Array works. I.e. it's a list of children - not the value of a child over time. It also doesn't actually render one component at a time. The way it works is more like awaiting the entire list to become an array and then it shows up. Before that it suspends the parent. To actually get these to display one at a time, you have to opt-in with `` to describe how they should appear. That's really the interesting part and that not implemented yet. Additionally, since these are effectively Async Functions and uncached promises, they're not actually fully "supported" on the client yet for the same reason rendering plain Promises and Async Functions aren't. They warn. It's only really useful when paired with RSC that produces instrumented versions of these. Ideally we'd published instrumented helpers to help with map/filter style operations that yield new instrumented AsyncIterables. The way the implementation works basically just relies on unwrapThenable and otherwise works like a plain Iterator. There is one quirk with these that are different than just promises. We ask for a new iterator each time we rerender. This means that upon retry we kick off another iteration which itself might kick off new requests that block iterating further. To solve this and make it actually efficient enough to use on the client we'd need to stash something like a buffer of the previous iteration and maybe iterator on the iterable so that we can continue where we left off or synchronously iterate if we've seen it before. Similar to our `.value` convention on Promises. In Fizz, I had to do a special case because when we render an iterator child we don't actually rerender the parent again like we do in Fiber. However, it's more efficient to just continue on where we left off by reusing the entries from the thenable state from before in that case. DiffTrain build for commit https://github.com/facebook/react/commit/9f2eebd807bf53b7d9901cf0b768762948224cae. --- .../cjs/ReactTestRenderer-dev.js | 24 ++-- .../cjs/ReactTestRenderer-prod.js | 76 ++++++------ .../cjs/ReactTestRenderer-profiling.js | 62 +++++----- .../Libraries/Renderer/REVISION | 2 +- .../implementations/ReactFabric-dev.fb.js | 24 ++-- .../implementations/ReactFabric-prod.fb.js | 110 +++++++++--------- .../ReactFabric-profiling.fb.js | 96 +++++++-------- .../ReactNativeRenderer-dev.fb.js | 24 ++-- .../ReactNativeRenderer-prod.fb.js | 110 +++++++++--------- .../ReactNativeRenderer-profiling.fb.js | 96 +++++++-------- 10 files changed, 333 insertions(+), 291 deletions(-) diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-dev.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-dev.js index fc49c736aa591..180322e928c57 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-dev.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-dev.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<46b519886f2205ba3e56e9120fea4a08>> + * @generated SignedSource<> */ 'use strict'; @@ -131,6 +131,7 @@ var enableSchedulingProfiler = true; var enableProfilerTimer = true; var enableProfilerCommitHooks = true; var enableProfilerNestedUpdatePhase = true; +var enableAsyncIterableChildren = false; var syncLaneExpirationMs = 250; var transitionLaneExpirationMs = 5000; var enableLazyContextPropagation = false; @@ -5751,7 +5752,7 @@ function createChildReconciler(shouldTrackSideEffects) { } } - if (isArray(newChild) || getIteratorFn(newChild)) { + if (isArray(newChild) || getIteratorFn(newChild) || enableAsyncIterableChildren ) { var _created3 = createFiberFromFragment(newChild, returnFiber.mode, lanes, null); _created3.return = returnFiber; @@ -5836,7 +5837,7 @@ function createChildReconciler(shouldTrackSideEffects) { } } - if (isArray(newChild) || getIteratorFn(newChild)) { + if (isArray(newChild) || getIteratorFn(newChild) || enableAsyncIterableChildren ) { if (key !== null) { return null; } @@ -5904,7 +5905,7 @@ function createChildReconciler(shouldTrackSideEffects) { return updateFromMap(existingChildren, returnFiber, newIdx, init(payload), lanes, mergeDebugInfo(debugInfo, newChild._debugInfo)); } - if (isArray(newChild) || getIteratorFn(newChild)) { + if (isArray(newChild) || getIteratorFn(newChild) || enableAsyncIterableChildren ) { var _matchedFiber3 = existingChildren.get(newIdx) || null; return updateFragment(returnFiber, _matchedFiber3, newChild, lanes, null, mergeDebugInfo(debugInfo, newChild._debugInfo)); @@ -6137,7 +6138,7 @@ function createChildReconciler(shouldTrackSideEffects) { return resultingFirstChild; } - function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildrenIterable, lanes, debugInfo) { + function reconcileChildrenIteratable(returnFiber, currentFirstChild, newChildrenIterable, lanes, debugInfo) { // This is the same implementation as reconcileChildrenArray(), // but using the iterator instead. var iteratorFn = getIteratorFn(newChildrenIterable); @@ -6176,6 +6177,10 @@ function createChildReconciler(shouldTrackSideEffects) { } } + return reconcileChildrenIterator(returnFiber, currentFirstChild, newChildren, lanes, debugInfo); + } + + function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildren, lanes, debugInfo) { if (newChildren == null) { throw new Error('An iterable object provided no iterator.'); } @@ -6481,8 +6486,8 @@ function createChildReconciler(shouldTrackSideEffects) { } if (getIteratorFn(newChild)) { - return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, lanes, mergeDebugInfo(debugInfo, newChild._debugInfo)); - } // Usables are a valid React node type. When React encounters a Usable in + return reconcileChildrenIteratable(returnFiber, currentFirstChild, newChild, lanes, mergeDebugInfo(debugInfo, newChild._debugInfo)); + } // a child position, it unwraps it using the same algorithm as `use`. For // example, for promises, React will throw an exception to unwind the // stack, then replay the component once the promise resolves. @@ -6967,7 +6972,8 @@ function warnIfAsyncClientComponent(Component) { // for transpiled async functions. Neither mechanism is completely // bulletproof but together they cover the most common cases. var isAsyncFunction = // $FlowIgnore[method-unbinding] - Object.prototype.toString.call(Component) === '[object AsyncFunction]'; + Object.prototype.toString.call(Component) === '[object AsyncFunction]' || // $FlowIgnore[method-unbinding] + Object.prototype.toString.call(Component) === '[object AsyncGeneratorFunction]'; if (isAsyncFunction) { // Encountered an async Client Component. This is not yet supported. @@ -22983,7 +22989,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition return root; } -var ReactVersion = '19.0.0-canary-faeca3c1'; +var ReactVersion = '19.0.0-canary-88928511'; /* * The `'' + value` pattern (used in perf-sensitive code) throws for Symbol diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-prod.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-prod.js index 5fce45490c03b..262f280da3f76 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-prod.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-prod.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<9553b8ed4acfe1f92cf2f7113b446768>> + * @generated SignedSource<> */ "use strict"; @@ -1811,25 +1811,20 @@ function createChildReconciler(shouldTrackSideEffects) { function reconcileChildrenIterator( returnFiber, currentFirstChild, - newChildrenIterable, + newChildren, lanes ) { - var iteratorFn = getIteratorFn(newChildrenIterable); - if ("function" !== typeof iteratorFn) - throw Error( - "An object is not an iterable. This error is likely caused by a bug in React. Please file an issue." - ); - newChildrenIterable = iteratorFn.call(newChildrenIterable); - if (null == newChildrenIterable) + if (null == newChildren) throw Error("An iterable object provided no iterator."); for ( - var previousNewFiber = (iteratorFn = null), + var resultingFirstChild = null, + previousNewFiber = null, oldFiber = currentFirstChild, newIdx = (currentFirstChild = 0), nextOldFiber = null, - step = newChildrenIterable.next(); + step = newChildren.next(); null !== oldFiber && !step.done; - newIdx++, step = newChildrenIterable.next(), null + newIdx++, step = newChildren.next(), null ) { oldFiber.index > newIdx ? ((nextOldFiber = oldFiber), (oldFiber = null)) @@ -1845,28 +1840,30 @@ function createChildReconciler(shouldTrackSideEffects) { deleteChild(returnFiber, oldFiber); currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); null === previousNewFiber - ? (iteratorFn = newFiber) + ? (resultingFirstChild = newFiber) : (previousNewFiber.sibling = newFiber); previousNewFiber = newFiber; oldFiber = nextOldFiber; } if (step.done) - return deleteRemainingChildren(returnFiber, oldFiber), iteratorFn; + return ( + deleteRemainingChildren(returnFiber, oldFiber), resultingFirstChild + ); if (null === oldFiber) { - for (; !step.done; newIdx++, step = newChildrenIterable.next(), null) + for (; !step.done; newIdx++, step = newChildren.next(), null) (step = createChild(returnFiber, step.value, lanes)), null !== step && ((currentFirstChild = placeChild(step, currentFirstChild, newIdx)), null === previousNewFiber - ? (iteratorFn = step) + ? (resultingFirstChild = step) : (previousNewFiber.sibling = step), (previousNewFiber = step)); - return iteratorFn; + return resultingFirstChild; } for ( oldFiber = mapRemainingChildren(oldFiber); !step.done; - newIdx++, step = newChildrenIterable.next(), null + newIdx++, step = newChildren.next(), null ) (step = updateFromMap(oldFiber, returnFiber, newIdx, step.value, lanes)), null !== step && @@ -1875,14 +1872,14 @@ function createChildReconciler(shouldTrackSideEffects) { oldFiber.delete(null === step.key ? newIdx : step.key), (currentFirstChild = placeChild(step, currentFirstChild, newIdx)), null === previousNewFiber - ? (iteratorFn = step) + ? (resultingFirstChild = step) : (previousNewFiber.sibling = step), (previousNewFiber = step)); shouldTrackSideEffects && oldFiber.forEach(function (child) { return deleteChild(returnFiber, child); }); - return iteratorFn; + return resultingFirstChild; } function reconcileChildFibersImpl( returnFiber, @@ -2009,13 +2006,20 @@ function createChildReconciler(shouldTrackSideEffects) { newChild, lanes ); - if (getIteratorFn(newChild)) + if (getIteratorFn(newChild)) { + key = getIteratorFn(newChild); + if ("function" !== typeof key) + throw Error( + "An object is not an iterable. This error is likely caused by a bug in React. Please file an issue." + ); + newChild = key.call(newChild); return reconcileChildrenIterator( returnFiber, currentFirstChild, newChild, lanes ); + } if ("function" === typeof newChild.then) return reconcileChildFibersImpl( returnFiber, @@ -9143,19 +9147,19 @@ function wrapFiber(fiber) { fiberToWrapper.set(fiber, wrapper)); return wrapper; } -var devToolsConfig$jscomp$inline_1019 = { +var devToolsConfig$jscomp$inline_1028 = { findFiberByHostInstance: function () { throw Error("TestRenderer does not support findFiberByHostInstance()"); }, bundleType: 0, - version: "19.0.0-canary-926deca4", + version: "19.0.0-canary-e1a9c38c", rendererPackageName: "react-test-renderer" }; -var internals$jscomp$inline_1238 = { - bundleType: devToolsConfig$jscomp$inline_1019.bundleType, - version: devToolsConfig$jscomp$inline_1019.version, - rendererPackageName: devToolsConfig$jscomp$inline_1019.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1019.rendererConfig, +var internals$jscomp$inline_1247 = { + bundleType: devToolsConfig$jscomp$inline_1028.bundleType, + version: devToolsConfig$jscomp$inline_1028.version, + rendererPackageName: devToolsConfig$jscomp$inline_1028.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1028.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -9172,26 +9176,26 @@ var internals$jscomp$inline_1238 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1019.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1028.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-canary-926deca4" + reconcilerVersion: "19.0.0-canary-e1a9c38c" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1239 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1248 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1239.isDisabled && - hook$jscomp$inline_1239.supportsFiber + !hook$jscomp$inline_1248.isDisabled && + hook$jscomp$inline_1248.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1239.inject( - internals$jscomp$inline_1238 + (rendererID = hook$jscomp$inline_1248.inject( + internals$jscomp$inline_1247 )), - (injectedHook = hook$jscomp$inline_1239); + (injectedHook = hook$jscomp$inline_1248); } catch (err) {} } exports._Scheduler = Scheduler; diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-profiling.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-profiling.js index 49923b25a6fdb..f019750720f28 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-profiling.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-profiling.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<3a52338cfe089716cbc5c55bc70f1def>> + * @generated SignedSource<> */ "use strict"; @@ -1899,25 +1899,20 @@ function createChildReconciler(shouldTrackSideEffects) { function reconcileChildrenIterator( returnFiber, currentFirstChild, - newChildrenIterable, + newChildren, lanes ) { - var iteratorFn = getIteratorFn(newChildrenIterable); - if ("function" !== typeof iteratorFn) - throw Error( - "An object is not an iterable. This error is likely caused by a bug in React. Please file an issue." - ); - newChildrenIterable = iteratorFn.call(newChildrenIterable); - if (null == newChildrenIterable) + if (null == newChildren) throw Error("An iterable object provided no iterator."); for ( - var previousNewFiber = (iteratorFn = null), + var resultingFirstChild = null, + previousNewFiber = null, oldFiber = currentFirstChild, newIdx = (currentFirstChild = 0), nextOldFiber = null, - step = newChildrenIterable.next(); + step = newChildren.next(); null !== oldFiber && !step.done; - newIdx++, step = newChildrenIterable.next(), null + newIdx++, step = newChildren.next(), null ) { oldFiber.index > newIdx ? ((nextOldFiber = oldFiber), (oldFiber = null)) @@ -1933,28 +1928,30 @@ function createChildReconciler(shouldTrackSideEffects) { deleteChild(returnFiber, oldFiber); currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); null === previousNewFiber - ? (iteratorFn = newFiber) + ? (resultingFirstChild = newFiber) : (previousNewFiber.sibling = newFiber); previousNewFiber = newFiber; oldFiber = nextOldFiber; } if (step.done) - return deleteRemainingChildren(returnFiber, oldFiber), iteratorFn; + return ( + deleteRemainingChildren(returnFiber, oldFiber), resultingFirstChild + ); if (null === oldFiber) { - for (; !step.done; newIdx++, step = newChildrenIterable.next(), null) + for (; !step.done; newIdx++, step = newChildren.next(), null) (step = createChild(returnFiber, step.value, lanes)), null !== step && ((currentFirstChild = placeChild(step, currentFirstChild, newIdx)), null === previousNewFiber - ? (iteratorFn = step) + ? (resultingFirstChild = step) : (previousNewFiber.sibling = step), (previousNewFiber = step)); - return iteratorFn; + return resultingFirstChild; } for ( oldFiber = mapRemainingChildren(oldFiber); !step.done; - newIdx++, step = newChildrenIterable.next(), null + newIdx++, step = newChildren.next(), null ) (step = updateFromMap(oldFiber, returnFiber, newIdx, step.value, lanes)), null !== step && @@ -1963,14 +1960,14 @@ function createChildReconciler(shouldTrackSideEffects) { oldFiber.delete(null === step.key ? newIdx : step.key), (currentFirstChild = placeChild(step, currentFirstChild, newIdx)), null === previousNewFiber - ? (iteratorFn = step) + ? (resultingFirstChild = step) : (previousNewFiber.sibling = step), (previousNewFiber = step)); shouldTrackSideEffects && oldFiber.forEach(function (child) { return deleteChild(returnFiber, child); }); - return iteratorFn; + return resultingFirstChild; } function reconcileChildFibersImpl( returnFiber, @@ -2097,13 +2094,20 @@ function createChildReconciler(shouldTrackSideEffects) { newChild, lanes ); - if (getIteratorFn(newChild)) + if (getIteratorFn(newChild)) { + key = getIteratorFn(newChild); + if ("function" !== typeof key) + throw Error( + "An object is not an iterable. This error is likely caused by a bug in React. Please file an issue." + ); + newChild = key.call(newChild); return reconcileChildrenIterator( returnFiber, currentFirstChild, newChild, lanes ); + } if ("function" === typeof newChild.then) return reconcileChildFibersImpl( returnFiber, @@ -9759,12 +9763,12 @@ function wrapFiber(fiber) { fiberToWrapper.set(fiber, wrapper)); return wrapper; } -var devToolsConfig$jscomp$inline_1101 = { +var devToolsConfig$jscomp$inline_1110 = { findFiberByHostInstance: function () { throw Error("TestRenderer does not support findFiberByHostInstance()"); }, bundleType: 0, - version: "19.0.0-canary-1895753d", + version: "19.0.0-canary-71d4d884", rendererPackageName: "react-test-renderer" }; (function (internals) { @@ -9781,10 +9785,10 @@ var devToolsConfig$jscomp$inline_1101 = { } catch (err) {} return hook.checkDCE ? !0 : !1; })({ - bundleType: devToolsConfig$jscomp$inline_1101.bundleType, - version: devToolsConfig$jscomp$inline_1101.version, - rendererPackageName: devToolsConfig$jscomp$inline_1101.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1101.rendererConfig, + bundleType: devToolsConfig$jscomp$inline_1110.bundleType, + version: devToolsConfig$jscomp$inline_1110.version, + rendererPackageName: devToolsConfig$jscomp$inline_1110.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1110.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -9801,14 +9805,14 @@ var devToolsConfig$jscomp$inline_1101 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1101.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1110.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-canary-1895753d" + reconcilerVersion: "19.0.0-canary-71d4d884" }); exports._Scheduler = Scheduler; exports.act = act; diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/REVISION b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/REVISION index 177a8c5d4e98d..92ccccd83e0ab 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/REVISION +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/REVISION @@ -1 +1 @@ -3b551c82844bcfde51f0febb8e42c1a0d777df2c +9f2eebd807bf53b7d9901cf0b768762948224cae diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-dev.fb.js b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-dev.fb.js index 84e09a0424ec0..4d0989b9cd8a6 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-dev.fb.js +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-dev.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<50530e784c9e1753cdf1c441923f9a3d>> + * @generated SignedSource<<077c2c0ff9555d4a76d629316b424c88>> */ 'use strict'; @@ -2008,6 +2008,7 @@ var enableSchedulingProfiler = true; var enableProfilerTimer = true; var enableProfilerCommitHooks = true; var enableProfilerNestedUpdatePhase = true; +var enableAsyncIterableChildren = false; var syncLaneExpirationMs = 250; var transitionLaneExpirationMs = 5000; var enableLazyContextPropagation = false; @@ -8711,7 +8712,7 @@ function createChildReconciler(shouldTrackSideEffects) { } } - if (isArray(newChild) || getIteratorFn(newChild)) { + if (isArray(newChild) || getIteratorFn(newChild) || enableAsyncIterableChildren ) { var _created3 = createFiberFromFragment(newChild, returnFiber.mode, lanes, null); _created3.return = returnFiber; @@ -8796,7 +8797,7 @@ function createChildReconciler(shouldTrackSideEffects) { } } - if (isArray(newChild) || getIteratorFn(newChild)) { + if (isArray(newChild) || getIteratorFn(newChild) || enableAsyncIterableChildren ) { if (key !== null) { return null; } @@ -8864,7 +8865,7 @@ function createChildReconciler(shouldTrackSideEffects) { return updateFromMap(existingChildren, returnFiber, newIdx, init(payload), lanes, mergeDebugInfo(debugInfo, newChild._debugInfo)); } - if (isArray(newChild) || getIteratorFn(newChild)) { + if (isArray(newChild) || getIteratorFn(newChild) || enableAsyncIterableChildren ) { var _matchedFiber3 = existingChildren.get(newIdx) || null; return updateFragment(returnFiber, _matchedFiber3, newChild, lanes, null, mergeDebugInfo(debugInfo, newChild._debugInfo)); @@ -9097,7 +9098,7 @@ function createChildReconciler(shouldTrackSideEffects) { return resultingFirstChild; } - function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildrenIterable, lanes, debugInfo) { + function reconcileChildrenIteratable(returnFiber, currentFirstChild, newChildrenIterable, lanes, debugInfo) { // This is the same implementation as reconcileChildrenArray(), // but using the iterator instead. var iteratorFn = getIteratorFn(newChildrenIterable); @@ -9136,6 +9137,10 @@ function createChildReconciler(shouldTrackSideEffects) { } } + return reconcileChildrenIterator(returnFiber, currentFirstChild, newChildren, lanes, debugInfo); + } + + function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildren, lanes, debugInfo) { if (newChildren == null) { throw new Error('An iterable object provided no iterator.'); } @@ -9441,8 +9446,8 @@ function createChildReconciler(shouldTrackSideEffects) { } if (getIteratorFn(newChild)) { - return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, lanes, mergeDebugInfo(debugInfo, newChild._debugInfo)); - } // Usables are a valid React node type. When React encounters a Usable in + return reconcileChildrenIteratable(returnFiber, currentFirstChild, newChild, lanes, mergeDebugInfo(debugInfo, newChild._debugInfo)); + } // a child position, it unwraps it using the same algorithm as `use`. For // example, for promises, React will throw an exception to unwind the // stack, then replay the component once the promise resolves. @@ -9927,7 +9932,8 @@ function warnIfAsyncClientComponent(Component) { // for transpiled async functions. Neither mechanism is completely // bulletproof but together they cover the most common cases. var isAsyncFunction = // $FlowIgnore[method-unbinding] - Object.prototype.toString.call(Component) === '[object AsyncFunction]'; + Object.prototype.toString.call(Component) === '[object AsyncFunction]' || // $FlowIgnore[method-unbinding] + Object.prototype.toString.call(Component) === '[object AsyncGeneratorFunction]'; if (isAsyncFunction) { // Encountered an async Client Component. This is not yet supported. @@ -26053,7 +26059,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition return root; } -var ReactVersion = '19.0.0-canary-10068bda'; +var ReactVersion = '19.0.0-canary-4b13525c'; /* * The `'' + value` pattern (used in perf-sensitive code) throws for Symbol diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-prod.fb.js b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-prod.fb.js index f3b199d253334..238e1d1a3e3e2 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-prod.fb.js +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-prod.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<51142bb6cdcde9e8faffbaa114b1cbc7>> + * @generated SignedSource<> */ "use strict"; @@ -893,7 +893,7 @@ eventPluginOrder = Array.prototype.slice.call([ "ReactNativeBridgeEventPlugin" ]); recomputePluginOrdering(); -var injectedNamesToPlugins$jscomp$inline_247 = { +var injectedNamesToPlugins$jscomp$inline_248 = { ResponderEventPlugin: ResponderEventPlugin, ReactNativeBridgeEventPlugin: { eventTypes: {}, @@ -939,32 +939,32 @@ var injectedNamesToPlugins$jscomp$inline_247 = { } } }, - isOrderingDirty$jscomp$inline_248 = !1, - pluginName$jscomp$inline_249; -for (pluginName$jscomp$inline_249 in injectedNamesToPlugins$jscomp$inline_247) + isOrderingDirty$jscomp$inline_249 = !1, + pluginName$jscomp$inline_250; +for (pluginName$jscomp$inline_250 in injectedNamesToPlugins$jscomp$inline_248) if ( - injectedNamesToPlugins$jscomp$inline_247.hasOwnProperty( - pluginName$jscomp$inline_249 + injectedNamesToPlugins$jscomp$inline_248.hasOwnProperty( + pluginName$jscomp$inline_250 ) ) { - var pluginModule$jscomp$inline_250 = - injectedNamesToPlugins$jscomp$inline_247[pluginName$jscomp$inline_249]; + var pluginModule$jscomp$inline_251 = + injectedNamesToPlugins$jscomp$inline_248[pluginName$jscomp$inline_250]; if ( - !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_249) || - namesToPlugins[pluginName$jscomp$inline_249] !== - pluginModule$jscomp$inline_250 + !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_250) || + namesToPlugins[pluginName$jscomp$inline_250] !== + pluginModule$jscomp$inline_251 ) { - if (namesToPlugins[pluginName$jscomp$inline_249]) + if (namesToPlugins[pluginName$jscomp$inline_250]) throw Error( "EventPluginRegistry: Cannot inject two different event plugins using the same name, `" + - (pluginName$jscomp$inline_249 + "`.") + (pluginName$jscomp$inline_250 + "`.") ); - namesToPlugins[pluginName$jscomp$inline_249] = - pluginModule$jscomp$inline_250; - isOrderingDirty$jscomp$inline_248 = !0; + namesToPlugins[pluginName$jscomp$inline_250] = + pluginModule$jscomp$inline_251; + isOrderingDirty$jscomp$inline_249 = !0; } } -isOrderingDirty$jscomp$inline_248 && recomputePluginOrdering(); +isOrderingDirty$jscomp$inline_249 && recomputePluginOrdering(); var alwaysThrottleRetries = dynamicFlagsUntyped.alwaysThrottleRetries, consoleManagedByDevToolsDuringStrictMode = dynamicFlagsUntyped.consoleManagedByDevToolsDuringStrictMode, @@ -3336,25 +3336,20 @@ function createChildReconciler(shouldTrackSideEffects) { function reconcileChildrenIterator( returnFiber, currentFirstChild, - newChildrenIterable, + newChildren, lanes ) { - var iteratorFn = getIteratorFn(newChildrenIterable); - if ("function" !== typeof iteratorFn) - throw Error( - "An object is not an iterable. This error is likely caused by a bug in React. Please file an issue." - ); - newChildrenIterable = iteratorFn.call(newChildrenIterable); - if (null == newChildrenIterable) + if (null == newChildren) throw Error("An iterable object provided no iterator."); for ( - var previousNewFiber = (iteratorFn = null), + var resultingFirstChild = null, + previousNewFiber = null, oldFiber = currentFirstChild, newIdx = (currentFirstChild = 0), nextOldFiber = null, - step = newChildrenIterable.next(); + step = newChildren.next(); null !== oldFiber && !step.done; - newIdx++, step = newChildrenIterable.next(), null + newIdx++, step = newChildren.next(), null ) { oldFiber.index > newIdx ? ((nextOldFiber = oldFiber), (oldFiber = null)) @@ -3370,28 +3365,30 @@ function createChildReconciler(shouldTrackSideEffects) { deleteChild(returnFiber, oldFiber); currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); null === previousNewFiber - ? (iteratorFn = newFiber) + ? (resultingFirstChild = newFiber) : (previousNewFiber.sibling = newFiber); previousNewFiber = newFiber; oldFiber = nextOldFiber; } if (step.done) - return deleteRemainingChildren(returnFiber, oldFiber), iteratorFn; + return ( + deleteRemainingChildren(returnFiber, oldFiber), resultingFirstChild + ); if (null === oldFiber) { - for (; !step.done; newIdx++, step = newChildrenIterable.next(), null) + for (; !step.done; newIdx++, step = newChildren.next(), null) (step = createChild(returnFiber, step.value, lanes)), null !== step && ((currentFirstChild = placeChild(step, currentFirstChild, newIdx)), null === previousNewFiber - ? (iteratorFn = step) + ? (resultingFirstChild = step) : (previousNewFiber.sibling = step), (previousNewFiber = step)); - return iteratorFn; + return resultingFirstChild; } for ( oldFiber = mapRemainingChildren(oldFiber); !step.done; - newIdx++, step = newChildrenIterable.next(), null + newIdx++, step = newChildren.next(), null ) (step = updateFromMap(oldFiber, returnFiber, newIdx, step.value, lanes)), null !== step && @@ -3400,14 +3397,14 @@ function createChildReconciler(shouldTrackSideEffects) { oldFiber.delete(null === step.key ? newIdx : step.key), (currentFirstChild = placeChild(step, currentFirstChild, newIdx)), null === previousNewFiber - ? (iteratorFn = step) + ? (resultingFirstChild = step) : (previousNewFiber.sibling = step), (previousNewFiber = step)); shouldTrackSideEffects && oldFiber.forEach(function (child) { return deleteChild(returnFiber, child); }); - return iteratorFn; + return resultingFirstChild; } function reconcileChildFibersImpl( returnFiber, @@ -3534,13 +3531,20 @@ function createChildReconciler(shouldTrackSideEffects) { newChild, lanes ); - if (getIteratorFn(newChild)) + if (getIteratorFn(newChild)) { + key = getIteratorFn(newChild); + if ("function" !== typeof key) + throw Error( + "An object is not an iterable. This error is likely caused by a bug in React. Please file an issue." + ); + newChild = key.call(newChild); return reconcileChildrenIterator( returnFiber, currentFirstChild, newChild, lanes ); + } if ("function" === typeof newChild.then) return reconcileChildFibersImpl( returnFiber, @@ -10603,10 +10607,10 @@ batchedUpdatesImpl = function (fn, a) { } }; var roots = new Map(), - devToolsConfig$jscomp$inline_1099 = { + devToolsConfig$jscomp$inline_1108 = { findFiberByHostInstance: getInstanceFromNode, bundleType: 0, - version: "19.0.0-canary-7eb4df81", + version: "19.0.0-canary-44e696d7", rendererPackageName: "react-native-renderer", rendererConfig: { getInspectorDataForInstance: getInspectorDataForInstance, @@ -10622,11 +10626,11 @@ var roots = new Map(), }.bind(null, findNodeHandle) } }; -var internals$jscomp$inline_1366 = { - bundleType: devToolsConfig$jscomp$inline_1099.bundleType, - version: devToolsConfig$jscomp$inline_1099.version, - rendererPackageName: devToolsConfig$jscomp$inline_1099.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1099.rendererConfig, +var internals$jscomp$inline_1375 = { + bundleType: devToolsConfig$jscomp$inline_1108.bundleType, + version: devToolsConfig$jscomp$inline_1108.version, + rendererPackageName: devToolsConfig$jscomp$inline_1108.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1108.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -10642,26 +10646,26 @@ var internals$jscomp$inline_1366 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1099.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1108.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-canary-7eb4df81" + reconcilerVersion: "19.0.0-canary-44e696d7" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1367 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1376 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1367.isDisabled && - hook$jscomp$inline_1367.supportsFiber + !hook$jscomp$inline_1376.isDisabled && + hook$jscomp$inline_1376.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1367.inject( - internals$jscomp$inline_1366 + (rendererID = hook$jscomp$inline_1376.inject( + internals$jscomp$inline_1375 )), - (injectedHook = hook$jscomp$inline_1367); + (injectedHook = hook$jscomp$inline_1376); } catch (err) {} } exports.createPortal = function (children, containerTag) { diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js index 1f45bf5076b00..6bc1c411ab8af 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<3b7c022bad1965296de8faec24940d21>> + * @generated SignedSource<> */ "use strict"; @@ -897,7 +897,7 @@ eventPluginOrder = Array.prototype.slice.call([ "ReactNativeBridgeEventPlugin" ]); recomputePluginOrdering(); -var injectedNamesToPlugins$jscomp$inline_263 = { +var injectedNamesToPlugins$jscomp$inline_264 = { ResponderEventPlugin: ResponderEventPlugin, ReactNativeBridgeEventPlugin: { eventTypes: {}, @@ -943,32 +943,32 @@ var injectedNamesToPlugins$jscomp$inline_263 = { } } }, - isOrderingDirty$jscomp$inline_264 = !1, - pluginName$jscomp$inline_265; -for (pluginName$jscomp$inline_265 in injectedNamesToPlugins$jscomp$inline_263) + isOrderingDirty$jscomp$inline_265 = !1, + pluginName$jscomp$inline_266; +for (pluginName$jscomp$inline_266 in injectedNamesToPlugins$jscomp$inline_264) if ( - injectedNamesToPlugins$jscomp$inline_263.hasOwnProperty( - pluginName$jscomp$inline_265 + injectedNamesToPlugins$jscomp$inline_264.hasOwnProperty( + pluginName$jscomp$inline_266 ) ) { - var pluginModule$jscomp$inline_266 = - injectedNamesToPlugins$jscomp$inline_263[pluginName$jscomp$inline_265]; + var pluginModule$jscomp$inline_267 = + injectedNamesToPlugins$jscomp$inline_264[pluginName$jscomp$inline_266]; if ( - !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_265) || - namesToPlugins[pluginName$jscomp$inline_265] !== - pluginModule$jscomp$inline_266 + !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_266) || + namesToPlugins[pluginName$jscomp$inline_266] !== + pluginModule$jscomp$inline_267 ) { - if (namesToPlugins[pluginName$jscomp$inline_265]) + if (namesToPlugins[pluginName$jscomp$inline_266]) throw Error( "EventPluginRegistry: Cannot inject two different event plugins using the same name, `" + - (pluginName$jscomp$inline_265 + "`.") + (pluginName$jscomp$inline_266 + "`.") ); - namesToPlugins[pluginName$jscomp$inline_265] = - pluginModule$jscomp$inline_266; - isOrderingDirty$jscomp$inline_264 = !0; + namesToPlugins[pluginName$jscomp$inline_266] = + pluginModule$jscomp$inline_267; + isOrderingDirty$jscomp$inline_265 = !0; } } -isOrderingDirty$jscomp$inline_264 && recomputePluginOrdering(); +isOrderingDirty$jscomp$inline_265 && recomputePluginOrdering(); var alwaysThrottleRetries = dynamicFlagsUntyped.alwaysThrottleRetries, consoleManagedByDevToolsDuringStrictMode = dynamicFlagsUntyped.consoleManagedByDevToolsDuringStrictMode, @@ -3458,25 +3458,20 @@ function createChildReconciler(shouldTrackSideEffects) { function reconcileChildrenIterator( returnFiber, currentFirstChild, - newChildrenIterable, + newChildren, lanes ) { - var iteratorFn = getIteratorFn(newChildrenIterable); - if ("function" !== typeof iteratorFn) - throw Error( - "An object is not an iterable. This error is likely caused by a bug in React. Please file an issue." - ); - newChildrenIterable = iteratorFn.call(newChildrenIterable); - if (null == newChildrenIterable) + if (null == newChildren) throw Error("An iterable object provided no iterator."); for ( - var previousNewFiber = (iteratorFn = null), + var resultingFirstChild = null, + previousNewFiber = null, oldFiber = currentFirstChild, newIdx = (currentFirstChild = 0), nextOldFiber = null, - step = newChildrenIterable.next(); + step = newChildren.next(); null !== oldFiber && !step.done; - newIdx++, step = newChildrenIterable.next(), null + newIdx++, step = newChildren.next(), null ) { oldFiber.index > newIdx ? ((nextOldFiber = oldFiber), (oldFiber = null)) @@ -3492,28 +3487,30 @@ function createChildReconciler(shouldTrackSideEffects) { deleteChild(returnFiber, oldFiber); currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); null === previousNewFiber - ? (iteratorFn = newFiber) + ? (resultingFirstChild = newFiber) : (previousNewFiber.sibling = newFiber); previousNewFiber = newFiber; oldFiber = nextOldFiber; } if (step.done) - return deleteRemainingChildren(returnFiber, oldFiber), iteratorFn; + return ( + deleteRemainingChildren(returnFiber, oldFiber), resultingFirstChild + ); if (null === oldFiber) { - for (; !step.done; newIdx++, step = newChildrenIterable.next(), null) + for (; !step.done; newIdx++, step = newChildren.next(), null) (step = createChild(returnFiber, step.value, lanes)), null !== step && ((currentFirstChild = placeChild(step, currentFirstChild, newIdx)), null === previousNewFiber - ? (iteratorFn = step) + ? (resultingFirstChild = step) : (previousNewFiber.sibling = step), (previousNewFiber = step)); - return iteratorFn; + return resultingFirstChild; } for ( oldFiber = mapRemainingChildren(oldFiber); !step.done; - newIdx++, step = newChildrenIterable.next(), null + newIdx++, step = newChildren.next(), null ) (step = updateFromMap(oldFiber, returnFiber, newIdx, step.value, lanes)), null !== step && @@ -3522,14 +3519,14 @@ function createChildReconciler(shouldTrackSideEffects) { oldFiber.delete(null === step.key ? newIdx : step.key), (currentFirstChild = placeChild(step, currentFirstChild, newIdx)), null === previousNewFiber - ? (iteratorFn = step) + ? (resultingFirstChild = step) : (previousNewFiber.sibling = step), (previousNewFiber = step)); shouldTrackSideEffects && oldFiber.forEach(function (child) { return deleteChild(returnFiber, child); }); - return iteratorFn; + return resultingFirstChild; } function reconcileChildFibersImpl( returnFiber, @@ -3656,13 +3653,20 @@ function createChildReconciler(shouldTrackSideEffects) { newChild, lanes ); - if (getIteratorFn(newChild)) + if (getIteratorFn(newChild)) { + key = getIteratorFn(newChild); + if ("function" !== typeof key) + throw Error( + "An object is not an iterable. This error is likely caused by a bug in React. Please file an issue." + ); + newChild = key.call(newChild); return reconcileChildrenIterator( returnFiber, currentFirstChild, newChild, lanes ); + } if ("function" === typeof newChild.then) return reconcileChildFibersImpl( returnFiber, @@ -11308,10 +11312,10 @@ batchedUpdatesImpl = function (fn, a) { } }; var roots = new Map(), - devToolsConfig$jscomp$inline_1179 = { + devToolsConfig$jscomp$inline_1188 = { findFiberByHostInstance: getInstanceFromNode, bundleType: 0, - version: "19.0.0-canary-865489dc", + version: "19.0.0-canary-1d21c404", rendererPackageName: "react-native-renderer", rendererConfig: { getInspectorDataForInstance: getInspectorDataForInstance, @@ -11341,10 +11345,10 @@ var roots = new Map(), } catch (err) {} return hook.checkDCE ? !0 : !1; })({ - bundleType: devToolsConfig$jscomp$inline_1179.bundleType, - version: devToolsConfig$jscomp$inline_1179.version, - rendererPackageName: devToolsConfig$jscomp$inline_1179.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1179.rendererConfig, + bundleType: devToolsConfig$jscomp$inline_1188.bundleType, + version: devToolsConfig$jscomp$inline_1188.version, + rendererPackageName: devToolsConfig$jscomp$inline_1188.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1188.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -11360,14 +11364,14 @@ var roots = new Map(), return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1179.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1188.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-canary-865489dc" + reconcilerVersion: "19.0.0-canary-1d21c404" }); exports.createPortal = function (children, containerTag) { return createPortal$1( diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js index 8ed4096b658ca..69c56f39145f8 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<1805be4fd01dd300dab1d1eb6fec9931>> + * @generated SignedSource<<326542d2f2bb8bbc5fb69f5994f1ea0f>> */ 'use strict'; @@ -2355,6 +2355,7 @@ var enableSchedulingProfiler = true; var enableProfilerTimer = true; var enableProfilerCommitHooks = true; var enableProfilerNestedUpdatePhase = true; +var enableAsyncIterableChildren = false; var syncLaneExpirationMs = 250; var transitionLaneExpirationMs = 5000; var enableLazyContextPropagation = false; @@ -8950,7 +8951,7 @@ function createChildReconciler(shouldTrackSideEffects) { } } - if (isArray(newChild) || getIteratorFn(newChild)) { + if (isArray(newChild) || getIteratorFn(newChild) || enableAsyncIterableChildren ) { var _created3 = createFiberFromFragment(newChild, returnFiber.mode, lanes, null); _created3.return = returnFiber; @@ -9035,7 +9036,7 @@ function createChildReconciler(shouldTrackSideEffects) { } } - if (isArray(newChild) || getIteratorFn(newChild)) { + if (isArray(newChild) || getIteratorFn(newChild) || enableAsyncIterableChildren ) { if (key !== null) { return null; } @@ -9103,7 +9104,7 @@ function createChildReconciler(shouldTrackSideEffects) { return updateFromMap(existingChildren, returnFiber, newIdx, init(payload), lanes, mergeDebugInfo(debugInfo, newChild._debugInfo)); } - if (isArray(newChild) || getIteratorFn(newChild)) { + if (isArray(newChild) || getIteratorFn(newChild) || enableAsyncIterableChildren ) { var _matchedFiber3 = existingChildren.get(newIdx) || null; return updateFragment(returnFiber, _matchedFiber3, newChild, lanes, null, mergeDebugInfo(debugInfo, newChild._debugInfo)); @@ -9336,7 +9337,7 @@ function createChildReconciler(shouldTrackSideEffects) { return resultingFirstChild; } - function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildrenIterable, lanes, debugInfo) { + function reconcileChildrenIteratable(returnFiber, currentFirstChild, newChildrenIterable, lanes, debugInfo) { // This is the same implementation as reconcileChildrenArray(), // but using the iterator instead. var iteratorFn = getIteratorFn(newChildrenIterable); @@ -9375,6 +9376,10 @@ function createChildReconciler(shouldTrackSideEffects) { } } + return reconcileChildrenIterator(returnFiber, currentFirstChild, newChildren, lanes, debugInfo); + } + + function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildren, lanes, debugInfo) { if (newChildren == null) { throw new Error('An iterable object provided no iterator.'); } @@ -9680,8 +9685,8 @@ function createChildReconciler(shouldTrackSideEffects) { } if (getIteratorFn(newChild)) { - return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, lanes, mergeDebugInfo(debugInfo, newChild._debugInfo)); - } // Usables are a valid React node type. When React encounters a Usable in + return reconcileChildrenIteratable(returnFiber, currentFirstChild, newChild, lanes, mergeDebugInfo(debugInfo, newChild._debugInfo)); + } // a child position, it unwraps it using the same algorithm as `use`. For // example, for promises, React will throw an exception to unwind the // stack, then replay the component once the promise resolves. @@ -10166,7 +10171,8 @@ function warnIfAsyncClientComponent(Component) { // for transpiled async functions. Neither mechanism is completely // bulletproof but together they cover the most common cases. var isAsyncFunction = // $FlowIgnore[method-unbinding] - Object.prototype.toString.call(Component) === '[object AsyncFunction]'; + Object.prototype.toString.call(Component) === '[object AsyncFunction]' || // $FlowIgnore[method-unbinding] + Object.prototype.toString.call(Component) === '[object AsyncGeneratorFunction]'; if (isAsyncFunction) { // Encountered an async Client Component. This is not yet supported. @@ -26468,7 +26474,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition return root; } -var ReactVersion = '19.0.0-canary-5d4acc6d'; +var ReactVersion = '19.0.0-canary-2d608505'; /* * The `'' + value` pattern (used in perf-sensitive code) throws for Symbol diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js index a6a98cd998e21..637e976dbc116 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<9fb9d275d91b0770a5e01a5d1b448a6b>> + * @generated SignedSource<<50ed89ef9d28f94308e802dfa68cd799>> */ "use strict"; @@ -893,7 +893,7 @@ eventPluginOrder = Array.prototype.slice.call([ "ReactNativeBridgeEventPlugin" ]); recomputePluginOrdering(); -var injectedNamesToPlugins$jscomp$inline_255 = { +var injectedNamesToPlugins$jscomp$inline_256 = { ResponderEventPlugin: ResponderEventPlugin, ReactNativeBridgeEventPlugin: { eventTypes: {}, @@ -939,32 +939,32 @@ var injectedNamesToPlugins$jscomp$inline_255 = { } } }, - isOrderingDirty$jscomp$inline_256 = !1, - pluginName$jscomp$inline_257; -for (pluginName$jscomp$inline_257 in injectedNamesToPlugins$jscomp$inline_255) + isOrderingDirty$jscomp$inline_257 = !1, + pluginName$jscomp$inline_258; +for (pluginName$jscomp$inline_258 in injectedNamesToPlugins$jscomp$inline_256) if ( - injectedNamesToPlugins$jscomp$inline_255.hasOwnProperty( - pluginName$jscomp$inline_257 + injectedNamesToPlugins$jscomp$inline_256.hasOwnProperty( + pluginName$jscomp$inline_258 ) ) { - var pluginModule$jscomp$inline_258 = - injectedNamesToPlugins$jscomp$inline_255[pluginName$jscomp$inline_257]; + var pluginModule$jscomp$inline_259 = + injectedNamesToPlugins$jscomp$inline_256[pluginName$jscomp$inline_258]; if ( - !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_257) || - namesToPlugins[pluginName$jscomp$inline_257] !== - pluginModule$jscomp$inline_258 + !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_258) || + namesToPlugins[pluginName$jscomp$inline_258] !== + pluginModule$jscomp$inline_259 ) { - if (namesToPlugins[pluginName$jscomp$inline_257]) + if (namesToPlugins[pluginName$jscomp$inline_258]) throw Error( "EventPluginRegistry: Cannot inject two different event plugins using the same name, `" + - (pluginName$jscomp$inline_257 + "`.") + (pluginName$jscomp$inline_258 + "`.") ); - namesToPlugins[pluginName$jscomp$inline_257] = - pluginModule$jscomp$inline_258; - isOrderingDirty$jscomp$inline_256 = !0; + namesToPlugins[pluginName$jscomp$inline_258] = + pluginModule$jscomp$inline_259; + isOrderingDirty$jscomp$inline_257 = !0; } } -isOrderingDirty$jscomp$inline_256 && recomputePluginOrdering(); +isOrderingDirty$jscomp$inline_257 && recomputePluginOrdering(); var instanceCache = new Map(), instanceProps = new Map(); function getInstanceFromTag(tag) { @@ -3389,25 +3389,20 @@ function createChildReconciler(shouldTrackSideEffects) { function reconcileChildrenIterator( returnFiber, currentFirstChild, - newChildrenIterable, + newChildren, lanes ) { - var iteratorFn = getIteratorFn(newChildrenIterable); - if ("function" !== typeof iteratorFn) - throw Error( - "An object is not an iterable. This error is likely caused by a bug in React. Please file an issue." - ); - newChildrenIterable = iteratorFn.call(newChildrenIterable); - if (null == newChildrenIterable) + if (null == newChildren) throw Error("An iterable object provided no iterator."); for ( - var previousNewFiber = (iteratorFn = null), + var resultingFirstChild = null, + previousNewFiber = null, oldFiber = currentFirstChild, newIdx = (currentFirstChild = 0), nextOldFiber = null, - step = newChildrenIterable.next(); + step = newChildren.next(); null !== oldFiber && !step.done; - newIdx++, step = newChildrenIterable.next(), null + newIdx++, step = newChildren.next(), null ) { oldFiber.index > newIdx ? ((nextOldFiber = oldFiber), (oldFiber = null)) @@ -3423,28 +3418,30 @@ function createChildReconciler(shouldTrackSideEffects) { deleteChild(returnFiber, oldFiber); currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); null === previousNewFiber - ? (iteratorFn = newFiber) + ? (resultingFirstChild = newFiber) : (previousNewFiber.sibling = newFiber); previousNewFiber = newFiber; oldFiber = nextOldFiber; } if (step.done) - return deleteRemainingChildren(returnFiber, oldFiber), iteratorFn; + return ( + deleteRemainingChildren(returnFiber, oldFiber), resultingFirstChild + ); if (null === oldFiber) { - for (; !step.done; newIdx++, step = newChildrenIterable.next(), null) + for (; !step.done; newIdx++, step = newChildren.next(), null) (step = createChild(returnFiber, step.value, lanes)), null !== step && ((currentFirstChild = placeChild(step, currentFirstChild, newIdx)), null === previousNewFiber - ? (iteratorFn = step) + ? (resultingFirstChild = step) : (previousNewFiber.sibling = step), (previousNewFiber = step)); - return iteratorFn; + return resultingFirstChild; } for ( oldFiber = mapRemainingChildren(oldFiber); !step.done; - newIdx++, step = newChildrenIterable.next(), null + newIdx++, step = newChildren.next(), null ) (step = updateFromMap(oldFiber, returnFiber, newIdx, step.value, lanes)), null !== step && @@ -3453,14 +3450,14 @@ function createChildReconciler(shouldTrackSideEffects) { oldFiber.delete(null === step.key ? newIdx : step.key), (currentFirstChild = placeChild(step, currentFirstChild, newIdx)), null === previousNewFiber - ? (iteratorFn = step) + ? (resultingFirstChild = step) : (previousNewFiber.sibling = step), (previousNewFiber = step)); shouldTrackSideEffects && oldFiber.forEach(function (child) { return deleteChild(returnFiber, child); }); - return iteratorFn; + return resultingFirstChild; } function reconcileChildFibersImpl( returnFiber, @@ -3587,13 +3584,20 @@ function createChildReconciler(shouldTrackSideEffects) { newChild, lanes ); - if (getIteratorFn(newChild)) + if (getIteratorFn(newChild)) { + key = getIteratorFn(newChild); + if ("function" !== typeof key) + throw Error( + "An object is not an iterable. This error is likely caused by a bug in React. Please file an issue." + ); + newChild = key.call(newChild); return reconcileChildrenIterator( returnFiber, currentFirstChild, newChild, lanes ); + } if ("function" === typeof newChild.then) return reconcileChildFibersImpl( returnFiber, @@ -10825,10 +10829,10 @@ batchedUpdatesImpl = function (fn, a) { } }; var roots = new Map(), - devToolsConfig$jscomp$inline_1168 = { + devToolsConfig$jscomp$inline_1177 = { findFiberByHostInstance: getInstanceFromTag, bundleType: 0, - version: "19.0.0-canary-8dcee9a8", + version: "19.0.0-canary-e4d135f3", rendererPackageName: "react-native-renderer", rendererConfig: { getInspectorDataForInstance: getInspectorDataForInstance, @@ -10844,11 +10848,11 @@ var roots = new Map(), }.bind(null, findNodeHandle) } }; -var internals$jscomp$inline_1452 = { - bundleType: devToolsConfig$jscomp$inline_1168.bundleType, - version: devToolsConfig$jscomp$inline_1168.version, - rendererPackageName: devToolsConfig$jscomp$inline_1168.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1168.rendererConfig, +var internals$jscomp$inline_1461 = { + bundleType: devToolsConfig$jscomp$inline_1177.bundleType, + version: devToolsConfig$jscomp$inline_1177.version, + rendererPackageName: devToolsConfig$jscomp$inline_1177.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1177.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -10864,26 +10868,26 @@ var internals$jscomp$inline_1452 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1168.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1177.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-canary-8dcee9a8" + reconcilerVersion: "19.0.0-canary-e4d135f3" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1453 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1462 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1453.isDisabled && - hook$jscomp$inline_1453.supportsFiber + !hook$jscomp$inline_1462.isDisabled && + hook$jscomp$inline_1462.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1453.inject( - internals$jscomp$inline_1452 + (rendererID = hook$jscomp$inline_1462.inject( + internals$jscomp$inline_1461 )), - (injectedHook = hook$jscomp$inline_1453); + (injectedHook = hook$jscomp$inline_1462); } catch (err) {} } exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = { diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js index 9fcb58c8c0ff9..cb9cf47867bec 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<43dee07829a8836e41fb24b81dcf0f1c>> + * @generated SignedSource<> */ "use strict"; @@ -897,7 +897,7 @@ eventPluginOrder = Array.prototype.slice.call([ "ReactNativeBridgeEventPlugin" ]); recomputePluginOrdering(); -var injectedNamesToPlugins$jscomp$inline_271 = { +var injectedNamesToPlugins$jscomp$inline_272 = { ResponderEventPlugin: ResponderEventPlugin, ReactNativeBridgeEventPlugin: { eventTypes: {}, @@ -943,32 +943,32 @@ var injectedNamesToPlugins$jscomp$inline_271 = { } } }, - isOrderingDirty$jscomp$inline_272 = !1, - pluginName$jscomp$inline_273; -for (pluginName$jscomp$inline_273 in injectedNamesToPlugins$jscomp$inline_271) + isOrderingDirty$jscomp$inline_273 = !1, + pluginName$jscomp$inline_274; +for (pluginName$jscomp$inline_274 in injectedNamesToPlugins$jscomp$inline_272) if ( - injectedNamesToPlugins$jscomp$inline_271.hasOwnProperty( - pluginName$jscomp$inline_273 + injectedNamesToPlugins$jscomp$inline_272.hasOwnProperty( + pluginName$jscomp$inline_274 ) ) { - var pluginModule$jscomp$inline_274 = - injectedNamesToPlugins$jscomp$inline_271[pluginName$jscomp$inline_273]; + var pluginModule$jscomp$inline_275 = + injectedNamesToPlugins$jscomp$inline_272[pluginName$jscomp$inline_274]; if ( - !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_273) || - namesToPlugins[pluginName$jscomp$inline_273] !== - pluginModule$jscomp$inline_274 + !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_274) || + namesToPlugins[pluginName$jscomp$inline_274] !== + pluginModule$jscomp$inline_275 ) { - if (namesToPlugins[pluginName$jscomp$inline_273]) + if (namesToPlugins[pluginName$jscomp$inline_274]) throw Error( "EventPluginRegistry: Cannot inject two different event plugins using the same name, `" + - (pluginName$jscomp$inline_273 + "`.") + (pluginName$jscomp$inline_274 + "`.") ); - namesToPlugins[pluginName$jscomp$inline_273] = - pluginModule$jscomp$inline_274; - isOrderingDirty$jscomp$inline_272 = !0; + namesToPlugins[pluginName$jscomp$inline_274] = + pluginModule$jscomp$inline_275; + isOrderingDirty$jscomp$inline_273 = !0; } } -isOrderingDirty$jscomp$inline_272 && recomputePluginOrdering(); +isOrderingDirty$jscomp$inline_273 && recomputePluginOrdering(); var instanceCache = new Map(), instanceProps = new Map(); function getInstanceFromTag(tag) { @@ -3511,25 +3511,20 @@ function createChildReconciler(shouldTrackSideEffects) { function reconcileChildrenIterator( returnFiber, currentFirstChild, - newChildrenIterable, + newChildren, lanes ) { - var iteratorFn = getIteratorFn(newChildrenIterable); - if ("function" !== typeof iteratorFn) - throw Error( - "An object is not an iterable. This error is likely caused by a bug in React. Please file an issue." - ); - newChildrenIterable = iteratorFn.call(newChildrenIterable); - if (null == newChildrenIterable) + if (null == newChildren) throw Error("An iterable object provided no iterator."); for ( - var previousNewFiber = (iteratorFn = null), + var resultingFirstChild = null, + previousNewFiber = null, oldFiber = currentFirstChild, newIdx = (currentFirstChild = 0), nextOldFiber = null, - step = newChildrenIterable.next(); + step = newChildren.next(); null !== oldFiber && !step.done; - newIdx++, step = newChildrenIterable.next(), null + newIdx++, step = newChildren.next(), null ) { oldFiber.index > newIdx ? ((nextOldFiber = oldFiber), (oldFiber = null)) @@ -3545,28 +3540,30 @@ function createChildReconciler(shouldTrackSideEffects) { deleteChild(returnFiber, oldFiber); currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); null === previousNewFiber - ? (iteratorFn = newFiber) + ? (resultingFirstChild = newFiber) : (previousNewFiber.sibling = newFiber); previousNewFiber = newFiber; oldFiber = nextOldFiber; } if (step.done) - return deleteRemainingChildren(returnFiber, oldFiber), iteratorFn; + return ( + deleteRemainingChildren(returnFiber, oldFiber), resultingFirstChild + ); if (null === oldFiber) { - for (; !step.done; newIdx++, step = newChildrenIterable.next(), null) + for (; !step.done; newIdx++, step = newChildren.next(), null) (step = createChild(returnFiber, step.value, lanes)), null !== step && ((currentFirstChild = placeChild(step, currentFirstChild, newIdx)), null === previousNewFiber - ? (iteratorFn = step) + ? (resultingFirstChild = step) : (previousNewFiber.sibling = step), (previousNewFiber = step)); - return iteratorFn; + return resultingFirstChild; } for ( oldFiber = mapRemainingChildren(oldFiber); !step.done; - newIdx++, step = newChildrenIterable.next(), null + newIdx++, step = newChildren.next(), null ) (step = updateFromMap(oldFiber, returnFiber, newIdx, step.value, lanes)), null !== step && @@ -3575,14 +3572,14 @@ function createChildReconciler(shouldTrackSideEffects) { oldFiber.delete(null === step.key ? newIdx : step.key), (currentFirstChild = placeChild(step, currentFirstChild, newIdx)), null === previousNewFiber - ? (iteratorFn = step) + ? (resultingFirstChild = step) : (previousNewFiber.sibling = step), (previousNewFiber = step)); shouldTrackSideEffects && oldFiber.forEach(function (child) { return deleteChild(returnFiber, child); }); - return iteratorFn; + return resultingFirstChild; } function reconcileChildFibersImpl( returnFiber, @@ -3709,13 +3706,20 @@ function createChildReconciler(shouldTrackSideEffects) { newChild, lanes ); - if (getIteratorFn(newChild)) + if (getIteratorFn(newChild)) { + key = getIteratorFn(newChild); + if ("function" !== typeof key) + throw Error( + "An object is not an iterable. This error is likely caused by a bug in React. Please file an issue." + ); + newChild = key.call(newChild); return reconcileChildrenIterator( returnFiber, currentFirstChild, newChild, lanes ); + } if ("function" === typeof newChild.then) return reconcileChildFibersImpl( returnFiber, @@ -11531,10 +11535,10 @@ batchedUpdatesImpl = function (fn, a) { } }; var roots = new Map(), - devToolsConfig$jscomp$inline_1248 = { + devToolsConfig$jscomp$inline_1257 = { findFiberByHostInstance: getInstanceFromTag, bundleType: 0, - version: "19.0.0-canary-8d3077e0", + version: "19.0.0-canary-e234a1a7", rendererPackageName: "react-native-renderer", rendererConfig: { getInspectorDataForInstance: getInspectorDataForInstance, @@ -11564,10 +11568,10 @@ var roots = new Map(), } catch (err) {} return hook.checkDCE ? !0 : !1; })({ - bundleType: devToolsConfig$jscomp$inline_1248.bundleType, - version: devToolsConfig$jscomp$inline_1248.version, - rendererPackageName: devToolsConfig$jscomp$inline_1248.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1248.rendererConfig, + bundleType: devToolsConfig$jscomp$inline_1257.bundleType, + version: devToolsConfig$jscomp$inline_1257.version, + rendererPackageName: devToolsConfig$jscomp$inline_1257.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1257.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -11583,14 +11587,14 @@ var roots = new Map(), return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1248.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1257.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-canary-8d3077e0" + reconcilerVersion: "19.0.0-canary-e234a1a7" }); exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = { computeComponentStackForErrorReporting: function (reactTag) {