Skip to content

docs: two-phase route definition design for RSC#71

Merged
uhyo merged 2 commits intomasterfrom
docs/two-phase-route-design
Feb 24, 2026
Merged

docs: two-phase route definition design for RSC#71
uhyo merged 2 commits intomasterfrom
docs/two-phase-route-design

Conversation

@uhyo
Copy link
Owner

@uhyo uhyo commented Feb 24, 2026

Summary

  • Adds a design document (docs/design/route-identity-rsc.md) proposing a solution for the RSC/client route import problem
  • Routes are split into two phases: Phase 1 (route() without component) creates a shared partial route carrying all type info (id, path, loader, state), and Phase 2 (bindRoute()) attaches the server component in the server module
  • This enables type-safe useRouteParams, useRouteData, and useRouteState hooks in client components while preserving server component references in the route tree

Test plan

  • Review the design document for correctness and completeness
  • Validate that the proposed API is compatible with the current @funstack/router type system
  • Consider edge cases around TypeScript overload resolution

🤖 Generated with Claude Code

uhyo and others added 2 commits February 24, 2026 12:40
Add design document proposing a solution for the RSC/client route import
problem. Routes are split into two phases: a shared partial route (id,
path, loader, state) importable by client components, and a server-side
bindRoute() that attaches the component. This enables type-safe hooks
in client components while preserving server component references.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@uhyo uhyo merged commit 4f1ed89 into master Feb 24, 2026
1 check passed
@uhyo uhyo deleted the docs/two-phase-route-design branch February 24, 2026 03:44
uhyo added a commit that referenced this pull request Feb 24, 2026
This reverts commit 4f1ed89.

Reason: commited to wrong repository
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.

1 participant