Skip to content

chore: upgrade to Astro 7.0.0-alpha.0 (Rust compiler default + Vite 8)#167

Merged
masuP9 merged 5 commits into
mainfrom
upgrade/astro-7-alpha
May 1, 2026
Merged

chore: upgrade to Astro 7.0.0-alpha.0 (Rust compiler default + Vite 8)#167
masuP9 merged 5 commits into
mainfrom
upgrade/astro-7-alpha

Conversation

@masuP9
Copy link
Copy Markdown
Owner

@masuP9 masuP9 commented Apr 30, 2026

Summary

Astro 7.0.0-alpha.0 (release, 2026-04-30) makes the Rust compiler default and bumps Vite to v8. This branch adapts the project to that release and verifies build/test/preview locally so we can decide whether to merge based on Cloudflare Pages / GitHub Pages preview build outcomes.

Plan worked out together with Codex (壁打ち): branch-only validation, exact-pin alpha versions, manualChunks function form, drop the lucide-svelte Vite 7 workaround.

Changes

  • deps (exact pin alpha): astro 7.0.0-alpha.0, @astrojs/{mdx,react,svelte,vue} matching alphas
  • deps (Vite 8 ecosystem): @astrojs/compiler-rs ^0.1.10, @sveltejs/vite-plugin-svelte ^7, @vitejs/plugin-react ^6, plus patch updates for @vitejs/plugin-vue, @tailwindcss/vite, vitest, @vitest/*
  • config: removed experimental.rustCompiler (flag dropped in Astro 7), converted manualChunks from object → function form (Vite 8 removed object form), removed the lucide-svelte alias workaround (no longer needed under Vite 8)

Local verification

  • npm run build — 553 pages built (~42s)
  • npm run test:unit — 75 files / 2624+144 tests passed (Vitest + Container API)
  • npm run lint:astro — 0 errors / 0 warnings (kept old @astrojs/check ^0.9.7 since no Astro-7-compatible alpha is published yet; works in practice)
  • npm run preview — manually walked checkbox/{react,vue,svelte,astro}, button/{react,vue,svelte,astro}, tabs, toggle-button via Playwright

Test plan

  • Cloudflare Pages preview build succeeds
  • GitHub Pages preview build (CI) succeeds
  • No regression on the Cloudflare Pages preview URL

Known issues (alpha-related, surfaced during validation)

  1. dev server HMR error for some pages (e.g. /patterns/checkbox/react/): ReferenceError: $RefreshSig$ is not defined originating from Checkbox.vue when transformed by Vite. Production build is unaffected — preview build of the same page renders cleanly. Likely an alpha-stage interaction between @vitejs/plugin-react@6.x and @astrojs/vue@7.0.0-alpha.0. Will revisit once a beta lands.
  2. Pre-existing hydration mismatch on /ja/... pages: PatternSearch.tsx calls getLocaleFromDocument() inside a useState initializer. This returns 'en' during SSR (no document) and 'ja' after hydration — server HTML uses Japanese pattern descriptions while the client tree initializes with English. Verified the implementation hasn't changed since the component was added (commits ff7015b, 5617cba); React 19 + Astro 7's stricter hydration likely just surfaces a latent bug. Out of scope for this PR; will file a separate issue.
  3. vite-plugin-svelte prints Support for vite 8 beta in vite-plugin-svelte is experimental at startup. Builds and tests pass.

Notes for future cleanup

  • Once @astrojs/check ships an Astro 7 alpha, drop the peer-warning suppression context and verify lint:astro still works.
  • manualChunks function form is deprecated in Vite 8; long-term migration path is Rolldown's codeSplitting.groups. Park for now.

🤖 Generated with Claude Code

masuP9 and others added 3 commits May 1, 2026 06:43
Astro 7 makes the Rust compiler default and bumps Vite to v8. This
upgrades all related integrations to alpha versions pinned exactly,
and bumps Vite plugins to versions with vite ^8 peer dependencies.

- astro 6 → 7.0.0-alpha.0 (exact pin)
- @astrojs/{mdx,react,svelte,vue} → matching alpha versions (exact pin)
- @astrojs/compiler-rs ^0.1.4 → ^0.1.10
- @sveltejs/vite-plugin-svelte 6 → 7
- @vitejs/plugin-react 5 → 6
- @vitejs/plugin-vue / @tailwindcss/vite / vitest patch updates

@astrojs/check is left at 0.9.7 (Astro 7 alpha not yet published);
peer warnings tolerated for now and confirmed lint:astro still works.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Drop experimental.rustCompiler flag (removed in Astro 7; Rust
  compiler is now the default)
- Convert manualChunks from object form to function form (Vite 8
  removed the object form; function form remains supported)
- Remove the lucide-svelte alias workaround. The original Vite 7
  strict ESM resolution issue no longer reproduces under Vite 8;
  build and Svelte island hydration verified without the alias
- Drop the now-unused node:path / node:url imports

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@astrojs/svelte 9 alpha still pins @sveltejs/vite-plugin-svelte ^6.x
in its peer dependencies, which conflicts with the vite-plugin-svelte
7 / Vite 8 we need. Set legacy-peer-deps=true so npm install/ci accept
the resolution, and regenerate the lockfile so npm ci stays in sync
on CI and Cloudflare Pages.

Can be reverted once the alpha integrations align their peer deps.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 30, 2026

Deploying apg-patterns-examples with  Cloudflare Pages  Cloudflare Pages

Latest commit: 8b42095
Status: ✅  Deploy successful!
Preview URL: https://d705d70a.apg-patterns-examples.pages.dev
Branch Preview URL: https://upgrade-astro-7-alpha.apg-patterns-examples.pages.dev

View logs

masuP9 and others added 2 commits May 1, 2026 06:56
Two side effects from regenerating the lockfile under legacy-peer-deps:

- eslint-plugin-react-hooks bumped 7.0.1 → 7.1.1 implicitly, which
  enables a new "Cannot access refs during render" error rule. Pin to
  7.0.1 to keep the lint regression separate from the Astro 7 work.
- vue-eslint-parser (peer dep of eslint-plugin-vue) was no longer
  hoisted automatically. Add it explicitly so npm ci on CI / Cloudflare
  Pages can resolve it.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The @vite-ignore directive was added as a dev-only HMR workaround,
but it also tells Vite not to bundle the import. Under Astro 7 + Vite 8
the unbundled URL ./Dialog.vue ends up referenced from the production
chunk and the browser receives 404 for /_astro/Dialog.vue, which broke
all Vue Dialog E2E tests on CI.

Removing the comment lets Vite bundle Dialog.vue normally. Verified
locally with npm run build + npm run preview that the dialog page now
renders without console errors.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@masuP9 masuP9 merged commit 1da798f into main May 1, 2026
17 checks passed
@masuP9 masuP9 deleted the upgrade/astro-7-alpha branch May 1, 2026 04:07
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