Skip to content

docs(hydrate): update SSG hydration guide to match the fixed pattern - #80

Merged
jonlaing merged 1 commit into
mainfrom
docs/hydrate-ssg-pattern
Aug 3, 2026
Merged

docs(hydrate): update SSG hydration guide to match the fixed pattern#80
jonlaing merged 1 commit into
mainfrom
docs/hydrate-ssg-pattern

Conversation

@jonlaing

@jonlaing jonlaing commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Summary

Follow-up to #78 — the docs pages that describe client hydration were still showing the buggy Effect.provide(App(), navLayer) bake-in this PR series fixed. Two content updates:

  • apps/docs/content/06-platform/02-static-site-generation.md — swapped Effect.provide(App(), navLayer) for hydrate(App(), root, { layers: Platform.makeClientLayer(router) }), with a short note about why the bake-in kills scoped resources (popstate listener, SubscriptionRef PubSub).
  • apps/docs/content/quick-start.md — corrected the "SSG doesn't need Platform.makeClientLayer" claim. SSG needs it for NavigationContext (used by Outlet/Link) and for RouteDataProvider to surface window.__EFFEX_DATA__ / ?_data=1 HTML data — the Vite plugin strips loaders from the client bundle, so this provider is the only path data reaches routes after hydration.

No code changes.

Test plan

  • Reviewed both pages for internal consistency with 06-platform/01-server-side-rendering.md (which already showed the correct pattern)

🤖 Generated with Claude Code

The SSG page's client entry was showing the same buggy
`Effect.provide(App(), navLayer)` bake-in that this PR fixes in the
templates. The quick-start also incorrectly claimed SSG doesn't need
`Platform.makeClientLayer` — it does, both for NavigationContext and
so the stripped-loader routes can read window.__EFFEX_DATA__ / fetch
`?_data=1` on client-side nav.

Both pages now show `hydrate(App(), root, { layers: Platform.makeClientLayer(router) })`.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 3, 2026

Copy link
Copy Markdown

Deploying effex-api with  Cloudflare Pages  Cloudflare Pages

Latest commit: 01cf355
Status: ✅  Deploy successful!
Preview URL: https://5baa356e.effex-api.pages.dev
Branch Preview URL: https://docs-hydrate-ssg-pattern.effex-api.pages.dev

View logs

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying effex with  Cloudflare Pages  Cloudflare Pages

Latest commit: 01cf355
Status: ✅  Deploy successful!
Preview URL: https://8af15256.effex.pages.dev
Branch Preview URL: https://docs-hydrate-ssg-pattern.effex.pages.dev

View logs

@jonlaing
jonlaing merged commit 2285fa3 into main Aug 3, 2026
4 checks passed
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