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 c47aa28
Browse filesBrowse the repository at this point in the historyBrowse files
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]>
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.
Copy file name to clipboardExpand all lines: AGENTS.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,7 @@
8
8
## Work and validation
9
9
10
10
- 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.
11
12
- 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.**
12
13
- 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.
13
14
- Use Node from `.nvmrc` and pnpm from root `package.json`. Install at the root with `CI=1 pnpm install --frozen-lockfile`.
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -142,6 +142,14 @@ pnpm dev
142
142
143
143
## AI-assisted contributions
144
144
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
+
145
153
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.
146
154
147
155
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.
Copy file name to clipboardExpand all lines: benchmarks/AGENTS.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,4 +10,6 @@ Read the relevant README before running benchmarks. Compare baseline and candida
10
10
11
11
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.
12
12
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
+
13
15
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.
Copy file name to clipboardExpand all lines: benchmarks/client-nav/README.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -78,6 +78,7 @@ scenarios follow these navigation/mount conventions:
78
78
- 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.
79
79
- 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.
80
80
- 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.
81
82
- 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.
82
83
- 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.
83
84
- 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):
102
103
103
104
```bash
104
105
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
106
107
```
107
108
108
109
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
178
179
tests count Link renders or reactive evaluations and check they stop before the
179
180
measured region ends; counting is disabled in the timed workload.
180
181
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.
186
186
187
187
Each scenario is included in its framework's aggregate build and CodSpeed run.
188
188
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
196
196
loading. To isolate initialization, use the core construction benchmark:
0 commit comments