You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 289dd2d
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: packages/react-start/skills/react-start/SKILL.md
+12-4Lines changed: 12 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ description: >-
7
7
hook.
8
8
type: framework
9
9
library: tanstack-start
10
-
library_version: '1.166.2'
10
+
library_version: '1.168.32'
11
11
framework: react
12
12
requires:
13
13
- start-core
@@ -18,9 +18,7 @@ sources:
18
18
19
19
# React Start (`@tanstack/react-start`)
20
20
21
-
This skill builds on start-core. Read [start-core](../../../start-client-core/skills/start-core/SKILL.md) first for foundational concepts.
22
-
23
-
This skill covers the React-specific bindings, setup, and patterns for TanStack Start.
21
+
This is the React Start entry skill. Use the workflow below, then load only the package skill that owns the boundary you are changing. Do not read `start-core`, Router Core, and React Router manuals in full before starting.
24
22
25
23
For React Server Components patterns, see [react-start/server-components](./server-components/SKILL.md).
26
24
@@ -30,6 +28,16 @@ For React Server Components patterns, see [react-start/server-components](./serv
30
28
31
29
> **CRITICAL**: Types are FULLY INFERRED. Never cast, never annotate inferred values.
32
30
31
+
## Full-Stack Workflow
32
+
33
+
1. Define the route and component with `createFileRoute`.
34
+
2. Put private or server-only reads and writes in `createServerFn`; call reads directly from loaders.
35
+
3. Use `useServerFn` for component mutations, then invalidate the router or query cache after the write resolves.
36
+
4. Enforce auth in every private server function or server route. Add `beforeLoad` separately for navigation UX.
37
+
5. Run the initial SSR path, client navigation, mutation plus reload, direct anonymous endpoint request, runtime response assertion, type tests, and production build.
38
+
39
+
Load `start-core/server-routes` instead of `server-functions` only when a raw HTTP endpoint is required. Load `router-core/*` only for the specific routing concern involved, such as params or search validation.
40
+
33
41
## Package API Surface
34
42
35
43
`@tanstack/react-start` re-exports everything from `@tanstack/start-client-core` plus:
Copy file name to clipboardExpand all lines: packages/router-core/skills/router-core/SKILL.md
+20-2Lines changed: 20 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ description: >-
7
7
file naming conventions. Entry point for all router skills.
8
8
type: core
9
9
library: tanstack-router
10
-
library_version: '1.166.2'
10
+
library_version: '1.171.15'
11
11
---
12
12
13
13
# TanStack Router Core
@@ -18,6 +18,8 @@ TanStack Router is a type-safe router for React and Solid with built-in SWR cach
18
18
19
19
> **CRITICAL**: TanStack Router is CLIENT-FIRST. Loaders run on the client by default, NOT server-only like Remix/Next.js. Do not confuse TanStack Router APIs with Next.js or React Router.
20
20
21
+
Use this entry skill to choose one primary sub-skill. Do not load the full catalog. Load a second sub-skill only when the task crosses a real boundary, such as an authenticated loader that needs both `auth-and-guards` and `data-loading`.
22
+
21
23
## Sub-Skills
22
24
23
25
| Task | Sub-Skill |
@@ -66,6 +68,22 @@ Need server-side rendering?
66
68
→ router-core/ssr
67
69
```
68
70
71
+
## Cross-Cutting Completion Checks
72
+
73
+
For route refactors:
74
+
75
+
1. Rename or move the route file; do not hand-edit the generated `createFileRoute` path.
76
+
2. Regenerate `routeTree.gen.ts` with the configured Router plugin or CLI.
77
+
3. Update links, redirects, `from` narrowing, params, and tests that reference the old route.
78
+
4. Run type tests and a production build. A typecheck alone does not prove route generation or bundling works.
79
+
80
+
For response schema changes:
81
+
82
+
1. Update the source model and shared validation schema.
83
+
2. Update the server function or API serializer so the field exists at runtime.
84
+
3. Update loader and component consumers without casts.
85
+
4. Assert the actual response payload in a unit or integration test. Typechecking cannot catch a serializer that omits the new field.
86
+
69
87
## Minimal Working Example
70
88
71
89
```tsx
@@ -136,4 +154,4 @@ The plugin auto-generates this string. If you rename a route file, the plugin up
136
154
137
155
## Version Note
138
156
139
-
This skill targets `@tanstack/router-core` v1.166.2 and `@tanstack/react-router` v1.166.2. APIs are stable. Splat routes use `$` (not `*`); the `*` compat alias will be removed in v2.
157
+
This skill targets `@tanstack/router-core` v1.171.15. Splat routes use `$` (not `*`); the `*` compat alias will be removed in v2.
Rule of thumb: every `createServerFn`, server route, or API endpoint that touches user data needs `authMiddleware` (or an equivalent in-handler check). The route guard is for the page experience; the endpoint guard is for the data. See [start-core/auth-server-primitives](../../../../start-client-core/skills/start-core/auth-server-primitives/SKILL.md) for the full session/middleware pattern.
412
411
412
+
### CRITICAL: The anonymous destination can still disclose protected data
413
+
Protect the entire anonymous response, not only the API call. A public login or unauthorized page still leaks data if its title, copy, search params, or serialized loader state names the protected user, tenant, record, or resource. Test a direct anonymous request and follow redirects. Assert that the handler rejects before reading private data, no protected loader runs, the final HTML and serialized state contain no protected identity, and the redirect contains only a sanitized relative return URL.
414
+
413
415
### HIGH: Auth check in component instead of beforeLoad
414
416
415
417
Component-level auth checks cause a **flash of protected content** before the redirect:
0 commit comments