withastro / astro

The web framework for content-driven websites. ⭐️ Star to support our work!
https://astro.build
Other
45.85k stars 2.41k forks source link

fix: warn for missing head #11286

Closed ascorbic closed 3 months ago

ascorbic commented 3 months ago

Changes

This PR warns if a page has either hoisted scripts or inline styles, but does not have a head element. This can cause bugs and is probably a mistake.

Testing

Docs

changeset-bot[bot] commented 3 months ago

⚠️ No Changeset found

Latest commit: 439532db5f6c8caa25a9c3fa93a638e7b4bbcdb5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

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

matthewp commented 3 months ago

@ascorbic after reviewing the issue more, I don't think we should tackle this as a fix. For one, this only gives a warning in SSG builds. Secondly, this is an extreme edge case and we tell people to also include a <head>. For historical reasons we don't require it, but I think we should start doing so in 5.0.

ematipico commented 3 months ago

For historical reasons we don't require it

I'm curious now 🤣 what are the reasons?