Skip to content

[Fiber] track stylesheet preloads when explicitly preloaded#36386

Merged
gnoff merged 2 commits intofacebook:mainfrom
gnoff:jstory/connect-stylesheets-to-preload-loading
May 7, 2026
Merged

[Fiber] track stylesheet preloads when explicitly preloaded#36386
gnoff merged 2 commits intofacebook:mainfrom
gnoff:jstory/connect-stylesheets-to-preload-loading

Conversation

@gnoff
Copy link
Copy Markdown
Collaborator

@gnoff gnoff commented May 1, 2026

Previously stylesheet resources would omit connecting with preloads inserted via preload which caused unecessary suspension of commits since the stylsheet resource would attempt to load the stylesheet again and delay the initial commit or commit a fallback (depending on whether the current screen should remain). This missing piece is that if you preload a stylesheet you must be able to use that sheets loading state when determining if the stylesheet is already loaded or not.

This adds a pending indicator on client inserted prelaod links. We still assume SSR'd preloads are already loaded.

Previously stylesheet resources would omit connecting with preloads inserted via `preload` which caused unecessary suspension of commits since the stylsheet resource would attempt ot load the stylesheet again and delay the initial commit or commit a fallback (depending on whether the current screen should remain). This missing piece is that if you preload a stylesheet you must be able to use that sheets loading state when determining if the stylesheet is already loaded or not.

This adds a pending indicator on client inserted prelaod links. We still assume SSR'd preloads are already loaded.
@meta-cla meta-cla Bot added the CLA Signed label May 1, 2026
@gnoff gnoff requested review from acdlite and eps1lon May 1, 2026 19:38
@github-actions github-actions Bot added the React Core Team Opened by a member of the React Core Team label May 1, 2026
@react-sizebot
Copy link
Copy Markdown

react-sizebot commented May 1, 2026

Comparing: f4e0d4e...a13ce76

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.js = 6.84 kB 6.84 kB +0.05% 1.88 kB 1.88 kB
oss-stable/react-dom/cjs/react-dom-client.production.js +0.11% 612.85 kB 613.53 kB +0.13% 108.29 kB 108.44 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.84 kB 6.84 kB +0.05% 1.88 kB 1.88 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js +0.10% 678.78 kB 679.46 kB +0.12% 119.26 kB 119.40 kB
facebook-www/ReactDOM-prod.classic.js +0.10% 699.20 kB 699.88 kB +0.12% 122.82 kB 122.96 kB
facebook-www/ReactDOM-prod.modern.js +0.10% 689.51 kB 690.20 kB +0.12% 121.21 kB 121.35 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against a13ce76

Comment thread packages/react-dom-bindings/src/client/ReactFiberConfigDOM.js Outdated
…tylesheets remains because it is byte length sensitive with the fizz runtime.
@gnoff gnoff merged commit d5736f0 into facebook:main May 7, 2026
237 checks passed
@gnoff gnoff deleted the jstory/connect-stylesheets-to-preload-loading branch May 7, 2026 17:49
github-actions Bot pushed a commit that referenced this pull request May 7, 2026
Previously stylesheet resources would omit connecting with preloads
inserted via `preload` which caused unecessary suspension of commits
since the stylsheet resource would attempt to load the stylesheet again
and delay the initial commit or commit a fallback (depending on whether
the current screen should remain). This missing piece is that if you
preload a stylesheet you must be able to use that sheets loading state
when determining if the stylesheet is already loaded or not.

This adds a pending indicator on client inserted prelaod links. We still
assume SSR'd preloads are already loaded.

DiffTrain build for [d5736f0](d5736f0)
github-actions Bot pushed a commit that referenced this pull request May 7, 2026
Previously stylesheet resources would omit connecting with preloads
inserted via `preload` which caused unecessary suspension of commits
since the stylsheet resource would attempt to load the stylesheet again
and delay the initial commit or commit a fallback (depending on whether
the current screen should remain). This missing piece is that if you
preload a stylesheet you must be able to use that sheets loading state
when determining if the stylesheet is already loaded or not.

This adds a pending indicator on client inserted prelaod links. We still
assume SSR'd preloads are already loaded.

DiffTrain build for [d5736f0](d5736f0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed React Core Team Opened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants