Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 16 additions & 10 deletions packages/docs/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,16 +182,22 @@ export const routes = [
],
}),
route({
path: "/react-server-components",
component: defer(<LearnRscPage />, {
name: "LearnRscPage",
}),
}),
route({
path: "/route-definitions",
component: defer(<LearnRouteDefinitionsPage />, {
name: "LearnRouteDefinitionsPage",
}),
path: "/rsc",
component: <Outlet />,
children: [
route({
path: "/",
component: defer(<LearnRscPage />, {
name: "LearnRscPage",
}),
}),
route({
path: "/route-features",
component: defer(<LearnRouteDefinitionsPage />, {
name: "LearnRouteDefinitionsPage",
}),
}),
],
}),
route({
path: "/actions",
Expand Down
9 changes: 4 additions & 5 deletions packages/docs/src/pages/ApiUtilitiesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ const routes = [
<li>
<code>bindRoute</code> - Binds a component to a partial route
definition (see{" "}
<a href="/learn/route-definitions">Two-Phase Route Definitions</a>)
<a href="/learn/rsc/route-features">Two-Phase Route Definitions</a>)
</li>
<li>
Types: <code>ActionArgs</code>, <code>LoaderArgs</code>,{" "}
Expand All @@ -363,10 +363,9 @@ const routes = [
, and hooks, use the main <code>@funstack/router</code> entry point.
</p>
<p>
See the{" "}
<a href="/learn/react-server-components">React Server Components</a>{" "}
guide for a full walkthrough of using the server entry point, and the{" "}
<a href="/learn/route-definitions">Two-Phase Route Definitions</a>{" "}
See the <a href="/learn/rsc">React Server Components</a> guide for a
full walkthrough of using the server entry point, and the{" "}
<a href="/learn/rsc/route-features">Two-Phase Route Definitions</a>{" "}
guide for using <code>bindRoute()</code> to split route definitions
across the RSC boundary.
</p>
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/src/pages/HomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export function HomePage() {
<h3>RSC Compatible</h3>
<p>
Designed to work with React Server Components.{" "}
<a href="/learn/react-server-components">Learn more</a>
<a href="/learn/rsc">Learn more</a>
</p>
</div>
</div>
Expand Down
36 changes: 17 additions & 19 deletions packages/docs/src/pages/LearnIndexPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,27 +72,25 @@ export function LearnIndexPage() {
</section>

<section className="learn-category">
<h2>
<a href="/learn/react-server-components">React Server Components</a>
</h2>
<p>
Learn how to use FUNSTACK Router with React Server Components. Define
routes in server modules using the{" "}
<code>@funstack/router/server</code> entry point and keep your client
bundle lean by separating route definitions from runtime router code.
</p>
</section>
<section className="learn-category">
<h2>
<a href="/learn/route-definitions">RSC with Route Features</a>
</h2>
<h2>React Server Components</h2>
<p>
Use loaders, typed hooks (<code>useRouteParams</code>,{" "}
<code>useRouteData</code>, <code>useRouteState</code>), and navigation
state alongside React Server Components. This guide shows how to split
route definitions across the server/client boundary using{" "}
<code>bindRoute()</code> so client components get full type safety.
FUNSTACK Router is designed to work with React Server Components.
These guides cover how to define routes in server modules and use
route features alongside RSC:
</p>
<ul>
<li>
<a href="/learn/rsc">React Server Components</a> &mdash; define
routes in server modules using the{" "}
<code>@funstack/router/server</code> entry point and keep your
client bundle lean
</li>
<li>
<a href="/learn/rsc/route-features">RSC with Route Features</a>{" "}
&mdash; use loaders, typed hooks, and navigation state alongside RSC
by splitting route definitions with <code>bindRoute()</code>
</li>
</ul>
</section>

<section className="learn-category">
Expand Down
15 changes: 7 additions & 8 deletions packages/docs/src/pages/LearnPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ const learnNavItems: NavEntry[] = [
{ path: "/learn/navigation-api", label: "Navigation API" },
{ path: "/learn/nested-routes", label: "Nested Routes" },
{ path: "/learn/type-safety", label: "Type Safety" },
{ path: "/learn/actions", label: "Form Actions" },
{ path: "/learn/transitions", label: "Transitions" },
{
label: "SSR",
items: [
Expand All @@ -31,15 +33,12 @@ const learnNavItems: NavEntry[] = [
],
},
{
path: "/learn/react-server-components",
label: "React Server Components",
},
{
path: "/learn/route-definitions",
label: "RSC with Route Features",
label: "RSC",
items: [
{ path: "/learn/rsc", label: "React Server Components" },
{ path: "/learn/rsc/route-features", label: "RSC with Route Features" },
],
},
{ path: "/learn/actions", label: "Form Actions" },
{ path: "/learn/transitions", label: "Transitions" },
];

function isNavGroup(entry: NavEntry): entry is NavGroup {
Expand Down
4 changes: 2 additions & 2 deletions packages/docs/src/pages/LearnRscPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,8 @@ export default function App() {
</li>
<li>
For type-safe hooks in client components, see the{" "}
<a href="/learn/route-definitions">RSC with Route Features</a> guide
which explains how to split route definitions across the
<a href="/learn/rsc/route-features">RSC with Route Features</a>{" "}
guide which explains how to split route definitions across the
server/client boundary
</li>
</ul>
Expand Down
8 changes: 3 additions & 5 deletions packages/docs/src/pages/LearnSsgPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,9 @@ export function LearnSsgPage() {
</p>
<p>
If you only need loaders to run at build time (not on the client),
consider using{" "}
<a href="/learn/react-server-components">React Server Components</a>{" "}
with SSG. RSC lets you fetch data on the server during the build and
send the result as static HTML, without shipping loader code to the
client.
consider using <a href="/learn/rsc">React Server Components</a> with
SSG. RSC lets you fetch data on the server during the build and send
the result as static HTML, without shipping loader code to the client.
</p>
</section>

Expand Down