Skip to content

Add support for skew protect for images and fonts#14627

Merged
matthewp merged 14 commits intomainfrom
skew-images-fonts
Oct 29, 2025
Merged

Add support for skew protect for images and fonts#14627
matthewp merged 14 commits intomainfrom
skew-images-fonts

Conversation

@matthewp
Copy link
Copy Markdown
Contributor

@matthewp matthewp commented Oct 27, 2025

Changes

  • Makes assetQueryParams available as the imageConfig passed to image services so they can append. Default service uses it.
  • Passes it to Font URL resolution too

Testing

  • Added tests for links (styles), images, and fonts.

Docs

N/A, bug fix.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Oct 27, 2025

🦋 Changeset detected

Latest commit: 04e5bd7

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 27, 2025
@matthewp matthewp added the pr preview Apply this label to a PR to generate a preview release label Oct 27, 2025
@matthewp matthewp self-assigned this Oct 27, 2025
@github-actions github-actions bot removed the pr preview Apply this label to a PR to generate a preview release label Oct 27, 2025
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Oct 27, 2025

npm i https://pkg.pr.new/astro@14627

commit: a91cfe5

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Oct 27, 2025

CodSpeed Performance Report

Merging #14627 will not alter performance

Comparing skew-images-fonts (04e5bd7) with main (c5fe295)1

Summary

✅ 6 untouched

Footnotes

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

@matthewp matthewp added the pr preview Apply this label to a PR to generate a preview release label Oct 27, 2025
@github-actions github-actions bot removed the pr preview Apply this label to a PR to generate a preview release label Oct 27, 2025
Add comprehensive test suite for adapter client assetQueryParams feature across different asset types. Tests verify that query parameters (e.g., deployment IDs for skew protection) are correctly appended to:
- Stylesheet URLs in SSR
- Image component src attributes in SSR
- Font preload links in SSR

Updates fonts fixture to enable experimental fonts feature for testing.
@matthewp matthewp marked this pull request as ready for review October 27, 2025 20:09
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 update the fonts unit tests:

  1. Make sure types are still fine after my suggestions (eg. searchParams is not optional)
  2. Add unit test for searchParams in implementations.test.js

Copy link
Copy Markdown
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

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

I would update the code to work with URL types instead of strings

Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Oct 29, 2025

📝 Changeset Validation Results

Changeset validation failed

Issues Found:

.changeset/apply-asset-query-params-to-assets.md

Issue with: 'Fixes skew protection support for images and font URLs'

❌ The description does not match the specified change type 'patch' as it introduces new capabilities to the asset handling system.

💡 Use a change type of 'minor' for this changeset as it includes new features.

General Errors:

  • Detected inconsistency between the description content and the specified change type.

📖 See Astro's changeset guide for details.

@matthewp matthewp merged commit b368de0 into main Oct 29, 2025
23 checks passed
@matthewp matthewp deleted the skew-images-fonts branch October 29, 2025 15:07
@astrobot-houston astrobot-houston mentioned this pull request Oct 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants