Skip to content

chore: migrate to Astro 7#40

Merged
lmammino merged 1 commit into
mainfrom
upgrade/astro-7
Jul 6, 2026
Merged

chore: migrate to Astro 7#40
lmammino merged 1 commit into
mainfrom
upgrade/astro-7

Conversation

@lmammino

@lmammino lmammino commented Jul 5, 2026

Copy link
Copy Markdown
Member

Summary

Migrates the site from Astro 5.16.16 to Astro 7.0.6 (crosses two majors, 5 → 6 → 7), following the official upgrade guides for v6 and v7.

Dependency bumps

  • astro 5.16.16 → 7.0.6, @astrojs/react → 6.0.1, @astrojs/sitemap → 3.7.3
  • astro-expressive-code + @expressive-code/plugin-collapsible-sections → 0.44.0 (Astro 7 peer support)
  • @lucide/astro 0.522 → 1.23 (Astro 7 peer support)
  • tailwindcss + @tailwindcss/vite → 4.3.2 (Vite 8 peer support), @tailwindcss/typography → 0.5.20
  • new: @astrojs/markdown-remark (see below), mdast-util-to-hast (devDep, type augmentation for the admonitions plugin)

Code/config changes for breaking changes

  • Markdown pipeline: Astro 7 defaults to the new Sätteri pipeline, which would silently drop our remark-based admonitions. The config now explicitly uses processor: unified({ remarkPlugins: [...] }) from @astrojs/markdown-remark. (Porting admonitions to Sätteri could be a future follow-up.)
  • Fonts: experimental.fonts graduated → top-level fonts (same shape).
  • compressHTML: true pinned: the new 'jsx' default strips whitespace between inline elements, which our templates rely on (e.g. icon + label in BlogLayout).
  • Zod 4: z.string().url()z.url(); z imported from astro/zod.
  • tsconfig: dropped baseUrl — with it set, Astro 7's tsconfig-alias plugin stats every bare specifier and crashes (ENAMETOOLONG) on the base64 data: font URI inside swiper's CSS. paths resolve relative to the tsconfig without it, so @components/@lib/@images aliases are unaffected.
  • Footer GitHub icon: lucide 1.x removed brand icons; Footer now uses the existing local ui/social/github.astro (whose <title> wrongly said "LinkedIn", fixed).
  • engines.node >= 22.12.0 added (Astro 7 requirement; CI already runs Node 24).

Sanity testing (v5 baseline build vs v7 build)

  • ✅ Page inventory identical (15 pages, all html/xml/txt routes)
  • ✅ Structural per-page diff identical: admonition counts, expressive-code block counts, astro-island counts, TOC presence, font CSS vars/preloads, <title>s, and all h2/h3 heading IDs (no anchor/SEO churn)
  • ✅ In-page anchor validator: every href="#x" resolves on both builds
  • rss.xml byte-identical modulo lastBuildDate (12 items), sitemaps valid XML with same 14 URLs, JSON-LD blocks byte-identical
  • ✅ Image markup: all 157 srcsets identical; only diffs are fetchpriority="auto" no longer emitted (browser default) and 12 markdown images gaining an inert empty srcset="" (Astro 7's no-upscale rule; browsers fall back to src)
  • ✅ Headless-Chrome screenshots of /, /blog/, /blog/nodejs-http-request/, /404: fonts, hero image, hydrated counters, admonitions, code blocks, TOC, avatars all render correctly (404's WebGL area is blank in headless capture on the v5 baseline too, i.e. not a regression)
  • pnpm build, typecheck, lint, format:check all green

Remaining known cosmetic diffs: lucide 1.x icon SVG markup, expressive-code copy button gained an aria-live region (a11y improvement).

🤖 Generated with Claude Code

- astro 5.16.16 -> 7.0.6, @astrojs/react -> 6.0.1, @astrojs/sitemap -> 3.7.3
- keep the remark/rehype markdown pipeline (admonitions) via
  @astrojs/markdown-remark unified() processor instead of the new
  Sätteri default
- hoist experimental.fonts to the stable top-level fonts config
- pin compressHTML: true to preserve whitespace between inline elements
- Zod 4: z.string().url() -> z.url(), import z from astro/zod
- bump astro-expressive-code + plugin-collapsible-sections to 0.44,
  tailwindcss/@tailwindcss/vite to 4.3.2 (Vite 8 peer support)
- @lucide/astro 0.522 -> 1.23: brand icons removed upstream, Footer now
  uses the local github.astro component (and its title is fixed)
- drop tsconfig baseUrl (crashes Astro 7 alias resolver on data: URIs
  from swiper CSS; paths resolve relative to tsconfig without it)
- add mdast-util-to-hast devDep for the hName/hProperties mdast Data
  augmentation used by the admonitions plugin
- add engines.node >=22.12.0 (Astro 7 requirement)
@lmammino
lmammino merged commit c6f4c79 into main Jul 6, 2026
1 check passed
@lmammino
lmammino deleted the upgrade/astro-7 branch July 6, 2026 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant