diff --git a/package.json b/package.json index f9430d1cf6148..cb51955c24a52 100644 --- a/package.json +++ b/package.json @@ -233,16 +233,16 @@ "pretty-ms": "7.0.0", "random-seed": "0.3.0", "react": "19.0.0", - "react-builtin": "npm:react@19.2.0-canary-197d6a04-20250424", + "react-builtin": "npm:react@19.2.0-canary-b7e2de63-20250611", "react-dom": "19.0.0", - "react-dom-builtin": "npm:react-dom@19.2.0-canary-197d6a04-20250424", - "react-dom-experimental-builtin": "npm:react-dom@0.0.0-experimental-197d6a04-20250424", - "react-experimental-builtin": "npm:react@0.0.0-experimental-197d6a04-20250424", - "react-is-builtin": "npm:react-is@19.2.0-canary-197d6a04-20250424", - "react-server-dom-turbopack": "19.2.0-canary-197d6a04-20250424", - "react-server-dom-turbopack-experimental": "npm:react-server-dom-turbopack@0.0.0-experimental-197d6a04-20250424", - "react-server-dom-webpack": "19.2.0-canary-197d6a04-20250424", - "react-server-dom-webpack-experimental": "npm:react-server-dom-webpack@0.0.0-experimental-197d6a04-20250424", + "react-dom-builtin": "npm:react-dom@19.2.0-canary-b7e2de63-20250611", + "react-dom-experimental-builtin": "npm:react-dom@0.0.0-experimental-b7e2de63-20250611", + "react-experimental-builtin": "npm:react@0.0.0-experimental-b7e2de63-20250611", + "react-is-builtin": "npm:react-is@19.2.0-canary-b7e2de63-20250611", + "react-server-dom-turbopack": "19.2.0-canary-b7e2de63-20250611", + "react-server-dom-turbopack-experimental": "npm:react-server-dom-turbopack@0.0.0-experimental-b7e2de63-20250611", + "react-server-dom-webpack": "19.2.0-canary-b7e2de63-20250611", + "react-server-dom-webpack-experimental": "npm:react-server-dom-webpack@0.0.0-experimental-b7e2de63-20250611", "react-ssr-prepass": "1.0.8", "react-virtualized": "9.22.3", "relay-compiler": "13.0.2", @@ -252,8 +252,8 @@ "resolve-from": "5.0.0", "sass": "1.54.0", "satori": "0.12.2", - "scheduler-builtin": "npm:scheduler@0.27.0-canary-197d6a04-20250424", - "scheduler-experimental-builtin": "npm:scheduler@0.0.0-experimental-197d6a04-20250424", + "scheduler-builtin": "npm:scheduler@0.27.0-canary-b7e2de63-20250611", + "scheduler-experimental-builtin": "npm:scheduler@0.0.0-experimental-b7e2de63-20250611", "seedrandom": "3.0.5", "semver": "7.3.7", "shell-quote": "1.7.3", @@ -296,10 +296,10 @@ "@types/react-dom": "19.1.2", "@types/retry": "0.12.0", "jest-snapshot": "30.0.0-alpha.6", - "react": "19.2.0-canary-197d6a04-20250424", - "react-dom": "19.2.0-canary-197d6a04-20250424", - "react-is": "19.2.0-canary-197d6a04-20250424", - "scheduler": "0.27.0-canary-197d6a04-20250424" + "react": "19.2.0-canary-b7e2de63-20250611", + "react-dom": "19.2.0-canary-b7e2de63-20250611", + "react-is": "19.2.0-canary-b7e2de63-20250611", + "scheduler": "0.27.0-canary-b7e2de63-20250611" }, "patchedDependencies": { "webpack-sources@3.2.3": "patches/webpack-sources@3.2.3.patch", diff --git a/packages/next/src/client/app-index.tsx b/packages/next/src/client/app-index.tsx index feed92040312f..ea49e611e180e 100644 --- a/packages/next/src/client/app-index.tsx +++ b/packages/next/src/client/app-index.tsx @@ -206,7 +206,15 @@ function Root({ children }: React.PropsWithChildren<{}>) { return children } +function onDefaultTransitionIndicator() { + // TODO: Compose default with user-configureable (e.g. nprogress) + // TODO: Use React's default once we figure out hanging indicators: https://codesandbox.io/p/sandbox/charming-moon-hktkp6?file=%2Fsrc%2Findex.js%3A106%2C30 + return () => {} +} + const reactRootOptions: ReactDOMClient.RootOptions = { + // @ts-expect-error: Should pass on `@types/react` bump. + onDefaultTransitionIndicator: onDefaultTransitionIndicator, onRecoverableError, onCaughtError, onUncaughtError, diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.development.js index a45e90a546dcd..04ec88651a4d3 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.development.js @@ -83,7 +83,7 @@ "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." ); } - function noop$2() {} + function noop() {} function warnForMissingKey() {} function setToSortedString(set) { var array = []; @@ -246,15 +246,105 @@ } return null; } - function traverseFragmentInstanceChildren(child, fn, a, b, c) { + function traverseVisibleHostChildren( + child, + searchWithinHosts, + fn, + a, + b, + c + ) { for (; null !== child; ) { - if (5 === child.tag) { - if (fn(child.stateNode, a, b, c)) break; - } else - (22 === child.tag && null !== child.memoizedState) || - traverseFragmentInstanceChildren(child.child, fn, a, b, c); + if ( + (5 === child.tag && fn(child, a, b, c)) || + ((22 !== child.tag || null === child.memoizedState) && + (searchWithinHosts || 5 !== child.tag) && + traverseVisibleHostChildren( + child.child, + searchWithinHosts, + fn, + a, + b, + c + )) + ) + return !0; child = child.sibling; } + return !1; + } + function getFragmentParentHostFiber(fiber) { + for (fiber = fiber.return; null !== fiber; ) { + if (3 === fiber.tag || 5 === fiber.tag) return fiber; + fiber = fiber.return; + } + return null; + } + function getInstanceFromHostFiber(fiber) { + switch (fiber.tag) { + case 5: + return fiber.stateNode; + case 3: + return fiber.stateNode.containerInfo; + default: + throw Error("Expected to find a host node. This is a bug in React."); + } + } + function findNextSibling(child) { + searchTarget = child; + return !0; + } + function isFiberContainedBy(maybeChild, maybeParent) { + maybeParent = maybeParent.return; + if (maybeParent === maybeChild || maybeParent === maybeChild.alternate) + return !0; + for (; null !== maybeParent && maybeParent !== maybeChild; ) { + if ( + !( + (5 !== maybeParent.tag && 3 !== maybeParent.tag) || + (maybeParent.return !== maybeChild && + maybeParent.return !== maybeChild.alternate) + ) + ) + return !0; + maybeParent = maybeParent.return; + } + return !1; + } + function isFiberPrecedingCheck(child, target, boundary) { + return child === boundary + ? !0 + : child === target + ? ((searchTarget = child), !0) + : !1; + } + function isFiberFollowingCheck(child, target, boundary) { + return child === boundary + ? ((searchBoundary = child), !1) + : child === target + ? (null !== searchBoundary && (searchTarget = child), !0) + : !1; + } + function getParentForFragmentAncestors(inst) { + if (null === inst) return null; + do inst = null === inst ? null : inst.return; + while (inst && 5 !== inst.tag && 27 !== inst.tag && 3 !== inst.tag); + return inst ? inst : null; + } + function getLowestCommonAncestor(instA, instB, getParent) { + for (var depthA = 0, tempA = instA; tempA; tempA = getParent(tempA)) + depthA++; + tempA = 0; + for (var tempB = instB; tempB; tempB = getParent(tempB)) tempA++; + for (; 0 < depthA - tempA; ) (instA = getParent(instA)), depthA--; + for (; 0 < tempA - depthA; ) (instB = getParent(instB)), tempA--; + for (; depthA--; ) { + if (instA === instB || (null !== instB && instA === instB.alternate)) + return instA; + instA = getParent(instA); + instB = getParent(instB); + } + return null; } function getIteratorFn(maybeIterable) { if (null === maybeIterable || "object" !== typeof maybeIterable) @@ -298,7 +388,7 @@ case REACT_PORTAL_TYPE: return "Portal"; case REACT_CONTEXT_TYPE: - return (type.displayName || "Context") + ".Provider"; + return type.displayName || "Context"; case REACT_CONSUMER_TYPE: return (type._context.displayName || "Context") + ".Consumer"; case REACT_FORWARD_REF_TYPE: @@ -341,7 +431,7 @@ case 9: return (type._context.displayName || "Context") + ".Consumer"; case 10: - return (type.displayName || "Context") + ".Provider"; + return type.displayName || "Context"; case 18: return "DehydratedFragment"; case 11: @@ -1158,6 +1248,7 @@ } function markRootUpdated$1(root, updateLane) { root.pendingLanes |= updateLane; + root.indicatorLanes |= updateLane & 4194048; 268435456 !== updateLane && ((root.suspendedLanes = 0), (root.pingedLanes = 0), @@ -1176,6 +1267,7 @@ root.suspendedLanes = 0; root.pingedLanes = 0; root.warmLanes = 0; + root.indicatorLanes &= remainingLanes; root.expiredLanes &= remainingLanes; root.entangledLanes &= remainingLanes; root.errorRecoveryDisabledLanes &= remainingLanes; @@ -1467,6 +1559,10 @@ viewTransitionMutationContext = !1; return prev; } + function popMutationContext(prev) { + viewTransitionMutationContext && (rootMutationContext = !0); + viewTransitionMutationContext = prev; + } function getValueForAttributeOnCustomComponent(node, name, expected) { if (isAttributeNameSafe(name)) { if (!node.hasAttribute(name)) { @@ -1560,14 +1656,11 @@ ("checkbox" === type || "radio" === type) ); } - function trackValueOnNode(node) { - var valueField = isCheckable(node) ? "checked" : "value", - descriptor = Object.getOwnPropertyDescriptor( - node.constructor.prototype, - valueField - ); - checkFormFieldValueStringCoercion(node[valueField]); - var currentValue = "" + node[valueField]; + function trackValueOnNode(node, valueField, currentValue) { + var descriptor = Object.getOwnPropertyDescriptor( + node.constructor.prototype, + valueField + ); if ( !node.hasOwnProperty(valueField) && "undefined" !== typeof descriptor && @@ -1606,7 +1699,24 @@ } } function track(node) { - node._valueTracker || (node._valueTracker = trackValueOnNode(node)); + if (!node._valueTracker) { + var valueField = isCheckable(node) ? "checked" : "value"; + node._valueTracker = trackValueOnNode( + node, + valueField, + "" + node[valueField] + ); + } + } + function trackHydrated(node, initialValue, initialChecked) { + if (node._valueTracker) return !1; + if (isCheckable(node)) { + var valueField = "checked"; + initialValue = "" + initialChecked; + } else valueField = "value"; + initialChecked = "" + node[valueField]; + node._valueTracker = trackValueOnNode(node, valueField, initialValue); + return initialChecked !== initialValue; } function updateValueIfChanged(node) { if (!node) return !1; @@ -1708,48 +1818,6 @@ (element.name = "" + getToStringValue(name))) : element.removeAttribute("name"); } - function initInput( - element, - value, - defaultValue, - checked, - defaultChecked, - type, - name, - isHydrating - ) { - null != type && - "function" !== typeof type && - "symbol" !== typeof type && - "boolean" !== typeof type && - (checkAttributeStringCoercion(type, "type"), (element.type = type)); - if (null != value || null != defaultValue) { - if ( - !( - ("submit" !== type && "reset" !== type) || - (void 0 !== value && null !== value) - ) - ) - return; - defaultValue = - null != defaultValue ? "" + getToStringValue(defaultValue) : ""; - value = null != value ? "" + getToStringValue(value) : defaultValue; - isHydrating || value === element.value || (element.value = value); - element.defaultValue = value; - } - checked = null != checked ? checked : defaultChecked; - checked = - "function" !== typeof checked && - "symbol" !== typeof checked && - !!checked; - element.checked = isHydrating ? element.checked : !!checked; - element.defaultChecked = !!checked; - null != name && - "function" !== typeof name && - "symbol" !== typeof name && - "boolean" !== typeof name && - (checkAttributeStringCoercion(name, "name"), (element.name = name)); - } function setDefaultValue(node, type, value) { ("number" === type && getActiveElement(node.ownerDocument) === node) || node.defaultValue === "" + value || @@ -1868,31 +1936,6 @@ element.defaultValue = null != defaultValue ? "" + getToStringValue(defaultValue) : ""; } - function initTextarea(element, value, defaultValue, children) { - if (null == value) { - if (null != children) { - if (null != defaultValue) - throw Error( - "If you supply `defaultValue` on a