Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fizz][Float] When src or srcSet is a data URI we should not preload the image #27218

Merged
merged 1 commit into from
Aug 12, 2023

Conversation

gnoff
Copy link
Collaborator

@gnoff gnoff commented Aug 11, 2023

Data URI's in images can't effectively be preloaded (the URI contains the data so preloading only duplicates the data in the stream. If we encounter an image with this protocol in the src attribute we should avoid preloading it.

@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Aug 11, 2023
@gnoff gnoff changed the title When src or srcSet is a data URI we should not preload the image [Fizz][Float] When src or srcSet is a data URI we should not preload the image Aug 11, 2023
@gnoff gnoff requested a review from sebmarkbage August 11, 2023 20:18
@react-sizebot
Copy link

react-sizebot commented Aug 11, 2023

Comparing: 4e3618a...5fe0371

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.min.js = 164.32 kB 164.32 kB = 51.76 kB 51.76 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js = 171.74 kB 171.74 kB = 53.97 kB 53.98 kB
facebook-www/ReactDOM-prod.classic.js = 567.12 kB 567.12 kB = 100.09 kB 100.09 kB
facebook-www/ReactDOM-prod.modern.js = 550.92 kB 550.92 kB = 97.25 kB 97.25 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable-semver/react-dom/umd/react-dom-server-legacy.browser.production.min.js +0.50% 59.62 kB 59.91 kB +0.54% 18.18 kB 18.28 kB
oss-stable/react-dom/umd/react-dom-server-legacy.browser.production.min.js +0.50% 59.64 kB 59.94 kB +0.54% 18.20 kB 18.30 kB
oss-stable-semver/react-dom/cjs/react-dom-server-legacy.browser.production.min.js +0.50% 59.45 kB 59.74 kB +0.55% 17.85 kB 17.95 kB
oss-stable/react-dom/cjs/react-dom-server-legacy.browser.production.min.js +0.50% 59.47 kB 59.77 kB +0.55% 17.87 kB 17.97 kB
oss-stable-semver/react-dom/cjs/react-dom-server.browser.production.min.js +0.49% 61.60 kB 61.90 kB +0.43% 19.19 kB 19.27 kB
oss-stable/react-dom/cjs/react-dom-server.browser.production.min.js +0.49% 61.62 kB 61.92 kB +0.44% 19.21 kB 19.30 kB
oss-stable-semver/react-dom/umd/react-dom-server.browser.production.min.js +0.49% 61.76 kB 62.06 kB +0.50% 19.46 kB 19.56 kB
oss-stable/react-dom/umd/react-dom-server.browser.production.min.js +0.49% 61.78 kB 62.08 kB +0.50% 19.48 kB 19.58 kB
oss-experimental/react-dom/cjs/react-dom-server-legacy.browser.production.min.js +0.48% 61.29 kB 61.58 kB +0.45% 18.58 kB 18.67 kB
oss-experimental/react-dom/umd/react-dom-server-legacy.browser.production.min.js +0.48% 61.45 kB 61.75 kB +0.50% 18.96 kB 19.06 kB
oss-experimental/react-dom/cjs/react-dom-static.browser.production.min.js +0.48% 62.76 kB 63.06 kB +0.47% 19.62 kB 19.71 kB
oss-experimental/react-dom/umd/react-dom-server.browser.production.min.js +0.48% 63.04 kB 63.34 kB +0.42% 19.96 kB 20.04 kB
oss-experimental/react-dom/cjs/react-dom-server.browser.production.min.js +0.48% 62.88 kB 63.18 kB +0.47% 19.68 kB 19.77 kB
oss-experimental/react-dom/cjs/react-dom-static.edge.production.min.js +0.48% 63.10 kB 63.40 kB +0.47% 19.74 kB 19.83 kB
oss-stable-semver/react-dom/cjs/react-dom-server.bun.production.min.js +0.46% 63.97 kB 64.26 kB +0.48% 19.58 kB 19.68 kB
oss-stable/react-dom/cjs/react-dom-server.bun.production.min.js +0.46% 63.99 kB 64.29 kB +0.47% 19.61 kB 19.70 kB
oss-stable-semver/react-dom/cjs/react-dom-server-legacy.node.production.min.js +0.46% 64.22 kB 64.52 kB +0.50% 19.43 kB 19.53 kB
oss-stable/react-dom/cjs/react-dom-server-legacy.node.production.min.js +0.46% 64.25 kB 64.54 kB +0.50% 19.46 kB 19.56 kB
oss-stable-semver/react-dom/cjs/react-dom-server.edge.production.min.js +0.45% 65.84 kB 66.13 kB +0.42% 20.63 kB 20.71 kB
oss-stable/react-dom/cjs/react-dom-server.edge.production.min.js +0.45% 65.86 kB 66.16 kB +0.41% 20.65 kB 20.74 kB
oss-stable-semver/react-dom/cjs/react-dom-server.node.production.min.js +0.45% 65.94 kB 66.24 kB +0.49% 20.62 kB 20.72 kB
oss-stable/react-dom/cjs/react-dom-server.node.production.min.js +0.45% 65.96 kB 66.26 kB +0.49% 20.64 kB 20.74 kB
oss-experimental/react-dom/cjs/react-dom-server.bun.production.min.js +0.45% 65.92 kB 66.22 kB +0.48% 20.34 kB 20.44 kB
oss-experimental/react-dom/cjs/react-dom-server-legacy.node.production.min.js +0.45% 66.17 kB 66.47 kB +0.46% 20.20 kB 20.29 kB
oss-experimental/react-dom/cjs/react-dom-server.edge.production.min.js +0.45% 67.23 kB 67.53 kB +0.45% 21.15 kB 21.24 kB
oss-experimental/react-dom/cjs/react-dom-static.node.production.min.js +0.44% 67.31 kB 67.60 kB +0.42% 21.19 kB 21.28 kB
oss-experimental/react-dom/cjs/react-dom-server.node.production.min.js +0.44% 67.33 kB 67.63 kB +0.43% 21.17 kB 21.26 kB
facebook-www/ReactDOMServer-prod.modern.js +0.40% 141.79 kB 142.35 kB +0.45% 26.04 kB 26.15 kB
facebook-www/ReactDOMServer-prod.classic.js +0.39% 145.31 kB 145.88 kB +0.43% 26.72 kB 26.83 kB
facebook-www/ReactDOMServerStreaming-prod.modern.js +0.38% 148.46 kB 149.03 kB +0.39% 27.74 kB 27.85 kB

Generated by 🚫 dangerJS against 5fe0371

@gnoff gnoff force-pushed the img-preload-no-datauri branch from 1dd669b to f62c901 Compare August 11, 2023 20:23
@gnoff gnoff force-pushed the img-preload-no-datauri branch from f62c901 to 5fe0371 Compare August 12, 2023 16:13
@gnoff gnoff merged commit 1a001da into facebook:main Aug 12, 2023
@gnoff gnoff deleted the img-preload-no-datauri branch August 12, 2023 16:21
github-actions bot pushed a commit that referenced this pull request Aug 12, 2023
…the image (#27218)

Data URI's in images can't effectively be preloaded (the URI contains
the data so preloading only duplicates the data in the stream. If we
encounter an image with this protocol in the src attribute we should
avoid preloading it.

DiffTrain build for [1a001da](1a001da)
kodiakhq bot pushed a commit to vercel/next.js that referenced this pull request Aug 12, 2023
EdisonVan pushed a commit to EdisonVan/react that referenced this pull request Apr 15, 2024
…the image (facebook#27218)

Data URI's in images can't effectively be preloaded (the URI contains
the data so preloading only duplicates the data in the stream. If we
encounter an image with this protocol in the src attribute we should
avoid preloading it.
bigfootjon pushed a commit that referenced this pull request Apr 18, 2024
…the image (#27218)

Data URI's in images can't effectively be preloaded (the URI contains
the data so preloading only duplicates the data in the stream. If we
encounter an image with this protocol in the src attribute we should
avoid preloading it.

DiffTrain build for commit 1a001da.
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.

5 participants