Feat/landing ssr tanstack start - #1333
Open
Sharqiewicz wants to merge 8 commits into
Open
Conversation
✅ Deploy Preview for vortexfi ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
❌ Deploy Preview for vortex-sandbox failed. Why did it fail? →
|
❌ Deploy Preview for vrtx-dashboard failed. Why did it fail? →
|
Contributor
There was a problem hiding this comment.
Pull request overview
Migrates the frontend to TanStack Start, prerendering localized marketing pages while retaining the widget as a client-only flow.
Changes:
- Adds static prerendering for 21 localized marketing routes.
- Introduces TanStack Start hydration, routing, and Netlify deployment configuration.
- Adds DOM-less rendering safeguards and SSR regression tests.
Reviewed changes
Copilot reviewed 25 out of 26 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
bun.lock |
Updates TanStack Start and Vite dependencies. |
apps/frontend/vite.config.ts |
Configures prerendering and SPA shell generation. |
apps/frontend/src/wagmiConfig.ts |
Guards AppKit initialization from SSR. |
apps/frontend/src/tests/ssr-safety.test.tsx |
Adds DOM-less rendering tests. |
apps/frontend/src/services/storage/local.ts |
Makes storage access server-safe. |
apps/frontend/src/routeTree.gen.ts |
Regenerates frontend route metadata. |
apps/frontend/src/routes/{-$locale}/widget.tsx |
Disables SSR for the widget. |
apps/frontend/src/routes/__root.tsx |
Adds the Start document and providers. |
apps/frontend/src/router.tsx |
Creates per-render router and query clients. |
apps/frontend/src/main.tsx |
Removes the former SPA entry point. |
apps/frontend/src/i18n.ts |
Extracts SSR-compatible localization initialization. |
apps/frontend/src/hooks/useSyncFormToUrl.ts |
Uses the server-safe token hook. |
apps/frontend/src/hooks/useRampUrlParams.ts |
Uses the server-safe token hook. |
apps/frontend/src/hooks/useEvmTokensLoaded.ts |
Adds an external-store server snapshot. |
apps/frontend/src/contexts/rampState.tsx |
Avoids persisted-state reads during SSR. |
apps/frontend/src/components/ToastPopover/index.tsx |
Adds a toast server snapshot. |
apps/frontend/src/components/Ramp/Onramp/index.tsx |
Adopts the shared token-loading hook. |
apps/frontend/src/components/Ramp/Offramp/index.tsx |
Adopts the shared token-loading hook. |
apps/frontend/src/components/Globe/index.tsx |
Moves responsive sizing to CSS. |
apps/frontend/src/client.tsx |
Adds the TanStack Start hydration entry. |
apps/frontend/package.json |
Adds Start dependencies and updates build paths. |
apps/frontend/netlify.toml |
Publishes the generated client directory. |
apps/frontend/index.html |
Removes the former Vite HTML shell. |
apps/frontend/CLAUDE.md |
Documents SSR architecture and conventions. |
apps/frontend/_redirects |
Routes widget URLs to the SPA shell. |
apps/dashboard/src/routeTree.gen.ts |
Regenerates dashboard route ordering. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| <PersistentRampStateProvider> | ||
| <PolkadotNodeProvider> | ||
| <PolkadotWalletStateProvider> | ||
| <NetworkProvider> |
| // Initialize dynamic EVM tokens from SquidRouter API (falls back to static config on failure) | ||
| initializeEvmTokens(); | ||
|
|
||
| hydrateStart().then(router => { |
Comment on lines
+51
to
+52
| if (typeof window !== "undefined") { | ||
| createAppKit({ |
| - **Routing**: TanStack Router — route tree auto-generated in `src/routeTree.gen.ts` (do not hand-edit). | ||
| - **Rendering**: TanStack Start. Marketing routes are prerendered to static HTML at build time | ||
| (`dist/client`); `/widget` sets `ssr: false` and is served from the `_shell.html` SPA shell. | ||
| See [`docs/adr-0004-landing-page-ssr.md`](../../docs/adr-0004-landing-page-ssr.md). |
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.
Prerender the marketing pages to static HTML
Migrates the frontend from a client-rendered SPA to TanStack Start, so the
marketing pages are rendered to static HTML at build time instead of booting
an empty shell. Crawlers and first-paint now get real content.
What changed
(unprefixed,
/en,/pt-BR) — served by Netlify as plain files./widgetopts out (ssr: false) and renders from a prerendered SPAshell. The ramp flow depends on wallet SDKs and persisted machine state that
only exist in the browser.
localStorageprobed withtypeof, server snapshots foruseSyncExternalStore,createAppKitmoved behind awindowguard, Globesized from CSS instead of a measured viewport.
src/tests/ssr-safety.test.tsxpins each of those regressions.Netlify configuration
Two files under
apps/frontend/:netlify.toml(build command, publish dir) and_redirects(all routing rules, copied intodist/clientby the build).The publish directory moved from
disttodist/client. Note thatnetlify.tomloverrides the Netlify UI settings once deployed, and the build runs
--frozen-lockfile, sobun.lockmust be committed and in sync.Netlify serves real files before applying non-forced rules, which is what lets the
/* /404.html 404catch-all coexist with the prerendered pages.Adding a marketing page: add the route under
src/routes/{-$locale}/and add itspath to
MARKETING_ROUTESinvite.config.ts. Miss the second step and it works in devbut 404s in production, with no build error.
Adding a locale: add the prefix to
LOCALE_PREFIXESinvite.config.ts.Adding a client-only route: set
ssr: falseon the route and add a_redirectsrewrite to
/_shell.htmlfor each locale variant. Don't add it toMARKETING_ROUTES—the shell is appended last and would overwrite the real page.