📋 Context & Problem Description
Gutter CLI currently supports hot SSR (dynamic compilation/execution) and CSR. However, for content-centric pages like blogs, documentations, and landing pages, dynamic SSR adds unnecessary CPU overhead on the server. Developers currently have to write custom scripts to crawl and export HTML files.
💡 Proposed Solution & Implementation Plan
Add an SSG command to Gutter CLI:
Implementation Steps:
- Route Declaration: Introduce a configuration option in
gutter.Config or a CLI config file to list static routes to export (e.g. []string{"/", "/about", "/blog"}).
- Crawler/Render Walk: When
gutter export runs, build the host app and invoke RenderToHTML for each route.
- Export Directory Structure: Save the returned HTML to corresponding paths in the
./dist directory (e.g. / -> dist/index.html, /about -> dist/about/index.html).
- Asset Bundle: Copy all WASM and static assets into the export directory.
🎯 Impact & Benefits
- Serverless Deployments: Enables Gutter apps to be deployed directly to static hosts like Cloudflare Pages, Vercel, Netlify, and GitHub Pages.
- Instant TTFB: Zero server-side rendering latency at request time.
🏷️ Suggested Labels
feature, cli, ssr
📋 Context & Problem Description
Gutter CLI currently supports hot SSR (dynamic compilation/execution) and CSR. However, for content-centric pages like blogs, documentations, and landing pages, dynamic SSR adds unnecessary CPU overhead on the server. Developers currently have to write custom scripts to crawl and export HTML files.
💡 Proposed Solution & Implementation Plan
Add an SSG command to Gutter CLI:
gutter exportImplementation Steps:
gutter.Configor a CLI config file to list static routes to export (e.g.[]string{"/", "/about", "/blog"}).gutter exportruns, build the host app and invokeRenderToHTMLfor each route../distdirectory (e.g./->dist/index.html,/about->dist/about/index.html).🎯 Impact & Benefits
🏷️ Suggested Labels
feature,cli,ssr