Migrate to Astro 7, TypeScript 7, and Node 24 LTS#51
Conversation
Upgrade the framework, type-checker, and build toolchain with a verified-identical rendered result. - Astro 5 → 7.1.3; integrations bumped (mdx 7, react 6, rss, sitemap, expressive-code 0.44, astro-seo 1.1). - Content collections migrated from the legacy `type: "content"` API to Content Layer `glob()` loaders (src/content.config.ts); a custom generateId strips `/index` so every existing URL is preserved. Consumers updated for `.id` and `render()`; `z` now from `astro/zod` and `z.url()`. - Tailwind: replaced the Astro-7-incompatible @astrojs/tailwind integration with a PostCSS pipeline (tailwindcss v3 + autoprefixer), producing functionally identical CSS. Tailwind v4 deliberately deferred to avoid visual regressions. - TypeScript 6 → 7 via @typescript/native-preview (tsgo) for type-checking. Classic typescript@6 kept for `astro check` and typescript-eslint, which don't yet support the native compiler. - Node pinned to 24.18.0 (active LTS); added a TS7 typecheck step to CI. - Restored explicit spacing around the ExcerptEntry meta separator (Astro 7 trims inter-element whitespace). - Dropped the unused accessible-astro-components dependency. Verified: all 24 routes identical; full CI suite green; Playwright visual regression across 11 pages x desktop/mobile x light/dark shows pixel-parity with the pre-migration build. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ReviewSolid, well-documented upgrade — the PR description is unusually thorough (version table, rationale per decision, verification methodology). Went through the non-lockfile diff in detail; overall this looks safe to merge. A few notes: Content Layer migration (
|
PR Validation ✅All checks passed! Ready for review. Checks Performed:✓ Linting This is a complete dry-run of the deployment process, ensuring your changes will deploy successfully when merged. |
PR Validation ✅All checks passed! Ready for review. Checks Performed:✓ Linting This is a complete dry-run of the deployment process, ensuring your changes will deploy successfully when merged. |
ReviewSolid migration — the write-up is thorough and the verification approach (route parity + Playwright visual regression) is exactly right for a "no visible change" refactor like this. Went through the non-lockfile diff in detail; a few notes, nothing blocking. Code quality / correctness
Dependency/toolchain
Design-system / rendering
Test coverage
Overall: well-researched, appropriately scoped, and the deferred items (Tailwind v4, |
|
Addressed the worthwhile follow-ups in 6d53dd6:
Validation: npm run test:ci passes (lint, TypeScript 7 checks, 22 unit tests, spell/prose checks, Astro check/build, 24 generated pages, link validation, and RSS validation). |
PR Validation ✅All checks passed! Ready for review. Checks Performed:✓ Linting This is a complete dry-run of the deployment process, ensuring your changes will deploy successfully when merged. |
Review: Astro 7 / TypeScript 7 migrationSolid, well-documented migration — the PR description's verification section (route parity, visual regression, Code quality
Potential bugs / risk areas
Test coverage
Dependencies / maintenance
Security / performanceNothing concerning — this is a toolchain/version bump with no new runtime surface area, and the described verification (identical routes, pixel-parity screenshots) is a good substitute for a runtime security review here. Overall: thorough migration with unusually good self-verification. The two items I'd actually want addressed before merge are the misleading "byte-for-byte identical" comment in |
|
Addressed the two requested follow-ups from the latest automated review in b9ab8d2:
I did not hard-code a route count: the existing CI build and link validator exercise the current generated route set without making intentional content additions require test maintenance. The full npm run test:ci suite passes with 28 tests and all 24 generated pages validated. |
PR Validation ✅All checks passed! Ready for review. Checks Performed:✓ Linting This is a complete dry-run of the deployment process, ensuring your changes will deploy successfully when merged. |
ReviewSolid, well-documented migration. The write-up is unusually thorough (route-parity + visual-regression verification, explicit rationale for each deferred item), and the code changes match what the description claims. A few notes: Code quality / best practices
Potential bugs / edge cases
PerformanceNo concerns — the PostCSS-direct Tailwind pipeline is functionally the same pipeline SecurityNothing notable. Dependency bumps are all to official Test coverageGood targeted coverage for the riskiest part of this migration (ID generation, where a mistake would silently break URLs/SEO). One thing that's asserted in the PR description but not encoded as an automated check going forward: the 24-route parity / visual-regression comparison was presumably a one-time manual verification rather than a repeatable test. Not a blocker — just flagging that a future content-layer change won't get the same safety net unless a lighter-weight "route manifest" snapshot test is added later. Maintenance note (already acknowledged in the PR)Pinning Overall: low-risk, well-verified upgrade. Nothing here blocks merging. |
Summary
Upgrades the site to Astro 7, adopts the TypeScript 7 native compiler for type-checking, and refreshes the Node pin and build toolchain — with a verified-identical rendered result (all 24 routes byte-for-byte equivalent in structure; pixel-parity across a full Playwright visual-regression matrix).
Version changes
astro@astrojs/mdx@astrojs/react@astrojs/rss/sitemapastro-expressive-codeastro-seo@astrojs/tailwindtailwindcsstypescript@typescript/native-preview(tsgo)accessible-astro-components.nvmrc)Key decisions & things discovered
TypeScript 7 is the native compiler, and the ecosystem hasn't caught up.
typescript@7no longer ships the JS programmatic API thatastro check(via@astrojs/language-server) andtypescript-eslintdepend on — both fail hard on it (astro checkerrors; typescript-eslint has an explicit "does not support TS 7.0" guard). Following the TS team's own side-by-side guidance, the project:tsgo) —npm run typecheck, now also a CI step;typescript@6soastro checkand ESLint keep working (no overrides needed).This is a faithful TS7 adoption: the authoritative type-check runs on TS7. Remove
typescript@6once those tools support the native compiler.@astrojs/tailwinddoesn't support Astro 7. Replaced it with apostcss.config.mjsrunningtailwindcssv3 +autoprefixer— the exact pipeline that integration ran. Generated CSS is functionally identical (only newer-minifier reformatting: property reordering, value normalization likeflex:1 1 0%→flex:1, and rule-grouping). Tailwind v4 was deliberately deferred — its Preflight/default changes (e.g.backdrop-blur-sm4px→8px, default border color) risk visual regressions this migration is meant to avoid. Confirmed the header blur stays 4px and default border staysvar(--border).Content collections migrated to the Content Layer API. The legacy
type: "content"API is gone in Astro 7; collections now useglob()loaders insrc/content.config.ts. A customgenerateIdstrips/indexso folder-based posts/projects keep their bare slugs — every existing URL is preserved (verified: identical 24-route manifest). Consumers updated from.slug/entry.render()to.id/render(entry).Astro 7 trims inter-element whitespace that Astro 5 preserved. The only visible consequence was tighter spacing around the
·separator in home-feed meta rows; restored with explicit{" "}inExcerptEntry(measured back to pixel-identical). This also removes the design's fragile reliance on incidental template whitespace.Deprecations: adopted
import { z } from "astro/zod"andz.url()(Astro/Zod-v4 replacements) —astro checkis now fully clean (0 errors / 0 warnings / 0 hints). Leftmarkdown.rehypePluginsin place (still supported; migrating to theunified()processor risks changing GFM/markdown output) — noted as a follow-up.Verification
tsgotypecheck, 22 unit tests, spellcheck (source + HTML), Vale prose + fixtures, build (astro check: 0/0/0), internal-link validation, RSS feed validation.rss.xml/sitemap-index.xml/robots.txt."↔"entity style, and inline-script minification.Follow-ups (out of scope)
markdown.rehypePlugins→markdown.processor: unified(...).@typescript/native-previewsnapshot and lockfile entry refreshed until TypeScript 7 is stable; droptypescript@6onceastro check/ typescript-eslint support the native compiler.🤖 Generated with Claude Code