Skip to content

Preserve head metadata in Cloudflare dev rendering#16161

Merged
matthewp merged 9 commits intomainfrom
cloudflare-dev-head-metadata
Apr 1, 2026
Merged

Preserve head metadata in Cloudflare dev rendering#16161
matthewp merged 9 commits intomainfrom
cloudflare-dev-head-metadata

Conversation

@matthewp
Copy link
Copy Markdown
Contributor

Changes

  • Adds a new dev-only virtual module virtual:astro:component-metadata from the head metadata plugin.
  • Updates NonRunnablePipeline to use that metadata map so dev rendering has the same head metadata context as runnable dev.

Testing

  • Reproduced Starlight + Cloudflare dev output where style tags were injected inside a <template> when metadata was missing.
  • Verified that with metadata provided through the new virtual module, head metadata is available during non-runnable render and styles are injected in normal head flow.

Docs

  • No docs update needed because this is an internal dev rendering fix.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 31, 2026

🦋 Changeset detected

Latest commit: 3dd1d63

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 Mar 31, 2026
@matthewp matthewp added pr preview Apply this label to a PR to generate a preview release and removed pr preview Apply this label to a PR to generate a preview release labels Mar 31, 2026
@matthewp matthewp added the pr preview Apply this label to a PR to generate a preview release label Mar 31, 2026
@github-actions github-actions bot removed the pr preview Apply this label to a PR to generate a preview release label Mar 31, 2026
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 31, 2026

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

commit: 2ca2bdf

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 31, 2026

Merging this PR will not alter performance

✅ 18 untouched benchmarks


Comparing cloudflare-dev-head-metadata (3dd1d63) with main (4eec0f1)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (1d1448c) during the generation of this report, so 4eec0f1 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 Mar 31, 2026
@github-actions github-actions bot removed the pr preview Apply this label to a PR to generate a preview release label Mar 31, 2026
@matthewp matthewp marked this pull request as ready for review March 31, 2026 16:52
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.

Not sure why we need a plugin specifically for the non-runnable pipeline. If it works for the non-runnable, it must work for the runnable pipeline too. Wouldn't make sense to use one?

Regardless, please document its usage somewhere so we're aware of it

@matthewp matthewp merged commit b51f297 into main Apr 1, 2026
26 checks passed
@matthewp matthewp deleted the cloudflare-dev-head-metadata branch April 1, 2026 14:57
@astrobot-houston astrobot-houston mentioned this pull request Apr 1, 2026
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

Development

Successfully merging this pull request may close these issues.

2 participants