Skip to content

[Fiber] track stylesheet preloads when explicitly preloaded#36386

Open
gnoff wants to merge 1 commit intofacebook:mainfrom
gnoff:jstory/connect-stylesheets-to-preload-loading
Open

[Fiber] track stylesheet preloads when explicitly preloaded#36386
gnoff wants to merge 1 commit 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 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.

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

Comparing: f4e0d4e...8629e1a

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.09% 612.85 kB 613.40 kB +0.06% 108.29 kB 108.36 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.08% 678.78 kB 679.34 kB +0.05% 119.26 kB 119.32 kB
facebook-www/ReactDOM-prod.classic.js +0.08% 699.20 kB 699.76 kB +0.07% 122.82 kB 122.90 kB
facebook-www/ReactDOM-prod.modern.js +0.08% 689.51 kB 690.07 kB +0.07% 121.21 kB 121.29 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against 8629e1a

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.

2 participants