From b07717d857422af5fb1c2ee0930e5a2a62df2b0e Mon Sep 17 00:00:00 2001 From: Ricky Date: Wed, 28 May 2025 10:31:09 -0400 Subject: [PATCH 1/2] [devtools] upgrade json5 (#33358) --- packages/react-devtools-shared/package.json | 2 +- yarn.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-devtools-shared/package.json b/packages/react-devtools-shared/package.json index 94f3f9411b0..a8daa42a0d0 100644 --- a/packages/react-devtools-shared/package.json +++ b/packages/react-devtools-shared/package.json @@ -20,7 +20,7 @@ "clipboard-js": "^0.3.6", "compare-versions": "^5.0.3", "jsc-safe-url": "^0.2.4", - "json5": "^2.1.3", + "json5": "^2.2.3", "local-storage-fallback": "^4.1.1", "react-virtualized-auto-sizer": "^1.0.23", "react-window": "^1.8.10" diff --git a/yarn.lock b/yarn.lock index 90e9a8b06c9..0496eb78445 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11773,7 +11773,7 @@ json5@^2.1.0: dependencies: minimist "^1.2.0" -json5@^2.1.2, json5@^2.1.3: +json5@^2.1.2: version "2.1.3" resolved "https://registry.yarnpkg.com/json5/-/json5-2.1.3.tgz#c9b0f7fa9233bfe5807fe66fcf3a5617ed597d43" integrity sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA== From 5717f1933f2e8b10406fde1043c3047cbfbddc82 Mon Sep 17 00:00:00 2001 From: "Sebastian \"Sebbie\" Silbermann" Date: Wed, 28 May 2025 19:46:12 +0200 Subject: [PATCH 2/2] [react-dom] Enforce small gap between completed navigation and default Transition indicator (#33354) --- fixtures/flight/src/App.js | 2 + fixtures/flight/src/Navigate.js | 40 +++++++++++++++++++ .../ReactDOMDefaultTransitionIndicator.js | 5 ++- 3 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 fixtures/flight/src/Navigate.js diff --git a/fixtures/flight/src/App.js b/fixtures/flight/src/App.js index 2f2118580a9..7b811dd7628 100644 --- a/fixtures/flight/src/App.js +++ b/fixtures/flight/src/App.js @@ -12,6 +12,7 @@ import Button from './Button.js'; import Form from './Form.js'; import {Dynamic} from './Dynamic.js'; import {Client} from './Client.js'; +import {Navigate} from './Navigate.js'; import {Note} from './cjs/Note.js'; @@ -89,6 +90,7 @@ export default async function App({prerender}) { {dedupedChild} {Promise.resolve([dedupedChild])} + diff --git a/fixtures/flight/src/Navigate.js b/fixtures/flight/src/Navigate.js new file mode 100644 index 00000000000..4436b9fdf7d --- /dev/null +++ b/fixtures/flight/src/Navigate.js @@ -0,0 +1,40 @@ +'use client'; + +import * as React from 'react'; +import Container from './Container.js'; + +export function Navigate() { + /** Repro for https://issues.chromium.org/u/1/issues/419746417 */ + function provokeChromeCrash() { + React.startTransition(async () => { + console.log('Default transition triggered'); + + await new Promise(resolve => { + setTimeout( + () => { + history.pushState( + {}, + '', + `?chrome-crash-419746417=${performance.now()}` + ); + }, + // This needs to happen before React's default transition indicator + // is displayed but after it's scheduled. + 100 + -50 + ); + + setTimeout(() => { + console.log('Default transition completed'); + resolve(); + }, 1000); + }); + }); + } + + return ( + +

Navigation fixture

+ +
+ ); +} diff --git a/packages/react-dom/src/client/ReactDOMDefaultTransitionIndicator.js b/packages/react-dom/src/client/ReactDOMDefaultTransitionIndicator.js index 8f1a32d826c..37661849cad 100644 --- a/packages/react-dom/src/client/ReactDOMDefaultTransitionIndicator.js +++ b/packages/react-dom/src/client/ReactDOMDefaultTransitionIndicator.js @@ -38,7 +38,8 @@ export function defaultOnDefaultTransitionIndicator(): void | (() => void) { if (!isCancelled) { // Some other navigation completed but we should still be running. // Start another fake one to keep the loading indicator going. - startFakeNavigation(); + // There needs to be an async gap to work around https://issues.chromium.org/u/1/issues/419746417. + setTimeout(startFakeNavigation, 20); } } @@ -70,7 +71,7 @@ export function defaultOnDefaultTransitionIndicator(): void | (() => void) { } } - // Delay the start a bit in case this is a fast navigation. + // Delay the start a bit in case this is a fast Transition. setTimeout(startFakeNavigation, 100); return function () {