upgrade astro to v7 #14

Merged
matt merged 1 commit from astro-7 into main 2026-09-17 15:33:35 -04:00
Owner

What changed

Upgrade astro from ^6.0.0 to ^7.0.0, plus two fixes in src/pages/index.astro that the new compiler requires.

Why

Astro 7 compiles with a new Rust-based compiler that validates markup strictly, where astro 6's parser accepted it silently. The dependency bump alone fails the build; these are the only two things it objects to:

  • index.astro:89 closed an <h4> with </h3>.
    [CompilerError] Closing tag '</h3>' has no matching opening tag.
    
    Fixed the closing tag to match the opening one. global.css styles h3 and h4 in the same rule (lines 383-384), so there is no rendering change.
  • index.astro:50 had a top-level return in the inline tagline script.
    [CompilerError] A 'return' statement can only be used within a function body.
    
    Wrapped the script body in an IIFE so the guard stays valid. This keeps the diff to two added lines instead of re-indenting the whole script.

Commands run

make build      # what test.yml runs on pull requests

Result: exit 0, 168 page(s) built, dist 13M. Baseline sanity check: npm ci && npm run build on the astro 6 pin also exits 0, so the only difference is the version and those two fixes.

Manual verification

  • dist/index.html still contains the tagline paragraph, the injected quotes array, and the latest-post__title heading.
  • No page in dist is suspiciously small (nothing rendered empty).
  • deploy.yml runs on push to main only, so merging is what actually deploys this site.

Refs the Renovate PR this replaces.

## What changed Upgrade `astro` from `^6.0.0` to `^7.0.0`, plus two fixes in `src/pages/index.astro` that the new compiler requires. ## Why Astro 7 compiles with a new Rust-based compiler that validates markup strictly, where astro 6's parser accepted it silently. The dependency bump alone fails the build; these are the only two things it objects to: - **`index.astro:89`** closed an `<h4>` with `</h3>`. ``` [CompilerError] Closing tag '</h3>' has no matching opening tag. ``` Fixed the closing tag to match the opening one. `global.css` styles `h3` and `h4` in the same rule (lines 383-384), so there is no rendering change. - **`index.astro:50`** had a top-level `return` in the inline tagline script. ``` [CompilerError] A 'return' statement can only be used within a function body. ``` Wrapped the script body in an IIFE so the guard stays valid. This keeps the diff to two added lines instead of re-indenting the whole script. ## Commands run ``` make build # what test.yml runs on pull requests ``` Result: exit 0, `168 page(s) built`, `dist` 13M. Baseline sanity check: `npm ci && npm run build` on the astro 6 pin also exits 0, so the only difference is the version and those two fixes. ## Manual verification - `dist/index.html` still contains the tagline paragraph, the injected `quotes` array, and the `latest-post__title` heading. - No page in `dist` is suspiciously small (nothing rendered empty). - `deploy.yml` runs on push to `main` only, so merging is what actually deploys this site. Refs the Renovate PR this replaces.
upgrade astro to v7, fix markup the new compiler rejects
All checks were successful
test / testbuild (pull_request) Successful in 34s
a131ed468d
astro 7 compiles with a new Rust-based compiler that validates markup
strictly, where astro 6's parser was lenient. Two things it now refuses:

- src/pages/index.astro:89 closed an <h4> with </h3>. Fixed the closing
  tag to match the opening one; global.css styles h3 and h4 in the same
  rule, so there is no rendering change.
- src/pages/index.astro:50 had a top-level 'return' in the inline
  tagline script, which is only legal inside a function body. Wrapped
  the script body in an IIFE so the guard stays valid, with no
  re-indentation churn.

Verified: 'make build' (what test.yml runs on pull requests) exits 0 and
emits 168 pages. The tagline paragraph, its injected quotes array, and
the latest-post heading are all present in dist/index.html.
matt merged commit 205d334d42 into main 2026-09-17 15:33:35 -04:00
Sign in to join this conversation.
No reviewers
No labels
bigger
blog
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
matt/website!14
No description provided.