Skip to content

Add server-rendered Remix hydration#76

Merged
kentcdodds merged 12 commits into
mainfrom
cursor/server-rendering-hydration-routing-bcf6
Jul 8, 2026
Merged

Add server-rendered Remix hydration#76
kentcdodds merged 12 commits into
mainfrom
cursor/server-rendering-hydration-routing-bcf6

Conversation

@kentcdodds

@kentcdodds kentcdodds commented Jul 8, 2026

Copy link
Copy Markdown
Member

Summary

  • Render the Remix app document on the server with an AppRoot client entry for hydration.
  • Add SSR-aware route location context and route-pattern matching for client navigation.
  • Serve direct page routes through the same SSR path, including reset-password, account, and OAuth pages.
  • Add route-keyed loader data for account, chat, and OAuth authorize pages, with SSR embedding, SPA preload consumption, stale markers, and post-mutation revalidation.
  • Fold in the Kody PR #664/#666 fix class: successful route-loader consumption now schedules a corrective render so values derived before consumption cannot persist stale.
  • Share and refresh the embedded session with routed content so account, OAuth, and logout revalidation stay aligned with the authenticated nav.
  • Render OAuth authorize query errors during SSR and preserve them through hydration.
  • Pass CLOUDFLARE_ACCOUNT_ID from repository variables/secrets into Cloudflare preview and deploy jobs so Wrangler can select the intended account in non-interactive CI.

Walkthrough

clean-loader-data-revalidation-walkthrough.mp4

Testing

  • bunx vitest run --config vitest-unit.config.ts server/loader-data-context.test.ts
  • bunx vitest run --config vitest-unit.config.ts server/ssr-render.test.ts
  • bun run test:unit
  • bun run typecheck
  • bun run lint
  • bun run build
  • bun run test:e2e
  • Manual browser walkthrough covering signup/account SSR loader data, account reload, chat create/delete revalidation, and logout session revalidation.
Open in Web Open in Cursor 

Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Comment thread client/routes/chat.tsx Outdated
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
@cursor cursor Bot temporarily deployed to preview-76 July 8, 2026 00:36 Inactive
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

🔎 Preview deployed: https://epicflare-pr-76.kentcdodds.workers.dev

Worker: epicflare-pr-76
D1: epicflare-pr-76-db
KV: epicflare-pr-76-oauth-kv

Mocks:

Comment thread client/routes/account.tsx Outdated
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
@cursor cursor Bot temporarily deployed to preview-76 July 8, 2026 00:41 Inactive
Comment thread client/session-context.tsx Outdated
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
@cursor cursor Bot temporarily deployed to preview-76 July 8, 2026 00:50 Inactive
Comment thread client/routes/oauth-authorize.tsx Outdated
Comment thread client/routes/oauth-authorize.tsx
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
@cursor cursor Bot temporarily deployed to preview-76 July 8, 2026 01:07 Inactive
Comment thread client/app.tsx
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
@cursor cursor Bot temporarily deployed to preview-76 July 8, 2026 01:27 Inactive
Comment thread client/client-router.tsx
Comment thread client/routes/oauth-authorize.tsx
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
@cursor cursor Bot temporarily deployed to preview-76 July 8, 2026 01:58 Inactive
Comment thread client/routes/oauth-authorize.tsx
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
@cursor cursor Bot temporarily deployed to preview-76 July 8, 2026 02:01 Inactive

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 12a5fbc. Configure here.

Comment thread client/routes/chat.tsx
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
@cursor cursor Bot temporarily deployed to preview-76 July 8, 2026 02:07 Inactive
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
@kentcdodds kentcdodds merged commit dc8b42f into main Jul 8, 2026
8 checks passed
@kentcdodds kentcdodds deleted the cursor/server-rendering-hydration-routing-bcf6 branch July 8, 2026 13:57
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.

2 participants