Skip to content

Commit 7ad0bb1

Browse files
committed
Merge remote-tracking branch 'upstream/main' into test/rsc-hmr-e2e
2 parents ad36ddc + 44a8c3e commit 7ad0bb1

657 files changed

Lines changed: 35912 additions & 10368 deletions

File tree

Some content is hidden

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

‎.changeset/dirty-bushes-sink.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@tanstack/router-core': patch
3+
---
4+
5+
skip impossible JSON parse attempts
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@tanstack/start-client-core': patch
3+
---
4+
5+
perf: drop consumed chunks from the client frame decoder buffer with an O(1) head pointer instead of `Array.prototype.shift()` (O(n)). The previous approach degraded to O(n^2) when a single large frame (e.g. a big `RawStream` payload) was assembled from many small network reads.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@tanstack/router-core': patch
3+
---
4+
5+
perf: speed up structural sharing (`replaceEqualDeep`) by computing enumerable own keys with `Object.keys` + a length compare instead of `getOwnPropertyNames` followed by a `propertyIsEnumerable` call per key. This runs on every selector result on every state update when `defaultStructuralSharing` is enabled, and is ~1.3-1.5x faster on typical router state objects with identical behavior.

‎.github/workflows/bundle-size.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@ on:
88
paths:
99
- 'packages/**'
1010
- 'benchmarks/**'
11+
- 'scripts/benchmarks/bundle-size/**'
1112
push:
1213
branches: [main]
1314
paths:
1415
- 'packages/**'
1516
- 'benchmarks/**'
17+
- 'scripts/benchmarks/bundle-size/**'
1618
workflow_dispatch:
1719

1820
concurrency:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
distribute-on:
22
small-changeset: 4 linux-medium-js
33
medium-changeset: 8 linux-medium-js
4-
large-changeset: 14 linux-medium-js
4+
large-changeset: 16 linux-medium-js
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
exclude-reads:
2+
- e2e/.gitignore
3+
- '**/src/routeTree.gen.ts'
4+
exclude-writes:
5+
- '**/src/routeTree.gen.ts'
6+
task-exclusions:
7+
- target: test:build
8+
exclude-reads:
9+
- LICENSE

‎README.md‎

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,20 @@
44
<tr>
55
<td>
66

7-
<img
8-
src="./media/header_router.png"
9-
alt="TanStack Router"
10-
/>
7+
<picture>
8+
<source
9+
media="(prefers-color-scheme: dark)"
10+
srcset="https://tanstack.com/api/readme/router.png?theme=dark"
11+
/>
12+
<source
13+
media="(prefers-color-scheme: light)"
14+
srcset="https://tanstack.com/api/readme/router.png"
15+
/>
16+
<img
17+
src="https://tanstack.com/api/readme/router.png"
18+
alt="TanStack Router"
19+
/>
20+
</picture>
1121

1222
## TanStack Router
1323

@@ -23,10 +33,20 @@ A modern router designed for type safety, data‑driven navigation, and seamless
2333
</td>
2434
<td>
2535

26-
<img
27-
src="./media/header_start.png"
28-
alt="TanStack Start"
29-
/>
36+
<picture>
37+
<source
38+
media="(prefers-color-scheme: dark)"
39+
srcset="https://tanstack.com/api/readme/start.png?theme=dark"
40+
/>
41+
<source
42+
media="(prefers-color-scheme: light)"
43+
srcset="https://tanstack.com/api/readme/start.png"
44+
/>
45+
<img
46+
src="https://tanstack.com/api/readme/start.png"
47+
alt="TanStack Start"
48+
/>
49+
</picture>
3050

3151
## TanStack Start
3252

‎benchmarks/client-nav/package.json‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"test:types:vue": "tsc -p ./vue/tsconfig.json --noEmit"
2020
},
2121
"dependencies": {
22+
"@tanstack/history": "workspace:^",
2223
"@tanstack/react-router": "workspace:^",
2324
"@tanstack/router-core": "workspace:^",
2425
"@tanstack/solid-router": "workspace:^",
@@ -38,6 +39,7 @@
3839
"@vitejs/plugin-vue-jsx": "^5.1.5",
3940
"@types/jsdom": "28.0.0",
4041
"@typescript/native": "npm:typescript@^7.0.2",
42+
"jsdom": "^29.1.1",
4143
"typescript": "npm:@typescript/typescript6@^6.0.2",
4244
"vite": "^8.0.14",
4345
"vite-plugin-solid": "^2.11.11",

‎benchmarks/client-nav/scenarios/async-pipeline/react/speed.bench.ts‎

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,27 @@
1-
import { afterAll, beforeAll, bench, describe } from 'vitest'
1+
import { afterEach, beforeEach, bench, describe } from 'vitest'
22
import { benchOptions, ticksPerIteration } from '../shared'
33
import { setup } from './setup'
44

55
describe('client-async-pipeline', () => {
66
const test = setup()
77

88
/**
9-
* Running `vitest bench` ignores "suite hooks" like `beforeAll` and `afterAll`,
10-
* so we use tinybench's `setup` and `teardown` options to run our setup and teardown logic.
11-
*
12-
* But CodSpeed calls the benchmarked function directly, bypassing `setup` and `teardown`,
13-
* but it does support `beforeAll` and `afterAll`.
14-
*
15-
* So it looks like we're setting up in duplicate, but in reality, it's only running once per environment, as intended.
9+
* Running `vitest bench` ignores suite hooks, so Tinybench uses the `setup`
10+
* and `teardown` options below. CodSpeed bypasses those options but supports
11+
* `beforeEach` and `afterEach`. Only one lifecycle path runs in either
12+
* environment, and every measured invocation receives fresh application state.
1613
*/
1714

18-
beforeAll(test.before)
19-
afterAll(test.after)
15+
beforeEach(test.before)
16+
afterEach(test.after)
2017

2118
bench(
2219
'client-async-pipeline navigation loop (react)',
2320
async () => {
2421
for (let i = 0; i < ticksPerIteration; i++) {
2522
await test.tick()
2623
}
24+
await test.finishBatch()
2725
},
2826
{
2927
...benchOptions,

‎benchmarks/client-nav/scenarios/async-pipeline/react/src/main.tsx‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
import type { RouterHistory } from '@tanstack/history'
12
import { RouterProvider, createRouter } from '@tanstack/react-router'
23
import { createRoot } from 'react-dom/client'
34
import { routeTree } from './routeTree.gen'
45

5-
export function createTestRouter() {
6+
export function createTestRouter(history: RouterHistory) {
67
return createRouter({
78
routeTree,
9+
history,
810
scrollRestoration: true,
911
// Key the scroll-restoration cache by pathname instead of the default
1012
// random per-entry location key: with push navigations the default mints
@@ -22,8 +24,8 @@ declare module '@tanstack/react-router' {
2224
}
2325
}
2426

25-
export function mountTestApp(container: HTMLElement) {
26-
const router = createTestRouter()
27+
export function mountTestApp(container: HTMLElement, history: RouterHistory) {
28+
const router = createTestRouter(history)
2729

2830
const reactRoot = createRoot(container)
2931
reactRoot.render(<RouterProvider router={router} />)

0 commit comments

Comments
 (0)