Skip to content

Commit 73b6435

Browse files
authored
[Float][Fiber] Implement waitForCommitToBeReady for stylesheet resources (#26450)
Before a commit is finished if any new stylesheet resources are going to mount and we are capable of delaying the commit we will do the following 1. Wait for all preloads for newly created stylesheet resources to load 2. Once all preloads are finished we insert the stylesheet instances for these resources and wait for them all to load 3. Once all stylesheets have loaded we complete the commit In this PR I also removed the synchronous loadingstate tracking in the fizz runtime. It was not necessary to support the implementation on not used by the fizz runtime itself. It makes the inline script slightly smaller In this PR I also integrated ReactDOMFloatClient with ReactDOMHostConfig. It leads to better code factoring, something I already did on the server a while back. To make the diff a little easier to follow i make these changes in a single commit so you can look at the change after that commit if helpful There is a 500ms timeout which will finish the commit even if all suspended host instances have not finished loading yet At the moment error and load events are treated the same and we're really tracking whether the host instance is finished attempting to load.
1 parent 175962c commit 73b6435

16 files changed

+2354
-1423
lines changed

packages/react-dom-bindings/src/client/ReactDOMComponentTree.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
* @flow
88
*/
99

10-
import type {HoistableRoot, RootResources} from './ReactDOMFloatClient';
1110
import type {Fiber} from 'react-reconciler/src/ReactInternalTypes';
1211
import type {ReactScopeInstance} from 'shared/ReactTypes';
1312
import type {
@@ -20,6 +19,8 @@ import type {
2019
Instance,
2120
SuspenseInstance,
2221
Props,
22+
HoistableRoot,
23+
RootResources,
2324
} from './ReactDOMHostConfig';
2425

2526
import {

0 commit comments

Comments
 (0)