Skip to content

Only attach SVG component in SSR#14623

Merged
delucis merged 12 commits intomainfrom
chris/fix-svg-component
Oct 28, 2025
Merged

Only attach SVG component in SSR#14623
delucis merged 12 commits intomainfrom
chris/fix-svg-component

Conversation

@delucis
Copy link
Copy Markdown
Member

@delucis delucis commented Oct 26, 2025

Changes

Testing

  • I tested by applying this using pnpm patch in the reproductions for both the above issues, and it fixed both cases.
  • Existing tests should pass.
  • I’ve added a test that checks that a React component which imports an SVG does not have a large bundle size after astro build. Running this test on main results in a bundle of 66 KB. On the PR branch, the bundle is under 1 KB.
  • There’s a similar test added for the dev server which checks that the SVG module doesn’t contain any import statements, i.e. it only exports the image metadata.

Docs

n/a — bug fix

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Oct 26, 2025

🦋 Changeset detected

Latest commit: 06d1748

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Oct 26, 2025
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Oct 26, 2025

CodSpeed Performance Report

Merging #14623 will not alter performance

Comparing chris/fix-svg-component (06d1748) with main (18552c7)1

Summary

✅ 6 untouched

Footnotes

  1. No successful run was found on main (dacebaf) during the generation of this report, so 18552c7 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@ematipico ematipico added the pr preview Apply this label to a PR to generate a preview release label Oct 26, 2025
@ematipico ematipico removed the pr preview Apply this label to a PR to generate a preview release label Oct 26, 2025
@delucis delucis marked this pull request as ready for review October 28, 2025 10:37
Copy link
Copy Markdown
Member

@florian-lefebvre florian-lefebvre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a changeset?

@delucis delucis merged commit c5fe295 into main Oct 28, 2025
23 checks passed
@delucis delucis deleted the chris/fix-svg-component branch October 28, 2025 11:08
@astrobot-houston astrobot-houston mentioned this pull request Oct 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: astro Related to the core `astro` package (scope)

Projects

None yet

3 participants