Skip to content

Render the deferred parts of each page at build time in a static build - #805

Merged
ajolipa merged 1 commit into
jf/static-no-adapterfrom
jf/static-islands
Oct 9, 2026
Merged

ajolipa merged 1 commit into
jf/static-no-adapterfrom
jf/static-islands

Conversation

@jamiefolsom

@jamiefolsom jamiefolsom commented Sep 18, 2026 •

Copy link
Copy Markdown
Member

A server island is a part of a page that a server renders after the page itself has loaded. Astro cannot build server islands without an adapter, and a static site has no server to render them later. With STATIC_BUILD=true a small plugin drops the server:defer directive from each component as the component loads, before Astro compiles it, so every island renders into the page at build time. There are 19 such directives today, all in the record detail pages. Server-rendered sites keep deferring, and nothing changes when the flag is unset.

The plugin works as the file loads rather than in a transform, because Astro's own component plugin compiles in a pre-ordered transform that runs before any integration's transform. A transform receives compiled output and cannot remove the directive. A load hook returns the source that Astro then compiles.

Building marronage from this branch with STATIC_BUILD=true produced 167 pages. The output contains no server-islands directory and no page that references a server-island request, and the build emitted no serverless function.

Part of #710. This is the second of three pull requests that bring the static-build experiment into develop, and it sits on #804.

@jamiefolsom jamiefolsom added the static-mvp Static build: in the MVP (one site published as plain files from develop) label Sep 18, 2026
@jamiefolsom
jamiefolsom requested a review from ajolipa September 18, 2026 00:42
@jamiefolsom
jamiefolsom added this pull request to stack #806 September 18, 2026 00:42
@netlify

netlify Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for pss-scavenger-hunt ready!

Name Link
🔨 Latest commit 3d4a108
🔍 Latest deploy log https://app.netlify.com/projects/pss-scavenger-hunt/deploys/6ac96eac1134a40008fac071
😎 Deploy Preview https://deploy-preview-805--pss-scavenger-hunt.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for padp-staging ready!

Name Link
🔨 Latest commit 3d4a108
🔍 Latest deploy log https://app.netlify.com/projects/padp-staging/deploys/6ac96eaccfef520007d86181
😎 Deploy Preview https://deploy-preview-805--padp-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for marronage-staging ready!

Name Link
🔨 Latest commit 3d4a108
🔍 Latest deploy log https://app.netlify.com/projects/marronage-staging/deploys/6ac96eac801e91000882fc63
😎 Deploy Preview https://deploy-preview-805--marronage-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for relnet-staging ready!

Name Link
🔨 Latest commit 3d4a108
🔍 Latest deploy log https://app.netlify.com/projects/relnet-staging/deploys/6ac96ead77415900082549d1
😎 Deploy Preview https://deploy-preview-805--relnet-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@jamiefolsom jamiefolsom changed the title Render server islands at build time in static mode Render the deferred parts of each page at build time in a static build Sep 18, 2026
@ajolipa
ajolipa force-pushed the jf/static-islands branch from 3b8184d to b82548e Compare October 3, 2026 06:26
Astro cannot build server islands without an adapter, and a static site has no server to render them later. With STATIC_BUILD set, a small plugin drops the server:defer directive from each component as it is loaded, before Astro compiles it, so every island renders into the page at build time. Server-rendered sites keep deferring. The plugin works at load time because Astro's own component plugin compiles in a pre-ordered transform that runs before any integration's transform.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FbHx5mB9KZKURcTMDh8B9e
@ajolipa
ajolipa force-pushed the jf/static-islands branch from b82548e to 3d4a108 Compare October 9, 2026 22:46
@ajolipa
ajolipa merged commit dc653d0 into develop Oct 9, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

static-mvp Static build: in the MVP (one site published as plain files from develop)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants