Skip to content

feat(static): add configurable ssr option#29

Merged
uhyo merged 2 commits intomasterfrom
feat/configurable-ssr
Jan 28, 2026
Merged

feat(static): add configurable ssr option#29
uhyo merged 2 commits intomasterfrom
feat/configurable-ssr

Conversation

@uhyo
Copy link
Owner

@uhyo uhyo commented Jan 28, 2026

Summary

  • Add ssr option to FunstackStaticOptions (default: false) to control whether the App component is server-side rendered
  • SSR off (default): Only the Root shell is SSR'd with a placeholder; App renders client-side via createRoot
  • SSR on: Both Root and App are fully SSR'd; client hydrates via hydrateRoot
  • In production builds, RSC payload is always served as a separate file (not inline in HTML) for better caching
  • Document the new option in API reference and How It Works guide

Test plan

  • Dev SSR off: vite dev → page loads, view source shows minimal HTML shell, app renders client-side
  • Dev SSR on: set ssr: true → page loads, view source shows full SSR'd HTML, app hydrates
  • Prod SSR off: vite build && vite preview → same as current prod behavior
  • Prod SSR on: ssr: true, build & preview → HTML contains full SSR'd content, client hydrates

🤖 Generated with Claude Code

uhyo and others added 2 commits January 28, 2026 23:33
Add `ssr` option to `FunstackStaticOptions` (default: `false`) to control
whether the App component is server-side rendered.

- SSR off (default): Only the Root shell is SSR'd with a placeholder.
  The App renders client-side via `createRoot`.
- SSR on: Both Root and App are fully SSR'd. The client hydrates via
  `hydrateRoot`.

The SSR flag is provided via a virtual module (`virtual:funstack/config`)
for tree-shakeable compile-time branching.

In production builds, the RSC payload is always served as a separate file
(not inline in HTML) for better caching.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add documentation for the new `ssr` option:
- API reference in FunstackStatic.mdx
- Server-Side Rendering section in HowItWorks.mdx

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@uhyo uhyo merged commit e6cb700 into master Jan 28, 2026
1 check passed
@uhyo uhyo deleted the feat/configurable-ssr branch January 28, 2026 14:39
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