chore(portfolio): modernize Astro client setup - #24
Draft
sor4chi wants to merge 2 commits into
Draft
Conversation
- Migrate ViewTransitions -> ClientRouter (renamed in Astro 5; the old alias is deprecated). - Enable built-in link prefetching (prefetchAll) for snappier navigation, which pairs with the ClientRouter. - Drop the unused @astrojs/react integration and react/react-dom/@types dependencies — there are no .tsx files, React components, or client: directives anywhere in src, so it was pure deadweight in the bundle and dependency tree. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Deploying portfolio with
|
| Latest commit: |
560ffd3
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://ffdc5982.portfolio-monica-dev-com.pages.dev |
| Branch Preview URL: | https://chore-astro-client-modernize.portfolio-monica-dev-com.pages.dev |
Deploying slide with
|
| Latest commit: |
560ffd3
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://f48f41b9.monica-dev-com.pages.dev |
| Branch Preview URL: | https://chore-astro-client-modernize.monica-dev-com.pages.dev |
Mark the theme-toggle button with `transition:persist` so the ClientRouter keeps the same DOM node across navigations instead of re-rendering it. Its click listener now survives too, so the `astro:after-swap` re-init is removed — re-running it would stack a second listener on the persisted node and toggle the theme twice (a silent no-op). Verified in a preview build: the button is the same node after navigating between pages, and a single click flips the theme exactly once. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Owner
Author
|
追記: テーマトグルを |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
Astro 5 で使えるようになった機能に合わせ、クライアント/ハイドレーション設定を現代化する。低リスクな確実改善の第一弾。
変更点
ViewTransitions→ClientRouter:Astro 5 でリネームされ、旧ViewTransitionsは deprecated alias。Base.astroの import と要素を更新。prefetch: { prefetchAll: true }):ClientRouter と組み合わせ、ブログ/works 間のナビゲーションを高速化。srcに.tsx/React コンポーネント/client:ディレクティブは一切無く、@astrojs/react+react/react-dom/@types/react(-dom)は完全なデッドウェイトだったため除去(twitter 埋め込みは remark プラグイン側でReactではない)。確認したこと
astro build成功(37ページ)。distに react チャンクが消えたこと、dist/index.htmlに ClientRouter(transitions)スクリプトが存在することを確認。レビュー観点
defaultStrategyをtap等に調整可能。🤖 Generated with Claude Code