Skip to content

Commit b3ea474

Browse files
authored
Merge branch 'main' into rob/tanstack-start-clerk-rc
2 parents a0388a7 + 7978449 commit b3ea474

File tree

119 files changed

+433
-617
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+433
-617
lines changed

docs/router/framework/react/api/router/NavigateOptionsType.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ The `NavigateOptions` object accepts the following properties:
5050
- Optional
5151
- Defaults to `false`.
5252
- If `true`, navigation will be called using `document.startViewTransition()`.
53-
- If [`ViewTransitionOptions`](../ViewTransitionOptionsType.md), route navigations will be called using `document.startViewTransition({update, types})` where `types` will be the strings array passed with `ViewTransitionOptions["types"]`. If the browser does not support viewTransition types, the navigation will fall back to normal `document.startTransition()`, same as if `true` was passed.
53+
- If [`ViewTransitionOptions`](../ViewTransitionOptionsType.md), route navigations will be called using `document.startViewTransition({update, types})` where `types` will determine the strings array passed with `ViewTransitionOptions["types"]`. If the browser does not support viewTransition types, the navigation will fall back to normal `document.startTransition()`, same as if `true` was passed.
5454
- If the browser does not support this api, this option will be ignored.
5555
- See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Document/startViewTransition) for more information on how this function works.
5656
- See [Google](https://developer.chrome.com/docs/web-platform/view-transitions/same-document#view-transition-types) for more information on viewTransition types

docs/router/framework/react/api/router/ViewTransitionOptionsType.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,15 @@ The `ViewTransitionOptions` type is used to define a
88

99
```tsx
1010
interface ViewTransitionOptions {
11-
types: Array<string>
11+
types:
12+
| Array<string>
13+
| ((locationChangeInfo: {
14+
fromLocation?: ParsedLocation
15+
toLocation: ParsedLocation
16+
pathChanged: boolean
17+
hrefChanged: boolean
18+
hashChanged: boolean
19+
}) => Array<string> | false)
1220
}
1321
```
1422

@@ -18,6 +26,16 @@ The `ViewTransitionOptions` type accepts an object with a single property:
1826

1927
### `types` property
2028

21-
- Type: `Array<string>`
29+
- Type: `Array<string> | ((locationChangeInfo: {
30+
fromLocation?: ParsedLocation
31+
toLocation: ParsedLocation
32+
pathChanged: boolean
33+
hrefChanged: boolean
34+
hashChanged: boolean
35+
}) => (Array<string> | false))`
2236
- Required
23-
- The types array that will be passed to the `document.startViewTransition({update, types}) call`;
37+
- Either one of:
38+
- An array of strings that will be passed to the `document.startViewTransition({update, types}) call`
39+
- A function that accepts `locationChangeInfo` object and returns either:
40+
- An array of strings that will be passed to the `document.startViewTransition({update, types}) call`
41+
- or `false` to skip the view transition

docs/start/framework/react/guide/authentication.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export const logoutFn = createServerFn({ method: 'POST' }).handler(async () => {
7878
export const getCurrentUserFn = createServerFn({ method: 'GET' }).handler(
7979
async () => {
8080
const session = await useAppSession()
81-
const userId = session.get('userId')
81+
const userId = session.userId
8282

8383
if (!userId) {
8484
return null

docs/start/framework/react/guide/server-functions.md

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -228,20 +228,18 @@ Cache server function results at build time for static generation. See [Static S
228228

229229
Handle request cancellation with `AbortSignal` for long-running operations.
230230

231-
### Function ID generation
231+
### Function ID generation for production build
232232

233233
Server functions are addressed by a generated, stable function ID under the hood. These IDs are embedded into the client/SSR builds and used by the server to locate and import the correct module at runtime.
234234

235-
Defaults:
236-
237-
- In development, IDs are URL-safe strings derived from `${filename}--${functionName}` to aid debugging.
238-
- In production, IDs are SHA256 hashes of the same seed to keep bundles compact and avoid leaking file paths.
239-
- If two server functions end up with the same ID (including when using a custom generator), the system de-duplicates by appending an incrementing suffix like `_1`, `_2`, etc.
240-
- IDs are stable for a given file/function tuple for the lifetime of the process (hot updates keep the same mapping).
235+
By default, IDs are SHA256 hashes of the same seed to keep bundles compact and avoid leaking file paths.
236+
If two server functions end up with the same ID (including when using a custom generator), the system de-duplicates by appending an incrementing suffix like `_1`, `_2`, etc.
241237

242238
Customization:
243239

244-
You can customize function ID generation by providing a `generateFunctionId` function when configuring the TanStack Start Vite plugin.
240+
You can customize function ID generation for the production build by providing a `generateFunctionId` function when configuring the TanStack Start Vite plugin.
241+
242+
Prefer deterministic inputs (filename + functionName) so IDs remain stable between builds.
245243

246244
Please note that this customization is **experimental** und subject to change.
247245

@@ -259,8 +257,10 @@ export default defineConfig({
259257
serverFns: {
260258
generateFunctionId: ({ filename, functionName }) => {
261259
// Return a custom ID string. If you return undefined, the default is used.
262-
// For example, always hash (even in dev):
263-
// return createHash('sha256').update(`${filename}--${functionName}`).digest('hex')
260+
return crypto
261+
.createHash('sha1')
262+
.update(`${filename}--${functionName}`)
263+
.digest('hex')
264264
return undefined
265265
},
266266
},
@@ -270,12 +270,6 @@ export default defineConfig({
270270
})
271271
```
272272

273-
Tips:
274-
275-
- Prefer deterministic inputs (filename + functionName) so IDs remain stable between builds.
276-
- If you don’t want file paths in dev IDs, return a hash in all environments.
277-
- Ensure the returned ID is **URL-safe**.
278-
279273
---
280274

281275
> **Note**: Server functions use a compilation process that extracts server code from client bundles while maintaining seamless calling patterns. On the client, calls become `fetch` requests to the server.

examples/react/authenticated-routes-firebase/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
"start": "vite"
1010
},
1111
"dependencies": {
12-
"@tanstack/react-router": "^1.133.8",
13-
"@tanstack/react-router-devtools": "^1.133.8",
14-
"@tanstack/router-plugin": "^1.133.8",
12+
"@tanstack/react-router": "^1.133.10",
13+
"@tanstack/react-router-devtools": "^1.133.10",
14+
"@tanstack/router-plugin": "^1.133.10",
1515
"autoprefixer": "^10.4.20",
1616
"firebase": "^11.4.0",
1717
"postcss": "^8.5.1",

examples/react/authenticated-routes/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
"start": "vite"
1010
},
1111
"dependencies": {
12-
"@tanstack/react-router": "^1.133.8",
13-
"@tanstack/react-router-devtools": "^1.133.8",
14-
"@tanstack/router-plugin": "^1.133.8",
12+
"@tanstack/react-router": "^1.133.10",
13+
"@tanstack/react-router-devtools": "^1.133.10",
14+
"@tanstack/router-plugin": "^1.133.10",
1515
"react": "^19.0.0",
1616
"react-dom": "^19.0.0",
1717
"redaxios": "^0.5.1",

examples/react/basic-default-search-params/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
},
1111
"dependencies": {
1212
"@tanstack/react-query": "^5.66.0",
13-
"@tanstack/react-router": "^1.133.8",
14-
"@tanstack/react-router-devtools": "^1.133.8",
13+
"@tanstack/react-router": "^1.133.10",
14+
"@tanstack/react-router-devtools": "^1.133.10",
1515
"react": "^19.0.0",
1616
"react-dom": "^19.0.0",
1717
"redaxios": "^0.5.1",

examples/react/basic-devtools-panel/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"start": "vite"
1010
},
1111
"dependencies": {
12-
"@tanstack/react-router": "^1.133.8",
13-
"@tanstack/react-router-devtools": "^1.133.8",
12+
"@tanstack/react-router": "^1.133.10",
13+
"@tanstack/react-router-devtools": "^1.133.10",
1414
"@tanstack/react-query-devtools": "^5.67.2",
1515
"react": "^19.0.0",
1616
"react-dom": "^19.0.0",

examples/react/basic-file-based/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
"start": "vite"
1010
},
1111
"dependencies": {
12-
"@tanstack/react-router": "^1.133.8",
13-
"@tanstack/react-router-devtools": "^1.133.8",
14-
"@tanstack/router-plugin": "^1.133.8",
12+
"@tanstack/react-router": "^1.133.10",
13+
"@tanstack/react-router-devtools": "^1.133.10",
14+
"@tanstack/router-plugin": "^1.133.10",
1515
"react": "^19.0.0",
1616
"react-dom": "^19.0.0",
1717
"redaxios": "^0.5.1",

examples/react/basic-non-nested-devtools/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"start": "vite"
1010
},
1111
"dependencies": {
12-
"@tanstack/react-router": "^1.133.8",
13-
"@tanstack/react-router-devtools": "^1.133.8",
12+
"@tanstack/react-router": "^1.133.10",
13+
"@tanstack/react-router-devtools": "^1.133.10",
1414
"react": "^19.0.0",
1515
"react-dom": "^19.0.0",
1616
"redaxios": "^0.5.1",

0 commit comments

Comments
 (0)