Conversation
useLocation() threw during SSR because RouterContext.url was always null when there was no locationEntry. Now falls back to constructing a URL from ssr.path, consistent with how route matching already works. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Generate one HTML file per route instead of relying on SPA fallback. Each route gets pre-rendered HTML, improving initial load and SEO. - Add entries.tsx that derives entry list from the route tree - Pass ssrPath through App → ClientApp → Router - Switch vite.config.ts from single-entry to multi-entry mode - Change Cloudflare not_found_handling to 404-page Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
RouterContextduring SSR souseLocation()works with thessrpropChanges
Router (
@funstack/router)RouterContext.urlnow falls back tonew URL(ssr.path, "http://localhost")when thessrprop is provided, instead of always beingnulluseLocation()works during SSRDocs site
ssrPathprop toAppandClientApp, passed through asssr={{ path: ssrPath }}to<Router>entries.tsxthat derives entries from the route tree automatically — adding a route toApp.tsxautomatically generates a new HTML entryvite.config.tsfrom single-entry (root/app) to multi-entry (entries) mode with SSR enablednot_found_handlingfromsingle-page-applicationto404-pageurlpattern-polyfillfor Vite's SSR dev server (runs in an isolated VM context without Node.js globals)Test plan
pnpm --filter @funstack/router test:run— 227 tests passpnpm build— all packages build, 18 HTML files generatedpnpm typecheck— all packages pass🤖 Generated with Claude Code