static-server-side-rendering-routing

command
v4.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 5, 2026 License: MIT Imports: 8 Imported by: 0

README

SSR Routing Demo

This example is the static-shell SSR prototype.

Current Status

This example remains the static-document SSR and hydration prototype in the examples set.

Use it when you want to inspect pre-rendered HTML plus bootstrap-driven hydration inside a static example shell. If you need true request-time HTML responses on direct navigation, the current integrated server-backed reference is examples/server/server-side-rendering-routing.

If you want the request-time server-rendered version with real HTML responses on direct URL navigation, use examples/server/server-side-rendering-routing instead.

This example demonstrates:

  • static SSR markup shipped directly in the HTML document
  • a sidecar bootstrap payload loaded from bootstrap.json
  • wasm hydration startup through ui.Hydrate(...)
  • DOM reuse for matching server-rendered nodes, with subtree fallback if hydration cannot continue safely
  • advanced routing features including params, redirects, guards, query-aware loaders, and manual revalidation

Serve examples from the repo root with:

go run ./tools/gwc examples

Then open:

/examples/public/static-server-side-rendering-routing/ssr-routing.html

The initial document contains pre-rendered docs content for /docs/ssr. Once wasm starts, the client restores the bootstrap payload, reuses matching server DOM where possible, and hydrates into a routed app that supports:

  • /docs/:section
  • /search?q=...
  • /secure?auth=true
  • /legacy redirecting into the docs route

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL