Repository navigation
Render the deferred parts of each page at build time in a static build - #805
Merged
Merged
Conversation
✅ Deploy Preview for pss-scavenger-hunt ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for padp-staging ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for marronage-staging ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for relnet-staging ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This was referenced Sep 18, 2026
ajolipa
force-pushed
the
jf/static-islands
branch
from
October 3, 2026 06:26
3b8184d to
b82548e
Compare
ajolipa
approved these changes
Oct 3, 2026
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
force-pushed
the
jf/static-islands
branch
from
October 9, 2026 22:46
b82548e to
3d4a108
Compare
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.
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=truea small plugin drops theserver:deferdirective 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=trueproduced 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.