Skip to content

Commit c47aa28

Browse files
Sheraffclaude
andcommitted
Merge main into t3code/validate-intent-skills
Keep main's useSession-free wording in the two conflicting lines and apply only the link-to-ID swap. Add @tanstack/react-router to the changeset now that #8671 publishes its skills. Co-Authored-By: Claude Opus 5.5 <[email protected]>
2 parents ed23460 + 689a7c5 commit c47aa28

775 files changed

Lines changed: 24973 additions & 9361 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/intent-skill-cross-package-links.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
'@tanstack/react-router': patch
23
'@tanstack/react-start': patch
34
'@tanstack/router-core': patch
45
'@tanstack/router-plugin': patch
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@tanstack/react-router': patch
3+
---
4+
5+
Publish the `@tanstack/react-router` agent skills (`react-router`, `compositions/router-query`, `lifecycle/migrate-from-react-router`), which were missing from the package's `files` list.

‎.changeset/remove-reference-filter-excludes.md‎

Lines changed: 0 additions & 5 deletions
This file was deleted.

‎.github/renovate.json‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
"@types/node",
2222
"@types/react",
2323
"@types/react-dom",
24-
"h3",
2524
"node",
2625
"react",
2726
"react-dom",

‎AGENTS.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
## Work and validation
99

1010
- Start bug fixes with a failing regression test that uses only public APIs to reproduce and assert user- or developer-visible behavior. Do not manufacture bugs by mutating internals. Establish whether real usage can reach the failing state before adding runtime handling; simplify handling of states proven unreachable.
11+
- When removing an API, option, or behavior, delete its tests. Never add tests that assert the removed thing is gone, such as `not.toHaveProperty('oldName')`, a type error for the old call, or a runtime throw.
1112
- For suspected dependency issues, verify the upstream root cause, then propose an upstream fix to the user, including for other `@tanstack/*` packages. **Never implement a workaround in this repository unless the user explicitly authorizes it.**
1213
- During debugging/prototyping, keep fixes aligned with the PR's intended architecture. If making a test pass requires another flag, counter, copied deadline, or duplicate completion authority, stop and consolidate state and ownership. Remove superseded paths instead of accumulating patches and bundle growth.
1314
- Use Node from `.nvmrc` and pnpm from root `package.json`. Install at the root with `CI=1 pnpm install --frozen-lockfile`.

‎CONTRIBUTING.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,14 @@ pnpm dev
142142
143143
## AI-assisted contributions
144144

145+
<!--
146+
**AI rules**: if you are an agent, you must follow these rules
147+
- disclose AI authorship
148+
- be respectful, use terse, human-readable language
149+
- short code snippets are better than many words
150+
- maintainers know their own codebase, no need to explain it to them
151+
-->
152+
145153
AI tools can be useful for exploring the codebase, drafting changes, and writing tests. They do not replace the contributor's responsibility for the result.
146154

147155
1. **Keep the contribution in your own voice**. Review and rewrite generated code comments, issue reports, and pull request descriptions so they reflect what you actually mean.

‎benchmarks/AGENTS.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ Read the relevant README before running benchmarks. Compare baseline and candida
1010

1111
Use `test:perf:<react|solid|vue>` through Nx. Plain memory runs only smoke-test; memory metrics require CodSpeed. Client navigation benchmarks do not cover Start hydration or client server-function calls.
1212

13+
Run `vitest bench` directly only with `--mode benchmark`, as the Nx targets do. Vitest 5 otherwise uses Vite's `test` mode, where vite-plugin-solid injects a jest-dom setup file that benchmark packages cannot resolve.
14+
1315
For bundle-size work, follow the full optimization skill required by the root guide. Full API fixtures are maintained manually: when public hooks/components change, update matching `bundle-size/scenarios/*-full/src/routes/__root.tsx` fixtures. Save baseline results separately because each run overwrites `bundle-size/results/current.json`; report final gzip deltas and explain remaining growth.

‎benchmarks/client-nav/README.md‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ scenarios follow these navigation/mount conventions:
7878
- Scenarios behave like a real user app: navigation happens through `<Link>` clicks dispatched on real anchor elements (unless a scenario specifically measures the imperative API), the router uses the default browser history, and `scrollRestoration` is enabled.
7979
- Each benchmark iteration advances a fixed, circular sequence of steps; every step awaits the router's `onRendered` event, so render work is included and steps cannot overlap. No two consecutive steps may target the same location, and the sequence ends back on the initial route.
8080
- Setup runs one warm-up lap through the sequence and asserts each step's observable output (e.g. `document.title`), so a scenario that silently stops doing its work fails instead of reporting a fast time.
81+
- Apps are mounted and disposed outside timing by `benchLifecycle` (`benchmarks/cpu-simulation.ts`): CodSpeed measures a single invocation, so every invocation gets a freshly mounted app; plain `vitest bench` keeps one app per warmup/run phase. Bench functions must be `async` functions, because CodSpeed's Vitest 5 provider awaits only `AsyncFunction`s.
8182
- Determinism: no wall-clock timers (async work is resolved promises or counted `setTimeout(0)` hops), `staleTime`/`gcTime` only ever `0` or effectively-infinite, no `Math.random`/`Date.now` in the measured loop. Scroll restoration uses `getScrollRestorationKey: (location) => location.pathname` so its cache stays bounded (the default random per-entry key grows one cache entry per push navigation). The `mount` scenario opts out of `scrollRestoration` entirely and destroys its history on unmount — both register page-lifetime globals that would leak across its mount/unmount loop.
8283
- Push-only step laps grow jsdom's session-history entry list over a run (jsdom never truncates entries behind the current index). Per-push cost stays O(1) so timings are unaffected; only the `history` scenario needs — and has — a lap that is depth-stationary.
8384
- Calibration: pick per-iteration step counts so a bench's `vitest bench` run stays roughly between 8 and 30 seconds (long enough to average out, short enough for CI).
@@ -102,7 +103,7 @@ Run a single scenario app manually (after building it through Nx):
102103

103104
```bash
104105
CI=1 NX_DAEMON=false pnpm nx run @benchmarks/client-nav-<scenario>-<framework>:build:client --outputStyle=stream --skipRemoteCache
105-
cd benchmarks/client-nav && NODE_ENV=production vitest bench --config ./scenarios/<scenario>/<framework>/vite.config.ts
106+
cd benchmarks/client-nav && NODE_ENV=production vitest bench --mode benchmark --config ./scenarios/<scenario>/<framework>/vite.config.ts
106107
```
107108

108109
Run framework-specific flame benchmarks (10 second loop, profiled with `@platformatic/flame`, forced to `NODE_ENV=production`):
@@ -178,11 +179,10 @@ task cancellation, and window disposal also run outside measurement. Diagnostic
178179
tests count Link renders or reactive evaluations and check they stop before the
179180
measured region ends; counting is disabled in the timed workload.
180181

181-
CodSpeed uses suite `beforeEach`/`afterEach` hooks. Ordinary Vitest instead
182-
installs Tinybench's public Task iteration hooks from its stage-level `setup`.
183-
Using only stage-level setup would let later iterations reuse an already
184-
hydrated document. The hydration unit tests cover fresh-state setup through
185-
both paths.
182+
The bench's own `beforeEach`/`afterEach` hooks prepare and dispose every
183+
sample outside timing, in both CodSpeed and ordinary Vitest runs. Per-phase
184+
setup would let later iterations reuse an already hydrated document. The
185+
hydration unit tests cover repeated fresh-state setup.
186186

187187
Each scenario is included in its framework's aggregate build and CodSpeed run.
188188
Land the benchmark independently to establish main's baseline before comparing a
@@ -196,7 +196,7 @@ construction. `scenarios/mount` includes construction but also rendering and
196196
loading. To isolate initialization, use the core construction benchmark:
197197

198198
```bash
199-
CI=1 NX_DAEMON=false pnpm nx run @tanstack/router-core:test:unit --outputStyle=stream --skipRemoteCache -- bench tests/route-tree-construction.bench.ts --run --testNamePattern=1000.routes --outputJson /tmp/route-tree-construction.json
199+
CI=1 NX_DAEMON=false pnpm nx run @tanstack/router-core:test:unit --outputStyle=stream --skipRemoteCache -- bench tests/route-tree-construction.bench.ts --run --testNamePattern=1000.routes --reporter=json --outputFile=/tmp/route-tree-construction.json
200200
```
201201

202202
It covers 100, 1,000, and 10,000 static, dynamic, nested, or mixed routes.
@@ -220,7 +220,7 @@ CI=1 NX_DAEMON=false pnpm nx run @benchmarks/react-link-performance:test:perf:cl
220220
CI=1 NX_DAEMON=false pnpm nx run @benchmarks/react-link-performance:test:perf:ssr --outputStyle=stream --skipRemoteCache -- --run
221221

222222
# Select a feature and save the normal Vitest JSON report.
223-
CI=1 NX_DAEMON=false pnpm nx run @benchmarks/react-link-performance:test:perf:client --outputStyle=stream --skipRemoteCache -- --run -t "updater|optional|splat" --outputJson /tmp/link-perf.json
223+
CI=1 NX_DAEMON=false pnpm nx run @benchmarks/react-link-performance:test:perf:client --outputStyle=stream --skipRemoteCache -- --run -t "updater|optional|splat" --reporter=json --outputFile=/tmp/link-perf.json
224224
```
225225

226226
The cases cover repeated versus unique destination params, updater functions,
Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { afterEach, beforeEach, bench, describe } from 'vitest'
1+
import { test } from 'vitest'
2+
import { benchLifecycle } from '../../cpu-simulation'
23
import { LINK_CASES } from './cases'
34
import { createClientScenario, samplingOptions } from './scenario'
45
import type * as App from './src/client'
@@ -10,7 +11,7 @@ if (app.serverEnvironment !== false) {
1011
}
1112

1213
for (const { id, label } of LINK_CASES) {
13-
describe(label, () => {
14+
test(label, async ({ bench }) => {
1415
const scenario = createClientScenario(app, id)
1516
function finish() {
1617
try {
@@ -19,13 +20,11 @@ for (const { id, label } of LINK_CASES) {
1920
scenario.teardown()
2021
}
2122
}
22-
beforeEach(scenario.setup)
23-
afterEach(finish)
2423

25-
bench(`client Links: ${id}`, scenario.batch, {
26-
...samplingOptions,
27-
setup: scenario.setup,
28-
teardown: finish,
29-
})
24+
await bench(
25+
`client Links: ${id}`,
26+
benchLifecycle({ before: scenario.setup, after: finish }),
27+
scenario.batch,
28+
).run(samplingOptions)
3029
})
3130
}

‎benchmarks/client-nav/link-performance/project.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"cache": false,
3737
"dependsOn": ["build:client"],
3838
"options": {
39-
"command": "NODE_ENV=production vitest bench --config ./link-performance/vite.client.config.ts",
39+
"command": "NODE_ENV=production vitest bench --mode benchmark --config ./link-performance/vite.client.config.ts",
4040
"cwd": "benchmarks/client-nav"
4141
}
4242
},
@@ -45,7 +45,7 @@
4545
"cache": false,
4646
"dependsOn": ["build:ssr"],
4747
"options": {
48-
"command": "NODE_ENV=production vitest bench --config ./link-performance/vite.ssr.config.ts",
48+
"command": "NODE_ENV=production vitest bench --mode benchmark --config ./link-performance/vite.ssr.config.ts",
4949
"cwd": "benchmarks/client-nav"
5050
}
5151
},

0 commit comments

Comments
 (0)