build: bump Astro from 6 to 7#685
Conversation
See https://docs.astro.build/en/guides/upgrade-to/v7/ Astro 7 changes that needed code fixes: - New Rust compiler is stricter about HTML. Every non-void element now needs a closing tag; the old Go compiler used to fix this by itself. Added the missing `</Layout>` tags in `survey.astro` and `newsletter.astro`. - Markdown now runs through a `processor`. Moved `remarkPlugins` and `rehypePlugins` into `unified({...})` from `@astrojs/markdown-remark` so the deprecation warning is gone. - Astro 7 also moves to Vite 8 (handled by the dependency bumps). - `src/lib/search-index.js` used an undefined `fs` (the import was named `fs2`). The bug was there before but stayed hidden; Astro 7 fails the `build:done` hook on it. Renamed the import to `fs`. - `package.json` override: ```js "overrides": { "astro-rehype-relative-markdown-links": { "astro": "$astro" } } ``` `astro-rehype-relative-markdown-links` does not yet list Astro 7 as a supported peer, but it works fine. The override makes it use our Astro version and avoids a peer-dependency install error. See vernak2539/astro-rehype-relative-markdown-links#84
Deploying ddev-com-front-end with
|
| Latest commit: |
924884f
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://c5b224db.ddev-com-front-end.pages.dev |
| Branch Preview URL: | https://20260723-stasadev-astro-7.ddev-com-front-end.pages.dev |
Claude Review: differential crawl of both deployed sitesInstead of eyeballing the three listed pages, I compared all 216 sitemap pages on prod ( Results — no regressions
The 11 residual differences:
Link/asset diffs reduced to build-hash changes plus giscus emitting Highest-risk change verified clean: the markdown processor migration ( Code reviewAll 8 files look correct and minimal:
Recommendation: approve. The preview deploy building and serving all 216 pages is itself proof the Astro 7 build succeeds. The only PR-attributable rendering difference is the cosmetic Comparison script used (
|
|
Manual clicking around also found no issues. |
…tons
The Astro 7 Rust compiler no longer interprets escape sequences in plain
attribute strings the way the old Go compiler did, so the CtaButton labels
rendered a literal "\n" instead of a line break on /get-started/.
Switch the two `text=` props to expression syntax (`text={"...\n..."}`) so
the escape is a real newline character, which the button's `whitespace-pre-line`
class renders as a line break as before.
🤖 Developed with assistance from [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
|
I took the liberty of pushing the tiny change to windows.astro. |
|
Claude commented on compressHTML — worth consideration, low risk The default flipped from true (HTML-aware) to 'jsx' (React-style), a documented breaking change requiring whitespace review. The repo doesn't set it, so it takes the new default. My 216-page crawl found no whitespace regressions attributable to it (the only whitespace diff was the \n bug above, which is unrelated). So it's low-risk as-is; optionally pin compressHTML: true in astro.config.mjs to guarantee Astro-6-identical output, or leave it and rely on the crawl evidence. |

The Issue
See https://docs.astro.build/en/guides/upgrade-to/v7/
How This PR Solves The Issue
Astro 7 changes that needed code fixes:
New Rust compiler is stricter about HTML. Every non-void element now needs a closing tag; the old Go compiler used to fix this by itself. Added the missing
</Layout>tags insurvey.astroandnewsletter.astro.Markdown now runs through a
processor. MovedremarkPluginsandrehypePluginsintounified({...})from@astrojs/markdown-remarkso the deprecation warning is gone.Astro 7 also moves to Vite 8 (handled by the dependency bumps).
src/lib/search-index.jsused an undefinedfs(the import was namedfs2). The bug was there before but stayed hidden; Astro 7 fails thebuild:donehook on it. Renamed the import tofs.package.jsonoverride:astro-rehype-relative-markdown-linksdoes not yet list Astro 7 as a supported peer, but it works fine. The override makes it use our Astro version and avoids a peer-dependency install error. See Support Astro v7 (update peer dependency range) vernak2539/astro-rehype-relative-markdown-links#84Manual Testing Instructions
Compare https://20260723-stasadev-astro-7.ddev-com-front-end.pages.dev/ vs https://ddev.com/
Click different links and confirm that everything works as expected in both desktop and mobile views.
Automated Testing Overview
Release/Deployment Notes