Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Astro Islandsの 内部実装を 「日本で一番わかりやすく」 ざっくり解説!
Search
Wu Kenji
March 23, 2026
Technology
400
0
Share
Astro Islandsの 内部実装を 「日本で一番わかりやすく」 ざっくり解説!
Wu Kenji
March 23, 2026
Other Decks in Technology
See All in Technology
幾億の壁を超えて/Beyond Countless Walls(JP)
ikuodanaka
0
110
プロダクトを触って語って理解する、チーム横断バグバッシュのすすめ / 20260411 Naoki Takahashi
shift_evolve
PRO
1
270
GitHub Copilotを極める会 - 開発者のための活用術
findy_eventslides
6
4k
AgentCore RuntimeからS3 Filesをマウントしてみる
har1101
3
400
Proxmox超入門
devops_vtj
0
180
システムは「動く」だけでは足りない 実装編 - 非機能要件・分散システム・トレードオフをコードで見る
nwiizo
2
330
本番環境でPHPコードに触れずに「使われていないコード」を調べるにはどうしたらよいか?
egmc
2
280
2026年度新卒技術研修 サイバーエージェントのデータベース 活用事例とパフォーマンス調査入門
cyberagentdevelopers
PRO
6
7.7k
Kubernetes基盤における開発者体験 とセキュリティの両⽴ / Balancing developer experience and security in a Kubernetes-based environment
chmikata
0
250
新規サービス開発におけるReact Nativeのリアル〜技術選定の裏側と実践的OSS活用〜
grandbig
2
180
デシリアライゼーションを理解する / Inside Deserialization
tomzoh
0
260
60分で学ぶ最新Webフロントエンド
mizdra
PRO
23
11k
Featured
See All Featured
Docker and Python
trallard
47
3.8k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
240
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
410
Bash Introduction
62gerente
615
210k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
250
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
1k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Technical Leadership for Architectural Decision Making
baasie
3
320
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
490
エンジニアに許された特別な時間の終わり
watany
106
240k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
55k
Writing Fast Ruby
sferik
630
63k
Transcript
Astro Islandsの 内部実装を 「日本で一番わかりやすく」 ざっくり解説! Version 1.0 March, 2026
ちなみに「世界で一番わかりやすい」のは Navigating Islands of Interactivity Reuben Tier — React Summit
2025 今日は「日本で一番」をやります
ケンジ Bluesky : jp-knj GitHub : jp-knj
ウェブの普遍的な パターンの話
ウェブは昔からずっと 似たような構造を繰り返している PHP サーバーがHTML生成 Astro Component Server Component ビルド時にHTML生成 サーバーで実行
+ + + jQuery Plugin Client Component Island
だいたい、 クライアントとサーバサイドの境界を コンポーネント単位で決めれる みたいな話 でも、前提が違ったりする
Nuxt Astro 前提がSPAで、引き算としてのアプローチ → 前提がMPAで、足し算としてのアプローチ →
Astro 構成として Astro Component Client Island Server Island
Client Islandは この足し算の中で 何が起きているのか?
ビルドタイムでコンパイラが .astroファイルの中でIslandを見つける client:* なし client:* あり 静的HTML JS ゼロ Island
として抽出 STEP 01 Props シリアライズ STEP 02 コード分割 STEP 03 <astro-island>
Propsのシリアライズ Server JavaScript オブジェクト Browser HTML属性の文字列 { } count: 1,
date: new Date(...), items: new Set([1,2]), tags: new Map([...]) props=' {"count": [0, 1], "date": [2, "2025-..."], "items": [4, [[0,1], [0,2]]], "tags": [5, [...]] }' → devalue by Rich Harris(Svelte作者)
Viteによるコード分割 index.html 静的HTML Page.astro <Header /> → Counter.BxK3q.js コンポーネント本体 Search.Dm2r8.js
コンポーネント本体 <Counter client:visible /> <Search client:idle /> <Footer /> client.Fj7nP.js レンダラー共有
<astro-island> でラッピング <body> <header>My Site</header> <astro-island component-url="/_astro/Counter.BxK3q.js" renderer-url="/_astro/client.Fj7nP.js" props='{"count":[0,1]}' client="visible">
<div>0</div> </astro-island> <footer>© 2025</footer> </body>
Astro Islandは Web Components class AstroIsland extends HTMLElement customElements.define('astro-island', AstroIsland)
Astro Island はなぜ、Web Components なのか?
ちょうどいい仕組みだから Astroが使うのは Custom Elements API だけ Web Components Custom Elements
Shadow DOM HTML Templates connectedCallback ブラウザが勝手に呼んでくれる → hydration の起点
Astro Islandの内部 connectedCallback() this.getAttribute('client') "load" 即座に実行 "idle" "visible" "media" matchMedia
IdleCallback request Intersection Observer 条件を満たしたら import(renderer-url) fetch renderer → hydrate import(component-url) fetch component
だいたい "ブラウザが持っている力" Astroのランタイムは本当に短い。
HTMLはそのままで十分強い Polymer → Astro
Astroは HTMLをそのまま活かして、 JSを足すタイミングだけを Web Componentsで制御する。
おしまい