diff --git a/.changeset/brave-pans-create.md b/.changeset/brave-pans-create.md
new file mode 100644
index 0000000000..0411cdfa59
--- /dev/null
+++ b/.changeset/brave-pans-create.md
@@ -0,0 +1,10 @@
+---
+'@tanstack/solid-router-ssr-query': patch
+'@tanstack/solid-router-devtools': patch
+'@tanstack/solid-start-client': patch
+'@tanstack/solid-start-server': patch
+'@tanstack/solid-router': patch
+'@tanstack/solid-start': patch
+---
+
+Update to beta.4
diff --git a/.changeset/brown-breads-begin.md b/.changeset/brown-breads-begin.md
new file mode 100644
index 0000000000..0c54b09096
--- /dev/null
+++ b/.changeset/brown-breads-begin.md
@@ -0,0 +1,10 @@
+---
+'@tanstack/solid-router-ssr-query': patch
+'@tanstack/solid-router-devtools': patch
+'@tanstack/solid-start-client': patch
+'@tanstack/solid-start-server': patch
+'@tanstack/solid-router': patch
+'@tanstack/solid-start': patch
+---
+
+Fix two related issues with HeadContent in solid-router
diff --git a/.changeset/bump-solid-query-beta-5.md b/.changeset/bump-solid-query-beta-5.md
new file mode 100644
index 0000000000..270f7bf30f
--- /dev/null
+++ b/.changeset/bump-solid-query-beta-5.md
@@ -0,0 +1,5 @@
+---
+'@tanstack/solid-router-ssr-query': patch
+---
+
+Upgrade `@tanstack/solid-query` to `6.0.0-beta.5`
diff --git a/.changeset/bump-solid-query-rc-4.md b/.changeset/bump-solid-query-rc-4.md
new file mode 100644
index 0000000000..016ce240fc
--- /dev/null
+++ b/.changeset/bump-solid-query-rc-4.md
@@ -0,0 +1,5 @@
+---
+'@tanstack/solid-router-ssr-query': patch
+---
+
+Upgrade `@tanstack/solid-query` to `6.0.0-rc.4`
diff --git a/.changeset/bump-solid-rc-16.md b/.changeset/bump-solid-rc-16.md
new file mode 100644
index 0000000000..64a1880fa1
--- /dev/null
+++ b/.changeset/bump-solid-rc-16.md
@@ -0,0 +1,14 @@
+---
+'@tanstack/solid-router': patch
+'@tanstack/solid-router-devtools': patch
+'@tanstack/solid-router-ssr-query': patch
+'@tanstack/solid-start': patch
+'@tanstack/solid-start-client': patch
+'@tanstack/solid-start-server': patch
+---
+
+Bump solid-js and @solidjs/web to ^2.0.0-rc.16 and @solidjs/vite-plugin to ^3.0.0-next.51 across the monorepo (with @solidjs/babel-plugin 2.0.0-rc.16 for the webpack path and the `@rsbuild/plugin-solid` compiler overrides), and raise the Solid packages' solid-js / @solidjs/web peer floors to 2.0.0-rc.16. @solidjs/vite-plugin 3.0.0-next.51 peer-requires rc.16 and no longer adds a `$$moduleUrl` export to SSR entry chunks, which Cloudflare Workers rejected (solidjs/solid-vite-plugin#423).
+
+Bump @tanstack/solid-query to ^6.0.0-rc.5 and move @tanstack/solid-query-devtools off its exact 6.0.0-rc.1 pin to ^6.0.0-rc.5; every solid-js export the rc.5 devtools import exists in rc.16.
+
+`` no longer renders its children with `undefined` data while hydrating a streamed deferred promise. seroval has already settled the promise by then, but `defer()` only records the result in a `.then` callback, so `` now reads seroval's synchronous status markers when the deferred state is still pending.
diff --git a/.changeset/bump-solid-rc-2.md b/.changeset/bump-solid-rc-2.md
new file mode 100644
index 0000000000..875876dc38
--- /dev/null
+++ b/.changeset/bump-solid-rc-2.md
@@ -0,0 +1,10 @@
+---
+'@tanstack/solid-router': patch
+'@tanstack/solid-router-devtools': patch
+'@tanstack/solid-router-ssr-query': patch
+'@tanstack/solid-start': patch
+'@tanstack/solid-start-client': patch
+'@tanstack/solid-start-server': patch
+---
+
+Bump solid-js and @solidjs/web to ^2.0.0-rc.2 and @solidjs/vite-plugin to ^3.0.0-next.32 across the monorepo.
diff --git a/.changeset/bump-solid-rc-20.md b/.changeset/bump-solid-rc-20.md
new file mode 100644
index 0000000000..7db54eb07c
--- /dev/null
+++ b/.changeset/bump-solid-rc-20.md
@@ -0,0 +1,10 @@
+---
+'@tanstack/solid-router': patch
+'@tanstack/solid-router-devtools': patch
+'@tanstack/solid-router-ssr-query': patch
+'@tanstack/solid-start': patch
+'@tanstack/solid-start-client': patch
+'@tanstack/solid-start-server': patch
+---
+
+Bump solid-js and @solidjs/web to ^2.0.0-rc.20 and @solidjs/vite-plugin to ^3.0.0-next.54 across the monorepo (with @solidjs/babel-plugin 2.0.0-rc.20 for the webpack path and the `@rsbuild/plugin-solid` compiler overrides), and raise the Solid packages' solid-js / @solidjs/web peer floors to 2.0.0-rc.20.
diff --git a/.changeset/bump-solid-rc-4.md b/.changeset/bump-solid-rc-4.md
new file mode 100644
index 0000000000..079673ee61
--- /dev/null
+++ b/.changeset/bump-solid-rc-4.md
@@ -0,0 +1,10 @@
+---
+'@tanstack/solid-router': patch
+'@tanstack/solid-router-devtools': patch
+'@tanstack/solid-router-ssr-query': patch
+'@tanstack/solid-start': patch
+'@tanstack/solid-start-client': patch
+'@tanstack/solid-start-server': patch
+---
+
+Bump solid-js and @solidjs/web to ^2.0.0-rc.4 and @solidjs/vite-plugin to ^3.0.0-next.35 across the monorepo.
diff --git a/.changeset/bump-solid-rc-6.md b/.changeset/bump-solid-rc-6.md
new file mode 100644
index 0000000000..b7f8375097
--- /dev/null
+++ b/.changeset/bump-solid-rc-6.md
@@ -0,0 +1,10 @@
+---
+'@tanstack/solid-router': patch
+'@tanstack/solid-router-devtools': patch
+'@tanstack/solid-router-ssr-query': patch
+'@tanstack/solid-start': patch
+'@tanstack/solid-start-client': patch
+'@tanstack/solid-start-server': patch
+---
+
+Bump solid-js, @solidjs/web, and @solidjs/signals to ^2.0.0-rc.6 across the monorepo. rc.6 provides the named flight-data source API (registerFlightDataSource / two-argument subscribeFlightData) that the Start single-flight integration now requires; @tanstack/solid-start's peer floor moves to rc.6 accordingly.
diff --git a/.changeset/bump-solid-rc-8.md b/.changeset/bump-solid-rc-8.md
new file mode 100644
index 0000000000..41a0a604db
--- /dev/null
+++ b/.changeset/bump-solid-rc-8.md
@@ -0,0 +1,10 @@
+---
+'@tanstack/solid-router': patch
+'@tanstack/solid-router-devtools': patch
+'@tanstack/solid-router-ssr-query': patch
+'@tanstack/solid-start': patch
+'@tanstack/solid-start-client': patch
+'@tanstack/solid-start-server': patch
+---
+
+Bump solid-js and @solidjs/web to ^2.0.0-rc.8 and @solidjs/vite-plugin to ^3.0.0-next.43 across the monorepo (with @rsbuild/plugin-solid ^2.0.0-rc.0 and @solidjs/babel-plugin ^2.0.0-rc.8 for the rsbuild/webpack paths). rc.8 is ESM-only and declares `engines.node >= 22.12`. @solidjs/vite-plugin 3.0.0-next.43 is the first release that honors `resolve.noExternal` patterns when it externalizes the dependencies of packages that consume the Solid runtime (solidjs/solid-vite-plugin#360); on next.41 and next.42, `vite dev` fails for TanStack Start apps with "Package import specifier '#tanstack-router-entry' is not defined".
diff --git a/.changeset/bump-solid-rc-9.md b/.changeset/bump-solid-rc-9.md
new file mode 100644
index 0000000000..bad75b7481
--- /dev/null
+++ b/.changeset/bump-solid-rc-9.md
@@ -0,0 +1,14 @@
+---
+'@tanstack/solid-router': patch
+'@tanstack/solid-router-devtools': patch
+'@tanstack/solid-router-ssr-query': patch
+'@tanstack/solid-start': patch
+'@tanstack/solid-start-client': patch
+'@tanstack/solid-start-server': patch
+---
+
+Bump solid-js and @solidjs/web to ^2.0.0-rc.9 and @solidjs/vite-plugin to ^3.0.0-next.44 across the monorepo (with @solidjs/babel-plugin 2.0.0-rc.9 for the webpack path). @solidjs/vite-plugin 3.0.0-next.44 peer-requires solid-js ^2.0.0-rc.9 and ships the rc.9 compiler.
+
+rc.9 changed `serverFunctionUrl` to describe a `GET()` reference's own call (`serverFunctionUrl(fn, ...args)`) and moved the id-based form-post address to `serverFunctionActionUrl` / `parseServerFunctionActionUrl` (solidjs/solid#3440); @tanstack/solid-start's server-function handler now uses those.
+
+Rsbuild apps: `@rsbuild/plugin-solid@2.0.0-rc.0` hard-pins the rc.6 compiler, which emits the old delegated-event key (`el.$$click`) that the rc.9 runtime no longer reads (`_$$click`), so delegated handlers never fire. Until the plugin ships an rc.9-based release, override its `@solidjs/compiler` and `@solidjs/babel-plugin` to 2.0.0-rc.9 (the monorepo does this in `pnpm-workspace.yaml`).
diff --git a/.changeset/clever-apples-jog.md b/.changeset/clever-apples-jog.md
new file mode 100644
index 0000000000..279c5ab8d2
--- /dev/null
+++ b/.changeset/clever-apples-jog.md
@@ -0,0 +1,5 @@
+---
+'@tanstack/solid-router': patch
+---
+
+fix: move HydrationScript to HeadContent
diff --git a/.changeset/clever-bears-stand.md b/.changeset/clever-bears-stand.md
new file mode 100644
index 0000000000..1d4eb2d164
--- /dev/null
+++ b/.changeset/clever-bears-stand.md
@@ -0,0 +1,7 @@
+---
+'@tanstack/solid-router-ssr-query': patch
+'@tanstack/solid-router': patch
+'@tanstack/solid-start': patch
+---
+
+Upgrade to Solid 2.0.0-beta.5
diff --git a/.changeset/clever-vans-yawn.md b/.changeset/clever-vans-yawn.md
new file mode 100644
index 0000000000..2f2ad97772
--- /dev/null
+++ b/.changeset/clever-vans-yawn.md
@@ -0,0 +1,10 @@
+---
+'@tanstack/solid-router-ssr-query': patch
+'@tanstack/solid-router-devtools': patch
+'@tanstack/solid-start-client': patch
+'@tanstack/solid-start-server': patch
+'@tanstack/solid-router': patch
+'@tanstack/solid-start': patch
+---
+
+build: bundle packages with rolldown
diff --git a/.changeset/cruel-tips-shine.md b/.changeset/cruel-tips-shine.md
new file mode 100644
index 0000000000..b282563a90
--- /dev/null
+++ b/.changeset/cruel-tips-shine.md
@@ -0,0 +1,10 @@
+---
+'@tanstack/solid-router-ssr-query': patch
+'@tanstack/solid-router-devtools': patch
+'@tanstack/solid-start-client': patch
+'@tanstack/solid-start-server': patch
+'@tanstack/solid-router': patch
+'@tanstack/solid-start': patch
+---
+
+Upgrade to solidjs beta 14
diff --git a/.changeset/cuddly-drinks-count.md b/.changeset/cuddly-drinks-count.md
new file mode 100644
index 0000000000..d02d0893b2
--- /dev/null
+++ b/.changeset/cuddly-drinks-count.md
@@ -0,0 +1,10 @@
+---
+'@tanstack/solid-router-ssr-query': patch
+'@tanstack/solid-router-devtools': patch
+'@tanstack/solid-start-client': patch
+'@tanstack/solid-start-server': patch
+'@tanstack/solid-router': patch
+'@tanstack/solid-start': patch
+---
+
+chore: sync main to pre-release branch
diff --git a/.changeset/curly-times-sip.md b/.changeset/curly-times-sip.md
new file mode 100644
index 0000000000..a7f13c676d
--- /dev/null
+++ b/.changeset/curly-times-sip.md
@@ -0,0 +1,10 @@
+---
+'@tanstack/solid-router-ssr-query': patch
+'@tanstack/solid-router-devtools': patch
+'@tanstack/solid-start-client': patch
+'@tanstack/solid-start-server': patch
+'@tanstack/solid-router': patch
+'@tanstack/solid-start': patch
+---
+
+Upgrade to Solid v2.0.0-beta.6
diff --git a/.changeset/cyan-otters-notice.md b/.changeset/cyan-otters-notice.md
new file mode 100644
index 0000000000..c2b84d53fd
--- /dev/null
+++ b/.changeset/cyan-otters-notice.md
@@ -0,0 +1,10 @@
+---
+'@tanstack/solid-router-ssr-query': patch
+'@tanstack/solid-router-devtools': patch
+'@tanstack/solid-start-client': patch
+'@tanstack/solid-start-server': patch
+'@tanstack/solid-router': patch
+'@tanstack/solid-start': patch
+---
+
+Upgrade to solid v2 beta 10
diff --git a/.changeset/evil-parrots-end.md b/.changeset/evil-parrots-end.md
new file mode 100644
index 0000000000..6f7116a6c4
--- /dev/null
+++ b/.changeset/evil-parrots-end.md
@@ -0,0 +1,6 @@
+---
+'@tanstack/solid-router': patch
+'@tanstack/solid-start': patch
+---
+
+Bump to solid js 2.0.0-beta.3
diff --git a/.changeset/fuzzy-peas-sneeze.md b/.changeset/fuzzy-peas-sneeze.md
new file mode 100644
index 0000000000..95bd1c048d
--- /dev/null
+++ b/.changeset/fuzzy-peas-sneeze.md
@@ -0,0 +1,10 @@
+---
+'@tanstack/solid-router-ssr-query': patch
+'@tanstack/solid-router-devtools': patch
+'@tanstack/solid-start-client': patch
+'@tanstack/solid-start-server': patch
+'@tanstack/solid-router': patch
+'@tanstack/solid-start': patch
+---
+
+Update to solid v2 beta 8
diff --git a/.changeset/hot-pillows-bathe.md b/.changeset/hot-pillows-bathe.md
new file mode 100644
index 0000000000..f6b3bf8463
--- /dev/null
+++ b/.changeset/hot-pillows-bathe.md
@@ -0,0 +1,10 @@
+---
+'@tanstack/solid-router-ssr-query': patch
+'@tanstack/solid-router-devtools': patch
+'@tanstack/solid-start-client': patch
+'@tanstack/solid-start-server': patch
+'@tanstack/solid-router': patch
+'@tanstack/solid-start': patch
+---
+
+chore: bump solid 2 to beta.7
diff --git a/.changeset/load-flight-target.md b/.changeset/load-flight-target.md
new file mode 100644
index 0000000000..ab03351452
--- /dev/null
+++ b/.changeset/load-flight-target.md
@@ -0,0 +1,5 @@
+---
+'@tanstack/solid-router': patch
+---
+
+New `loadFlightTarget` helper (exported from `@tanstack/solid-router/ssr/server`): the router's half of a single-flight refresh. Given the mutation request's target href, it builds a router for that location, loads it, and returns the dehydrated payload for the `tsr` flight-data slice, so server collectors can refresh router state alongside other caches on the same mutation response.
diff --git a/.changeset/modern-islands-enjoy.md b/.changeset/modern-islands-enjoy.md
new file mode 100644
index 0000000000..2d8953740d
--- /dev/null
+++ b/.changeset/modern-islands-enjoy.md
@@ -0,0 +1,10 @@
+---
+'@tanstack/solid-router-ssr-query': patch
+'@tanstack/solid-router-devtools': patch
+'@tanstack/solid-start-client': patch
+'@tanstack/solid-start-server': patch
+'@tanstack/solid-router': patch
+'@tanstack/solid-start': patch
+---
+
+fix: pin solid 2 beta.6 due to server range with -experimental tag
diff --git a/.changeset/named-flight-source.md b/.changeset/named-flight-source.md
new file mode 100644
index 0000000000..ec82099738
--- /dev/null
+++ b/.changeset/named-flight-source.md
@@ -0,0 +1,5 @@
+---
+'@tanstack/solid-start': patch
+---
+
+Adopt Solid's multi-source single-flight protocol: the router's flight data (loader/match state, dehydrated data) registers under its own source id (`tsr`), so other caches' slices — e.g. solid-query's `sq` — coexist on the same mutation response instead of competing for a single consumer slot, and a user-supplied `collectFlightData` hook adds data alongside the router's rather than displacing it. Requires solid-js / @solidjs/web 2.0.0-rc.6+ (named flight-data sources).
diff --git a/.changeset/petite-icons-press.md b/.changeset/petite-icons-press.md
new file mode 100644
index 0000000000..b33b9eda69
--- /dev/null
+++ b/.changeset/petite-icons-press.md
@@ -0,0 +1,5 @@
+---
+'@tanstack/solid-router-ssr-query': patch
+---
+
+chore: bump solid-query to 6.0.0-alpha.1
diff --git a/.changeset/pre.json b/.changeset/pre.json
new file mode 100644
index 0000000000..057a165725
--- /dev/null
+++ b/.changeset/pre.json
@@ -0,0 +1,127 @@
+{
+ "mode": "pre",
+ "tag": "rc",
+ "initialVersions": {
+ "@tanstack/arktype-adapter": "1.167.0",
+ "@tanstack/eslint-plugin-router": "1.162.0",
+ "@tanstack/eslint-plugin-start": "0.1.0",
+ "@tanstack/history": "1.162.0",
+ "@tanstack/nitro-v2-vite-plugin": "1.155.0",
+ "@tanstack/react-router": "1.170.19",
+ "@tanstack/react-router-devtools": "1.167.1",
+ "@tanstack/react-router-ssr-query": "1.167.1",
+ "@tanstack/react-start": "1.168.36",
+ "@tanstack/react-start-client": "1.168.17",
+ "@tanstack/react-start-rsc": "0.1.35",
+ "@tanstack/react-start-server": "1.167.24",
+ "@tanstack/router-cli": "1.167.22",
+ "@tanstack/router-core": "1.171.16",
+ "@tanstack/router-devtools": "1.167.1",
+ "@tanstack/router-devtools-core": "1.168.1",
+ "@tanstack/router-generator": "1.167.22",
+ "@tanstack/router-plugin": "1.168.24",
+ "@tanstack/router-ssr-query-core": "1.169.1",
+ "@tanstack/router-utils": "1.162.2",
+ "@tanstack/router-vite-plugin": "1.167.24",
+ "@tanstack/solid-router": "2.0.0-beta.30",
+ "@tanstack/solid-router-devtools": "2.0.0-beta.25",
+ "@tanstack/solid-router-ssr-query": "2.0.0-beta.31",
+ "@tanstack/solid-start": "2.0.0-beta.31",
+ "@tanstack/solid-start-client": "2.0.0-beta.30",
+ "@tanstack/solid-start-server": "2.0.0-beta.30",
+ "@tanstack/start-client-core": "1.170.15",
+ "@tanstack/start-fn-stubs": "1.162.0",
+ "@tanstack/start-plugin-core": "1.171.27",
+ "@tanstack/start-server-core": "1.169.19",
+ "@tanstack/start-static-server-functions": "1.167.20",
+ "@tanstack/start-storage-context": "1.167.18",
+ "@tanstack/valibot-adapter": "1.167.0",
+ "@tanstack/virtual-file-routes": "1.162.0",
+ "@tanstack/vue-router": "1.170.18",
+ "@tanstack/vue-router-devtools": "1.167.1",
+ "@tanstack/vue-router-ssr-query": "1.167.1",
+ "@tanstack/vue-start": "1.168.34",
+ "@tanstack/vue-start-client": "1.167.20",
+ "@tanstack/vue-start-server": "1.167.24",
+ "@tanstack/zod-adapter": "1.167.0"
+ },
+ "changesets": [
+ "brave-pans-create",
+ "brown-breads-begin",
+ "bump-solid-query-beta-5",
+ "bump-solid-query-rc-4",
+ "bump-solid-rc-16",
+ "bump-solid-rc-2",
+ "bump-solid-rc-20",
+ "bump-solid-rc-4",
+ "bump-solid-rc-6",
+ "bump-solid-rc-8",
+ "bump-solid-rc-9",
+ "clever-apples-jog",
+ "clever-bears-stand",
+ "clever-vans-yawn",
+ "cruel-tips-shine",
+ "cuddly-drinks-count",
+ "curly-times-sip",
+ "cyan-otters-notice",
+ "evil-parrots-end",
+ "fuzzy-peas-sneeze",
+ "hot-pillows-bathe",
+ "load-flight-target",
+ "modern-islands-enjoy",
+ "named-flight-source",
+ "petite-icons-press",
+ "proxy-free-link-props",
+ "quiet-shrimps-jam",
+ "retire-solid-router-ssr-query",
+ "shaky-tools-think",
+ "silent-streets-camp",
+ "smooth-swans-ask",
+ "social-mails-sort",
+ "social-rules-fold",
+ "solid-functions-flight",
+ "solid-js-beta-15",
+ "solid-js-beta-17",
+ "solid-js-beta-18",
+ "solid-js-beta-19",
+ "solid-js-beta-20",
+ "solid-js-beta-21",
+ "solid-js-beta-25",
+ "solid-js-beta-27",
+ "solid-js-beta-29",
+ "solid-js-beta-32",
+ "solid-js-rc-0",
+ "solid-kings-help",
+ "solid-lazy-route-components",
+ "solid-link-idle-preload-listeners",
+ "solid-link-role",
+ "solid-match-suspend-ssr-only",
+ "solid-native-ssr-transfer",
+ "solid-router-dev-ssr-detection",
+ "solid-router-no-router-owned-loading-boundaries",
+ "solid-router-observe-blocker-interaction",
+ "solid-router-observe-first-load-redirect",
+ "solid-router-observe-initial-route",
+ "solid-router-observe-interaction",
+ "solid-router-observe-location-href",
+ "solid-router-observe-navigation",
+ "solid-router-observe-pending-not-found",
+ "solid-router-observe-redirect-hops",
+ "solid-router-observe-route-names",
+ "solid-router-public-hydration-api",
+ "solid-router-server-function-metadata",
+ "solid-router-settlement-ack",
+ "solid-rsbuild-native-loader",
+ "solid-server-fn-abort-signal",
+ "solid-usehead-registry",
+ "spotty-moons-listen",
+ "store-bridge-single-flush",
+ "tall-horses-repair",
+ "tame-lions-hunt",
+ "three-carrots-return",
+ "tiny-beds-tan",
+ "tired-pants-eat",
+ "violet-turkeys-cross",
+ "wicked-olives-poke"
+ ]
+}
diff --git a/.changeset/proxy-free-link-props.md b/.changeset/proxy-free-link-props.md
new file mode 100644
index 0000000000..e0f5879cc3
--- /dev/null
+++ b/.changeset/proxy-free-link-props.md
@@ -0,0 +1,23 @@
+---
+'@tanstack/solid-router': patch
+---
+
+perf(solid-router): make `useLinkProps` proxy-free in the spread hot path
+
+`useLinkProps` previously layered four proxies (`merge` for defaults, two
+`splitProps`/`omit` proxies, and a final `merge` of spreadable props with the
+resolved props memo). Solid's `spread()` re-enumerated all of them through V8
+proxy traps on every navigation, for every `Link`, which showed up in CodSpeed
+profiles as a large unattributed "NodeJS internals" cost.
+
+`useLinkProps` now returns a plain object with a stable key set whose
+reactivity lives in property getters backed by fine-grained memos. Values that
+no longer apply resolve to `undefined`, which `spread()` treats as attribute
+removal. The built-location memo also gained href-based equality so downstream
+memos skip work when a navigation doesn't change a link's target.
+
+This makes the client-side navigation benchmark ~30% faster.
+
+Note: keys returned by `activeProps`/`inactiveProps` functions are discovered
+once at setup — functions that later return brand-new keys (beyond the initial
+set plus `class`/`style`) won't have those keys applied.
diff --git a/.changeset/quiet-shrimps-jam.md b/.changeset/quiet-shrimps-jam.md
new file mode 100644
index 0000000000..240815ab5c
--- /dev/null
+++ b/.changeset/quiet-shrimps-jam.md
@@ -0,0 +1,5 @@
+---
+'@tanstack/solid-router-ssr-query': patch
+---
+
+fix: use solid v2 compatible solid-query
diff --git a/.changeset/retire-solid-router-ssr-query.md b/.changeset/retire-solid-router-ssr-query.md
new file mode 100644
index 0000000000..7603eaeecd
--- /dev/null
+++ b/.changeset/retire-solid-router-ssr-query.md
@@ -0,0 +1,5 @@
+---
+'@tanstack/solid-router-ssr-query': patch
+---
+
+Deprecated: Solid Query's `QueryClientProvider` now carries the Router + Query SSR pairing natively (registry hydration, named single-flight sources, redirect handling via userland glue), so this integration package is no longer needed. See the README for the migration.
diff --git a/.changeset/rsbuild-manifest-module-chunks-once.md b/.changeset/rsbuild-manifest-module-chunks-once.md
deleted file mode 100644
index 02febd9d84..0000000000
--- a/.changeset/rsbuild-manifest-module-chunks-once.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'@tanstack/start-plugin-core': patch
----
-
-Rsbuild: the Start manifest pass that runs after every client compilation (builds and each dev update) reads an imported module's chunks once per compilation and counts the module once per importing chunk, instead of once per import connection. The manifest is unchanged; the pass takes about 40 % less time (on a 333-route app, tens of milliseconds less per HMR update).
diff --git a/.changeset/rsbuild-manifest-own-chunks.md b/.changeset/rsbuild-manifest-own-chunks.md
deleted file mode 100644
index 04e8e29928..0000000000
--- a/.changeset/rsbuild-manifest-own-chunks.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'@tanstack/start-plugin-core': patch
----
-
-Rsbuild: a route's client manifest entry lists only its own chunks and CSS. When two routes shared a module in a chunk of its own, each route's entry also listed the other route's chunk as a preload and its stylesheet.
diff --git a/.changeset/rsbuild-rule-use-falsy-loaders.md b/.changeset/rsbuild-rule-use-falsy-loaders.md
deleted file mode 100644
index a84a054fbd..0000000000
--- a/.changeset/rsbuild-rule-use-falsy-loaders.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'@tanstack/start-plugin-core': patch
----
-
-fix: the Rsbuild RSC integration skips falsy entries in a rule's `use` array (Rspack's conditionally disabled loaders) instead of treating them as loaders.
diff --git a/.changeset/rsbuild-virtual-modules-build.md b/.changeset/rsbuild-virtual-modules-build.md
deleted file mode 100644
index 01a0c5ee6e..0000000000
--- a/.changeset/rsbuild-virtual-modules-build.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'@tanstack/start-plugin-core': patch
----
-
-Rsbuild: fix the Rsbuild plugin build after two changes to its virtual modules crossed. Without this fix the package does not build, so no release could ship it. The Rsbuild dev manifest is written to its virtual module under the app's root.
diff --git a/.changeset/rsbuild-virtual-modules-root.md b/.changeset/rsbuild-virtual-modules-root.md
deleted file mode 100644
index 427043a712..0000000000
--- a/.changeset/rsbuild-virtual-modules-root.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'@tanstack/start-plugin-core': patch
----
-
-Rsbuild: Start writes its virtual modules under the app's root, not the working directory. An app built or served from another directory (`rsbuild build --root ` from a monorepo root) no longer fails with "Module not found" on the packages they import, such as RSC's serialization adapters.
diff --git a/.changeset/rsc-security-floor.md b/.changeset/rsc-security-floor.md
deleted file mode 100644
index 9c828f13b3..0000000000
--- a/.changeset/rsc-security-floor.md
+++ /dev/null
@@ -1,8 +0,0 @@
----
-'@tanstack/react-start-rsc': patch
----
-
-Raise the minimum RSC bundler peer dependencies to versions with the React Server Components fixes for GHSA-xqc2-xf4c-x3h3 (CVE-2026-126187, unauthenticated RCE) and GHSA-h3gv-c5rc-p453 (server function DoS):
-
-- `@vitejs/plugin-rsc` to `>=0.5.38` (GHSA-59pf-q495-3c99), which vendors a fixed `react-server-dom-webpack`.
-- `react-server-dom-rspack` to `>=0.1.1`, the first release built from React sources that include the fix.
diff --git a/.changeset/shaky-tools-think.md b/.changeset/shaky-tools-think.md
new file mode 100644
index 0000000000..2218cdd8d4
--- /dev/null
+++ b/.changeset/shaky-tools-think.md
@@ -0,0 +1,5 @@
+---
+'@tanstack/solid-router-ssr-query': patch
+---
+
+chore: bump solid-query to 6.0.0-alpha.2
diff --git a/.changeset/silent-streets-camp.md b/.changeset/silent-streets-camp.md
new file mode 100644
index 0000000000..e2d8144dd7
--- /dev/null
+++ b/.changeset/silent-streets-camp.md
@@ -0,0 +1,10 @@
+---
+'@tanstack/solid-router-ssr-query': patch
+'@tanstack/solid-router-devtools': patch
+'@tanstack/solid-start-client': patch
+'@tanstack/solid-start-server': patch
+'@tanstack/solid-router': patch
+'@tanstack/solid-start': patch
+---
+
+fix: adjust pre-release ranges
diff --git a/.changeset/smooth-swans-ask.md b/.changeset/smooth-swans-ask.md
new file mode 100644
index 0000000000..bf7ecda35a
--- /dev/null
+++ b/.changeset/smooth-swans-ask.md
@@ -0,0 +1,10 @@
+---
+'@tanstack/solid-router-ssr-query': patch
+'@tanstack/solid-router-devtools': patch
+'@tanstack/solid-start-client': patch
+'@tanstack/solid-start-server': patch
+'@tanstack/solid-router': patch
+'@tanstack/solid-start': patch
+---
+
+fix: add vite 8 compat
diff --git a/.changeset/social-mails-sort.md b/.changeset/social-mails-sort.md
new file mode 100644
index 0000000000..77309d35a0
--- /dev/null
+++ b/.changeset/social-mails-sort.md
@@ -0,0 +1,10 @@
+---
+'@tanstack/solid-router-ssr-query': major
+'@tanstack/solid-router-devtools': major
+'@tanstack/solid-start-client': major
+'@tanstack/solid-start-server': major
+'@tanstack/solid-router': major
+'@tanstack/solid-start': major
+---
+
+solid v2 pre-release for solid-router and start
diff --git a/.changeset/social-rules-fold.md b/.changeset/social-rules-fold.md
new file mode 100644
index 0000000000..62c77ee9cd
--- /dev/null
+++ b/.changeset/social-rules-fold.md
@@ -0,0 +1,10 @@
+---
+'@tanstack/solid-router-ssr-query': patch
+'@tanstack/solid-router-devtools': patch
+'@tanstack/solid-start-client': patch
+'@tanstack/solid-start-server': patch
+'@tanstack/solid-router': patch
+'@tanstack/solid-start': patch
+---
+
+chore: bump solid-query and vite-plugin-solid
diff --git a/.changeset/solid-functions-flight.md b/.changeset/solid-functions-flight.md
new file mode 100644
index 0000000000..de272fadd2
--- /dev/null
+++ b/.changeset/solid-functions-flight.md
@@ -0,0 +1,12 @@
+---
+'@tanstack/solid-router-devtools': patch
+'@tanstack/solid-router-ssr-query': patch
+'@tanstack/solid-router': patch
+'@tanstack/solid-start-client': patch
+'@tanstack/solid-start-server': patch
+'@tanstack/solid-start': patch
+---
+
+Run Solid Start server functions through the Solid 2 server-function runtime, including request handling, serialization, middleware, direct SSR calls, and no-JS forms.
+
+POST server functions now use Solid 2's single-flight transport to return updated Router loader and hydration data with the mutation response.
diff --git a/.changeset/solid-js-beta-15.md b/.changeset/solid-js-beta-15.md
new file mode 100644
index 0000000000..93e0d17c2a
--- /dev/null
+++ b/.changeset/solid-js-beta-15.md
@@ -0,0 +1,10 @@
+---
+'@tanstack/solid-router-devtools': patch
+'@tanstack/solid-router-ssr-query': patch
+'@tanstack/solid-router': patch
+'@tanstack/solid-start-client': patch
+'@tanstack/solid-start-server': patch
+'@tanstack/solid-start': patch
+---
+
+Upgrade `solid-js` and `@solidjs/web` to `2.0.0-beta.15`
diff --git a/.changeset/solid-js-beta-17.md b/.changeset/solid-js-beta-17.md
new file mode 100644
index 0000000000..bfa0012943
--- /dev/null
+++ b/.changeset/solid-js-beta-17.md
@@ -0,0 +1,10 @@
+---
+'@tanstack/solid-router-devtools': patch
+'@tanstack/solid-router-ssr-query': patch
+'@tanstack/solid-router': patch
+'@tanstack/solid-start-client': patch
+'@tanstack/solid-start-server': patch
+'@tanstack/solid-start': patch
+---
+
+Upgrade `solid-js` and `@solidjs/web` to `2.0.0-beta.17`
diff --git a/.changeset/solid-js-beta-18.md b/.changeset/solid-js-beta-18.md
new file mode 100644
index 0000000000..be50246023
--- /dev/null
+++ b/.changeset/solid-js-beta-18.md
@@ -0,0 +1,10 @@
+---
+'@tanstack/solid-router-devtools': patch
+'@tanstack/solid-router-ssr-query': patch
+'@tanstack/solid-router': patch
+'@tanstack/solid-start-client': patch
+'@tanstack/solid-start-server': patch
+'@tanstack/solid-start': patch
+---
+
+Upgrade `solid-js` and `@solidjs/web` to `2.0.0-beta.18`
diff --git a/.changeset/solid-js-beta-19.md b/.changeset/solid-js-beta-19.md
new file mode 100644
index 0000000000..9f488348bc
--- /dev/null
+++ b/.changeset/solid-js-beta-19.md
@@ -0,0 +1,10 @@
+---
+'@tanstack/solid-router-devtools': patch
+'@tanstack/solid-router-ssr-query': patch
+'@tanstack/solid-router': patch
+'@tanstack/solid-start-client': patch
+'@tanstack/solid-start-server': patch
+'@tanstack/solid-start': patch
+---
+
+Upgrade `solid-js` and `@solidjs/web` to `2.0.0-beta.19` and `vite-plugin-solid` to `3.0.0-next.11`
diff --git a/.changeset/solid-js-beta-20.md b/.changeset/solid-js-beta-20.md
new file mode 100644
index 0000000000..2f531e0c6a
--- /dev/null
+++ b/.changeset/solid-js-beta-20.md
@@ -0,0 +1,10 @@
+---
+'@tanstack/solid-router-devtools': patch
+'@tanstack/solid-router-ssr-query': patch
+'@tanstack/solid-router': patch
+'@tanstack/solid-start-client': patch
+'@tanstack/solid-start-server': patch
+'@tanstack/solid-start': patch
+---
+
+Upgrade `solid-js` and `@solidjs/web` to `2.0.0-beta.20`
diff --git a/.changeset/solid-js-beta-21.md b/.changeset/solid-js-beta-21.md
new file mode 100644
index 0000000000..aeb66b6f90
--- /dev/null
+++ b/.changeset/solid-js-beta-21.md
@@ -0,0 +1,10 @@
+---
+'@tanstack/solid-router-devtools': patch
+'@tanstack/solid-router-ssr-query': patch
+'@tanstack/solid-router': patch
+'@tanstack/solid-start-client': patch
+'@tanstack/solid-start-server': patch
+'@tanstack/solid-start': patch
+---
+
+Upgrade `solid-js` and `@solidjs/web` to `2.0.0-beta.21`
diff --git a/.changeset/solid-js-beta-25.md b/.changeset/solid-js-beta-25.md
new file mode 100644
index 0000000000..934dd8661e
--- /dev/null
+++ b/.changeset/solid-js-beta-25.md
@@ -0,0 +1,10 @@
+---
+'@tanstack/solid-router-devtools': patch
+'@tanstack/solid-router-ssr-query': patch
+'@tanstack/solid-router': patch
+'@tanstack/solid-start-client': patch
+'@tanstack/solid-start-server': patch
+'@tanstack/solid-start': patch
+---
+
+Upgrade `solid-js` and `@solidjs/web` to `2.0.0-beta.25`
diff --git a/.changeset/solid-js-beta-27.md b/.changeset/solid-js-beta-27.md
new file mode 100644
index 0000000000..49ee209768
--- /dev/null
+++ b/.changeset/solid-js-beta-27.md
@@ -0,0 +1,10 @@
+---
+'@tanstack/solid-router-devtools': patch
+'@tanstack/solid-router-ssr-query': patch
+'@tanstack/solid-router': patch
+'@tanstack/solid-start-client': patch
+'@tanstack/solid-start-server': patch
+'@tanstack/solid-start': patch
+---
+
+Upgrade `solid-js` and `@solidjs/web` to `2.0.0-beta.27`
diff --git a/.changeset/solid-js-beta-29.md b/.changeset/solid-js-beta-29.md
new file mode 100644
index 0000000000..c9fa2b2729
--- /dev/null
+++ b/.changeset/solid-js-beta-29.md
@@ -0,0 +1,10 @@
+---
+'@tanstack/solid-router-devtools': patch
+'@tanstack/solid-router-ssr-query': patch
+'@tanstack/solid-router': patch
+'@tanstack/solid-start-client': patch
+'@tanstack/solid-start-server': patch
+'@tanstack/solid-start': patch
+---
+
+Upgrade `solid-js` and `@solidjs/web` to `2.0.0-beta.29`
diff --git a/.changeset/solid-js-beta-32.md b/.changeset/solid-js-beta-32.md
new file mode 100644
index 0000000000..ad1c5d575b
--- /dev/null
+++ b/.changeset/solid-js-beta-32.md
@@ -0,0 +1,10 @@
+---
+'@tanstack/solid-router-devtools': patch
+'@tanstack/solid-router-ssr-query': patch
+'@tanstack/solid-router': patch
+'@tanstack/solid-start-client': patch
+'@tanstack/solid-start-server': patch
+'@tanstack/solid-start': patch
+---
+
+Upgrade `solid-js` and `@solidjs/web` to `2.0.0-beta.32`
diff --git a/.changeset/solid-js-rc-0.md b/.changeset/solid-js-rc-0.md
new file mode 100644
index 0000000000..59ca0fcbdc
--- /dev/null
+++ b/.changeset/solid-js-rc-0.md
@@ -0,0 +1,16 @@
+---
+'@tanstack/solid-router-devtools': patch
+'@tanstack/solid-router-ssr-query': patch
+'@tanstack/solid-router': patch
+'@tanstack/solid-start-client': patch
+'@tanstack/solid-start-server': patch
+'@tanstack/solid-start': patch
+---
+
+Upgrade `solid-js` and `@solidjs/web` to `2.0.0-rc.0`, and migrate from `vite-plugin-solid` to its new name `@solidjs/vite-plugin` at `3.0.0-next.28`
+
+`vite-plugin-solid` was renamed to `@solidjs/vite-plugin`; its final release (`3.0.0-next.27`) is a re-export shim over the new package. `@solidjs/vite-plugin@3.0.0-next.28` requires `solid-js`/`@solidjs/web` `^2.0.0-rc.0`, so the rename and the `rc` bump land together.
+
+`@tanstack/router-plugin` is intentionally untouched: it detects the Solid JSX plugin by its Vite plugin _name_ (`solid`), which the renamed package still registers, and its `vite-plugin-solid` peer is optional — so it keeps working for both Solid 1 and Solid 2 consumers without a change.
+
+Also bumps `@tanstack/solid-query` and `@tanstack/solid-query-devtools` to `^6.0.0-rc.0` (whose peer requires `solid-js >=2.0.0-rc.0`), and converges `@tanstack/query-core` on `5.101.4` — `solid-query` depends on query-core `5.101.0`, which previously resolved to a stale `5.99.0` and produced two incompatible `QueryClient` types.
diff --git a/.changeset/solid-kings-help.md b/.changeset/solid-kings-help.md
new file mode 100644
index 0000000000..b638658e9b
--- /dev/null
+++ b/.changeset/solid-kings-help.md
@@ -0,0 +1,5 @@
+---
+'@tanstack/solid-router': patch
+---
+
+Upgrade solid refresh, fix deep equal for promises
diff --git a/.changeset/solid-lazy-route-components.md b/.changeset/solid-lazy-route-components.md
new file mode 100644
index 0000000000..7d75969507
--- /dev/null
+++ b/.changeset/solid-lazy-route-components.md
@@ -0,0 +1,17 @@
+---
+'@tanstack/solid-router-ssr-query': patch
+'@tanstack/solid-router-devtools': patch
+'@tanstack/solid-start-client': patch
+'@tanstack/solid-start-server': patch
+'@tanstack/solid-router': patch
+'@tanstack/solid-start': patch
+---
+
+`lazyRouteComponent` now delegates to Solid's `lazy()` using its `{ export }`
+option (solid-js 2.0.0-rc.1): the module namespace passes through untouched,
+so SSR'd route chunks resolve their client assets (stylesheet links,
+modulepreload hints, hydration gating) through the client-assets manifest,
+and hydration claims the component synchronously from the preloaded module.
+Failed chunk downloads are retried by the next preload or render, and the
+module-not-found reload-once behavior is unchanged. Solid packages are
+bumped to the 2.0.0-rc.1 line (`@solidjs/vite-plugin` 3.0.0-next.30).
diff --git a/.changeset/solid-link-idle-preload-listeners.md b/.changeset/solid-link-idle-preload-listeners.md
new file mode 100644
index 0000000000..345c56f777
--- /dev/null
+++ b/.changeset/solid-link-idle-preload-listeners.md
@@ -0,0 +1,18 @@
+---
+'@tanstack/solid-router': patch
+---
+
+Stop installing intent-preload listeners on ` ` when intent preloading is off.
+
+`useLinkProps` handed out `onFocus`/`onBlur`/`onMouseEnter`/`onMouseLeave` (and the
+mouse-over/out/touch-start pair) unconditionally, with the `preload() !== 'intent'`
+check living _inside_ each handler. Solid does not delegate `mouseenter`,
+`mouseleave`, `focus` or `blur`, so every anchor installed four real listeners that
+did nothing but return — on a list view that is four per row (a 165-row board
+measured 660 listeners whose only job was to bail).
+
+The handlers are now resolved through getters: with intent preloading off the
+property yields whatever the consumer passed (or `undefined`, which `spread()`
+treats as removal), and nothing is attached. Behaviour is unchanged — the getters
+stay reactive, so flipping `preload` back to `'intent'` re-runs the consuming
+spread and attaches the composed handler.
diff --git a/.changeset/solid-link-role.md b/.changeset/solid-link-role.md
new file mode 100644
index 0000000000..b66e1c1dc6
--- /dev/null
+++ b/.changeset/solid-link-role.md
@@ -0,0 +1,5 @@
+---
+'@tanstack/solid-router': patch
+---
+
+Preserve caller-provided roles on enabled links.
diff --git a/.changeset/solid-match-suspend-ssr-only.md b/.changeset/solid-match-suspend-ssr-only.md
new file mode 100644
index 0000000000..c83ea61355
--- /dev/null
+++ b/.changeset/solid-match-suspend-ssr-only.md
@@ -0,0 +1,5 @@
+---
+'@tanstack/solid-router': patch
+---
+
+Suspend on the match `loadPromise` only during SSR. On the client, suspending on the pending match kept a live async source in the tree, which since `solid-js@2.0.0-beta.16` routed signal writes into a transition hold and broke synchronous write-then-load flows such as `invalidate()` on a `notFound` match.
diff --git a/.changeset/solid-native-ssr-transfer.md b/.changeset/solid-native-ssr-transfer.md
new file mode 100644
index 0000000000..08093414b6
--- /dev/null
+++ b/.changeset/solid-native-ssr-transfer.md
@@ -0,0 +1,5 @@
+---
+'@tanstack/solid-router': patch
+---
+
+Native SSR state transfer for Solid: router match state (loaderData, beforeLoad context, status, errors) now rides Solid's hydration registry under `tsr:` keys instead of a bespoke bootstrap script, deferred `loaderData` promises stream natively via seroval, the client primes router state from the registry in the Router constructor (before any render context, eliminating boot-time refetches and `bootLoad`-style workarounds), and `RouterProvider` owns the server-side `router.load()` dispatch so server entries no longer await it manually.
diff --git a/.changeset/solid-router-dev-ssr-detection.md b/.changeset/solid-router-dev-ssr-detection.md
new file mode 100644
index 0000000000..21530ba043
--- /dev/null
+++ b/.changeset/solid-router-dev-ssr-detection.md
@@ -0,0 +1,5 @@
+---
+'@tanstack/solid-router': patch
+---
+
+Fall back to the router instance's server flag during development SSR. This prevents router construction from entering client hydration on the server and restores provider-owned loading and match-state serialization.
diff --git a/.changeset/solid-router-no-router-owned-loading-boundaries.md b/.changeset/solid-router-no-router-owned-loading-boundaries.md
new file mode 100644
index 0000000000..4baa6d86b6
--- /dev/null
+++ b/.changeset/solid-router-no-router-owned-loading-boundaries.md
@@ -0,0 +1,5 @@
+---
+'@tanstack/solid-router': patch
+---
+
+Remove all router-owned `Loading` boundaries from `Matches`, `Match`, and `Outlet`, and only install one in `Await` when a `fallback` is provided. Async reads in route components are no longer caught by an invisible router boundary, so Solid's implicit transitions hold the previous view — live and interactive — until the new route settles, then swap atomically. `pendingComponent` is presented through router pending state (`pendingMs`/`pendingMinMs`) as before; loading boundaries are now exclusively user-provided.
diff --git a/.changeset/solid-router-observe-blocker-interaction.md b/.changeset/solid-router-observe-blocker-interaction.md
new file mode 100644
index 0000000000..82b952637b
--- /dev/null
+++ b/.changeset/solid-router-observe-blocker-interaction.md
@@ -0,0 +1,5 @@
+---
+'@tanstack/solid-router': patch
+---
+
+Observe tier (Solid's dev and observe builds only): a navigation that passes a `useBlocker` keeps the interaction that requested it and is dated from the request, though the history awaits the blocker before it changes; one the blocker holds until `proceed()` joins the interaction that proceeds and is dated from it, as `@solidjs/router`'s `retry()` makes it. The router notes the request at `commitLocation` for the history change to take. A navigation the blocker stops, or a request that changes no history (the same location reloading), leaves nothing noted behind. Nothing changes in production, where `OBSERVE` is undefined.
diff --git a/.changeset/solid-router-observe-first-load-redirect.md b/.changeset/solid-router-observe-first-load-redirect.md
new file mode 100644
index 0000000000..a70d283c45
--- /dev/null
+++ b/.changeset/solid-router-observe-first-load-redirect.md
@@ -0,0 +1,5 @@
+---
+'@tanstack/solid-router': patch
+---
+
+Observe tier (Solid's dev and observe builds only): a redirect while the first page loads — a client-rendered arrival whose `beforeLoad` or loader throws `redirect()` — is recorded as a navigation from the arrival to where the redirect sent it, after the initial record that names the arrival, as `@solidjs/router` records one. It had no record: nothing was shown yet to navigate from. Nothing changes in production, where `OBSERVE` is undefined.
diff --git a/.changeset/solid-router-observe-initial-route.md b/.changeset/solid-router-observe-initial-route.md
new file mode 100644
index 0000000000..fe61ae8df2
--- /dev/null
+++ b/.changeset/solid-router-observe-initial-route.md
@@ -0,0 +1,7 @@
+---
+'@tanstack/solid-router': patch
+---
+
+Observe tier (Solid's dev and observe builds only): the router declares the route the document arrived on, with the same `OBSERVE.attribution.withOrigin` call it makes for every navigation (`initial: true` on the ref), around the work that establishes its initial match — the Transitioner's on the client, `RouterProvider`'s load on the server. On the client this is the first `"navigation"` record (`initial: true`, `at` the document's navigation start, no write to wait for), kept out of `feedback().navigations`; on the server the same declaration names the request's `"render"` record (`RenderEvent.route`: the matched route's `fullPath`, the path and search, the params), read when the render settles, so a render whose provider ran the load names the location it resolved. A consumer naming page loads and requests by route (`/users/$id` rather than one name per user) had this for every navigation but the first; now it has the first too.
+
+The Transitioner committing the canonical form of the arrival location (search defaults, trailing slash) is part of the arrival, as in `@solidjs/router`: the initial record names the canonical location, a router loaded before it mounted no longer records the commit as a navigation, and the next navigation is dated from its own request rather than from that commit. Nothing changes in production, where `OBSERVE` is undefined.
diff --git a/.changeset/solid-router-observe-interaction.md b/.changeset/solid-router-observe-interaction.md
new file mode 100644
index 0000000000..c10135c4e9
--- /dev/null
+++ b/.changeset/solid-router-observe-interaction.md
@@ -0,0 +1,5 @@
+---
+'@tanstack/solid-router': patch
+---
+
+Observe tier (Solid's dev and observe builds only): a navigation's record joins the interaction that requested it — the ` ` click, or any handler that called `navigate()` — though the match publish it wraps runs after the loaders, long after the handler returned. The Transitioner captures `OBSERVE.attribution.currentOrigin()` with the request time when the history changes and hands it back as `NavigationRef.interaction` (solid-js 2.0.0-rc.12), so the record, and every hold and re-run the publish causes, carries the click. A navigation requested outside any interaction declares none. Nothing changes in production, where `OBSERVE` is undefined.
diff --git a/.changeset/solid-router-observe-location-href.md b/.changeset/solid-router-observe-location-href.md
new file mode 100644
index 0000000000..fc320dadcf
--- /dev/null
+++ b/.changeset/solid-router-observe-location-href.md
@@ -0,0 +1,5 @@
+---
+'@tanstack/solid-router': patch
+---
+
+Observe tier (Solid's dev and observe builds only): a navigation's `to` and `from`, the initial record's `to`, and a server render's `RenderEvent.route.to` are the location's path, search and hash (`/users/42?tab=posts#bio`) rather than its pathname, as `@solidjs/router` gives them — its `href`, in the router's own path space, the one `name` is in (before a basepath or rewrite). A request carries no hash, so a render's `to` is the path and search. The name stays the route pattern the pathname matches. Nothing changes in production, where `OBSERVE` is undefined.
diff --git a/.changeset/solid-router-observe-navigation.md b/.changeset/solid-router-observe-navigation.md
new file mode 100644
index 0000000000..78147b945b
--- /dev/null
+++ b/.changeset/solid-router-observe-navigation.md
@@ -0,0 +1,5 @@
+---
+'@tanstack/solid-router': patch
+---
+
+Declare navigations to Solid's observe tier. On Solid's dev and observe builds (`OBSERVE` defined), the match publish inside `startTransition` is wrapped in `OBSERVE.attribution.withOrigin` with the destination route's `fullPath`, params, `to`/`from` pathnames and `at` from the history change that started the load, so the holds and re-runs a navigation causes are named after the route and the record spans the loader wait. The pending offer, the initial load and same-location reloads are published undeclared. Nothing changes in production, where `OBSERVE` is undefined.
diff --git a/.changeset/solid-router-observe-pending-not-found.md b/.changeset/solid-router-observe-pending-not-found.md
new file mode 100644
index 0000000000..24096baee0
--- /dev/null
+++ b/.changeset/solid-router-observe-pending-not-found.md
@@ -0,0 +1,5 @@
+---
+'@tanstack/solid-router': patch
+---
+
+Observe tier (Solid's dev and observe builds only): a not-found under a route with a loader (`/users/2/nope` under `/users/$id`) is recorded, named by its pathname, as `@solidjs/router` records an unmatched path. The route's match sits below the not-found boundary and never loads, so it stays `pending` in the publish that lands, which was mistaken for the pending offer and published undeclared: the navigation had no record. Only a match pending at or above the not-found boundary marks the pending offer now. Nothing changes in production, where `OBSERVE` is undefined.
diff --git a/.changeset/solid-router-observe-redirect-hops.md b/.changeset/solid-router-observe-redirect-hops.md
new file mode 100644
index 0000000000..e5ae7fd166
--- /dev/null
+++ b/.changeset/solid-router-observe-redirect-hops.md
@@ -0,0 +1,5 @@
+---
+'@tanstack/solid-router': patch
+---
+
+Observe tier (Solid's dev and observe builds only): a navigation sent elsewhere while it is pending — a `beforeLoad` or loader redirecting it, or another navigation requested before it published — is one record with its hops, as `@solidjs/router` declares one: the record keeps the first request's time and interaction, names the destination that showed, and lists the destinations it abandoned in `redirects` (each with its name, `to`, params, and when it was sent on). The router declares a `redirect: n` ref per hop around the publish that lands. The browser moving (back, forward) while a navigation is pending supersedes it instead: a record of its own, from the location shown. Before, the record named only the final destination and kept no hops. Nothing changes in production, where `OBSERVE` is undefined.
diff --git a/.changeset/solid-router-observe-route-names.md b/.changeset/solid-router-observe-route-names.md
new file mode 100644
index 0000000000..2313b52dd6
--- /dev/null
+++ b/.changeset/solid-router-observe-route-names.md
@@ -0,0 +1,5 @@
+---
+'@tanstack/solid-router': patch
+---
+
+Observe tier (Solid's dev and observe builds only): a navigation's record names a not-found by its pathname instead of the route above it, so `/nope` no longer files under `/` beside the home page, and its `params` are the strings the path bound rather than the values `params.parse` returned, as Solid's `NavigationRef` declares them. Nothing changes in production, where `OBSERVE` is undefined.
diff --git a/.changeset/solid-router-public-hydration-api.md b/.changeset/solid-router-public-hydration-api.md
new file mode 100644
index 0000000000..d0249f5d6d
--- /dev/null
+++ b/.changeset/solid-router-public-hydration-api.md
@@ -0,0 +1,12 @@
+---
+'@tanstack/solid-router': patch
+'@tanstack/solid-router-devtools': patch
+'@tanstack/solid-router-ssr-query': patch
+'@tanstack/solid-start': patch
+'@tanstack/solid-start-client': patch
+'@tanstack/solid-start-server': patch
+---
+
+Bump solid-js and @solidjs/web to ^2.0.0-rc.13 (and @solidjs/vite-plugin to ^3.0.0-next.46), and raise the Solid peer floors to 2.0.0-rc.13.
+
+@tanstack/solid-router moves off Solid's internal `sharedConfig` and the raw `_$HY` registry onto the public hydration API rc.13 ships (solidjs/solid#3718): `useHydrated` reads `isHydrating()`; the native SSR match transfer writes through `getHydrationWriter()` gated on `isHydratable()`, so it now respects ``; and the client boot takes each match's entry with `takeHydrationValue()`.
diff --git a/.changeset/solid-router-server-function-metadata.md b/.changeset/solid-router-server-function-metadata.md
new file mode 100644
index 0000000000..10995632ba
--- /dev/null
+++ b/.changeset/solid-router-server-function-metadata.md
@@ -0,0 +1,5 @@
+---
+'@tanstack/solid-router': patch
+---
+
+Consume Solid server-function response metadata. `RouterContextProvider` registers the router as the transport's unnamed single-flight consumer on the client, so the response helpers a mutation returns take effect without the caller wrapping the call: `redirect()` navigates — same-origin targets softly under the router with `replace`, other origins through a document navigation via `navigate({ href })` so the protocol allowlist and blockers still apply — and any declaration of a write (`redirect()`, `reload({ revalidate })`, `respond(value, { revalidate })`, the reserved `revalidate: '*'`) reloads route data through `router.invalidate()`. An empty declaration (`revalidate: []`) is honored as nothing to reload. Navigation runs before invalidation so a redirect costs one load: the destination commits with its shared layouts reloaded and the page being left never reruns its own loaders. `X-Revalidate` keys name entries in caches the router does not own and are left to those caches' consumers.
diff --git a/.changeset/solid-router-settlement-ack.md b/.changeset/solid-router-settlement-ack.md
new file mode 100644
index 0000000000..c7133af16a
--- /dev/null
+++ b/.changeset/solid-router-settlement-ack.md
@@ -0,0 +1,5 @@
+---
+'@tanstack/solid-router': patch
+---
+
+Resolve the `router.startTransition` render acknowledgement when the commit's transition actually settles instead of immediately after flush. View transitions, `onRendered` (scroll restoration), pending minimum-display timing, and `status: 'idle'` now observe the committed swap instead of firing against held DOM; superseded or rolled-back commits acknowledge `false` instead of leaking. Synchronous navigations still acknowledge within the same flush.
diff --git a/.changeset/solid-rsbuild-native-loader.md b/.changeset/solid-rsbuild-native-loader.md
new file mode 100644
index 0000000000..8532432e66
--- /dev/null
+++ b/.changeset/solid-rsbuild-native-loader.md
@@ -0,0 +1,5 @@
+---
+'@tanstack/solid-start': patch
+---
+
+Patch @rsbuild/plugin-solid's native `solid` loader options for SSR builds. Since 2.0.0-beta.1 the plugin compiles through its own loader (native compiler by default) instead of registering babel-preset-solid, so the babel preset patch never fired and node-target bundles were compiled in dom mode, crashing at import with "Client-only API called on the server side". The rsbuild start plugin now patches the loader's `solid` options (`generate: 'ssr'` on node targets, `hydratable: true`) alongside the legacy babel preset patch.
diff --git a/.changeset/solid-server-fn-abort-signal.md b/.changeset/solid-server-fn-abort-signal.md
new file mode 100644
index 0000000000..f6f9202526
--- /dev/null
+++ b/.changeset/solid-server-fn-abort-signal.md
@@ -0,0 +1,5 @@
+---
+'@tanstack/solid-start': patch
+---
+
+Support per-call AbortSignals for Solid server functions. solid-js 2.0.0-rc.4 added the per-call invocation channel (`invoke(fn, { signal }, ...args)`) and moved server function id resolution from the `X-Server-Function` header to the request url pathname; the client rpc now rides that channel when a `signal` is passed to a server function, and the server handler resolves/normalizes ids via the url. The previously skipped abort e2e tests are re-enabled.
diff --git a/.changeset/solid-usehead-registry.md b/.changeset/solid-usehead-registry.md
new file mode 100644
index 0000000000..9af2b378e0
--- /dev/null
+++ b/.changeset/solid-usehead-registry.md
@@ -0,0 +1,19 @@
+---
+'@tanstack/solid-router-ssr-query': patch
+'@tanstack/solid-router-devtools': patch
+'@tanstack/solid-start-client': patch
+'@tanstack/solid-start-server': patch
+'@tanstack/solid-router': patch
+'@tanstack/solid-start': patch
+---
+
+Register head tags through Solid's `useHead` registry. `HeadContent` now
+feeds the route-derived tags to Solid's head registry as one reactive group
+instead of rendering elements in-tree: the registry owns head emission on
+both runtimes (SSR splicing/streaming and client-side patching), replacing
+the manual relocate-into-head, imperative script injection, and
+`document.title` syncing. Inline scripts and styles carry a stable
+content-derived key so server and client reconcile on the same identity.
+`HeadContent` can now be rendered anywhere in the tree. The dedicated
+development entry (`index.dev`) and its `development` export conditions are
+retired along with it.
diff --git a/.changeset/spotty-moons-listen.md b/.changeset/spotty-moons-listen.md
new file mode 100644
index 0000000000..e2d8cc318b
--- /dev/null
+++ b/.changeset/spotty-moons-listen.md
@@ -0,0 +1,5 @@
+---
+'@tanstack/solid-router': patch
+---
+
+fix: keep route-scoped accessors (e.g. `Route.useParams()`, `Route.useSearch()`) readable when read from async work after navigating away. Once the owning scope is disposed, the accessor returns its last known value instead of `undefined` for the now-missing match.
diff --git a/.changeset/start-server-fn-custom-id-check.md b/.changeset/start-server-fn-custom-id-check.md
deleted file mode 100644
index 384f0ade06..0000000000
--- a/.changeset/start-server-fn-custom-id-check.md
+++ /dev/null
@@ -1,7 +0,0 @@
----
-'@tanstack/start-plugin-core': minor
----
-
-A server function id that a custom `serverFns.generateFunctionId` returns and that never worked over HTTP now fails the build, with an error naming the file, the function and the id: whitespace, a control or non-ASCII character, any of `"`, `#`, `/`, `<`, `>`, `?`, `\`, `^`, `` ` ``, `{`, `}`, the ids `.` and `..`, and a percent-encoding the server reads as another id (`%41`, lowercase hex, `%2E`) or rejects. The client puts the id in the URL unencoded, so a `#` or `?` ended the path and a `/` cut the id short (the call silently ran another server function of the file or none), and the other characters reached the server percent-encoded and matched no function. An id embedding a non-ASCII `functionName` is one of these. One case did work and now fails the build: such an id on a server function only SSR code called.
-
-Ids with `%` or the other characters URLs allow (such as `:`, `@`, `+`, `=`, `,`, `;`, `!`, `*`, `(`, `)`, `&`, `'`, `|`, `[`, `]`) still build and reach their handler, with a deprecation warning (from the Vite plugin; the Rsbuild plugin does not print compiler warnings yet): the next major version rejects them, since proxies and servers may decode or rewrite them (hash the inputs instead, as the documented example does). An id with `'` no longer breaks the server bundle.
diff --git a/.changeset/start-vite-root-library-discovery.md b/.changeset/start-vite-root-library-discovery.md
deleted file mode 100644
index d4e8221c59..0000000000
--- a/.changeset/start-vite-root-library-discovery.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'@tanstack/start-plugin-core': patch
----
-
-Vite: Start finds the Start libraries it bundles in the SSR build from Vite's root, not the working directory. A `vite build ` run from another directory (a monorepo root, a script) no longer leaves them external and uncompiled, where their server fns returned `undefined`.
diff --git a/.changeset/store-bridge-single-flush.md b/.changeset/store-bridge-single-flush.md
new file mode 100644
index 0000000000..0a63beb57f
--- /dev/null
+++ b/.changeset/store-bridge-single-flush.md
@@ -0,0 +1,5 @@
+---
+'@tanstack/solid-router': patch
+---
+
+Stop force-flushing Solid's scheduler on every router-core batch. Store writes now coalesce through the scheduler (one settle per navigation instead of 3-5 full synchronous flushes) while reads stay synchronously fresh via a shadow value in the store bridge.
diff --git a/.changeset/tall-horses-repair.md b/.changeset/tall-horses-repair.md
new file mode 100644
index 0000000000..295b9e819d
--- /dev/null
+++ b/.changeset/tall-horses-repair.md
@@ -0,0 +1,10 @@
+---
+'@tanstack/solid-router-ssr-query': patch
+'@tanstack/solid-router-devtools': patch
+'@tanstack/solid-start-client': patch
+'@tanstack/solid-start-server': patch
+'@tanstack/solid-router': patch
+'@tanstack/solid-start': patch
+---
+
+fix: use TSR_DEFERRED_PROMISE
diff --git a/.changeset/tame-lions-hunt.md b/.changeset/tame-lions-hunt.md
new file mode 100644
index 0000000000..d54795134a
--- /dev/null
+++ b/.changeset/tame-lions-hunt.md
@@ -0,0 +1,5 @@
+---
+'@tanstack/solid-router': patch
+---
+
+Fix hydration desync by resolving `defaultNotFoundComponent` at render time instead of lazily mutating the boundary route's `options.notFoundComponent`. Route objects are module singletons shared across server requests, so once the server handled any 404, later SSRs of valid URLs wrapped the match in a `CatchNotFound` boundary the client didn't render, shifting hydration keys and leaving the subtree inert.
diff --git a/.changeset/three-carrots-return.md b/.changeset/three-carrots-return.md
new file mode 100644
index 0000000000..bd8daa172e
--- /dev/null
+++ b/.changeset/three-carrots-return.md
@@ -0,0 +1,10 @@
+---
+'@tanstack/solid-router-ssr-query': patch
+'@tanstack/solid-router-devtools': patch
+'@tanstack/solid-start-client': patch
+'@tanstack/solid-start-server': patch
+'@tanstack/solid-router': patch
+'@tanstack/solid-start': patch
+---
+
+bump to alpha.1
diff --git a/.changeset/tiny-beds-tan.md b/.changeset/tiny-beds-tan.md
new file mode 100644
index 0000000000..fb8bca1450
--- /dev/null
+++ b/.changeset/tiny-beds-tan.md
@@ -0,0 +1,10 @@
+---
+'@tanstack/solid-router-ssr-query': patch
+'@tanstack/solid-router-devtools': patch
+'@tanstack/solid-start-client': patch
+'@tanstack/solid-start-server': patch
+'@tanstack/solid-router': patch
+'@tanstack/solid-start': patch
+---
+
+sync main
diff --git a/.changeset/tired-pants-eat.md b/.changeset/tired-pants-eat.md
new file mode 100644
index 0000000000..d4a071c298
--- /dev/null
+++ b/.changeset/tired-pants-eat.md
@@ -0,0 +1,5 @@
+---
+'@tanstack/solid-start': patch
+---
+
+fix: better rollupOptions/rolldownOptions handling
diff --git a/.changeset/violet-turkeys-cross.md b/.changeset/violet-turkeys-cross.md
new file mode 100644
index 0000000000..b095b45e58
--- /dev/null
+++ b/.changeset/violet-turkeys-cross.md
@@ -0,0 +1,10 @@
+---
+'@tanstack/solid-router-ssr-query': patch
+'@tanstack/solid-router-devtools': patch
+'@tanstack/solid-start-client': patch
+'@tanstack/solid-start-server': patch
+'@tanstack/solid-router': patch
+'@tanstack/solid-start': patch
+---
+
+chore: sync main branch with store refactor
diff --git a/.changeset/wicked-olives-poke.md b/.changeset/wicked-olives-poke.md
new file mode 100644
index 0000000000..479ea10d53
--- /dev/null
+++ b/.changeset/wicked-olives-poke.md
@@ -0,0 +1,5 @@
+---
+'@tanstack/solid-router-ssr-query': patch
+---
+
+fix: use solid-query 6.0.0-alpha.0
diff --git a/.coderabbit.yaml b/.coderabbit.yaml
deleted file mode 100644
index 21d884dbeb..0000000000
--- a/.coderabbit.yaml
+++ /dev/null
@@ -1,12 +0,0 @@
-# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
-
-reviews:
- request_changes_workflow: false
- slop_detection:
- enabled: true
-
-knowledge_base:
- code_guidelines:
- enabled: true
- filePatterns:
- - 'CONTRIBUTING.md'
diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml
index 9dd0def7bd..a33150af03 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.yml
+++ b/.github/ISSUE_TEMPLATE/bug_report.yml
@@ -4,14 +4,6 @@ body:
- type: markdown
attributes:
value: |
-
-
Thank you for reporting an issue :pray:.
This issue tracker is for reporting bugs found in TanStack Router and/or Start.
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
deleted file mode 100644
index a5ef10f1ff..0000000000
--- a/.github/pull_request_template.md
+++ /dev/null
@@ -1,22 +0,0 @@
-## 🎯 Changes
-
-
-
-## ✅ Checklist
-
-- [ ] I have followed the steps in the [Contributing guide](https://github.com/TanStack/router/blob/main/CONTRIBUTING.md).
-- [ ] I have tested code changes locally with the relevant test commands, or tests do not apply to this pull request.
-- [ ] I fully understand the code in this pull request, including any code generated with AI assistance.
-
-## 🚀 Release Impact
-
-- [ ] This change affects published code, and I have generated a [changeset](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md).
-- [ ] This change is docs/CI/dev-only (no release).
-
-
diff --git a/.github/renovate.json b/.github/renovate.json
index 6fd5aa1c86..01be1ce5c2 100644
--- a/.github/renovate.json
+++ b/.github/renovate.json
@@ -21,6 +21,7 @@
"@types/node",
"@types/react",
"@types/react-dom",
+ "h3",
"node",
"react",
"react-dom",
diff --git a/.github/workflows/bundle-size.yml b/.github/workflows/bundle-size.yml
index 51ffa28e4c..23c354e06e 100644
--- a/.github/workflows/bundle-size.yml
+++ b/.github/workflows/bundle-size.yml
@@ -9,18 +9,12 @@ on:
- 'packages/**'
- 'benchmarks/**'
- 'scripts/benchmarks/bundle-size/**'
- - '.nvmrc'
- - 'package.json'
- - 'pnpm-lock.yaml'
push:
branches: [main]
paths:
- 'packages/**'
- 'benchmarks/**'
- 'scripts/benchmarks/bundle-size/**'
- - '.nvmrc'
- - 'package.json'
- - 'pnpm-lock.yaml'
workflow_dispatch:
concurrency:
@@ -51,7 +45,7 @@ jobs:
uses: TanStack/config/.github/setup@e4b48f16568324f76f467aa4c2aac2f05db632c3 # main
- name: Measure Bundle Size
- run: pnpm benchmark:bundle-size --outputStyle=stream --skipRemoteCache
+ run: pnpm nx run @benchmarks/bundle-size:build --outputStyle=stream --skipRemoteCache
- name: Capture Benchmark Outputs
id: capture
@@ -109,8 +103,6 @@ jobs:
cat benchmarks/bundle-size/results/pr-comment.md
- name: Upsert Sticky PR Comment
- # Fork PRs have a read-only GITHUB_TOKEN, so they cannot update comments.
- if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
@@ -120,7 +112,7 @@ jobs:
benchmark-main:
name: Publish Bundle Size History
- if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/main' && github.repository_owner == 'TanStack'
+ if: github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository_owner == 'TanStack'
runs-on: ubuntu-latest
permissions:
contents: write
@@ -135,7 +127,7 @@ jobs:
uses: TanStack/config/.github/setup@e4b48f16568324f76f467aa4c2aac2f05db632c3 # main
- name: Measure Bundle Size
- run: pnpm benchmark:bundle-size --outputStyle=stream --skipRemoteCache
+ run: pnpm nx run @benchmarks/bundle-size:build --outputStyle=stream --skipRemoteCache
- name: Publish Benchmark Dashboard
uses: benchmark-action/github-action-benchmark@52576c92bccf6ac60c8223ec7eb2565637cae9ba # v1.22.1
with:
diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/client-nav-benchmarks.yml
similarity index 88%
rename from .github/workflows/benchmarks.yml
rename to .github/workflows/client-nav-benchmarks.yml
index bbc3a1fa24..8715312d36 100644
--- a/.github/workflows/benchmarks.yml
+++ b/.github/workflows/client-nav-benchmarks.yml
@@ -18,18 +18,9 @@ on:
pull_request:
paths:
- 'packages/**'
- - '!packages/**/tests/**'
- - '!packages/**/__tests__/**'
- - '!packages/**/*.test.*'
- 'benchmarks/**'
- - '.nvmrc'
workflow_dispatch:
-concurrency:
- group: benchmarks-${{ github.ref }}
- cancel-in-progress: false
- queue: single
-
permissions:
contents: read # required for actions/checkout
id-token: write # required for OIDC authentication with CodSpeed
@@ -81,8 +72,7 @@ jobs:
@benchmarks/${{ matrix.benchmark }}:build:${{ matrix.framework }}
- name: Run ${{ matrix.benchmark }}:${{ matrix.framework }} CodSpeed benchmark
- uses: CodSpeedHQ/action@373d6868929f444bc08d901fd0eb0ad52a8875ea # v5.2.1
- timeout-minutes: 20
+ uses: CodSpeedHQ/action@4296e51e7041e24dadb86d1d6e8b9320d223dbe8 # v5.0.3
with:
mode: ${{ matrix.mode }}
run: >-
diff --git a/.github/workflows/compiler-platforms.yml b/.github/workflows/compiler-platforms.yml
deleted file mode 100644
index ad70e39bb6..0000000000
--- a/.github/workflows/compiler-platforms.yml
+++ /dev/null
@@ -1,101 +0,0 @@
-name: Compiler Platforms
-
-# The main PR workflow only runs on Linux x64 (glibc). The compilers load a
-# native Yuku binary per platform and handle platform-specific paths, so run
-# their unit tests and a Vite and Rsbuild production build on the other
-# platforms we ship to.
-
-on:
- pull_request:
- paths:
- - 'packages/router-utils/**'
- - 'packages/router-generator/**'
- - 'packages/router-plugin/**'
- - 'packages/start-plugin-core/**'
- - 'pnpm-lock.yaml'
- - '.github/workflows/compiler-platforms.yml'
- schedule:
- # Weekly, to catch new Yuku releases and runner image updates
- - cron: '0 6 * * 1'
- workflow_dispatch:
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
- cancel-in-progress: true
-
-permissions:
- contents: read
-
-env:
- NX_DAEMON: 'false'
- NX_NO_CLOUD: 'true'
-
-defaults:
- run:
- shell: bash
-
-jobs:
- compiler:
- name: ${{ matrix.name }}
- runs-on: ${{ matrix.os }}
- # actions/setup-node only ships glibc builds, so musl uses Alpine's Node image
- container: ${{ matrix.container }}
- strategy:
- fail-fast: false
- matrix:
- include:
- - name: Windows x64
- os: windows-latest
- - name: macOS arm64
- os: macos-latest
- - name: Linux arm64
- os: ubuntu-24.04-arm
- - name: Linux x64 musl
- os: ubuntu-latest
- container: node:24.8.0-alpine3.22@sha256:3e843c608bb5232f39ecb2b25e41214b958b0795914707374c8acc28487dea17
- steps:
- - name: Install system packages
- if: ${{ matrix.container }}
- shell: sh
- run: apk add --no-cache bash git
- - name: Keep LF line endings
- # Snapshots are stored with LF. Windows runners check out CRLF by default,
- # and with `* text=auto` disabling autocrlf alone still uses the native eol
- run: |
- git config --global core.autocrlf false
- git config --global core.eol lf
- - name: Checkout
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- with:
- persist-credentials: false
- - name: Setup pnpm
- if: ${{ !matrix.container }}
- uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1
- - name: Setup Node
- if: ${{ !matrix.container }}
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
- with:
- node-version-file: .nvmrc
- package-manager-cache: false
- - name: Setup pnpm (container)
- if: ${{ matrix.container }}
- run: npm install --global "$(node -p "require('./package.json').packageManager")"
- - name: Install dependencies
- run: >-
- pnpm install --frozen-lockfile
- --filter .
- --filter "@tanstack/router-utils..."
- --filter "@tanstack/router-generator..."
- --filter "@tanstack/router-plugin..."
- --filter "@tanstack/start-plugin-core..."
- --filter "tanstack-react-start-e2e-basic..."
- - name: Unit tests
- run: >-
- pnpm nx run-many --targets=test:unit
- --projects=@tanstack/router-utils,@tanstack/router-generator,@tanstack/router-plugin,@tanstack/start-plugin-core
- --skip-nx-cache --outputStyle=static
- - name: Production builds
- run: >-
- pnpm nx run-many --targets=build:vite:ssr,build:rsbuild:ssr
- --projects=tanstack-react-start-e2e-basic
- --skip-nx-cache --outputStyle=static
diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml
index fde1100409..d8c779b170 100644
--- a/.github/workflows/labeler.yml
+++ b/.github/workflows/labeler.yml
@@ -9,8 +9,6 @@ permissions:
jobs:
labeler:
- # Fork PRs have a read-only GITHUB_TOKEN, so they cannot update labels.
- if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
runs-on: ubuntu-latest
steps:
- name: Labeller
diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml
index ae19b4f0d2..71026a0a92 100644
--- a/.github/workflows/pr.yml
+++ b/.github/workflows/pr.yml
@@ -10,13 +10,6 @@ concurrency:
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
SERVER_PRESET: 'node-server'
- # Enable dynamic task packing for distributed CI.
- NX_CLOUD_AGENT_TASK_QUEUE: true
- NX_CLOUD_AUTO_TASK_PACKING: true
- NX_CLOUD_AGENT_UNCAPPED_GROUP_WORK: true
- NX_CLOUD_PACKING_MEM_MULTIPLIER: 1.5
- NX_CLOUD_BUFFER_TASK_COMPLETIONS: true
- NX_CLOUD_CONTINUOUS_ASSIGNMENT: true
permissions:
contents: read
@@ -33,8 +26,8 @@ jobs:
with:
fetch-depth: 0
persist-credentials: false
- - name: Start Nx Workers
- run: npx nx-cloud start-workers
+ - name: Start Nx Agents
+ run: npx nx-cloud start-ci-run --distribute-on=".nx/workflows/dynamic-changesets.yaml"
- name: Setup Tools
uses: TanStack/config/.github/setup@e4b48f16568324f76f467aa4c2aac2f05db632c3 # main
- name: Get base and head commits for `nx affected`
@@ -43,9 +36,9 @@ jobs:
main-branch-name: main
- name: Run Checks
run: pnpm run test:pr --parallel=3
- - name: Stop Nx Workers
+ - name: Stop Nx Agents
if: ${{ always() }}
- run: npx nx-cloud stop-all-workers
+ run: npx nx-cloud stop-all-agents
preview:
name: Preview
runs-on: ubuntu-latest
diff --git a/.gitignore b/.gitignore
index 70028b2860..1699592784 100644
--- a/.gitignore
+++ b/.gitignore
@@ -66,7 +66,6 @@ nx-cloud.env
.nx/workspace-data
.nx/polygraph
.nx/self-healing
-.nx/migrate-runs
gpt/db.json
diff --git a/.nvmrc b/.nvmrc
index 63f87c20ef..b404027604 100644
--- a/.nvmrc
+++ b/.nvmrc
@@ -1 +1 @@
-26.12.1
+24.8.0
diff --git a/.nx/ci-config.yaml b/.nx/ci-config.yaml
deleted file mode 100644
index 2f0783feb4..0000000000
--- a/.nx/ci-config.yaml
+++ /dev/null
@@ -1,5 +0,0 @@
-dte:
- distribute-on:
- small-changeset: 6 linux-medium-js
- medium-changeset: 12 linux-medium-js
- large-changeset: 18 linux-medium-js
diff --git a/.nx/workflows/dynamic-changesets.yaml b/.nx/workflows/dynamic-changesets.yaml
new file mode 100644
index 0000000000..39d858d5b2
--- /dev/null
+++ b/.nx/workflows/dynamic-changesets.yaml
@@ -0,0 +1,4 @@
+distribute-on:
+ small-changeset: 4 linux-medium-js
+ medium-changeset: 8 linux-medium-js
+ large-changeset: 16 linux-medium-js
diff --git a/.nx/workflows/sandboxing-config.yaml b/.nx/workflows/sandboxing-config.yaml
new file mode 100644
index 0000000000..4fa2634bc3
--- /dev/null
+++ b/.nx/workflows/sandboxing-config.yaml
@@ -0,0 +1,9 @@
+exclude-reads:
+ - e2e/.gitignore
+ - '**/src/routeTree.gen.ts'
+exclude-writes:
+ - '**/src/routeTree.gen.ts'
+task-exclusions:
+ - target: test:build
+ exclude-reads:
+ - LICENSE
diff --git a/.nx/workflows/ultracache-config.yaml b/.nx/workflows/ultracache-config.yaml
deleted file mode 100644
index b3ed223621..0000000000
--- a/.nx/workflows/ultracache-config.yaml
+++ /dev/null
@@ -1,124 +0,0 @@
-ignore-reads:
- - e2e/.gitignore
- - '**/src/routeTree.gen.ts'
-ignore-writes:
- - '**/src/routeTree.gen.ts'
-task-exclusions:
- - target: test:build
- ignore-reads:
- - LICENSE
- # HMR tests edit these inputs in place and restore their original contents.
- # Keep them out of cached outputs so cache replay never overwrites source.
- - project: tanstack-react-start-e2e-deferred-hydration
- target: test:e2e
- ignore-writes:
- - e2e/react-start/deferred-hydration/src/routes/components.tsx
- - project: tanstack-react-start-e2e-hmr
- target: test:e2e
- ignore-writes: &hmr-source-writes
- - e2e/react-start/hmr/src/components/AliasedRouteImportChildPanel.tsx
- - e2e/react-start/hmr/src/components/AliasedRouteImportParentPanel.tsx
- - e2e/react-start/hmr/src/hmr/server-fn-hmr-factory.ts
- - e2e/react-start/hmr/src/routes/__root.tsx
- - e2e/react-start/hmr/src/routes/child.tsx
- - e2e/react-start/hmr/src/routes/component-hmr-inline-error-split.tsx
- - e2e/react-start/hmr/src/routes/component-hmr-inline-nosplit.tsx
- - e2e/react-start/hmr/src/routes/component-hmr-inline-split.tsx
- - e2e/react-start/hmr/src/routes/component-hmr-lowercase-named-split.tsx
- - e2e/react-start/hmr/src/routes/component-hmr-named-error-split.tsx
- - e2e/react-start/hmr/src/routes/component-hmr-named-nosplit.tsx
- - e2e/react-start/hmr/src/routes/component-hmr-named-split.tsx
- - e2e/react-start/hmr/src/routes/index.tsx
- - e2e/react-start/hmr/src/routes/inputs.tsx
- - project: tanstack-react-start-e2e-hmr
- target: test:e2e--vite-ssr
- ignore-writes: *hmr-source-writes
- - project: tanstack-react-start-e2e-hmr
- target: test:e2e--vite-ssr--bundled-dev
- ignore-writes: *hmr-source-writes
- - project: tanstack-react-start-e2e-hmr
- target: test:e2e--rsbuild-ssr
- ignore-writes: *hmr-source-writes
- - project: tanstack-react-start-e2e-rsbuild
- target: test:e2e--rsbuild-ssr
- ignore-writes:
- - e2e/react-start/rsbuild/src/routes/index.tsx
- - project: tanstack-react-start-e2e-server-functions
- target: test:e2e
- ignore-writes:
- - e2e/react-start/server-functions/src/routes/consistent.tsx
- # Scaffolding tests deliberately populate tracked empty route fixtures.
- - project: '@tanstack/router-generator'
- target: test:unit
- ignore-writes:
- - packages/router-generator/tests/generator/custom-scaffolding/routes/__root.tsx
- - packages/router-generator/tests/generator/custom-scaffolding/routes/api/bar.tsx
- - packages/router-generator/tests/generator/custom-scaffolding/routes/foo.lazy.tsx
- - packages/router-generator/tests/generator/custom-scaffolding/routes/index.tsx
- # These reads are of scratch files created by the same test invocation.
- - project: tanstack-solid-start-e2e-basic-auth
- target: test:e2e
- ignore-reads:
- - e2e/solid-start/basic-auth/.tmp/dev.db
- - project: tanstack-vue-start-e2e-basic-auth
- target: test:e2e
- ignore-reads:
- - e2e/vue-start/basic-auth/.tmp/dev.db
- - project: '@tanstack/router-generator'
- target: test:unit
- ignore-reads:
- - packages/router-generator/tests/generator/file-modification/routes/[(]test[)]/initiallyEmpty.tsx
- - packages/router-generator/tests/generator/file-modification/routes/[(]test[)]/initiallyEmpty.lazy.tsx
- # Mutable counters are scratch state, not artifacts to replay from cache.
- - project: tanstack-react-start-e2e-basic-tsr-config
- target: test:e2e
- ignore-reads:
- - e2e/react-start/basic-tsr-config/count.txt
- ignore-writes:
- - e2e/react-start/basic-tsr-config/count.txt
- - project: tanstack-solid-start-e2e-basic-tsr-config
- target: test:e2e
- ignore-reads:
- - e2e/solid-start/basic-tsr-config/count.txt
- ignore-writes:
- - e2e/solid-start/basic-tsr-config/count.txt
- - project: tanstack-vue-start-e2e-basic-tsr-config
- target: test:e2e
- ignore-reads:
- - e2e/vue-start/basic-tsr-config/count.txt
- ignore-writes:
- - e2e/vue-start/basic-tsr-config/count.txt
- # Paraglide downloads compiler plugins from the URLs in settings.json.
- # Ignore warm-cache reads; the settings remain inputs and cache files outputs.
- - project: tanstack-react-start-e2e-i18n-paraglide
- target: build
- ignore-reads:
- - e2e/react-start/i18n-paraglide/project.inlang/cache/plugins/*
- - project: tanstack-router-e2e-react-i18n-paraglide
- target: build
- ignore-reads:
- - e2e/react-router/i18n-paraglide/project.inlang/cache/plugins/*
- - project: tanstack-react-start-e2e-i18n-paraglide
- target: test:e2e
- ignore-reads:
- - e2e/react-start/i18n-paraglide/project.inlang/cache/plugins/*
- - project: tanstack-router-e2e-react-i18n-paraglide
- target: test:e2e
- ignore-reads:
- - e2e/react-router/i18n-paraglide/project.inlang/cache/plugins/*
- - project: tanstack-router-i18n-paraglide
- target: build
- ignore-reads:
- - examples/react/i18n-paraglide/project.inlang/cache/plugins/*
- - project: tanstack-start-i18n-paraglide
- target: build
- ignore-reads:
- - examples/react/start-i18n-paraglide/project.inlang/cache/plugins/*
- - project: tanstack-router-solid-i18n-paraglide
- target: build
- ignore-reads:
- - examples/solid/i18n-paraglide/project.inlang/cache/plugins/*
- - project: tanstack-solid-start-i18n-paraglide
- target: build
- ignore-reads:
- - examples/solid/start-i18n-paraglide/project.inlang/cache/plugins/*
diff --git a/.nxignore b/.nxignore
new file mode 100644
index 0000000000..867e529a65
--- /dev/null
+++ b/.nxignore
@@ -0,0 +1,23 @@
+# Solid v2 migration: temporarily excluded apps.
+#
+# These apps depend on third-party packages that do not yet support SolidJS v2
+# (solid-js@2.x). They cannot build against the v2 catalog and are excluded from
+# the Nx graph (build + e2e) until the upstream deps ship Solid v2 support.
+# Re-include each one by deleting its line once its blocking dep is Solid-2 ready.
+
+# solid-motionone (peer solid-js ^1.8.0, no Solid 2 release)
+examples/solid/with-framer-motion
+
+# convex-solidjs@0.0.3 (peer solid-js ^1.6.0, imports solid-js/web)
+examples/solid/start-convex-better-auth
+
+# @tanstack/solid-virtual (no Solid 2 release; imports solid-js/store)
+examples/solid/scroll-restoration
+e2e/solid-router/basic-scroll-restoration
+
+# @tanstack/solid-devtools@0.7.0 (devtools shell, peer solid-js >=1.9.7)
+examples/solid/start-bun
+examples/solid/start-i18n-paraglide
+
+# @sentry/solid@10.x (imports splitProps from solid-js)
+e2e/solid-router/sentry-integration
diff --git a/.prettierignore b/.prettierignore
index de501452ad..65991e1964 100644
--- a/.prettierignore
+++ b/.prettierignore
@@ -17,7 +17,4 @@ node_modules
/.nx/workspace-data
**/src/routeTree.gen.ts
packages/router-plugin/tests/**/test-files/**
-.nx/self-healing
-
-# Preserve the pinned upstream URL fixtures byte for byte.
-packages/router-core/tests/fixtures/wpt-url/urltestdata*.json
+.nx/self-healing
\ No newline at end of file
diff --git a/AGENTS.md b/AGENTS.md
index f47b5103e1..490cb691d4 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -1,41 +1,177 @@
# AGENTS.md
-## Scope
+## Project overview
-- Read applicable nested `AGENTS.md` files before editing or testing a subtree.
-- Shared routing belongs in `packages/router-core`; check React, Solid, and Vue bindings for shared changes. Shared Start runtime/build logic lives in `packages/start-*-core`.
+TanStack Router is a type-safe router with built-in caching and URL state management for React and Solid applications. This monorepo contains two main products:
-## Work and validation
+- **TanStack Router** - Core routing library with type-safe navigation, search params, and path params
+- **TanStack Start** - Full-stack framework built on top of TanStack Router
-- 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.
-- 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.
-- 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.**
-- 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.
-- Use Node from `.nvmrc` and pnpm from root `package.json`. Install at the root with `CI=1 pnpm install --frozen-lockfile`.
-- For sandbox-blocked registry/store access, escalate the same command; report the blocker if unavailable. Do not change stores, delete dependencies/lockfiles, use `--force`/`--ignore-scripts`, or weaken workspace trust/build policies to bypass it.
-- Never manually edit `pnpm-lock.yaml` or any `routeTree.gen.ts`. Regenerate the lockfile with `pnpm install --no-frozen-lockfile` after intentional dependency changes; regenerate route trees through app builds/dev servers or the generator fixture harness.
-- Always use control-flow braces. Run `pnpm format` before validation.
-- Use Nx: workspace imports consume built packages, so direct runners can test stale dependencies. Inspect resolved targets with `pnpm nx show project --json`; some are inferred.
-- Run finite validation through `run-many` with explicit projects and targets, including a single project/target. Nx automatically selects `summary` output when it detects an AI agent: omit `--outputStyle` for normal runs. Read the reported full log files for failures; use `--outputStyle=summary` if agent detection is unavailable.
-- Use `--outputStyle=static` or `pnpm nx run :` only when diagnosing a task and its full output is needed. Continuous/watch targets may use live output.
+## Setup commands
-```sh
-CI=1 NX_DAEMON=false pnpm nx run-many -p -t --skipRemoteCache
-```
+- Install deps: `pnpm install`
+- Setup e2e testing: `pnpm exec playwright install`
+- Build packages: `pnpm build` (affected) or `pnpm build:all` (force all)
+- Start dev server: `pnpm dev`
+- Run tests: `pnpm test`
-- Run one Nx command at a time. For a ~20-second startup/graph stall, stop, run `pnpm nx reset`, and retry once, then escalate. Do not apply that timeout to running tests.
-- For code changes, run affected packages' `test:unit`, `test:types`, and `test:eslint` where available, including affected consumers; use `test:e2e` for browser/app behavior and `test:build` for exports/build changes. Root `pnpm test` includes the full e2e suite. Published-code changes require `pnpm changeset`.
+## Code style
-## Runtime rules
+- TypeScript strict mode with extensive type safety
+- Framework-agnostic core logic separated from React/Solid bindings
+- Type-safe routing with search params and path params
+- Use workspace protocol for internal dependencies (`workspace:*`)
+- Always use curly braces for `if`, `else`, loops, and similar control statements. Never write one-line bodies like `if (foo) x = 1`.
-- Import `isServer` from `@tanstack/router-core/isServer`. Conditional exports select: `development` → `undefined`; server (`workerd`, `worker`, `deno`, `node`, `bun`) → `true` except `NODE_ENV=test` → `undefined`; browser/fallback → `false`. `development` wins; `NODE_ENV=development` alone does not select it.
-- Keep `isServer ?? router.isServer` directly in each branch condition for dead-code elimination; negate the whole expression for client branches. Never extract it into a variable (e.g. `const serverRendering = isServer ?? router.isServer`) or helper. Without a router, inline `isServer ?? typeof window === 'undefined'` (or the existing `document` check). Keep the constant first and use `??`, never `||`.
-- **Never create UI/router reactivity on the server, including development/tests.** Branch before reactive setup; use direct reads and core non-reactive stores. Required transport listeners are allowed only with request-scoped lifetimes and cleanup.
-- Shared route definitions/build metadata must not acquire request/user data. Keep it on the request's Router, context, or QueryClient.
-- HMR can replace code while caches and pending work survive. Invalidate derived state or bypass caching in development; reject stale async results while preserving intentional HMR identities/state.
-- Gate developer diagnostics and message construction with direct `process.env.NODE_ENV !== 'production'` checks. Preserve required validation/throws in production (e.g. detailed development error, compact `invariant()` failure). `!== 'development'` also enables the guarded code in tests; preserve existing dev-server mode gates.
+## Dev environment tips
-## Performance and final bundle pass
+- This is a pnpm workspace monorepo with packages organized by functionality
+- Nx provides caching, affected testing, targeting, and parallel execution for efficiency
+- Use `pnpm nx show projects` to list all available packages
+- Target specific packages: `pnpm nx run @tanstack/react-router:test:unit`
+- Target multiple packages: `pnpm nx run-many --target=test:eslint --projects=@tanstack/history,@tanstack/router-core`
+- Run affected tests only: `pnpm nx affected --target=test:unit`
+- Exclude patterns: `pnpm nx run-many --target=test:unit --exclude="examples/**,e2e/**"`
+- Navigate to examples and run `pnpm dev` to test changes: `cd examples/react/basic && pnpm dev`
+- **Granular unit testing through Nx (recommended):**
+ - Specific files: `pnpm nx run @tanstack/react-router:test:unit -- tests/link.test.tsx tests/Scripts.test.tsx`
+ - Test patterns: `pnpm nx run @tanstack/react-router:test:unit -- tests/ClientOnly.test.tsx -t "should render fallback"`
+ - Name patterns: `pnpm nx run @tanstack/react-router:test:unit -- -t "navigation"` (all tests with "navigation" in name)
+ - Exclude patterns: `pnpm nx run @tanstack/react-router:test:unit -- --exclude="**/*link*" tests/`
+ - List tests: `pnpm nx run @tanstack/react-router:test:unit -- list tests/link.test.tsx` (or `-- list` for all)
+- **Available test targets per package:** `test:unit`, `test:types`, `test:eslint`, `test:build`, `test:perf`, `build`
+- **Testing strategy:** Package level (nx) → File-level args via nx → Test-level args (`-t`) via nx → Pattern-level args (`--exclude`) via nx
+- **Agent execution guardrails (important):**
+ - Always prefer `pnpm nx ...` over `npx nx ...`.
+ - Prefer Nx targets over direct test runners so task dependencies (including required builds) remain in the graph.
+ - In sandbox, run Nx with `CI=1 NX_DAEMON=false pnpm nx run : --outputStyle=stream --skipRemoteCache`
+ - Run only one Nx command at a time.
+ - If an Nx command shows no output for ~20 seconds, stop, run `pnpm nx reset` once, and retry once.
+ - Do not loop retries indefinitely. If it still hangs or sandbox blocks graph/daemon behavior, request escalation immediately.
-- For runtime/memory changes, compare identical baseline/candidate workloads using the relevant [benchmark guide](benchmarks/AGENTS.md): client navigation, Start SSR, or memory. Add coverage for unmeasured mechanisms.
-- **Last phase for every change affecting emitted client JavaScript**, including core/build transforms: complete the full [bundle-size-optimization skill](.agents/skills/bundle-size-optimization/SKILL.md) after correctness and performance validation. The full workflow is mandatory.
+## Testing instructions
+
+- **Critical**: Always run unit and type tests during development - do not proceed if they fail
+- **Test types:** `pnpm test:unit`, `pnpm test:types`, `pnpm test:eslint`, `pnpm test:e2e`, `pnpm test:build`
+- **Full CI suite:** `pnpm test:ci`
+- **Fix formatting:** `pnpm format`
+- **Efficient targeted testing workflow:**
+ 1. **Affected only:** `pnpm nx affected --target=test:unit` (compares to main branch)
+ 2. **Specific packages:** `pnpm nx run @tanstack/react-router:test:unit`
+ 3. **Specific files:** `pnpm nx run @tanstack/react-router:test:unit -- tests/link.test.tsx`
+ 4. **Specific patterns:** `pnpm nx run @tanstack/react-router:test:unit -- tests/link.test.tsx -t "preloading"`
+- **Pro tips:**
+ - Use `pnpm nx run @tanstack/react-router:test:unit -- list` to explore available tests before running
+ - Use `-t "pattern"` to focus on specific functionality during development
+ - Use `--exclude` patterns to skip unrelated tests
+ - Keep all test filtering arguments behind `pnpm nx run ... -- ...` for maximum precision while preserving task dependencies
+- **Example workflow:** `pnpm nx run @tanstack/react-router:test:unit` → `pnpm nx run @tanstack/react-router:test:unit -- tests/link.test.tsx` → `pnpm nx run @tanstack/react-router:test:unit -- tests/link.test.tsx -t "preloading"`
+
+## PR instructions
+
+- Always run `pnpm test:eslint`, `pnpm test:types`, and `pnpm test:unit` before committing
+- Test changes in relevant example apps: `cd examples/react/basic && pnpm dev`
+- Update corresponding documentation in `docs/` directory when adding features
+- Add or update tests for any code changes
+- Use internal docs links relative to `docs/` folder (e.g., `./guide/data-loading`)
+
+## Package structure
+
+**Core packages:**
+
+- `packages/router-core/` - Framework-agnostic core router logic
+- `packages/react-router/`, `packages/solid-router/` - React/Solid bindings and components
+- `packages/history/` - Browser history management
+
+**Tooling:**
+
+- `packages/router-cli/` - CLI tools for code generation
+- `packages/router-generator/` - Route generation utilities
+- `packages/router-plugin/` - Universal bundler plugins (Vite, Webpack, ESBuild, Rspack)
+- `packages/virtual-file-routes/` - Virtual file routing system
+
+**Developer experience:**
+
+- `packages/router-devtools/`, `packages/*-router-devtools/` - Development tools
+- `packages/eslint-plugin-router/` - ESLint rules for router
+
+**Validation adapters:**
+
+- `packages/zod-adapter/`, `packages/valibot-adapter/`, `packages/arktype-adapter/`
+
+**Start framework:**
+
+- `packages/*-start/`, `packages/start-*/` - Full-stack framework packages
+
+**Examples & testing:**
+
+- `examples/react/`, `examples/solid/` - Example applications (test changes here)
+- `e2e/` - End-to-end tests (requires Playwright)
+- `docs/router/`, `docs/start/` - Documentation with React/Solid subdirectories
+
+**Dependencies:** Uses workspace protocol (`workspace:*`) - core → framework → start packages
+
+## Common development tasks
+
+**Adding new routes:**
+
+- Use file-based routing in `src/routes/` directories
+- Or use code-based routing with route definitions
+- Run route generation with CLI tools
+
+**Testing changes:**
+
+- Build packages: `pnpm build` or `pnpm dev` (watch mode)
+- Run example apps to test functionality
+- Use devtools for debugging router state
+
+**Documentation updates:**
+
+- Update relevant docs in `docs/` directory
+- Ensure examples reflect documentation changes
+- Test documentation links and references
+- Use relative links to `docs/` folder format
+
+## Framework-specific notes
+
+**React:**
+
+- Uses React Router components and hooks
+- Supports React Server Components (RSC)
+- Examples include React Query integration
+- Package: `@tanstack/react-router`
+
+**Solid:**
+
+- Uses Solid Router components and primitives
+- Supports Solid Start for full-stack applications
+- Examples include Solid Query integration
+- Package: `@tanstack/solid-router`
+
+## Environment requirements
+
+- **Node.js** - Required for development
+- **pnpm** - Package manager (required for workspace features)
+- **Playwright** - Required for e2e tests (`pnpm exec playwright install`)
+
+## Key architecture patterns
+
+- **Type Safety**: Extensive TypeScript for type-safe routing
+- **Framework Agnostic**: Core logic separated from framework bindings
+- **Plugin Architecture**: Universal bundler plugins using unplugin
+- **File-based Routing**: Support for both code-based and file-based routing
+- **Search Params**: First-class support for type-safe search parameters
+
+## Development workflow
+
+1. **Setup**: `pnpm install` and `pnpm exec playwright install`
+2. **Build**: `pnpm build:all` or `pnpm dev` for watch mode
+3. **Test**: Make changes and run relevant tests (use nx for targeted testing)
+4. **Examples**: Navigate to examples and run `pnpm dev` to test changes
+5. **Quality**: Run `pnpm test:eslint`, `pnpm test:types`, `pnpm test:unit` before committing
+
+## References
+
+- **Documentation**: https://tanstack.com/router
+- **GitHub**: https://github.com/TanStack/router
+- **Discord Community**: https://discord.com/invite/WrRKjPJ
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 4b6e808af1..e9e793926f 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -33,17 +33,7 @@ TanStack Router is a community project. Contributions to both TanStack Router an
## Before you start
-- Search the [open and closed issues](https://github.com/TanStack/router/issues?q=is%3Aissue) before reporting a bug. If it has not already been reported, use the [bug report template](https://github.com/TanStack/router/issues/new?template=bug_report.yml).
-- Search the [open and closed pull requests](https://github.com/TanStack/router/pulls?q=is%3Apr) before starting work to avoid duplicating an existing contribution.
-- Pull requests that require API changes must first be proposed as an issue and receive maintainer sign-off before implementation begins.
-
-## Pull request guidelines
-
-Every pull request must follow the [TanStack Router pull request template](.github/pull_request_template.md). Complete its description and checklist without removing or bypassing the required sections.
-
-- Keep each pull request focused on one change or topic. Pull requests that combine unrelated changes will be closed with a request to split them into separately reviewable contributions.
-- Write a concise description that clearly explains what changed and why. Follow the sections in the pull request template; a long, unstructured description makes a contribution harder to review.
-- Every change that affects a published package must include a changeset. Create it with `pnpm changeset`; documentation, CI, examples, and development-only changes do not require one.
+PRs that require API changes must first be proposed as an issue and receive maintainer sign-off before implementation begins.
## Development
@@ -142,19 +132,10 @@ pnpm dev
## AI-assisted contributions
-
-
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.
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.
2. **Keep ownership of technical decisions**. Understand every change, verify its behavior with the appropriate tests and documentation, and be ready to explain it during review.
3. **Do not paste LLM output verbatim into the codebase or a contribution**. Treat generated text and code as a draft: check its claims, adapt it to the repository, and remove anything you cannot justify. Issues or pull requests that appear to contain unreviewed LLM output may be closed without further review.
-4. **Do not mass-submit unrelated or low-quality AI-generated pull requests**. We treat that behavior as spam and may close the pull requests, block the contributor, and report the GitHub account.
AI-assisted contributions follow the same standards for correctness, testing, documentation, and review as every other contribution.
diff --git a/RFC-solid-native-ssr.md b/RFC-solid-native-ssr.md
new file mode 100644
index 0000000000..bdc1030fa6
--- /dev/null
+++ b/RFC-solid-native-ssr.md
@@ -0,0 +1,138 @@
+# RFC: Solid-native SSR/hydration for `@tanstack/solid-router`
+
+**Status:** draft for discussion
+**Scope:** the Solid adapter's SSR transfer and hydration boot — not the cross-framework router API
+
+## Context
+
+The Solid v2 line has been converging on a pattern, one PR at a time: every
+mechanism the router carried for moving state across the wire has a Solid
+2.0 channel that does it natively, and every replacement so far has shrunk
+code and payload while keeping every e2e suite green.
+
+- SSR query transfer → the hydration registry, content-addressed
+ (`solid-query` v6; `solid-router-ssr-query` retired in
+ [#8193](https://github.com/TanStack/router/pull/8193), which removed a
+ double-ship of every query payload)
+- Post-mutation data → the multi-source single-flight envelope
+ ([#8192](https://github.com/TanStack/router/pull/8192): named sources +
+ `loadFlightTarget`)
+- Redirects from cache-driven fetches → a dozen lines composing
+ `isRedirect`/`resolveRedirect` with the caches' `config.onError`
+- The reference for all of it: solidjs/templates `fullstack-tanstack`
+ (bare vite + Router + Query, no Start, no integration package —
+ [templates#287](https://github.com/solidjs/templates/pull/287))
+
+What remains are the deeper assumptions, inherited from the React
+integration model where the framework has no serialization channel and no
+hydration-claiming, so the router had to build both:
+
+1. **The router owns the SSR envelope.** `router.serverSsr`, the
+ `dehydrate()`/`hydrate()` options, and the `__TSR_SSR__` script protocol
+ form a parallel serialization channel through the router's own stream
+ injection.
+2. **The router loads before hydration.** The client is expected to
+ resolve and commit matches before first render (the template's
+ `bootLoad`, plus the prefetch-pausing it drags along) because React
+ hydration can't claim through async work.
+3. **The router owns the HTML's boundary structure.** A global catch
+ boundary is injected client-side that the server never rendered —
+ correct when TanStack's stream handlers produce the HTML, a hydration
+ mismatch when Solid's renderer does (today's escape hatch:
+ `disableGlobalCatchBoundary: true`).
+4. **Suspense-era data ergonomics.** Deferred/`Await` patterns exist
+ because components couldn't just read async values. In Solid 2 they
+ can; the idiomatic usage is already "loaders as non-blocking prefetch
+ hints, suspension at the read point."
+
+## Principles
+
+- **The framework channel is the transfer.** Anything Solid can serialize
+ through the hydration registry (promise-valued, streamed by seroval as
+ it settles) should not ride a router-owned side channel.
+- **Never block up front.** No pre-hydration load pass, no up-front chunk
+ resolution, no envelope waiting. Solid's `lazy` already participates in
+ hydration — a route chunk resolves under its boundary and claims its
+ markup when it lands — so `route.lazy` maps onto read-point resolution.
+ The same goes for data: pending loaders transfer as promises and settle
+ where they're read.
+- **Loader API semantics are untouched.** Blocking loaders,
+ `pendingComponent`, `beforeLoad`, deferred — the cross-framework
+ contract stays. This RFC changes how the _adapter_ transfers and boots,
+ not what the API promises.
+- **Data lives in caches that know how to transfer themselves.** The
+ router transfers _its_ state (matches, `loaderData`, statuses); query
+ caches transfer theirs; the flight envelope keys them independently.
+ Nothing aggregates someone else's state.
+
+## Phase 1 — the bare pairing goes fully native (no Start exposure)
+
+The template path (`createRouter` + `RouterProvider` under Solid's
+renderer) never enters `createStartHandler`, so it can change freely.
+
+- **Registry match transfer.** _(Landed: `registryTransfer.ts`,
+ serialization in `RouterProvider`.)_ During server render the adapter
+ serializes each settled match's state content-addressed
+ (`tsr:` keys) — the pattern `solid-query`'s provider proved.
+ Still open within this bullet: promise-valued entries for matches
+ pending at render time (streaming SSR). This core has no per-match
+ settle promise, so it needs a dispatch-time hook; today pending matches
+ are skipped and the client boot falls through to current behavior.
+- **Hydration-claiming boot.** _(Landed: the `Router` constructor.)_
+ Match synchronously, prime match state from the registry, commit
+ without running loaders. Placement discovered to be load-bearing:
+ committing inside the hydration render desyncs the claiming walk's
+ registry bookkeeping even with writes moved off the owner — router
+ creation is the client's natural pre-render moment (after document
+ parse, before `hydrate()`). Route chunks resolve at the read point via
+ Solid `lazy` semantics. This deleted the template's `bootLoad` (and its
+ URL-divergence reload guard) and the prefetch-pausing flag outright —
+ verified on the production template: zero server-function requests at
+ boot, hydration clean, single-flight unchanged.
+- **Boundary parity.** _(Already true on this line.)_ The adapter's
+ boundary structure is symmetric between server and client
+ (`_resolveMatchesLoadingBoundary` consults no hydration state), so
+ `disableGlobalCatchBoundary` is no longer a parity workaround — it
+ survives as a semantic choice: let errors (including SSR-thrown
+ `redirect()`) bubble past the router to app-owned boundaries and the
+ stream handler. The template's comment was corrected to say so.
+
+## Phase 2 — Start rides it behind the existing contract
+
+`start-server-core` orchestrates through `attachRouterServerSsrUtils`,
+`dehydrate()`/`hydrate()`, and the stream handler — that contract is
+shared core and stays intact as a facade. Within it, the Solid
+`defaultStreamHandler`/`renderRouterToStream` source the transfer from the
+registry channel instead of `__TSR_SSR__` script injection wherever both
+exist; user `dehydrate`/`hydrate` hooks keep working. The flight collector
+already went through this door: `loadFlightTarget` absorbed the
+event-derivation half, and its extraction half shrinks further once match
+state is registry-addressed.
+
+**Regression gate:** the three Solid Start e2e suites
+(`basic-solid-query`, `server-functions`, `server-routes` — 37 tests,
+including redirect-from-query on both mount and SSR paths, and the
+transition semantics) all run locally today and define "didn't break
+Start."
+
+## Phase 3 — upstream
+
+Once both runs are proven, propose the defaults upstream with working
+code and measured deltas (payload double-ship eliminated, boot code
+deleted, boundary workaround gone), the same argument shape as #8193 one
+layer deeper. React/Vue adapters are untouched throughout;
+`router-ssr-query-core`'s transport remains correct for frameworks
+without a native channel.
+
+## Open questions
+
+- Match key identity: route id + params hash vs match id — needs to be
+ stable across server/client and across redirects into the same route.
+- `loaderData` streaming semantics vs the existing deferred API: a
+ promise-valued registry entry makes deferred _transfer_ free, but the
+ read-side API compatibility needs mapping.
+- Scroll restoration and `__TSR_SSR__` consumers beyond match state
+ (manifest/asset injection) — inventory what else rides the script
+ channel before swapping it.
+- Where the SSR teardown lands for router state (the query cache got
+ cancel+clear on render disposal; matches may want the same).
diff --git a/_artifacts/domain_map.yaml b/_artifacts/domain_map.yaml
index 0b2672f0c6..4b5d6f8386 100644
--- a/_artifacts/domain_map.yaml
+++ b/_artifacts/domain_map.yaml
@@ -147,15 +147,13 @@ skills:
context types to not flow into loader.
wrong_pattern: |
createFileRoute('/posts')({
- loader: ({ context }) =>
- context.queryClient.query({ ...postsQuery, staleTime: 'static' }),
+ loader: ({ context }) => context.queryClient.ensureQueryData(postsQuery),
beforeLoad: ({ context }) => ({ queryClient: context.queryClient }),
})
correct_pattern: |
createFileRoute('/posts')({
beforeLoad: ({ context }) => ({ queryClient: context.queryClient }),
- loader: ({ context }) =>
- context.queryClient.query({ ...postsQuery, staleTime: 'static' }),
+ loader: ({ context }) => context.queryClient.ensureQueryData(postsQuery),
})
source: 'docs/router/eslint/create-route-property-order.md'
priority: HIGH
@@ -538,7 +536,7 @@ skills:
- '@tanstack/react-router-ssr-query'
covers:
- External cache coordination pattern
- - "queryClient.query with staleTime: 'static' in loader"
+ - queryClient.ensureQueryData in loader
- useSuspenseQuery in components
- setupRouterSsrQueryIntegration
- defaultPreloadStaleTime
@@ -581,11 +579,11 @@ skills:
priority: HIGH
status: active
- - mistake: 'Awaiting a fire-and-forget query in loader blocks rendering'
+ - mistake: 'Awaiting prefetchQuery in loader blocks rendering'
mechanism: >-
- For streaming/deferred patterns, start a query without awaiting
- it and handle failures with catch(noop) — it starts fetching on
- the server and streams without blocking. Awaiting defeats the purpose.
+ For streaming/deferred patterns, prefetchQuery should NOT
+ be awaited in the loader — it starts fetching on server
+ and streams without blocking. Awaiting defeats the purpose.
source: 'docs/router/integrations/query.md'
priority: MEDIUM
status: active
diff --git a/_artifacts/skill_spec.md b/_artifacts/skill_spec.md
index 7eb9554a42..4503afb48a 100644
--- a/_artifacts/skill_spec.md
+++ b/_artifacts/skill_spec.md
@@ -83,11 +83,11 @@ TanStack Router is a type-safe router for React and Solid applications with buil
### external-data-loading (3 failure modes)
-| # | Mistake | Priority | Source | Cross-skill? |
-| --- | ----------------------------------------------------------- | -------- | -------------------------------- | ------------ |
-| 1 | Not setting defaultPreloadStaleTime to 0 | HIGH | docs/guide/external-data-loading | — |
-| 2 | Creating QueryClient outside createRouter for SSR | HIGH | docs/guide/external-data-loading | — |
-| 3 | Awaiting a fire-and-forget query in loader blocks rendering | MEDIUM | docs/integrations/query | — |
+| # | Mistake | Priority | Source | Cross-skill? |
+| --- | ------------------------------------------------- | -------- | -------------------------------- | ------------ |
+| 1 | Not setting defaultPreloadStaleTime to 0 | HIGH | docs/guide/external-data-loading | — |
+| 2 | Creating QueryClient outside createRouter for SSR | HIGH | docs/guide/external-data-loading | — |
+| 3 | Awaiting prefetchQuery in loader blocks rendering | MEDIUM | docs/integrations/query | — |
### auth-and-guards (3 failure modes)
diff --git a/_artifacts/skill_tree.yaml b/_artifacts/skill_tree.yaml
index 6f7c4c8742..ec38a04bdd 100644
--- a/_artifacts/skill_tree.yaml
+++ b/_artifacts/skill_tree.yaml
@@ -246,7 +246,7 @@ skills:
package: 'packages/react-router'
description: >-
Integrating TanStack Router with TanStack Query: queryClient
- in router context, static queries and fire-and-forget queries in loaders,
+ in router context, ensureQueryData/prefetchQuery in loaders,
useSuspenseQuery in components, defaultPreloadStaleTime: 0,
setupRouterSsrQueryIntegration for SSR dehydration/hydration
and streaming, per-request QueryClient isolation.
diff --git a/benchmarks/AGENTS.md b/benchmarks/AGENTS.md
deleted file mode 100644
index 9d56a2411a..0000000000
--- a/benchmarks/AGENTS.md
+++ /dev/null
@@ -1,15 +0,0 @@
-# Benchmarks
-
-Read the relevant README before running benchmarks. Compare baseline and candidate with the same workload and production builds; add a focused case when existing scenarios miss the changed mechanism. Keep workloads and benchmark names stable for historical comparisons.
-
-| Changed behavior | Guide | Nx project |
-| ------------------------------------------ | ---------------------------------- | -------------------------------------------------------- |
-| Standalone Router navigation/rendering CPU | [client-nav](client-nav/README.md) | `@benchmarks/client-nav` |
-| Start request/SSR CPU | [ssr](ssr/README.md) | `@benchmarks/ssr` |
-| Client/server retention and allocations | [memory](memory/README.md) | `@benchmarks/memory-client`, `@benchmarks/memory-server` |
-
-Use `test:perf:` 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.
-
-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.
-
-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.
diff --git a/benchmarks/README.md b/benchmarks/README.md
deleted file mode 100644
index 94d2f31802..0000000000
--- a/benchmarks/README.md
+++ /dev/null
@@ -1,88 +0,0 @@
-# CPU simulation benchmarks
-
-`client-nav` measures navigation, mounting, and React/Solid hydration in
-Node/jsdom; `ssr` measures server requests.
-Both suites run through the CodSpeed Vitest integration in CPU simulation mode.
-
-## Worker runtime
-
-Every CPU benchmark project includes `cpuSimulationExecArgv()` from
-[`cpu-simulation.ts`](./cpu-simulation.ts). It augments CodSpeed's worker flags
-only during CPU simulation, including the legacy `instrumentation` mode.
-
-The pinned CodSpeed integration supplies `--no-opt`. In Node 24 this is an alias
-for `--no-turbofan`, so Maglev can still optimize and inline hot functions. The
-additional `--no-maglev` keeps the optimizing compiler out of the simulation.
-`--always-sparkplug` compiles baseline code on first use, so warmup does not leave
-functions approaching a later tier-up or batch-compilation threshold. The worker
-regression test checks that even a once-called function receives baseline code.
-The integration also omits the old `--no-scavenge-task` flag on Node 20 and
-newer, where V8 renamed it to `--no-minor-gc-task`. Supplying the renamed flag
-keeps minor GC tied to allocation pressure instead of scheduled foreground
-tasks. Both flags follow the fixes in
-[CodSpeed's Node 24 support](https://github.com/CodSpeedHQ/codspeed-node/commit/e3224e7872).
-
-`--initial-old-space-size=512` fixes the initial/minimum old-generation
-allocation budget at 512 MiB. Removing only this override after worker isolation
-left two Vue SSR scenarios with same-commit spreads above 2% in five full-suite
-repetitions. The paired default-heap comparison with stock incremental-marking
-tasks also exceeded 2%. Runtime comparisons and tested alternatives are recorded in
-[PR #8248](https://github.com/TanStack/router/pull/8248).
-
-This is a GC-policy tradeoff. Minor collections and allocation work remain
-measured, and CodSpeed still explicitly collects before measurement. However,
-V8 can skip automatic full collections below this old-generation budget, so the
-benchmark can omit some eventual full-GC CPU cost from increased object
-retention. Repeatability does not establish representative production GC
-frequency. The flag does not preallocate 512 MiB; the existing 4096 MiB maximum
-remains. See [V8's initial/minimum heap configuration](https://github.com/nodejs/node/blob/v24.8.0/deps/v8/src/heap/heap.cc#L5071).
-
-The configuration preserves CodSpeed's incremental-marking task settings; the
-additional `--no-incremental-marking-task` from the initial stabilization proposal
-has been removed.
-
-The flags are intentionally absent from ordinary Vitest timing and walltime runs.
-
-Changing simulation compiler settings changes the measurement baseline. Compare
-repeatability within each configuration before interpreting performance changes
-between configurations as router improvements or regressions.
-
-## Worker isolation
-
-Keep one SSR workload in each `speed*.bench.ts` file. These projects explicitly
-enable Vitest isolation; CodSpeed uses the forks pool, so every file receives a
-fresh worker. Multiple workloads in one file share the worker's runtime state,
-even though CodSpeed collects before each measurement. Later control cases
-remained noisy after the runtime flag corrections. Running the React plain
-dehydration and linked-CSS controls alone reduced their observed three-run spreads
-to 0.09% and 0.02% respectively.
-
-Variant files keep their workload names, request counts, concurrency, payloads
-and assertions. CodSpeed includes the file path in a benchmark's identity, so
-moved variants start a new history. The first workload keeps `speed.bench.ts`;
-the additional variants have descriptive file names alongside it. Type-check
-includes cover all of these files.
-
-## Streaming workload
-
-Deferred payloads in the SSR streaming scenario resolve after two task turns on
-Node. A real 1 ms timer lets elapsed host time decide which concurrent requests
-resolve together. Counted turns preserve the initial loading render and deferred
-payloads; the existing HTML assertions check both. These benchmarks execute in
-Node and use `setImmediate` directly.
-
-## Repeatability checks
-
-Dispatch the existing `Benchmarks` workflow against an unchanged branch:
-
-```sh
-gh workflow run benchmarks.yml --ref
-```
-
-Wait for each workflow run to finish before dispatching the next repetition at
-the same commit. The workflow also runs memory benchmarks; exclude those results
-when assessing CPU repeatability. Check that every repetition has all expected
-CPU results (currently 134), rather than inherited results from an earlier run.
-Compare each benchmark's minimum and maximum across repetitions; keep input data,
-navigation/request counts, builds, dependencies and Node version fixed when
-testing runtime configuration changes.
diff --git a/benchmarks/bundle-size/.gitignore b/benchmarks/bundle-size/.gitignore
index bd05a98cee..d5ced39aa3 100644
--- a/benchmarks/bundle-size/.gitignore
+++ b/benchmarks/bundle-size/.gitignore
@@ -6,6 +6,4 @@ scenarios/*/src/routeTree.gen.ts
results/*.json
results/*.md
results/*.js
-results/*.log
-results/runs/
!results/.gitkeep
diff --git a/benchmarks/bundle-size/README.md b/benchmarks/bundle-size/README.md
index 2185d6b43f..4d4d3dc2d3 100644
--- a/benchmarks/bundle-size/README.md
+++ b/benchmarks/bundle-size/README.md
@@ -29,102 +29,29 @@ Each package has `minimal` and `full` scenarios:
## Local Run
```bash
-pnpm benchmark:bundle-size:run
+pnpm nx run @benchmarks/bundle-size:build
```
Run one or more scenarios during local optimization:
```bash
-pnpm benchmark:bundle-size:run --scenario react-router.minimal
-pnpm benchmark:bundle-size:run --scenario react-router.minimal,react-router.full
+pnpm nx run @benchmarks/bundle-size:build -- --scenario react-router.minimal
+pnpm nx run @benchmarks/bundle-size:build -- --scenario react-router.minimal,react-router.full
```
-The runner calls `measure.mjs`, which builds the selected package projects through Nx. Full runs build the package projects for all scenarios.
-`pnpm benchmark:bundle-size` uses the Nx build cache for the full benchmark, then generates `current.json` with the current commit, branch, dirty status, and report timestamp. CI uses this command as well.
-
-Nx caches the bundles, `measurements.json`, and `benchmark-action.json`. Git metadata does not affect the build cache. The report preserves the original `measuredAt` and build duration when measurements come from cache; `generatedAt` records when the report was generated. Running `pnpm nx run @benchmarks/bundle-size:measure` directly produces only the cacheable outputs; run `node scripts/benchmarks/bundle-size/report.mjs` afterward to refresh `current.json`.
-
-If the required packages are already built and unchanged, skip that step:
+Filtered runs build only the package projects needed by selected scenarios. Full runs build all package projects needed by all scenarios. If the required packages are already built and unchanged, skip that step:
```bash
-pnpm benchmark:bundle-size:run --scenario react-router.minimal --skip-package-builds
+pnpm nx run @benchmarks/bundle-size:build -- --scenario react-router.minimal --skip-package-builds
```
This writes:
-- `benchmarks/bundle-size/results/measurements.json`
- `benchmarks/bundle-size/results/current.json`
- `benchmarks/bundle-size/results/benchmark-action.json`
-- `benchmarks/bundle-size/results/measure.log`
`current.json` includes run status, selected package build projects, per-scenario totals, per-file sizes, and the emitted JS files used for measurement. Dist paths use `scenarioDir`/`outDir`, e.g. `react-router.minimal` maps to `benchmarks/bundle-size/dist/react-router-minimal/`.
-The runner sets `CI=1` and `NX_DAEMON=false`. Successful runs print log locations and the existing `query` or `diff` summary.
-If a step fails, the runner stops with a nonzero exit code. It prints the last 40 log lines, limited to 8,000 characters.
-Full stdout and stderr stay in the log files. A positive bundle-size delta does not cause failure.
-
-For agent runs, use `pnpm --silent benchmark:bundle-size:run ...` to omit the package-manager command echo.
-
-### Phase Timings
-
-To diagnose measurement time, request a fresh run:
-
-```bash
-pnpm benchmark:bundle-size:run --scenario react-router.minimal --analysis --timings
-```
-
-The runner directly executes `measure.mjs` on every invocation, rebuilding the selected scenarios and recording fresh timings in `measure.log`. Its package-build step still uses Nx and may restore cached packages. Use `--skip-package-builds` only when those packages are already built and unchanged.
-
-`measure.mjs` also accepts `--timings` directly. Alternatively, set `BUNDLE_SIZE_TIMINGS=1`. Timing lines go to stderr with the prefix `[bundle-size:timing]` followed by JSON containing `phase`, `durationMs`, and, for scenario phases, `scenario`. They are diagnostics only and do not add fields to the size metrics.
-
-The cached `pnpm benchmark:bundle-size` / Nx build path can replay terminal output from an earlier execution, including old timing lines. Setting `BUNDLE_SIZE_TIMINGS=1` does not invalidate that cache or guarantee fresh timings. Use the direct runner above for timing investigations; refreshing `current.json` after a cache hit does not remeasure build time.
-
-- `package-builds`: elapsed time for the package-build invocation, including Nx startup/cache handling; omitted when package builds are skipped.
-- `scenario-build`: elapsed time for each scenario's build and cleanup.
-- `manifest-resolution`: manifest discovery, parsing, entry selection, and collection of all/initial JS file lists.
-- `gzip` / `brotli`: accumulated codec time across distinct files for each scenario, using Node's default compression settings. File reads and summation are excluded; initial files reuse already measured sizes.
-- `analysis`: source attribution, when `--analysis` is enabled.
-- `overall`: measurement execution through report/history writing. Module imports, process startup, and the outer runner's tests/report command are excluded.
-
-Phases that start also report elapsed work on failure; compression reports partial accumulated times before propagating the error. Timing records alone do not indicate success. `overall` contains the other phases, so nested timings must not be added to it. The phase breakdown also excludes overhead such as file reads and result writing, so its sum is not expected to equal `overall`.
-
-## Compare Optimization Candidates
-
-Before you change the implementation, save a named baseline:
-
-```bash
-pnpm benchmark:bundle-size:run --name baseline --scenario react-router.minimal,react-router.full
-```
-
-After you change the implementation, compare a candidate against that baseline:
-
-```bash
-pnpm benchmark:bundle-size:run --name candidate --baseline baseline \
- --scenario react-router.minimal,react-router.full \
- --test-projects @tanstack/router-core,@tanstack/react-router \
- -- tests/path.test.ts tests/link.test.tsx
-```
-
-`--test-projects` runs the selected Nx unit-test targets before measurement. Arguments after `--` go only to those tests.
-Tests and measurement run sequentially. Failed tests stop the runner before measurement, so old results cannot produce a misleading diff.
-Without `--test-projects`, the runner only measures bundles. Type tests, performance benchmarks, and e2e tests remain separate commands.
-
-Named runs store their metrics and logs in `benchmarks/bundle-size/results/runs//`. Existing named results cannot be overwritten.
-Without `--name`, runs replace `current.json` and the logs for the steps they run.
-Emitted bundles still use the shared `dist/` directory. To retain emitted bundles for a candidate, pass a separate `--dist-dir`.
-
-`--baseline` accepts a run name or a JSON file path, such as `--baseline ./baseline.json`.
-With `--scenario`, the comparison reports only the scenarios measured in the current run, even when the baseline contains more scenarios. Selected scenarios missing from the baseline remain visible with `n/a` for their baseline and deltas.
-Without `--scenario`, comparisons include scenarios from either result file.
-`--results-dir ` changes the results root, including the location of named runs.
-Use the same scenario selection and measurement flags for the baseline and candidate.
-
-For command reference, run:
-
-```bash
-pnpm benchmark:bundle-size:run --help
-```
-
## Local Query Tools
```bash
@@ -133,22 +60,18 @@ pnpm benchmark:bundle-size:diff --baseline /tmp/base-current.json --id react-rou
pnpm benchmark:bundle-size:history --id react-router.minimal --top-deltas 20
```
-Use `pnpm benchmark:bundle-size:diff --baseline /tmp/base-current.json --current-only` to compare only scenarios present in the current results. This applies to both text and `--json` output; an explicit `--id` takes precedence.
-
For source attribution, run an analysis build. This uses hidden source maps and writes source estimates into `current.json`; those estimates are for investigation only, not tracking.
```bash
-pnpm benchmark:bundle-size:run --scenario react-router.minimal --analysis
+pnpm nx run @benchmarks/bundle-size:build -- --scenario react-router.minimal --analysis
pnpm benchmark:bundle-size:analyze --id react-router.minimal --top-sources 30
```
-For a named run, pass `--current benchmarks/bundle-size/results/runs//current.json` to `query`, `diff`, or `analyze`.
-
## CI Reporting
- PR workflow generates a sticky comment with:
- - current gzip, initial gzip, raw, and Brotli values
- - per-metric deltas from the `main` baseline
+ - current gzip values
+ - baseline delta
- inline sparkline trend
- Pushes to `main` publish historical chart data to GitHub Pages via `benchmark-action/github-action-benchmark`.
diff --git a/benchmarks/bundle-size/package.json b/benchmarks/bundle-size/package.json
index ca34cd6cd7..47d61512b4 100644
--- a/benchmarks/bundle-size/package.json
+++ b/benchmarks/bundle-size/package.json
@@ -3,35 +3,17 @@
"private": true,
"type": "module",
"scripts": {
- "measure": "node ../../scripts/benchmarks/bundle-size/measure.mjs --skip-package-builds --measurements-only",
- "test:unit": "node --test ../../scripts/benchmarks/bundle-size/pr-report.test.mjs ../../scripts/benchmarks/bundle-size/run.test.mjs ../../scripts/benchmarks/bundle-size/report.test.mjs ../../scripts/benchmarks/bundle-size/build.test.mjs ../../scripts/benchmarks/bundle-size/compress.test.mjs ../../scripts/benchmarks/bundle-size/timings.test.mjs"
+ "build": "node ../../scripts/benchmarks/bundle-size/measure.mjs --skip-package-builds",
+ "test:unit": "node --test ../../scripts/benchmarks/bundle-size/pr-report.test.mjs"
},
"nx": {
"targets": {
- "measure": {
- "cache": true,
- "inputs": [
- "buildProduction",
- "^buildProduction",
- "dependentTaskOutputs",
- "{workspaceRoot}/scripts/benchmarks/bundle-size/measure.mjs",
- "{workspaceRoot}/scripts/benchmarks/bundle-size/compress.mjs",
- "{workspaceRoot}/scripts/benchmarks/bundle-size/timings.mjs",
- "{workspaceRoot}/scripts/benchmarks/bundle-size/report.mjs",
- {
- "runtime": "node --version"
- }
- ],
- "outputs": [
- "{projectRoot}/dist",
- "{projectRoot}/results/measurements.json",
- "{projectRoot}/results/benchmark-action.json"
- ],
+ "build": {
+ "cache": false,
"dependsOn": [
{
"projects": [
"@tanstack/react-router",
- "@tanstack/react-router-ssr-query",
"@tanstack/react-start",
"@tanstack/router-plugin",
"@tanstack/solid-router",
@@ -44,32 +26,32 @@
]
},
"test:unit": {
- "dependsOn": [],
"inputs": [
"default",
"^production",
- "{workspaceRoot}/scripts/benchmarks/bundle-size/*.mjs"
+ "{workspaceRoot}/scripts/benchmarks/bundle-size/pr-report.mjs",
+ "{workspaceRoot}/scripts/benchmarks/bundle-size/pr-report.test.mjs"
]
}
}
},
"dependencies": {
+ "@solidjs/web": "^2.0.0-rc.20",
"@tanstack/react-router": "workspace:^",
- "@tanstack/react-router-ssr-query": "workspace:^",
- "@tanstack/solid-router": "workspace:^",
- "@tanstack/vue-router": "workspace:^",
"@tanstack/react-start": "workspace:^",
+ "@tanstack/solid-router": "workspace:^",
"@tanstack/solid-start": "workspace:^",
+ "@tanstack/vue-router": "workspace:^",
"@tanstack/vue-start": "workspace:^",
- "@tanstack/react-query": "catalog:",
"react": "^19.0.0",
"react-dom": "^19.0.0",
- "solid-js": "^1.9.10",
+ "solid-js": "^2.0.0-rc.20",
"vue": "^3.5.16"
},
"devDependencies": {
- "@rsbuild/core": "^2.3.1",
+ "@rsbuild/core": "^2.1.0",
"@rsbuild/plugin-react": "^2.0.0",
+ "@solidjs/vite-plugin": "^3.0.0-next.54",
"@tanstack/router-plugin": "workspace:^",
"@types/react": "^19.0.8",
"@types/react-dom": "^19.0.3",
@@ -78,7 +60,6 @@
"@vitejs/plugin-vue-jsx": "^5.1.5",
"@typescript/native": "npm:typescript@^7.0.2",
"typescript": "npm:@typescript/typescript6@^6.0.2",
- "vite": "^8.0.14",
- "vite-plugin-solid": "^2.11.11"
+ "vite": "^8.0.14"
}
}
diff --git a/benchmarks/bundle-size/scenarios/react-start-full/rsbuild.config.ts b/benchmarks/bundle-size/scenarios/react-start-full/rsbuild.config.ts
index 349e11bec1..641de56234 100644
--- a/benchmarks/bundle-size/scenarios/react-start-full/rsbuild.config.ts
+++ b/benchmarks/bundle-size/scenarios/react-start-full/rsbuild.config.ts
@@ -6,7 +6,7 @@ const outDir = process.env.BUNDLE_SIZE_DIST_DIR ?? 'dist-rsbuild'
export default defineConfig({
logLevel: 'silent',
- plugins: [pluginReact(), tanstackStart()],
+ plugins: [pluginReact({ splitChunks: false }), tanstackStart()],
output: {
distPath: {
root: outDir,
diff --git a/benchmarks/bundle-size/scenarios/react-start-minimal/rsbuild.config.ts b/benchmarks/bundle-size/scenarios/react-start-minimal/rsbuild.config.ts
index 7d27421d4d..78752d0190 100644
--- a/benchmarks/bundle-size/scenarios/react-start-minimal/rsbuild.config.ts
+++ b/benchmarks/bundle-size/scenarios/react-start-minimal/rsbuild.config.ts
@@ -16,7 +16,7 @@ const startOptions = clientOutput
export default defineConfig({
logLevel: 'silent',
- plugins: [pluginReact(), tanstackStart(startOptions)],
+ plugins: [pluginReact({ splitChunks: false }), tanstackStart(startOptions)],
output: {
distPath: {
root: outDir,
diff --git a/benchmarks/bundle-size/scenarios/react-start-query-integration/src/router.tsx b/benchmarks/bundle-size/scenarios/react-start-query-integration/src/router.tsx
deleted file mode 100644
index 93b95f3148..0000000000
--- a/benchmarks/bundle-size/scenarios/react-start-query-integration/src/router.tsx
+++ /dev/null
@@ -1,17 +0,0 @@
-import { QueryClient } from '@tanstack/react-query'
-import { createRouter } from '@tanstack/react-router'
-import { setupRouterSsrQueryIntegration } from '@tanstack/react-router-ssr-query'
-import { routeTree } from './routeTree.gen'
-
-export function getRouter() {
- const queryClient = new QueryClient()
- const router = createRouter({
- routeTree,
- context: { queryClient },
- scrollRestoration: true,
- })
-
- setupRouterSsrQueryIntegration({ router, queryClient })
-
- return router
-}
diff --git a/benchmarks/bundle-size/scenarios/react-start-query-integration/src/routes/__root.tsx b/benchmarks/bundle-size/scenarios/react-start-query-integration/src/routes/__root.tsx
deleted file mode 100644
index ff1da4c304..0000000000
--- a/benchmarks/bundle-size/scenarios/react-start-query-integration/src/routes/__root.tsx
+++ /dev/null
@@ -1,24 +0,0 @@
-import {
- HeadContent,
- Outlet,
- Scripts,
- createRootRoute,
-} from '@tanstack/react-router'
-
-export const Route = createRootRoute({
- component: RootComponent,
-})
-
-function RootComponent() {
- return (
-
-
-
-
-
-
-
-
-
- )
-}
diff --git a/benchmarks/bundle-size/scenarios/react-start-query-integration/src/routes/index.tsx b/benchmarks/bundle-size/scenarios/react-start-query-integration/src/routes/index.tsx
deleted file mode 100644
index 76fb363538..0000000000
--- a/benchmarks/bundle-size/scenarios/react-start-query-integration/src/routes/index.tsx
+++ /dev/null
@@ -1,9 +0,0 @@
-import { createFileRoute } from '@tanstack/react-router'
-
-export const Route = createFileRoute('/')({
- component: IndexComponent,
-})
-
-function IndexComponent() {
- return hello world
-}
diff --git a/benchmarks/bundle-size/scenarios/react-start-query-integration/vite.config.ts b/benchmarks/bundle-size/scenarios/react-start-query-integration/vite.config.ts
deleted file mode 100644
index d4e4cd980d..0000000000
--- a/benchmarks/bundle-size/scenarios/react-start-query-integration/vite.config.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import { defineConfig } from 'vite'
-import viteReact from '@vitejs/plugin-react'
-import { tanstackStart } from '@tanstack/react-start/plugin/vite'
-
-export default defineConfig({
- plugins: [tanstackStart(), viteReact()],
-})
diff --git a/benchmarks/bundle-size/scenarios/solid-router-full/src/main.tsx b/benchmarks/bundle-size/scenarios/solid-router-full/src/main.tsx
index 505f79aee0..eaa48dd6c1 100644
--- a/benchmarks/bundle-size/scenarios/solid-router-full/src/main.tsx
+++ b/benchmarks/bundle-size/scenarios/solid-router-full/src/main.tsx
@@ -1,4 +1,4 @@
-import { render } from 'solid-js/web'
+import { render } from '@solidjs/web'
import { RouterProvider, createRouter } from '@tanstack/solid-router'
import { routeTree } from './routeTree.gen'
diff --git a/benchmarks/bundle-size/scenarios/solid-router-full/vite.config.ts b/benchmarks/bundle-size/scenarios/solid-router-full/vite.config.ts
index 9729ada0e8..c536beefe7 100644
--- a/benchmarks/bundle-size/scenarios/solid-router-full/vite.config.ts
+++ b/benchmarks/bundle-size/scenarios/solid-router-full/vite.config.ts
@@ -1,5 +1,5 @@
import { defineConfig } from 'vite'
-import solid from 'vite-plugin-solid'
+import solid from '@solidjs/vite-plugin'
import { tanstackRouter } from '@tanstack/router-plugin/vite'
export default defineConfig({
diff --git a/benchmarks/bundle-size/scenarios/solid-router-minimal/src/main.tsx b/benchmarks/bundle-size/scenarios/solid-router-minimal/src/main.tsx
index 210120b3f1..f7c0b4bc7f 100644
--- a/benchmarks/bundle-size/scenarios/solid-router-minimal/src/main.tsx
+++ b/benchmarks/bundle-size/scenarios/solid-router-minimal/src/main.tsx
@@ -1,4 +1,4 @@
-import { render } from 'solid-js/web'
+import { render } from '@solidjs/web'
import { RouterProvider, createRouter } from '@tanstack/solid-router'
import { routeTree } from './routeTree.gen'
diff --git a/benchmarks/bundle-size/scenarios/solid-router-minimal/vite.config.ts b/benchmarks/bundle-size/scenarios/solid-router-minimal/vite.config.ts
index 9729ada0e8..c536beefe7 100644
--- a/benchmarks/bundle-size/scenarios/solid-router-minimal/vite.config.ts
+++ b/benchmarks/bundle-size/scenarios/solid-router-minimal/vite.config.ts
@@ -1,5 +1,5 @@
import { defineConfig } from 'vite'
-import solid from 'vite-plugin-solid'
+import solid from '@solidjs/vite-plugin'
import { tanstackRouter } from '@tanstack/router-plugin/vite'
export default defineConfig({
diff --git a/benchmarks/bundle-size/scenarios/solid-start-deferred-hydration/vite.config.ts b/benchmarks/bundle-size/scenarios/solid-start-deferred-hydration/vite.config.ts
index 0bd21e64f4..8c3cc043ea 100644
--- a/benchmarks/bundle-size/scenarios/solid-start-deferred-hydration/vite.config.ts
+++ b/benchmarks/bundle-size/scenarios/solid-start-deferred-hydration/vite.config.ts
@@ -1,5 +1,5 @@
import { defineConfig } from 'vite'
-import solid from 'vite-plugin-solid'
+import solid from '@solidjs/vite-plugin'
import { tanstackStart } from '@tanstack/solid-start/plugin/vite'
export default defineConfig({
diff --git a/benchmarks/bundle-size/scenarios/solid-start-full/vite.config.ts b/benchmarks/bundle-size/scenarios/solid-start-full/vite.config.ts
index 0bd21e64f4..8c3cc043ea 100644
--- a/benchmarks/bundle-size/scenarios/solid-start-full/vite.config.ts
+++ b/benchmarks/bundle-size/scenarios/solid-start-full/vite.config.ts
@@ -1,5 +1,5 @@
import { defineConfig } from 'vite'
-import solid from 'vite-plugin-solid'
+import solid from '@solidjs/vite-plugin'
import { tanstackStart } from '@tanstack/solid-start/plugin/vite'
export default defineConfig({
diff --git a/benchmarks/bundle-size/scenarios/solid-start-minimal/vite.config.ts b/benchmarks/bundle-size/scenarios/solid-start-minimal/vite.config.ts
index 0bd21e64f4..8c3cc043ea 100644
--- a/benchmarks/bundle-size/scenarios/solid-start-minimal/vite.config.ts
+++ b/benchmarks/bundle-size/scenarios/solid-start-minimal/vite.config.ts
@@ -1,5 +1,5 @@
import { defineConfig } from 'vite'
-import solid from 'vite-plugin-solid'
+import solid from '@solidjs/vite-plugin'
import { tanstackStart } from '@tanstack/solid-start/plugin/vite'
export default defineConfig({
diff --git a/benchmarks/bundle-size/scenarios/vue-router-full/src/routes/__root.tsx b/benchmarks/bundle-size/scenarios/vue-router-full/src/routes/__root.tsx
index 0ff40aebfc..d696063083 100644
--- a/benchmarks/bundle-size/scenarios/vue-router-full/src/routes/__root.tsx
+++ b/benchmarks/bundle-size/scenarios/vue-router-full/src/routes/__root.tsx
@@ -1,4 +1,3 @@
-import { defineComponent } from 'vue'
import {
Asset,
Await,
@@ -46,151 +45,143 @@ import {
useTags,
} from '@tanstack/vue-router'
-const RootComponent = defineComponent({
- setup() {
- const router = useRouter()
- const [awaited] = useAwaited({ promise: Promise.resolve('ready') })
- const linkProps = useLinkProps({ to: '/' } as any)
- const matchRoute = useMatchRoute()
- const matches = useMatches()
- const parentMatches = useParentMatches()
- const childMatches = useChildMatches()
- const match = useMatch({ strict: false, shouldThrow: false } as any)
- const loaderDeps = useLoaderDeps({ strict: false } as any)
- const loaderData = useLoaderData({ strict: false } as any)
- const params = useParams({ strict: false } as any)
- const search = useSearch({ strict: false } as any)
- const routeContext = useRouteContext({ strict: false } as any)
- const routerState = useRouterState({
- select: (state) => state.status,
- } as any)
- const location = useLocation()
- const canGoBack = useCanGoBack()
- const navigate = useNavigate()
- const scrollEntry = useElementScrollRestoration({ id: 'root-scroll' })
- const tags = useTags()
-
- useBlocker({
- shouldBlockFn: () => false,
- disabled: true,
- withResolver: false,
- })
-
- const linkFactoryResult = linkOptions({ to: '/' } as any)
- const routeMatchResult = matchRoute({ to: '/' } as any)
- const SvgLink = createLink('svg')
-
- const hooksAndComponents = [
- useAwaited,
- useLinkProps,
- useMatchRoute,
- useMatches,
- useParentMatches,
- useChildMatches,
- useMatch,
- useLoaderDeps,
- useLoaderData,
- useBlocker,
- useNavigate,
- useParams,
- useSearch,
- useRouteContext,
- useRouter,
- useRouterState,
- useLocation,
- useCanGoBack,
- useElementScrollRestoration,
- useTags,
- Await,
- CatchBoundary,
- CatchNotFound,
- ClientOnly,
- DefaultGlobalNotFound,
- ErrorComponent,
- Link,
- Match,
- MatchRoute,
- Matches,
- Navigate,
- Outlet,
- RouterContextProvider,
- ScrollRestoration,
- Block,
- ScriptOnce,
- Asset,
- HeadContent,
- Scripts,
- Body,
- Html,
- ]
-
- ;(globalThis as any).__TANSTACK_BUNDLE_SIZE_KEEP__ = {
- hooksAndComponents,
- }
-
- return () => {
- void awaited
- void linkFactoryResult
- void matches.value
- void parentMatches.value
- void childMatches.value
- void match.value
- void loaderDeps.value
- void loaderData.value
- void params.value
- void search.value
- void routeContext.value
- void routerState.value
- void location.value
- void canGoBack.value
- void navigate
- void scrollEntry
- void tags()
- void routeMatchResult.value
-
- return (
- <>
-
- {'window.__tsr_bundle_size = true'}
-
- home
-
-
-
-
- {() => }
-
- }>
-
-
- }
- />
- false} disabled withResolver={false}>
- {() => }
-
- }>
-
-
-
-
-
-
-
-
-
- >
- )
- }
- },
-})
-
export const Route = createRootRoute({
component: RootComponent,
})
+
+function RootComponent() {
+ const router = useRouter()
+ const [awaited] = useAwaited({ promise: Promise.resolve('ready') })
+ const linkProps = useLinkProps({ to: '/' } as any)
+ const matchRoute = useMatchRoute()
+ const matches = useMatches()
+ const parentMatches = useParentMatches()
+ const childMatches = useChildMatches()
+ const match = useMatch({ strict: false, shouldThrow: false } as any)
+ const loaderDeps = useLoaderDeps({ strict: false } as any)
+ const loaderData = useLoaderData({ strict: false } as any)
+ const params = useParams({ strict: false } as any)
+ const search = useSearch({ strict: false } as any)
+ const routeContext = useRouteContext({ strict: false } as any)
+ const routerState = useRouterState({ select: (state) => state.status } as any)
+ const location = useLocation()
+ const canGoBack = useCanGoBack()
+ const navigate = useNavigate()
+ const scrollEntry = useElementScrollRestoration({ id: 'root-scroll' })
+ const tags = useTags()
+
+ useBlocker({
+ shouldBlockFn: () => false,
+ disabled: true,
+ withResolver: false,
+ })
+
+ const linkFactoryResult = linkOptions({ to: '/' } as any)
+ const routeMatchResult = matchRoute({ to: '/' } as any)
+ const SvgLink = createLink('svg')
+
+ const hooksAndComponents = [
+ useAwaited,
+ useLinkProps,
+ useMatchRoute,
+ useMatches,
+ useParentMatches,
+ useChildMatches,
+ useMatch,
+ useLoaderDeps,
+ useLoaderData,
+ useBlocker,
+ useNavigate,
+ useParams,
+ useSearch,
+ useRouteContext,
+ useRouter,
+ useRouterState,
+ useLocation,
+ useCanGoBack,
+ useElementScrollRestoration,
+ useTags,
+ Await,
+ CatchBoundary,
+ CatchNotFound,
+ ClientOnly,
+ DefaultGlobalNotFound,
+ ErrorComponent,
+ Link,
+ Match,
+ MatchRoute,
+ Matches,
+ Navigate,
+ Outlet,
+ RouterContextProvider,
+ ScrollRestoration,
+ Block,
+ ScriptOnce,
+ Asset,
+ HeadContent,
+ Scripts,
+ Body,
+ Html,
+ ]
+
+ ;(globalThis as any).__TANSTACK_BUNDLE_SIZE_KEEP__ = {
+ hooksAndComponents,
+ }
+
+ void awaited
+ void linkFactoryResult
+ void matches.value
+ void parentMatches.value
+ void childMatches.value
+ void match.value
+ void loaderDeps.value
+ void loaderData.value
+ void params.value
+ void search.value
+ void routeContext.value
+ void routerState.value
+ void location.value
+ void canGoBack.value
+ void navigate
+ void scrollEntry
+ void tags()
+ void routeMatchResult.value
+
+ return (
+ <>
+
+ {'window.__tsr_bundle_size = true'}
+
+ home
+
+
+
+ {() => }
+ }>
+
+
+ }
+ />
+ false} disabled withResolver={false}>
+ {() => }
+
+ }>
+
+
+
+
+
+
+
+
+
+ >
+ )
+}
diff --git a/benchmarks/bundle-size/scenarios/vue-start-full/src/routes/__root.tsx b/benchmarks/bundle-size/scenarios/vue-start-full/src/routes/__root.tsx
index 8e8870a2ce..aa0539fa1a 100644
--- a/benchmarks/bundle-size/scenarios/vue-start-full/src/routes/__root.tsx
+++ b/benchmarks/bundle-size/scenarios/vue-start-full/src/routes/__root.tsx
@@ -1,4 +1,3 @@
-import { defineComponent } from 'vue'
import {
Asset,
Await,
@@ -69,159 +68,151 @@ const helloServerFn = createServerFn({ method: 'GET' })
return 'hello from server fn'
})
-const RootComponent = defineComponent({
- setup() {
- const router = useRouter()
- const [awaited] = useAwaited({ promise: Promise.resolve('ready') })
- const linkProps = useLinkProps({ to: '/' } as any)
- const matchRoute = useMatchRoute()
- const matches = useMatches()
- const parentMatches = useParentMatches()
- const childMatches = useChildMatches()
- const match = useMatch({ strict: false, shouldThrow: false } as any)
- const loaderDeps = useLoaderDeps({ strict: false } as any)
- const loaderData = useLoaderData({ strict: false } as any)
- const params = useParams({ strict: false } as any)
- const search = useSearch({ strict: false } as any)
- const routeContext = useRouteContext({ strict: false } as any)
- const routerState = useRouterState({
- select: (state) => state.status,
- } as any)
- const location = useLocation()
- const canGoBack = useCanGoBack()
- const navigate = useNavigate()
- const scrollEntry = useElementScrollRestoration({ id: 'root-scroll' })
- const tags = useTags()
- const invokeServerFn = useServerFn(helloServerFn)
-
- useBlocker({
- shouldBlockFn: () => false,
- disabled: true,
- withResolver: false,
- })
-
- const linkFactoryResult = linkOptions({ to: '/' } as any)
- const routeMatchResult = matchRoute({ to: '/' } as any)
- const SvgLink = createLink('svg')
-
- const startSurface = [createMiddleware, createServerFn, useServerFn]
- const hooksAndComponents = [
- useAwaited,
- useLinkProps,
- useMatchRoute,
- useMatches,
- useParentMatches,
- useChildMatches,
- useMatch,
- useLoaderDeps,
- useLoaderData,
- useBlocker,
- useNavigate,
- useParams,
- useSearch,
- useRouteContext,
- useRouter,
- useRouterState,
- useLocation,
- useCanGoBack,
- useElementScrollRestoration,
- useTags,
- Await,
- CatchBoundary,
- CatchNotFound,
- ClientOnly,
- DefaultGlobalNotFound,
- ErrorComponent,
- Link,
- Match,
- MatchRoute,
- Matches,
- Navigate,
- Outlet,
- RouterContextProvider,
- ScrollRestoration,
- Block,
- ScriptOnce,
- Asset,
- HeadContent,
- Scripts,
- Body,
- Html,
- ]
-
- ;(globalThis as any).__TANSTACK_BUNDLE_SIZE_KEEP__ = {
- hooksAndComponents,
- startSurface,
- }
-
- return () => {
- void awaited
- void linkFactoryResult
- void matches.value
- void parentMatches.value
- void childMatches.value
- void match.value
- void loaderDeps.value
- void loaderData.value
- void params.value
- void search.value
- void routeContext.value
- void routerState.value
- void location.value
- void canGoBack.value
- void navigate
- void scrollEntry
- void tags()
- void routeMatchResult.value
- void invokeServerFn
-
- return (
-
-
-
-
-
- {'window.__tsr_bundle_size = true'}
-
- home
-
-
-
-
- {() => }
-
- }>
-
-
- }
- />
- false} disabled withResolver={false}>
- {() => }
-
- }>
-
-
-
-
-
-
-
-
-
-
-
- )
- }
- },
-})
-
export const Route = createRootRoute({
component: RootComponent,
})
+
+function RootComponent() {
+ const router = useRouter()
+ const [awaited] = useAwaited({ promise: Promise.resolve('ready') })
+ const linkProps = useLinkProps({ to: '/' } as any)
+ const matchRoute = useMatchRoute()
+ const matches = useMatches()
+ const parentMatches = useParentMatches()
+ const childMatches = useChildMatches()
+ const match = useMatch({ strict: false, shouldThrow: false } as any)
+ const loaderDeps = useLoaderDeps({ strict: false } as any)
+ const loaderData = useLoaderData({ strict: false } as any)
+ const params = useParams({ strict: false } as any)
+ const search = useSearch({ strict: false } as any)
+ const routeContext = useRouteContext({ strict: false } as any)
+ const routerState = useRouterState({ select: (state) => state.status } as any)
+ const location = useLocation()
+ const canGoBack = useCanGoBack()
+ const navigate = useNavigate()
+ const scrollEntry = useElementScrollRestoration({ id: 'root-scroll' })
+ const tags = useTags()
+ const invokeServerFn = useServerFn(helloServerFn)
+
+ useBlocker({
+ shouldBlockFn: () => false,
+ disabled: true,
+ withResolver: false,
+ })
+
+ const linkFactoryResult = linkOptions({ to: '/' } as any)
+ const routeMatchResult = matchRoute({ to: '/' } as any)
+ const SvgLink = createLink('svg')
+
+ const startSurface = [createMiddleware, createServerFn, useServerFn]
+ const hooksAndComponents = [
+ useAwaited,
+ useLinkProps,
+ useMatchRoute,
+ useMatches,
+ useParentMatches,
+ useChildMatches,
+ useMatch,
+ useLoaderDeps,
+ useLoaderData,
+ useBlocker,
+ useNavigate,
+ useParams,
+ useSearch,
+ useRouteContext,
+ useRouter,
+ useRouterState,
+ useLocation,
+ useCanGoBack,
+ useElementScrollRestoration,
+ useTags,
+ Await,
+ CatchBoundary,
+ CatchNotFound,
+ ClientOnly,
+ DefaultGlobalNotFound,
+ ErrorComponent,
+ Link,
+ Match,
+ MatchRoute,
+ Matches,
+ Navigate,
+ Outlet,
+ RouterContextProvider,
+ ScrollRestoration,
+ Block,
+ ScriptOnce,
+ Asset,
+ HeadContent,
+ Scripts,
+ Body,
+ Html,
+ ]
+
+ ;(globalThis as any).__TANSTACK_BUNDLE_SIZE_KEEP__ = {
+ hooksAndComponents,
+ startSurface,
+ }
+
+ void awaited
+ void linkFactoryResult
+ void matches.value
+ void parentMatches.value
+ void childMatches.value
+ void match.value
+ void loaderDeps.value
+ void loaderData.value
+ void params.value
+ void search.value
+ void routeContext.value
+ void routerState.value
+ void location.value
+ void canGoBack.value
+ void navigate
+ void scrollEntry
+ void tags()
+ void routeMatchResult.value
+ void invokeServerFn
+
+ return (
+
+
+
+
+
+ {'window.__tsr_bundle_size = true'}
+
+ home
+
+
+
+ {() => }
+ }>
+
+
+ }
+ />
+ false} disabled withResolver={false}>
+ {() => }
+
+ }>
+
+
+
+
+
+
+
+
+
+
+
+ )
+}
diff --git a/benchmarks/client-nav/README.md b/benchmarks/client-nav/README.md
index ec34ecc0c1..6179c7f0b8 100644
--- a/benchmarks/client-nav/README.md
+++ b/benchmarks/client-nav/README.md
@@ -9,11 +9,10 @@ Cross-framework client-side CPU benchmarks for:
The benchmarks run in jsdom against production builds of real apps, and are
tracked in CI by CodSpeed (simulation mode).
-> **Scope:** these benchmarks cover the client router. The hydration
-> scenarios also cover DOM hydration and the Router state-restoration path
-> used by Start. Start-specific entry-point initialization, streamed payload
-> arrival and client server-function calls are not included. Server request work
-> is covered by `benchmarks/ssr`.
+> **Scope:** these benchmarks cover the standalone client router only. The
+> client side of TanStack Start (hydration of a server-rendered document,
+> streamed payload consumption, server-function calls from the client, ...) is
+> not covered here; the server side of Start is covered by `benchmarks/ssr`.
## Layout
@@ -39,7 +38,7 @@ scenarios///
routes/
```
-Navigation scenario apps use file-based routing (`@tanstack/router-plugin`) with a
+Scenario apps use file-based routing (`@tanstack/router-plugin`) with a
generated `routeTree.gen.ts`, like a regular user app. Each scenario uses one
app per framework instead of sharing routes in the baseline app. This keeps
route-tree size and router options isolated so one scenario cannot shift
@@ -58,11 +57,9 @@ be attributed to a specific feature area.
| `control-flow` | Loader-thrown `redirect` (including a 2-hop chain), `notFound()` with `notFoundComponent`, loader errors with `errorComponent`, and boundary reset on recovery navigation. |
| `head` | `HeadContent` per-navigation work: nested route `head()` evaluation, title/meta/link dedupe across matches, and head tag DOM updates during navigation. |
| `history` | History push/replace/back/forward traversal, location masking, registered-but-never-blocking `useBlocker`, and `useCanGoBack`/`useLocation` subscriptions. |
-| `hydration` | Initial DOM hydration: execute the SSR payload, restore `beforeLoad` context and loader data, and hydrate 192 ordinary and eight hash-sensitive Links through their follow-up effects in React and Solid. |
-| `link-churn` | Links that depart, stay and mount: 30 `/hub` layout Links stay while 100 `/hub/list` leaf Links leave (alone, or with the layout to `/other`) and remount on return; a search-only change rebuilds updater and `to="."` Links. Unlike `links`, whose root-layout Links never depart. |
| `links` | Per-navigation cost of ~200 mounted ` `s: link prop building, active-state recompute across `activeOptions` variants, `activeProps` swaps, and `useMatchRoute` probes (the `MatchRoute` component is avoided: vue-router's implementation leaks one subscription per render). |
| `loaders` | Client loader dispatch: always-stale re-runs (`staleTime: 0`), cached revisits (re-run once per lap by the `invalidate` step), `loaderDeps`-keyed caching, `router.invalidate()`, and `useLoaderData` selectors. |
-| `mount` | Cold start: `createRouter` (route-tree processing) + first render + initial `router.load()` + unmount, with a fresh router per mount. |
+| `mount` | Cold start: `createRouter` (route-tree processing) + first render + initial `router.load()` + unmount, with a fresh router per mount. The only scenario measuring router creation. |
| `nested-params` | Deep nesting (8 dynamic levels): per-level `params.parse`/`stringify`, `beforeLoad` context accumulation across matches, and per-level `useParams`/`useRouteContext` subscriptions. Param values include characters requiring percent-encoding (as do `route-tree-scale`'s), so segment encode/decode paths run on every navigation. |
| `preload` | Intent preloading from hover events, programmatic `router.preloadRoute`, deterministic preload cache behavior (`defaultPreloadStaleTime: 0`), and commit-time cache maintenance. |
| `rewrites` | Composed client-side location rewrites: router `basepath` plus a locale input/output rewrite pair, running on every href build and location parse (the client analog of the SSR `rewrites` scenario). |
@@ -71,14 +68,10 @@ be attributed to a specific feature area.
## Conventions
-The hydration scenario has the separate lifecycle described below. The other
-scenarios follow these navigation/mount conventions:
-
- Apps are built with `NODE_ENV=production` (`minify: false`) into `dist/app.js`; benches import the built bundle, so production package builds and production JSX output are measured, not dev transforms.
- Scenarios behave like a real user app: navigation happens through ` ` 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.
- 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.
- 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.
-- 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.
- 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.
- 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.
- 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).
@@ -103,7 +96,7 @@ Run a single scenario app manually (after building it through Nx):
```bash
CI=1 NX_DAEMON=false pnpm nx run @benchmarks/client-nav--:build:client --outputStyle=stream --skipRemoteCache
-cd benchmarks/client-nav && NODE_ENV=production vitest bench --mode benchmark --config ./scenarios///vite.config.ts
+cd benchmarks/client-nav && NODE_ENV=production vitest bench --config ./scenarios///vite.config.ts
```
Run framework-specific flame benchmarks (10 second loop, profiled with `@platformatic/flame`, forced to `NODE_ENV=production`):
@@ -122,186 +115,3 @@ Typecheck benchmark sources (baseline + scenarios):
```bash
CI=1 NX_DAEMON=false pnpm nx run @benchmarks/client-nav:test:types --outputStyle=stream --skipRemoteCache
```
-
-## Hydration
-
-`scenarios/hydration/{react,solid}` provide the same initial-hydration
-workload: 192 ordinary Links, eight hash-sensitive Links, and three matched
-routes with three `beforeLoad` contexts and two loader results. The server URL
-has no fragment; the client URL has `#details`, matching half of the hash-sensitive Links.
-
-```bash
-CI=1 NX_DAEMON=false pnpm nx run @benchmarks/client-nav-hydration-react:test:perf --outputStyle=stream --skipRemoteCache
-CI=1 NX_DAEMON=false pnpm nx run @benchmarks/client-nav-hydration-react:test:unit --outputStyle=stream --skipRemoteCache
-CI=1 NX_DAEMON=false pnpm nx run @benchmarks/client-nav-hydration-react:test:types:client --outputStyle=stream --skipRemoteCache
-```
-
-Replace `react` with `solid` to run the other adapter.
-
-The build generates static HTML and its real Router SSR bootstrap scripts once
-with `createRequestHandler` and the adapter's streaming renderer. Generation
-fully consumes the response and runs outside the CodSpeed action. The measured
-worker only reads these artifacts; it does not import a server renderer or start a server.
-
-Each invocation uses a fresh jsdom window and a fresh evaluation of the complete
-production client bundle in that window's realm. HTML parsing, bundle evaluation,
-and the initial document lifecycle finish in untimed setup. This resets module
-state as well as the DOM, avoiding cached hydration promises and cross-realm
-payload objects. The bundle and bootstrap scripts are compiled once, so this
-measures a fresh application with warm code, not JavaScript download/parse cost.
-
-The timed region executes the serialized payload, creates the router and its
-small code-based route tree, calls the public client `hydrate` API, and hydrates
-the existing DOM with the framework's native renderer:
-
-- **React:** a separate completion component signals from its post-hydration
- effect, after the same snapshot transition as hash-sensitive Links. The harness
- awaits that signal and two idle React scheduler turns, then checks the expected
- active links. The window's `performance.now()` is frozen, so React's
- scheduler yields only to paint after commits, not after 5 ms of wall time, which CPU
- instrumentation stretches by a runner-dependent factor. Each sample therefore
- uses the same number of scheduler tasks. `Date.now()` is unchanged. A
- 60-second watchdog fails a sample that never settles.
-- **Solid:** execute the native hydration bootstrap and retain the server's
- component/key hierarchy. Wait for mount, the router's rendered event, active-link
- effects, and two idle turns. DOM identity assertions include every workload
- element so template fallback cannot silently replace server nodes.
-
-Solid bounds settlement to 100 turns. Ending at the hydration call or the
-first mount would miss post-hydration Link updates.
-Timer turns use `setImmediate`; scrolling is a no-op
-because this is CPU simulation rather than browser layout/paint measurement.
-
-Untimed assertions verify restored contexts and every loader row, zero client
-`beforeLoad`/loader calls, expected hrefs/active state, original DOM-node identity,
-working event handlers, and absence of hydration errors. Root unmount, pending
-task cancellation, and window disposal also run outside measurement. Diagnostic
-tests count Link renders or reactive evaluations and check they stop before the
-measured region ends; counting is disabled in the timed workload.
-
-The bench's own `beforeEach`/`afterEach` hooks prepare and dispose every
-sample outside timing, in both CodSpeed and ordinary Vitest runs. Per-phase
-setup would let later iterations reuse an already hydrated document. The
-hydration unit tests cover repeated fresh-state setup.
-
-Each scenario is included in its framework's aggregate build and CodSpeed run.
-Land the benchmark independently to establish main's baseline before comparing a
-hydration optimization. Regenerate each revision's artifacts with identical
-fixture data and dependencies; do not pin an old hydration wire format forever.
-
-## Isolated route-tree construction
-
-`scenarios/route-tree-scale` measures navigation over an existing tree, not
-construction. `scenarios/mount` includes construction but also rendering and
-loading. To isolate initialization, use the core construction benchmark:
-
-```bash
-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
-```
-
-It covers 100, 1,000, and 10,000 static, dynamic, nested, or mixed routes.
-The processing-only case creates fresh route objects in an untimed
-`beforeEach`, then measures `processRouteTree` and `route.init`. A separate
-case includes route-object creation. Neither case measures first interpolation
-or navigation. Remove the name filter to run all sizes. Compare identical
-benchmark sources in separate checkouts and repeat fresh processes; a cached
-router or repeatedly initialized tree is not a construction baseline.
-
-## Opt-in React Link performance suite
-
-`link-performance/` contains additional client-navigation and SSR workloads for
-focused Link work. They are **not included** in the regular client-nav/SSR
-aggregate projects or their CodSpeed build dependencies; they only run through
-the dedicated `@benchmarks/react-link-performance` targets below. Use `-t` to
-narrow a run to specific cases.
-
-```bash
-CI=1 NX_DAEMON=false pnpm nx run @benchmarks/react-link-performance:test:perf:client --outputStyle=stream --skipRemoteCache -- --run
-CI=1 NX_DAEMON=false pnpm nx run @benchmarks/react-link-performance:test:perf:ssr --outputStyle=stream --skipRemoteCache -- --run
-
-# Select a feature and save the normal Vitest JSON report.
-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
-```
-
-The cases cover repeated versus unique destination params, updater functions,
-relative/inherited values, search middleware chains, param stringification,
-optional and splat segments, encoding, masks, basepath/rewrites, and active
-props with structured search. These exercise different costs: cache hits and
-misses, parameter cloning, callbacks, middleware traversal, URI encoding,
-building masked/public locations, active-state comparisons, and prop merging.
-Existing preload, mount, and route-tree-scale scenarios remain responsible for
-those separate workloads.
-
-- **Client:** 200 persistent measured Links, four control Links, and eight
- completed navigations per timed batch. The existing client harness checks
- hrefs and active state during its untimed warm-up lap. Control navigations
- replace the history entry, keeping history size constant. Post-measurement
- assertions also check that the measured anchors stayed mounted.
-- **SSR:** four fresh-router requests per timed batch, each rendering 200
- measured Links through `RouterProvider` and `renderToString`. Router creation,
- `router.load()`, rendering, and history cleanup are included. This isolates
- Router SSR Link work, not Start HTTP handling, dehydration, or streaming.
- HTML assertions run outside the timed batch.
-- Both use the same code-based workload definitions and production JSX/library
- builds. The regular Vitest entry points use at least 100 warm-up iterations,
- one second of warm-up time, and five-second measurement windows. The client
- and server bundles assert their resolved `isServer` environment. React and
- React DOM remain external so comparisons can share the same renderer runtime.
- These bundles are Node-hosted (jsdom for client mode), not browser deployments.
-
-Run the gate tests and typecheck separately:
-
-```bash
-CI=1 NX_DAEMON=false pnpm nx run @benchmarks/react-link-performance:test:unit --outputStyle=stream --skipRemoteCache
-CI=1 NX_DAEMON=false pnpm nx run @benchmarks/react-link-performance:test:types --outputStyle=stream --skipRemoteCache
-```
-
-For before/after comparisons, use identical benchmark files and dependencies
-on both refs, build each ref through its Nx targets, and alternate fresh
-Vitest processes. Report the actual refs, per-case means and relative margins
-of error; rerun noisy or borderline results with `-t` rather than interpreting
-a small difference as a proven speedup. Client and SSR times have different
-batch units and should not be compared directly.
-
-### Stable paired comparisons
-
-For regression decisions, prefer the paired runner over a whole-file Vitest
-run. It starts a fresh process for every case and repetition, avoiding JIT
-feedback from earlier cases. Inside each process, both revisions share the
-same production React installation but have separate router/app modules and
-router instances. Initialization order alternates between repetitions.
-Built snapshots are staged under `node_modules/.cache` so the TypeScript
-harness loader does not transpile their emitted JavaScript a second time.
-
-```bash
-# Build the baseline using these same benchmark sources in its own checkout.
-# --baseline points to that checkout's link-performance/dist directory.
-pnpm nx run @benchmarks/react-link-performance:test:perf:stable -- \
- --baseline /path/to/baseline/benchmarks/client-nav/link-performance/dist \
- --outputJson /tmp/paired-links.json
-
-# Narrow a comparison, or increase independent process repetitions.
-pnpm nx run @benchmarks/react-link-performance:test:perf:stable -- \
- --baseline /path/to/baseline/benchmarks/client-nav/link-performance/dist \
- --mode ssr -t "middleware|unique-params" --repeats 6 \
- --outputJson /tmp/paired-links-ssr.json
-```
-
-The runner requires Node with `process.threadCpuUsage` (Node 24 works).
-It fixes V8 random/hash seeds, warms each variant for at least two seconds
-and 100 batches, then alternates ABBA/BAAB blocks calibrated to roughly 500 ms.
-Both variants do exactly the same number of batches per block. It records
-main-thread CPU time, wall time, and whole-process CPU time; GC during
-measurement is not disabled or discarded.
-
-The default is four independent process repetitions. Reported 95% intervals
-use their paired log-ratios, not the many correlated batches as independent
-samples. A faster/slower verdict requires CPU and wall intervals to agree.
-Intervals overlapping zero or disagreeing metrics are inconclusive; narrow
-intervals entirely inside +/-2% are reported separately.
-
-An A/A calibration uses the current `dist` directory as `--baseline`. Its
-intervals should contain zero before trusting similarly sized A/B differences.
-Shared-machine contention can still make small changes unresolved. Do not
-interpret a point estimate alone, or an inconclusive result, as proof that
-a workload is unchanged.
diff --git a/benchmarks/client-nav/link-performance/cases.ts b/benchmarks/client-nav/link-performance/cases.ts
deleted file mode 100644
index a25eac563b..0000000000
--- a/benchmarks/client-nav/link-performance/cases.ts
+++ /dev/null
@@ -1,360 +0,0 @@
-export const LINK_CASES = [
- {
- id: 'shared-params',
- label: 'Shared string params',
- description: '200 persistent Links reuse 40 string parameter values.',
- },
- {
- id: 'unique-params',
- label: 'Unique string params',
- description: '200 distinct parameter values exceed the 128-result cache.',
- },
- {
- id: 'param-updaters',
- label: 'Parameter updaters',
- description: 'Parameter functions derive destinations from current params.',
- },
- {
- id: 'location-updaters',
- label: 'Search, hash and state updaters',
- description:
- 'Functions derive search, hash and history state from the source.',
- },
- {
- id: 'relative',
- label: 'Relative targets',
- description: 'Parent and child targets inherit current params and search.',
- },
- {
- id: 'middleware',
- label: 'Search middleware chain',
- description:
- 'Retain a tenant, strip a default page and normalize a filter.',
- },
- {
- id: 'numeric-params',
- label: 'Numeric params',
- description: 'Parse numbers, update them numerically and stringify them.',
- },
- {
- id: 'optional-params',
- label: 'Optional segments',
- description: 'Set, inherit and explicitly clear an optional path segment.',
- },
- {
- id: 'splats',
- label: 'Splat params',
- description: 'Empty, multi-segment and encoded splat values.',
- },
- {
- id: 'encoding',
- label: 'Allowed path characters',
- description: 'Preserve allowed @, : and + while encoding other characters.',
- },
- {
- id: 'masks',
- label: 'Explicit route masks',
- description:
- 'Build a different public path and search for each destination.',
- },
- {
- id: 'rewrites',
- label: 'Basepath and rewrites',
- description: 'Compose /app with input/output locale path rewrites.',
- },
- {
- id: 'active',
- label: 'Active props and structured search',
- description:
- 'Exact, fuzzy and search matching with props and render children.',
- },
-] as const
-
-export type LinkCaseId = (typeof LINK_CASES)[number]['id']
-
-export const LINK_COUNT = 200
-export const NAVIGATION_STATES = [1, 2, 3, 0] as const
-export const LOCALES = ['en', 'fr', 'de', 'es'] as const
-
-export interface Filter {
- tag: string
- flags: { open: boolean }
- tags: Array
-}
-
-export interface LinkSearch {
- page?: number
- tenant?: string
- filter?: Filter
-}
-
-export function sourceFilter(index: number): Filter {
- return {
- tag: `group-${index}`,
- flags: { open: index % 2 === 0 },
- tags: ['links', `state-${index}`],
- }
-}
-
-export function sourceSearch(
- caseId: LinkCaseId,
- stateIndex: number,
-): Partial {
- switch (caseId) {
- case 'location-updaters':
- case 'relative':
- case 'middleware':
- case 'active':
- return {
- page: stateIndex + 1,
- tenant: `tenant-${stateIndex}`,
- filter: sourceFilter(stateIndex),
- }
- case 'rewrites':
- return { tenant: LOCALES[stateIndex] }
- default:
- return {}
- }
-}
-
-export function optionalCategory(stateIndex: number) {
- return stateIndex % 2 === 0 ? `category-${stateIndex}` : undefined
-}
-
-export function splatValue(index: number) {
- switch (index % 4) {
- case 0:
- return ''
- case 1:
- return `folder/sub/file-${index % 40}`
- case 2:
- return 'a b/100%/caf\u00e9?#'
- default:
- return 'literal%2F/\u{1f680}'
- }
-}
-
-export function encodedValue(index: number) {
- return `user-${index % 40}@mail.test:tag+value /?#% caf\u00e9`
-}
-
-function url(pathname: string, search: Partial = {}, hash = '') {
- const result = new URL(pathname, 'http://localhost')
- for (const [key, value] of Object.entries(
- search,
- )) {
- if (value !== undefined) {
- result.searchParams.set(
- key,
- typeof value === 'object' ? JSON.stringify(value) : String(value),
- )
- }
- }
- result.hash = hash
- return result.pathname + result.search + result.hash
-}
-
-function sourcePath(caseId: LinkCaseId, stateIndex: number) {
- switch (caseId) {
- case 'relative':
- return `/teams/team-${stateIndex}/item-${stateIndex}`
- case 'numeric-params':
- return `/numbers/${stateIndex}`
- case 'optional-params': {
- const category = optionalCategory(stateIndex)
- return `/optional/${category ? `${category}/` : ''}item-${stateIndex}`
- }
- case 'splats':
- return `/files/source/state-${stateIndex}`
- case 'encoding':
- return `/encoded/source-${stateIndex}`
- case 'active':
- return `/items/item-${stateIndex}/details`
- default:
- return `/items/item-${stateIndex}`
- }
-}
-
-export function getSourceUrl(caseId: LinkCaseId, stateIndex: number): string {
- if (!Number.isInteger(stateIndex) || stateIndex < 0 || stateIndex > 3) {
- throw new Error(`Invalid Link performance state: ${stateIndex}`)
- }
- const pathname = sourcePath(caseId, stateIndex)
- if (caseId === 'rewrites') {
- return `/app/${LOCALES[stateIndex]}${pathname}`
- }
- return url(
- pathname,
- sourceSearch(caseId, stateIndex),
- caseId === 'location-updaters' ? `source-${stateIndex}` : '',
- )
-}
-
-// These expectations use fixture values and platform encoding, not router APIs.
-function expectedHref(caseId: LinkCaseId, stateIndex: number, index: number) {
- const itemId = `item-${index % 40}`
- switch (caseId) {
- case 'shared-params':
- return `/items/${itemId}`
- case 'unique-params':
- return `/items/item-${index}`
- case 'param-updaters':
- return `/items/item-${stateIndex}-related-${index % 40}`
- case 'location-updaters':
- return url(
- `/items/item-${stateIndex}`,
- {
- ...sourceSearch(caseId, stateIndex),
- page: stateIndex + 2 + (index % 5),
- },
- `source-${stateIndex}-link-${index % 5}`,
- )
- case 'relative':
- return url(
- index % 2 === 0
- ? `/teams/team-${stateIndex}`
- : `/teams/team-${stateIndex}/item-${stateIndex}/details`,
- sourceSearch(caseId, stateIndex),
- )
- case 'middleware':
- return url(`/filtered/${itemId}`, {
- tenant: `tenant-${stateIndex}`,
- page: index % 2 === 0 ? undefined : 2,
- filter: { ...sourceFilter(index % 4), tag: `LABEL-${index % 40}` },
- })
- case 'numeric-params':
- return `/numbers/${stateIndex + (index % 40)}`
- case 'optional-params': {
- const category =
- index % 3 === 0
- ? 'fixed'
- : index % 3 === 1
- ? optionalCategory(stateIndex)
- : undefined
- return `/optional/${category ? `${category}/` : ''}${itemId}`
- }
- case 'splats': {
- const value = splatValue(index)
- return `/files${value ? `/${value.split('/').map(encodeURIComponent).join('/')}` : ''}`
- }
- case 'encoding': {
- const value = encodeURIComponent(encodedValue(index))
- .replaceAll('%40', '@')
- .replaceAll('%3A', ':')
- .replaceAll('%2B', '+')
- return `/encoded/${value}`
- }
- case 'masks':
- return url(`/public/display-${index % 40}`, {
- tenant: `mask-${index % 4}`,
- })
- case 'rewrites':
- return url(`/app/${LOCALES[index % 4]}/items/${itemId}`, {
- page: (index % 3) + 1,
- })
- case 'active': {
- const item = Math.floor(index / 5)
- const variant = index % 5
- const search =
- variant < 3
- ? { filter: sourceFilter(item % 4) }
- : {
- ...sourceSearch('active', item % 4),
- ...(variant === 4 ? { filter: undefined } : {}),
- }
- return url(`/items/item-${item}${variant < 2 ? '' : '/details'}`, search)
- }
- }
-}
-
-function assertUrl(
- actualHref: string | null,
- expectedHref: string,
- label: string,
-) {
- if (actualHref === null) {
- throw new Error(`${label}: missing href`)
- }
- const actual = new URL(actualHref, 'http://localhost')
- const expected = new URL(expectedHref, 'http://localhost')
- // Query ordering and the platform's '+' versus '%20' are immaterial here.
- const query = (value: URL) =>
- JSON.stringify([...value.searchParams.entries()].sort())
- if (
- actual.origin !== expected.origin ||
- actual.pathname !== expected.pathname ||
- actual.hash !== expected.hash ||
- query(actual) !== query(expected)
- ) {
- throw new Error(
- `${label}: expected ${expectedHref}, received ${actualHref}`,
- )
- }
-}
-
-export function assertScenario(
- caseId: LinkCaseId,
- stateIndex: number,
- root: ParentNode,
-): void {
- const source = root.querySelector('[data-testid="source-path"]')
- if (source?.textContent !== sourcePath(caseId, stateIndex)) {
- throw new Error(
- `${caseId}/${stateIndex}: unexpected source path ${source?.textContent}`,
- )
- }
- const links = root.querySelectorAll('a[data-perf-link]')
- if (links.length !== LINK_COUNT) {
- throw new Error(
- `${caseId}: expected ${LINK_COUNT} Links, got ${links.length}`,
- )
- }
- for (const [index, link] of links.entries()) {
- const label = `${caseId}/${stateIndex}/link-${index}`
- if (link.getAttribute('data-perf-link') !== String(index)) {
- throw new Error(`${label}: unexpected Link order`)
- }
- assertUrl(
- link.getAttribute('href'),
- expectedHref(caseId, stateIndex, index),
- label,
- )
- let active: boolean | undefined
- if (caseId === 'shared-params') {
- active = index % 40 === stateIndex
- } else if (caseId === 'unique-params') {
- active = index === stateIndex
- } else if (caseId === 'active') {
- active =
- Math.floor(index / 5) === stateIndex && [0, 2, 3].includes(index % 5)
- if (
- link.textContent !== `${index}:${active ? 'active' : 'inactive'}` ||
- link.getAttribute('title') !== (active ? 'active' : 'inactive') ||
- !link.classList.contains(active ? 'perf-active' : 'perf-inactive') ||
- link.style.color !== (active ? 'green' : 'gray') ||
- link.style.opacity !== '0.8'
- ) {
- throw new Error(
- `${label}: active props or render children are incorrect`,
- )
- }
- }
- if (
- active !== undefined &&
- (link.getAttribute('data-status') === 'active') !== active
- ) {
- throw new Error(`${label}: expected active=${active}`)
- }
- }
- for (let state = 0; state < 4; state++) {
- const control = root.querySelector(`[data-testid="go-state-${state}"]`)
- if (!control || control.hasAttribute('data-perf-link')) {
- throw new Error(`${caseId}: missing or measured control Link ${state}`)
- }
- assertUrl(
- control.getAttribute('href'),
- getSourceUrl(caseId, state),
- `${caseId}/control-${state}`,
- )
- }
-}
diff --git a/benchmarks/client-nav/link-performance/client.bench.ts b/benchmarks/client-nav/link-performance/client.bench.ts
deleted file mode 100644
index f819fab52b..0000000000
--- a/benchmarks/client-nav/link-performance/client.bench.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-import { test } from 'vitest'
-import { benchLifecycle } from '../../cpu-simulation'
-import { LINK_CASES } from './cases'
-import { createClientScenario, samplingOptions } from './scenario'
-import type * as App from './src/client'
-
-const appModulePath = './dist/client/app.js'
-const app: typeof App = await import(/* @vite-ignore */ appModulePath)
-if (app.serverEnvironment !== false) {
- throw new Error('Link client benchmarks must use the production client build')
-}
-
-for (const { id, label } of LINK_CASES) {
- test(label, async ({ bench }) => {
- const scenario = createClientScenario(app, id)
- function finish() {
- try {
- scenario.check()
- } finally {
- scenario.teardown()
- }
- }
-
- await bench(
- `client Links: ${id}`,
- benchLifecycle({ before: scenario.setup, after: finish }),
- scenario.batch,
- ).run(samplingOptions)
- })
-}
diff --git a/benchmarks/client-nav/link-performance/config.test.ts b/benchmarks/client-nav/link-performance/config.test.ts
deleted file mode 100644
index 1a468a3169..0000000000
--- a/benchmarks/client-nav/link-performance/config.test.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-import { afterEach, describe, expect, test, vi } from 'vitest'
-import { createLinkPerformanceConfig } from './config'
-
-afterEach(() => vi.unstubAllEnvs())
-
-describe.each(['client', 'ssr'] as const)('%s configuration', (target) => {
- test('discovers only the requested suite', () => {
- const config = createLinkPerformanceConfig(target)
- expect(config.test?.benchmark?.include).toEqual([`${target}.bench.ts`])
- })
-
- test('builds production code for the correct environment', () => {
- const config = createLinkPerformanceConfig(target)
- expect(config.define?.['process.env.NODE_ENV']).toBe('"production"')
- expect(config.resolve?.conditions).toContain(
- target === 'ssr' ? 'node' : 'browser',
- )
- expect(config.build?.ssr).toBe(target === 'ssr')
- expect(config.build?.outDir).toBe(`./dist/${target}`)
- expect(config.build?.rolldownOptions?.platform).toBe('node')
- expect(config.build?.rolldownOptions?.external).toEqual([
- 'node:module',
- 'module',
- /^react(?:\/|$)/,
- /^react-dom(?:\/|$)/,
- ])
- })
-
- test('does not retransform built bundles in the test environment', () => {
- vi.stubEnv('VITEST', 'true')
- const config = createLinkPerformanceConfig(target)
- expect(config.ssr?.noExternal).toBeUndefined()
- expect(config.test?.server?.deps?.external).toEqual([
- /\/link-performance\/dist\//,
- ])
- })
-
- test('bundles router dependencies when building app snapshots', () => {
- vi.stubEnv('VITEST', undefined)
- expect(createLinkPerformanceConfig(target).ssr?.noExternal).toBe(true)
- })
-})
diff --git a/benchmarks/client-nav/link-performance/config.ts b/benchmarks/client-nav/link-performance/config.ts
deleted file mode 100644
index 416b027057..0000000000
--- a/benchmarks/client-nav/link-performance/config.ts
+++ /dev/null
@@ -1,69 +0,0 @@
-import { fileURLToPath } from 'node:url'
-import react from '@vitejs/plugin-react'
-import codspeedPlugin from '@codspeed/vitest-plugin'
-import type { UserConfig } from 'vite'
-
-const root = fileURLToPath(new URL('.', import.meta.url))
-
-export function createLinkPerformanceConfig(
- target: 'client' | 'ssr',
-): UserConfig {
- const server = target === 'ssr'
-
- return {
- root,
- define: {
- 'process.env.NODE_ENV': JSON.stringify('production'),
- },
- plugins: [
- !!(process.env.VITEST && process.env.WITH_INSTRUMENTATION) &&
- codspeedPlugin(),
- react(),
- ],
- resolve: {
- conditions: [server ? 'node' : 'browser', 'production'],
- },
- ssr: {
- noExternal: process.env.VITEST ? undefined : true,
- resolve: {
- conditions: ['node', 'production'],
- },
- },
- build: {
- outDir: `./dist/${target}`,
- emptyOutDir: true,
- minify: false,
- ssr: server,
- lib: {
- entry: `${root}src/${target}.tsx`,
- formats: ['es'],
- fileName: 'app',
- },
- rolldownOptions: {
- platform: 'node',
- external: [
- 'node:module',
- 'module',
- /^react(?:\/|$)/,
- /^react-dom(?:\/|$)/,
- ],
- output: { entryFileNames: 'app.js' },
- },
- },
- test: {
- name: `react-link-performance-${target}`,
- watch: false,
- environment: server ? 'node' : 'jsdom',
- setupFiles: server ? [] : ['../vitest.setup.ts'],
- server: {
- deps: {
- external: [/\/link-performance\/dist\//],
- },
- },
- include: [],
- benchmark: {
- include: [`${target}.bench.ts`],
- },
- },
- }
-}
diff --git a/benchmarks/client-nav/link-performance/project.json b/benchmarks/client-nav/link-performance/project.json
deleted file mode 100644
index fd1751c081..0000000000
--- a/benchmarks/client-nav/link-performance/project.json
+++ /dev/null
@@ -1,103 +0,0 @@
-{
- "name": "@benchmarks/react-link-performance",
- "projectType": "application",
- "tags": ["optional-benchmark"],
- "targets": {
- "build:client": {
- "executor": "nx:run-commands",
- "cache": false,
- "dependsOn": [
- {
- "projects": ["@tanstack/react-router"],
- "target": "build"
- }
- ],
- "options": {
- "command": "NODE_ENV=production vite build --config ./link-performance/vite.client.config.ts",
- "cwd": "benchmarks/client-nav"
- }
- },
- "build:ssr": {
- "executor": "nx:run-commands",
- "cache": false,
- "dependsOn": [
- {
- "projects": ["@tanstack/react-router"],
- "target": "build"
- }
- ],
- "options": {
- "command": "NODE_ENV=production vite build --config ./link-performance/vite.ssr.config.ts",
- "cwd": "benchmarks/client-nav"
- }
- },
- "test:perf:client": {
- "executor": "nx:run-commands",
- "cache": false,
- "dependsOn": ["build:client"],
- "options": {
- "command": "NODE_ENV=production vitest bench --mode benchmark --config ./link-performance/vite.client.config.ts",
- "cwd": "benchmarks/client-nav"
- }
- },
- "test:perf:ssr": {
- "executor": "nx:run-commands",
- "cache": false,
- "dependsOn": ["build:ssr"],
- "options": {
- "command": "NODE_ENV=production vitest bench --mode benchmark --config ./link-performance/vite.ssr.config.ts",
- "cwd": "benchmarks/client-nav"
- }
- },
- "test:perf:stable": {
- "executor": "nx:run-commands",
- "cache": false,
- "dependsOn": ["build:client", "build:ssr"],
- "options": {
- "command": "NODE_ENV=production node --import=@swc-node/register/esm-register benchmarks/client-nav/link-performance/stable-runner.ts"
- }
- },
- "test:unit": {
- "executor": "nx:run-commands",
- "inputs": [
- "...",
- "{workspaceRoot}/benchmarks/client-nav/scenarios/harness.ts",
- "{workspaceRoot}/benchmarks/client-nav/scenarios/links/shared.ts",
- "{workspaceRoot}/benchmarks/client-nav/setup-helpers.ts",
- "{workspaceRoot}/benchmarks/client-nav/tsconfig.json"
- ],
- "dependsOn": [
- {
- "projects": ["@tanstack/history"],
- "target": "build"
- }
- ],
- "options": {
- "command": "vitest run --config ./link-performance/vitest.config.ts",
- "cwd": "benchmarks/client-nav"
- }
- },
- "test:types": {
- "executor": "nx:run-commands",
- "inputs": [
- "...",
- "{workspaceRoot}/benchmarks/client-nav/jsdom.ts",
- "{workspaceRoot}/benchmarks/client-nav/scenarios/harness.ts",
- "{workspaceRoot}/benchmarks/client-nav/scenarios/links/shared.ts",
- "{workspaceRoot}/benchmarks/client-nav/setup-helpers.ts",
- "{workspaceRoot}/benchmarks/client-nav/tsconfig.json",
- "{workspaceRoot}/benchmarks/client-nav/vitest.setup.ts"
- ],
- "dependsOn": [
- {
- "projects": ["@tanstack/react-router"],
- "target": "build"
- }
- ],
- "options": {
- "command": "tsc -p ./link-performance/tsconfig.json --noEmit",
- "cwd": "benchmarks/client-nav"
- }
- }
- }
-}
diff --git a/benchmarks/client-nav/link-performance/scenario.ts b/benchmarks/client-nav/link-performance/scenario.ts
deleted file mode 100644
index f1a3fb6df7..0000000000
--- a/benchmarks/client-nav/link-performance/scenario.ts
+++ /dev/null
@@ -1,114 +0,0 @@
-import { JSDOM } from 'jsdom'
-import { createScenarioSetup } from '../scenarios/harness'
-import { ticksPerIteration } from '../scenarios/links/shared'
-import { NAVIGATION_STATES, assertScenario, getSourceUrl } from './cases'
-import type { LinkCaseId } from './cases'
-import type * as ClientApp from './src/client'
-import type * as SsrApp from './src/ssr'
-
-export interface LinkScenario {
- setup: () => Promise
- batch: () => Promise
- check: () => void
- teardown: () => void
-}
-
-export const samplingOptions = {
- warmupIterations: 100,
- warmupTime: 1_000,
- time: 5_000,
- throws: true,
-}
-
-export function createClientScenario(
- app: typeof ClientApp,
- id: LinkCaseId,
-): LinkScenario {
- let mounted: ReturnType | undefined
- let container: HTMLElement | undefined
- let anchors: Array = []
- const test = createScenarioSetup({
- frameworkLabel: 'React',
- mount: (element, history) => {
- container = element
- mounted = app.mountTestApp(element, history, id)
- return mounted
- },
- initialUrl: getSourceUrl(id, 0),
- steps: NAVIGATION_STATES.map((state) => `go-state-${state}`),
- assertAfterStep: (index, element) => {
- assertScenario(id, NAVIGATION_STATES[index]!, element)
- if (!mounted) {
- throw new Error('Link benchmark app was not mounted')
- }
- mounted.assertStateUpdates()
- },
- })
-
- return {
- async setup() {
- await test.before()
- if (!container) {
- throw new Error('Link benchmark container was not created')
- }
- anchors = [...container.querySelectorAll('a[data-perf-link]')]
- },
- async batch() {
- for (let index = 0; index < ticksPerIteration; index++) {
- await test.tick()
- }
- await test.finishBatch()
- },
- check() {
- if (!container || !mounted) {
- throw new Error('Link benchmark app was not mounted')
- }
- assertScenario(id, 0, container)
- mounted.assertStateUpdates()
- if (mounted.router.history.length !== 1) {
- throw new Error('Link benchmark history must remain bounded')
- }
- const current = container.querySelectorAll('a[data-perf-link]')
- if (anchors.some((anchor, index) => current[index] !== anchor)) {
- throw new Error('Measured Links must stay mounted across navigations')
- }
- },
- teardown: test.after,
- }
-}
-
-export function createSsrScenario(
- app: typeof SsrApp,
- id: LinkCaseId,
-): LinkScenario {
- let html = ''
- let state = 0
- function check() {
- const dom = new JSDOM(html)
- try {
- assertScenario(id, state, dom.window.document)
- } finally {
- dom.window.close()
- }
- }
-
- return {
- async setup() {
- for (const nextState of NAVIGATION_STATES) {
- state = nextState
- html = await app.renderScenario(id, state, true)
- check()
- }
- },
- async batch() {
- for (const nextState of NAVIGATION_STATES) {
- state = nextState
- html = await app.renderScenario(id, state)
- }
- },
- check,
- teardown() {
- html = ''
- },
- }
-}
diff --git a/benchmarks/client-nav/link-performance/src/client.tsx b/benchmarks/client-nav/link-performance/src/client.tsx
deleted file mode 100644
index a187ee8c15..0000000000
--- a/benchmarks/client-nav/link-performance/src/client.tsx
+++ /dev/null
@@ -1,29 +0,0 @@
-import { RouterProvider } from '@tanstack/react-router'
-import { isServer } from '@tanstack/router-core/isServer'
-import { createRoot } from 'react-dom/client'
-import { assertStateUpdates, createLinkRouter } from './workload'
-import type { LinkRouter } from './workload'
-import type { RouterHistory } from '@tanstack/history'
-import type { LinkCaseId } from '../cases'
-
-export const serverEnvironment: boolean | undefined = isServer
-
-export function mountTestApp(
- container: HTMLElement,
- history: RouterHistory,
- caseId: LinkCaseId,
-): {
- router: LinkRouter
- unmount: () => void
- assertStateUpdates: () => void
-} {
- const router = createLinkRouter(caseId, history, false)
- const root = createRoot(container)
- root.render( )
-
- return {
- router,
- unmount: () => root.unmount(),
- assertStateUpdates: () => assertStateUpdates(router),
- }
-}
diff --git a/benchmarks/client-nav/link-performance/src/ssr.tsx b/benchmarks/client-nav/link-performance/src/ssr.tsx
deleted file mode 100644
index 491191b1f9..0000000000
--- a/benchmarks/client-nav/link-performance/src/ssr.tsx
+++ /dev/null
@@ -1,29 +0,0 @@
-import { RouterProvider, createMemoryHistory } from '@tanstack/react-router'
-import { isServer } from '@tanstack/router-core/isServer'
-import { renderToString } from 'react-dom/server'
-import { getSourceUrl } from '../cases'
-import { assertStateUpdates, createLinkRouter } from './workload'
-import type { LinkCaseId } from '../cases'
-
-export const serverEnvironment: boolean | undefined = isServer
-
-export async function renderScenario(
- caseId: LinkCaseId,
- stateIndex: number,
- verify = false,
-) {
- const history = createMemoryHistory({
- initialEntries: [getSourceUrl(caseId, stateIndex)],
- })
- const router = createLinkRouter(caseId, history, true)
- try {
- await router.load()
- const html = renderToString( )
- if (verify) {
- assertStateUpdates(router)
- }
- return html
- } finally {
- history.destroy()
- }
-}
diff --git a/benchmarks/client-nav/link-performance/src/workload.tsx b/benchmarks/client-nav/link-performance/src/workload.tsx
deleted file mode 100644
index 8315b85b8b..0000000000
--- a/benchmarks/client-nav/link-performance/src/workload.tsx
+++ /dev/null
@@ -1,506 +0,0 @@
-import {
- Link,
- Outlet,
- createRootRouteWithContext,
- createRoute,
- createRouter,
- linkOptions,
- retainSearchParams,
- stripSearchParams,
- useLocation,
-} from '@tanstack/react-router'
-import {
- LINK_COUNT,
- LOCALES,
- encodedValue,
- optionalCategory,
- sourceFilter,
- sourceSearch,
- splatValue,
-} from '../cases'
-import type { RouterHistory } from '@tanstack/history'
-import type { SearchSchemaInput } from '@tanstack/react-router'
-import type { Filter, LinkCaseId, LinkSearch } from '../cases'
-
-interface StateUpdates {
- calls: number
- verifiedCalls: number
- input: number
- output: number
- offset: number
-}
-
-interface WorkloadContext {
- caseId: LinkCaseId
- stateUpdates: StateUpdates
-}
-
-function isFilter(value: unknown): value is Filter {
- return (
- typeof value === 'object' &&
- value !== null &&
- 'tag' in value &&
- typeof value.tag === 'string' &&
- 'flags' in value &&
- typeof value.flags === 'object' &&
- value.flags !== null &&
- 'open' in value.flags &&
- typeof value.flags.open === 'boolean' &&
- 'tags' in value &&
- Array.isArray(value.tags) &&
- value.tags.every((tag: unknown) => typeof tag === 'string')
- )
-}
-
-const rootRoute = createRootRouteWithContext()({
- validateSearch: (
- search: Record & SearchSchemaInput,
- ): LinkSearch => ({
- page: typeof search.page === 'number' ? search.page : undefined,
- tenant: typeof search.tenant === 'string' ? search.tenant : undefined,
- filter: isFilter(search.filter) ? search.filter : undefined,
- }),
- component: RootLayout,
-})
-
-const itemsRoute = createRoute({
- getParentRoute: () => rootRoute,
- path: 'items/$itemId',
-})
-const detailsRoute = createRoute({
- getParentRoute: () => itemsRoute,
- path: 'details',
-})
-const teamRoute = createRoute({
- getParentRoute: () => rootRoute,
- path: 'teams/$teamId',
-})
-const teamItemRoute = createRoute({
- getParentRoute: () => teamRoute,
- path: '$itemId',
-})
-const teamDetailsRoute = createRoute({
- getParentRoute: () => teamItemRoute,
- path: 'details',
-})
-const filteredRoute = createRoute({
- getParentRoute: () => rootRoute,
- path: 'filtered/$itemId',
- search: {
- middlewares: [
- retainSearchParams(['tenant']),
- stripSearchParams({ page: 1 }),
- ({ search, next }) => {
- const result = next(search)
- return {
- ...result,
- filter: result.filter
- ? { ...result.filter, tag: result.filter.tag.trim().toUpperCase() }
- : undefined,
- }
- },
- ],
- },
-})
-const numericRoute = createRoute({
- getParentRoute: () => rootRoute,
- path: 'numbers/$number',
- params: {
- parse: ({ number }) => {
- const value = Number(number)
- if (!Number.isFinite(value)) {
- throw new Error(`Invalid number: ${number}`)
- }
- return { number: value }
- },
- stringify: ({ number }) => ({ number: String(number) }),
- },
-})
-const optionalRoute = createRoute({
- getParentRoute: () => rootRoute,
- path: 'optional/{-$category}/$itemId',
-})
-const splatRoute = createRoute({
- getParentRoute: () => rootRoute,
- path: 'files/$',
-})
-const encodedRoute = createRoute({
- getParentRoute: () => rootRoute,
- path: 'encoded/$value',
-})
-const publicRoute = createRoute({
- getParentRoute: () => rootRoute,
- path: 'public/$itemId',
-})
-
-const routeTree = rootRoute.addChildren([
- itemsRoute.addChildren([detailsRoute]),
- teamRoute.addChildren([teamItemRoute.addChildren([teamDetailsRoute])]),
- filteredRoute,
- numericRoute,
- optionalRoute,
- splatRoute,
- encodedRoute,
- publicRoute,
-])
-
-const localeRewrite = {
- input: ({ url }: { url: URL }) => {
- const match = /^\/(en|fr|de|es)(\/.*)$/.exec(url.pathname)
- if (match) {
- url.pathname = match[2]!
- url.searchParams.set('tenant', match[1]!)
- }
- return url
- },
- output: ({ url }: { url: URL }) => {
- const locale = url.searchParams.get('tenant')
- if (locale) {
- url.searchParams.delete('tenant')
- url.pathname = `/${locale}${url.pathname}`
- }
- return url
- },
-}
-
-export function createLinkRouter(
- caseId: LinkCaseId,
- history: RouterHistory,
- isServer: boolean,
-) {
- const context: WorkloadContext = {
- caseId,
- stateUpdates: {
- calls: 0,
- verifiedCalls: 0,
- input: 0,
- output: 0,
- offset: 0,
- },
- }
- return createRouter({
- routeTree,
- history,
- isServer,
- context,
- scrollRestoration: false,
- defaultPreload: false,
- trailingSlash: 'never',
- pathParamsAllowedCharacters:
- caseId === 'encoding' ? ['@', ':', '+'] : undefined,
- ...(caseId === 'rewrites'
- ? { basepath: '/app', rewrite: localeRewrite }
- : {}),
- })
-}
-
-export type LinkRouter = ReturnType
-
-declare module '@tanstack/react-router' {
- interface Register {
- router: LinkRouter
- }
-}
-
-declare module '@tanstack/history' {
- interface HistoryState {
- linkPerfState?: number
- }
-}
-
-// Call alongside DOM assertions, outside the timed loop, after each sample.
-export function assertStateUpdates(router: LinkRouter): void {
- const { caseId, stateUpdates } = router.options.context
- if (caseId !== 'location-updaters') {
- return
- }
- const input = router.state.location.state.linkPerfState ?? 0
- if (
- stateUpdates.calls - stateUpdates.verifiedCalls < LINK_COUNT ||
- stateUpdates.input !== input ||
- stateUpdates.output !== input + stateUpdates.offset ||
- stateUpdates.offset < 1 ||
- stateUpdates.offset > 40
- ) {
- throw new Error(
- 'Link history-state updaters did not run with current state',
- )
- }
- stateUpdates.verifiedCalls = stateUpdates.calls
-}
-
-function sourceOptions(caseId: LinkCaseId, stateIndex: number) {
- const itemId = `item-${stateIndex}`
- const common = {
- search: sourceSearch(caseId, stateIndex),
- hash: caseId === 'location-updaters' ? `source-${stateIndex}` : '',
- state: { linkPerfState: stateIndex + 10 },
- }
- switch (caseId) {
- case 'relative':
- return linkOptions({
- ...common,
- to: '/teams/$teamId/$itemId',
- params: { teamId: `team-${stateIndex}`, itemId },
- })
- case 'numeric-params':
- return linkOptions({
- ...common,
- to: '/numbers/$number',
- params: { number: stateIndex },
- })
- case 'optional-params':
- return linkOptions({
- ...common,
- to: '/optional/{-$category}/$itemId',
- params: { category: optionalCategory(stateIndex), itemId },
- })
- case 'splats':
- return linkOptions({
- ...common,
- to: '/files/$',
- params: { _splat: `source/state-${stateIndex}` },
- })
- case 'encoding':
- return linkOptions({
- ...common,
- to: '/encoded/$value',
- params: { value: `source-${stateIndex}` },
- })
- case 'active':
- return linkOptions({
- ...common,
- to: '/items/$itemId/details',
- params: { itemId },
- })
- default:
- return linkOptions({
- ...common,
- to: '/items/$itemId',
- params: { itemId },
- })
- }
-}
-
-const indexes = Array.from({ length: LINK_COUNT }, (_, index) => index)
-const controls = [0, 1, 2, 3] as const
-
-function SourcePath() {
- const pathname = useLocation({ select: (location) => location.pathname })
- return {pathname}
-}
-
-function RootLayout() {
- const context = rootRoute.useRouteContext()
- return (
- <>
-
- {controls.map((stateIndex) => (
-
- State {stateIndex}
-
- ))}
-
-
-
- {indexes.map((index) => measuredLink(context, index))}
-
-
- >
- )
-}
-
-function measuredLink(
- { caseId, stateUpdates }: WorkloadContext,
- index: number,
-) {
- const common = {
- key: index,
- 'data-perf-link': index,
- preload: false,
- children: `Link ${index}`,
- } as const
- const itemId = `item-${index % 40}`
- switch (caseId) {
- case 'shared-params':
- case 'unique-params':
- return (
-
- )
- case 'param-updaters':
- return (
- ({
- itemId: `${previous.itemId}-related-${index % 40}`,
- })}
- />
- )
- case 'location-updaters':
- return (
- ({
- ...previous,
- page: (previous.page ?? 1) + 1 + (index % 5),
- })}
- hash={(previous) => `${previous}-link-${index % 5}`}
- state={(previous) => {
- const input = previous.linkPerfState ?? 0
- const offset = (index % 40) + 1
- const output = input + offset
- stateUpdates.calls++
- stateUpdates.input = input
- stateUpdates.output = output
- stateUpdates.offset = offset
- return { ...previous, linkPerfState: output }
- }}
- />
- )
- case 'relative':
- return (
-
- )
- case 'middleware':
- return (
-
- )
- case 'numeric-params':
- return (
- ({ number: previous.number + (index % 40) })}
- />
- )
- case 'optional-params':
- return (
-
- )
- case 'splats':
- return (
-
- )
- case 'encoding':
- return (
-
- )
- case 'masks':
- return (
-
- )
- case 'rewrites':
- return (
-
- )
- case 'active': {
- const item = Math.floor(index / 5)
- const variant = index % 5
- return (
- ({
- className: 'perf-active',
- title: 'active',
- style: { color: 'green' },
- })}
- inactiveProps={() => ({
- className: 'perf-inactive',
- title: 'inactive',
- style: { color: 'gray' },
- })}
- >
- {({ isActive }) => `${index}:${isActive ? 'active' : 'inactive'}`}
-
- )
- }
- }
-}
diff --git a/benchmarks/client-nav/link-performance/ssr.bench.ts b/benchmarks/client-nav/link-performance/ssr.bench.ts
deleted file mode 100644
index c30084e510..0000000000
--- a/benchmarks/client-nav/link-performance/ssr.bench.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-import { test } from 'vitest'
-import { benchLifecycle } from '../../cpu-simulation'
-import { LINK_CASES } from './cases'
-import { createSsrScenario, samplingOptions } from './scenario'
-import type * as App from './src/ssr'
-
-const appUrl = new URL('./dist/ssr/app.js', import.meta.url).href
-const app: typeof App = await import(/* @vite-ignore */ appUrl)
-if (app.serverEnvironment !== true) {
- throw new Error('Link SSR benchmarks must use the production server build')
-}
-
-for (const { id, label } of LINK_CASES) {
- test(label, async ({ bench }) => {
- const scenario = createSsrScenario(app, id)
- function finish() {
- try {
- scenario.check()
- } finally {
- scenario.teardown()
- }
- }
-
- await bench(
- `SSR Links: ${id}`,
- benchLifecycle({ before: scenario.setup, after: finish }),
- scenario.batch,
- ).run(samplingOptions)
- })
-}
diff --git a/benchmarks/client-nav/link-performance/stable-runner.ts b/benchmarks/client-nav/link-performance/stable-runner.ts
deleted file mode 100644
index 59ccfa3cb4..0000000000
--- a/benchmarks/client-nav/link-performance/stable-runner.ts
+++ /dev/null
@@ -1,269 +0,0 @@
-import { fork } from 'node:child_process'
-import { createHash } from 'node:crypto'
-import {
- copyFileSync,
- mkdirSync,
- readFileSync,
- rmSync,
- writeFileSync,
-} from 'node:fs'
-import { dirname, resolve } from 'node:path'
-import { fileURLToPath } from 'node:url'
-import { parseArgs } from 'node:util'
-import { LINK_CASES } from './cases'
-import { createStagingDirectory } from './staging'
-import { classify, mean, summarizeRatios } from './statistics'
-import type { LinkCaseId } from './cases'
-import type {
- BlockSample,
- Mode,
- Variant,
- WorkerRequest,
- WorkerResponse,
-} from './worker-protocol'
-
-const projectRoot = fileURLToPath(new URL('.', import.meta.url))
-const workspaceRoot = resolve(projectRoot, '../../..')
-
-function startWorker() {
- const child = fork(
- fileURLToPath(new URL('./stable-worker.ts', import.meta.url)),
- {
- cwd: workspaceRoot,
- env: { ...process.env, NODE_ENV: 'production' },
- execArgv: [
- '--import=@swc-node/register/esm-register',
- '--random-seed=42',
- '--hash-seed=42',
- ],
- stdio: ['ignore', 'ignore', 'pipe', 'ipc'],
- },
- )
- let stderr = ''
- child.stderr?.on('data', (data: Buffer) => {
- stderr = (stderr + data.toString()).slice(-4_096)
- })
-
- function request(message: WorkerRequest): Promise {
- return new Promise((resolveResponse, reject) => {
- const timeout = setTimeout(() => {
- finish(
- new Error(`Sampling worker timed out: ${message.kind}\n${stderr}`),
- )
- }, 60_000)
- const onExit = (code: number | null) =>
- finish(new Error(`Sampling worker exited (${code})\n${stderr}`))
- const onError = (error: Error) => finish(error)
- const onMessage = (response: WorkerResponse) => {
- if (response.kind === 'error') {
- finish(new Error(response.message))
- } else {
- finish(undefined, response)
- }
- }
- function finish(error?: Error, response?: WorkerResponse) {
- clearTimeout(timeout)
- child.off('message', onMessage)
- child.off('error', onError)
- child.off('exit', onExit)
- if (error) {
- reject(error)
- } else if (response) {
- resolveResponse(response)
- }
- }
- child.once('message', onMessage)
- child.once('error', onError)
- child.once('exit', onExit)
- child.send(message, (error) => {
- if (error) {
- finish(error)
- }
- })
- })
- }
-
- return {
- request,
- kill: () => child.kill(),
- }
-}
-
-async function sampleReplica(
- mode: Mode,
- caseId: LinkCaseId,
- baseline: string,
- current: string,
- replica: number,
-) {
- const worker = startWorker()
- const samples: Array> = [[], []]
- const ratios: Array<{ cpu: number; wall: number }> = []
- try {
- const starts: Array = []
- // Balance module initialization and which variant finishes warming last.
- const startupOrder: Array = replica % 2 ? [1, 0] : [0, 1]
- for (const index of startupOrder) {
- const ready = await worker.request({
- kind: 'init',
- mode,
- caseId,
- bundle: index === 0 ? baseline : current,
- variant: index,
- })
- if (ready.kind !== 'ready') {
- throw new Error('Expected a ready sampling worker')
- }
- starts[index] = ready.batchMs
- }
- const iterations = Math.max(1, Math.ceil(500 / Math.min(...starts)))
- for (let round = 0; round < 2; round++) {
- const block: Array> = [[], []]
- const order: Array =
- (round + replica) % 2 ? [1, 0, 0, 1] : [0, 1, 1, 0]
- for (const index of order) {
- const result = await worker.request({
- kind: 'measure',
- iterations,
- variant: index,
- })
- if (result.kind !== 'sample') {
- throw new Error('Expected a block measurement')
- }
- samples[index]!.push(result.sample)
- block[index]!.push(result.sample)
- }
- ratios.push({
- cpu:
- mean(block[1]!.map((s) => s.cpuMs)) /
- mean(block[0]!.map((s) => s.cpuMs)),
- wall:
- mean(block[1]!.map((s) => s.wallMs)) /
- mean(block[0]!.map((s) => s.wallMs)),
- })
- }
- const response = await worker.request({ kind: 'stop' })
- if (response.kind !== 'stopped') {
- throw new Error('Expected successful post-measurement assertions')
- }
- return {
- iterations,
- baseline: samples[0]!,
- current: samples[1]!,
- cpuRatio: Math.exp(mean(ratios.map((r) => Math.log(r.cpu)))),
- wallRatio: Math.exp(mean(ratios.map((r) => Math.log(r.wall)))),
- }
- } finally {
- worker.kill()
- }
-}
-
-async function main() {
- const { values } = parseArgs({
- options: {
- baseline: { type: 'string' },
- current: { type: 'string', default: resolve(projectRoot, 'dist') },
- mode: { type: 'string', default: 'all' },
- repeats: { type: 'string', default: '4' },
- outputJson: { type: 'string' },
- testNamePattern: { type: 'string', short: 't' },
- },
- })
- if (!values.baseline || !values.outputJson) {
- throw new Error(
- 'Specify --baseline and --outputJson ',
- )
- }
- const repeats = Number(values.repeats)
- if (!Number.isInteger(repeats) || repeats < 3 || repeats > 11) {
- throw new Error('--repeats must be an integer between 3 and 11')
- }
- if (!['all', 'client', 'ssr'].includes(values.mode)) {
- throw new Error('--mode must be all, client, or ssr')
- }
- const modes: Array =
- values.mode === 'all'
- ? ['client', 'ssr']
- : values.mode === 'client'
- ? ['client']
- : ['ssr']
- const pattern = values.testNamePattern
- ? new RegExp(values.testNamePattern)
- : undefined
- const cases = LINK_CASES.filter(
- (c) => !pattern || pattern.test(`${c.label} ${c.id}`),
- )
- if (!cases.length) {
- throw new Error('No Link workloads match the requested pattern')
- }
- const report: {
- protocol: string
- node: string
- complete: boolean
- results: Array<{
- mode: Mode
- caseId: LinkCaseId
- baselineSha256: string
- currentSha256: string
- replicas: Array>>
- cpu: ReturnType
- wall: ReturnType
- verdict: ReturnType
- }>
- } = {
- protocol:
- 'fresh process per case/replica; shared React runtime; separately loaded router variants; 2 ABBA/BAAB rounds; ~500ms calibrated fixed-work blocks; >=2s/100 batches warmup; main-thread CPU and wall time; fixed V8 random/hash seeds',
- node: process.version,
- complete: false,
- results: [],
- }
- const output = resolve(values.outputJson)
- mkdirSync(dirname(output), { recursive: true })
- const staging = createStagingDirectory()
- try {
- for (const mode of modes) {
- const baselineInput = resolve(values.baseline, mode, 'app.js')
- const currentInput = resolve(values.current, mode, 'app.js')
- // Both snapshots resolve React from the same package installation.
- const baseline = resolve(staging, `baseline-${mode}.mjs`)
- const current = resolve(staging, `current-${mode}.mjs`)
- copyFileSync(baselineInput, baseline)
- copyFileSync(currentInput, current)
- const digest = (file: string) =>
- createHash('sha256').update(readFileSync(file)).digest('hex')
- const baselineSha256 = digest(baseline)
- const currentSha256 = digest(current)
- for (const { id } of cases) {
- const replicas = []
- for (let replica = 0; replica < repeats; replica++) {
- replicas.push(
- await sampleReplica(mode, id, baseline, current, replica),
- )
- }
- const cpu = summarizeRatios(replicas.map((r) => r.cpuRatio))
- const wall = summarizeRatios(replicas.map((r) => r.wallRatio))
- const verdict = classify(cpu, wall)
- report.results.push({
- mode,
- caseId: id,
- baselineSha256,
- currentSha256,
- replicas,
- cpu,
- wall,
- verdict,
- })
- writeFileSync(output, JSON.stringify(report, null, 2))
- console.log(
- `${mode} ${id}: CPU ${cpu.changePercent.toFixed(2)}% [${cpu.low95.toFixed(2)}, ${cpu.high95.toFixed(2)}], wall ${wall.changePercent.toFixed(2)}% [${wall.low95.toFixed(2)}, ${wall.high95.toFixed(2)}] ${verdict}`,
- )
- }
- }
- report.complete = true
- writeFileSync(output, JSON.stringify(report, null, 2))
- } finally {
- rmSync(staging, { recursive: true })
- }
-}
-
-await main()
diff --git a/benchmarks/client-nav/link-performance/stable-worker.test.ts b/benchmarks/client-nav/link-performance/stable-worker.test.ts
deleted file mode 100644
index 087b32414a..0000000000
--- a/benchmarks/client-nav/link-performance/stable-worker.test.ts
+++ /dev/null
@@ -1,60 +0,0 @@
-import { fork } from 'node:child_process'
-import { rmdirSync, unlinkSync, writeFileSync } from 'node:fs'
-import { join } from 'node:path'
-import { fileURLToPath } from 'node:url'
-import { expect, test } from 'vitest'
-import { createStagingDirectory } from './staging'
-import type { WorkerResponse } from './worker-protocol'
-
-test('loads emitted JavaScript without retranspiling it through SWC', async () => {
- const directory = createStagingDirectory()
- const bundle = join(directory, 'app.mjs')
- const definition = 'function untouched ( ) { return 1 }'
- writeFileSync(
- bundle,
- `${definition}\nawait Promise.resolve()\nthrow new Error(untouched.toString())`,
- )
- const worker = fork(
- fileURLToPath(new URL('./stable-worker.ts', import.meta.url)),
- {
- cwd: fileURLToPath(new URL('../../../', import.meta.url)),
- execArgv: ['--import=@swc-node/register/esm-register'],
- env: { ...process.env, NODE_ENV: 'production' },
- stdio: ['ignore', 'ignore', 'pipe', 'ipc'],
- },
- )
- let stderr = ''
- worker.stderr?.on('data', (data: Buffer) => {
- stderr += data.toString()
- })
- let timeout: ReturnType | undefined
- try {
- const result = new Promise((resolve, reject) => {
- worker.once('message', (message: WorkerResponse) => resolve(message))
- worker.once('error', reject)
- worker.once('exit', (code) => {
- reject(new Error(`Worker exited (${code}): ${stderr}`))
- })
- timeout = setTimeout(() => {
- reject(new Error(`Worker timed out: ${stderr}`))
- }, 5_000)
- })
- worker.send({
- kind: 'init',
- mode: 'ssr',
- caseId: 'shared-params',
- bundle,
- variant: 0,
- })
- const response = await result
- expect(response.kind).toBe('error')
- if (response.kind === 'error') {
- expect(response.message).toContain(`Error: ${definition}`)
- }
- } finally {
- clearTimeout(timeout)
- worker.kill()
- unlinkSync(bundle)
- rmdirSync(directory)
- }
-})
diff --git a/benchmarks/client-nav/link-performance/stable-worker.ts b/benchmarks/client-nav/link-performance/stable-worker.ts
deleted file mode 100644
index d98679dc15..0000000000
--- a/benchmarks/client-nav/link-performance/stable-worker.ts
+++ /dev/null
@@ -1,112 +0,0 @@
-import { pathToFileURL } from 'node:url'
-import { createClientScenario, createSsrScenario } from './scenario'
-import type { LinkScenario } from './scenario'
-import type { WorkerRequest, WorkerResponse } from './worker-protocol'
-import type * as ClientApp from './src/client'
-import type * as SsrApp from './src/ssr'
-
-const scenarios: Array = []
-const creationOrder: Array = []
-let closeWindow = () => {}
-
-function reply(response: WorkerResponse) {
- if (!process.send) {
- throw new Error('The Link sampling worker requires an IPC parent')
- }
- process.send(response)
-}
-
-async function handle(request: WorkerRequest) {
- if (request.kind === 'init') {
- if (typeof process.threadCpuUsage !== 'function') {
- throw new Error(
- 'Stable sampling requires Node.js with process.threadCpuUsage',
- )
- }
- if (scenarios[request.variant]) {
- throw new Error('A worker must only initialize each variant once')
- }
- let scenario: LinkScenario
- const bundleUrl = pathToFileURL(request.bundle)
- bundleUrl.searchParams.set('linkPerfVariant', String(request.variant))
- if (request.mode === 'client') {
- const { window } = await import('../jsdom')
- closeWindow = () => window.close()
- const app: typeof ClientApp = await import(bundleUrl.href)
- if (app.serverEnvironment !== false) {
- throw new Error('Expected a production client bundle')
- }
- scenario = createClientScenario(app, request.caseId)
- } else {
- const app: typeof SsrApp = await import(bundleUrl.href)
- if (app.serverEnvironment !== true) {
- throw new Error('Expected a production SSR bundle')
- }
- scenario = createSsrScenario(app, request.caseId)
- }
- scenarios[request.variant] = scenario
- creationOrder.push(scenario)
- await scenario.setup()
- const start = performance.now()
- let iterations = 0
- do {
- await scenario.batch()
- iterations++
- } while (iterations < 100 || performance.now() - start < 2_000)
- reply({
- kind: 'ready',
- batchMs: (performance.now() - start) / iterations,
- })
- return
- }
- if (request.kind === 'measure') {
- const scenario = scenarios[request.variant]
- if (!scenario) {
- throw new Error('The sampling worker has not been initialized')
- }
- if (!Number.isInteger(request.iterations) || request.iterations < 1) {
- throw new Error('Expected a positive batch count')
- }
- const cpuStart = process.threadCpuUsage()
- const processStart = process.cpuUsage()
- const start = performance.now()
- for (let index = 0; index < request.iterations; index++) {
- await scenario.batch()
- }
- const wallMs = performance.now() - start
- const cpu = process.threadCpuUsage(cpuStart)
- const processCpu = process.cpuUsage(processStart)
- reply({
- kind: 'sample',
- sample: {
- iterations: request.iterations,
- wallMs: wallMs / request.iterations,
- cpuMs: (cpu.user + cpu.system) / 1_000 / request.iterations,
- processCpuMs:
- (processCpu.user + processCpu.system) / 1_000 / request.iterations,
- },
- })
- return
- }
- try {
- for (const scenario of creationOrder) {
- scenario.check()
- }
- } finally {
- for (const scenario of creationOrder.reverse()) {
- scenario.teardown()
- }
- closeWindow()
- }
- reply({ kind: 'stopped' })
-}
-
-process.on('message', (request: WorkerRequest) => {
- void handle(request).catch((error: unknown) => {
- reply({
- kind: 'error',
- message:
- error instanceof Error ? error.stack || error.message : String(error),
- })
- })
-})
diff --git a/benchmarks/client-nav/link-performance/staging.ts b/benchmarks/client-nav/link-performance/staging.ts
deleted file mode 100644
index ac07d34c29..0000000000
--- a/benchmarks/client-nav/link-performance/staging.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-import { mkdirSync, mkdtempSync } from 'node:fs'
-import { resolve } from 'node:path'
-import { fileURLToPath } from 'node:url'
-
-export function createStagingDirectory() {
- // SWC skips node_modules, leaving the emitted benchmark JavaScript intact.
- const root = fileURLToPath(new URL('./node_modules/.cache/', import.meta.url))
- mkdirSync(root, { recursive: true })
- return mkdtempSync(resolve(root, 'link-performance-'))
-}
diff --git a/benchmarks/client-nav/link-performance/statistics.test.ts b/benchmarks/client-nav/link-performance/statistics.test.ts
deleted file mode 100644
index 8f5f37413b..0000000000
--- a/benchmarks/client-nav/link-performance/statistics.test.ts
+++ /dev/null
@@ -1,36 +0,0 @@
-import { expect, test } from 'vitest'
-import { classify, mean, summarizeRatios } from './statistics'
-
-test('summarizes multiplicative paired changes across process replicas', () => {
- const result = summarizeRatios([0.9, 0.9, 0.9, 0.9])
- expect(result.changePercent).toBeCloseTo(-10)
- expect(result.low95).toBeCloseTo(-10)
- expect(result.high95).toBeCloseTo(-10)
- expect(result.replicas).toBe(4)
-})
-
-test('does not turn opposite noisy runs into a conclusive result', () => {
- const result = summarizeRatios([0.9, 1.1, 0.95, 1.05])
- expect(result.low95).toBeLessThan(0)
- expect(result.high95).toBeGreaterThan(0)
- expect(classify(result, result)).toBe('inconclusive')
-})
-
-test('requires CPU and wall time to corroborate a direction', () => {
- const slower = summarizeRatios([1.08, 1.09, 1.08, 1.09])
- const faster = summarizeRatios([0.9, 0.91, 0.9, 0.91])
- expect(classify(slower, slower)).toBe('slower')
- expect(classify(faster, faster)).toBe('faster')
- expect(classify(slower, faster)).toBe('inconclusive')
- expect(classify(summarizeRatios([1, 1, 1]), summarizeRatios([1, 1, 1]))).toBe(
- 'within-2%',
- )
-})
-
-test('rejects incomplete or invalid sampling data', () => {
- expect(() => summarizeRatios([1])).toThrow()
- expect(() => summarizeRatios([0, 1])).toThrow()
- expect(() => summarizeRatios([NaN, 1])).toThrow()
- expect(() => mean([])).toThrow()
- expect(() => mean([Infinity])).toThrow()
-})
diff --git a/benchmarks/client-nav/link-performance/statistics.ts b/benchmarks/client-nav/link-performance/statistics.ts
deleted file mode 100644
index 469bdaf65a..0000000000
--- a/benchmarks/client-nav/link-performance/statistics.ts
+++ /dev/null
@@ -1,57 +0,0 @@
-const critical95 = [
- 12.7062, 4.3027, 3.1824, 2.7764, 2.5706, 2.4469, 2.3646, 2.306, 2.2622,
- 2.2281,
-]
-
-export function mean(values: ReadonlyArray) {
- if (!values.length || values.some((value) => !Number.isFinite(value))) {
- throw new Error('Expected finite, nonempty samples')
- }
- return values.reduce((sum, value) => sum + value, 0) / values.length
-}
-
-export function summarizeRatios(ratios: ReadonlyArray) {
- if (
- ratios.length < 2 ||
- ratios.length > 11 ||
- ratios.some((value) => value <= 0)
- ) {
- throw new Error('Expected 2-11 independent positive process-replica ratios')
- }
- const logs = ratios.map(Math.log)
- const center = mean(logs)
- const variance =
- logs.reduce((sum, value) => sum + (value - center) ** 2, 0) /
- (logs.length - 1)
- // Replicas, not the many correlated batches inside a worker, are the samples.
- const margin =
- critical95[logs.length - 2]! * Math.sqrt(variance / logs.length)
- const percent = (value: number) => (Math.exp(value) - 1) * 100
- return {
- changePercent: percent(center),
- low95: percent(center - margin),
- high95: percent(center + margin),
- replicas: ratios.length,
- }
-}
-
-export function classify(
- cpu: ReturnType,
- wall: ReturnType,
-) {
- if (cpu.low95 > 0 && wall.low95 > 0) {
- return 'slower'
- }
- if (cpu.high95 < 0 && wall.high95 < 0) {
- return 'faster'
- }
- if (
- cpu.low95 >= -2 &&
- cpu.high95 <= 2 &&
- wall.low95 >= -2 &&
- wall.high95 <= 2
- ) {
- return 'within-2%'
- }
- return 'inconclusive'
-}
diff --git a/benchmarks/client-nav/link-performance/tsconfig.json b/benchmarks/client-nav/link-performance/tsconfig.json
deleted file mode 100644
index fbf230c977..0000000000
--- a/benchmarks/client-nav/link-performance/tsconfig.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "extends": "../tsconfig.json",
- "compilerOptions": {
- "jsx": "react-jsx",
- "jsxImportSource": "react",
- "types": ["node", "vite/client", "vitest/globals"]
- },
- "include": [
- "./**/*.ts",
- "./**/*.tsx",
- "../scenarios/harness.ts",
- "../setup-helpers.ts",
- "../vitest.setup.ts"
- ]
-}
diff --git a/benchmarks/client-nav/link-performance/vite.client.config.ts b/benchmarks/client-nav/link-performance/vite.client.config.ts
deleted file mode 100644
index 1cd45fc45e..0000000000
--- a/benchmarks/client-nav/link-performance/vite.client.config.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { createLinkPerformanceConfig } from './config'
-
-export default createLinkPerformanceConfig('client')
diff --git a/benchmarks/client-nav/link-performance/vite.ssr.config.ts b/benchmarks/client-nav/link-performance/vite.ssr.config.ts
deleted file mode 100644
index f59148eaf6..0000000000
--- a/benchmarks/client-nav/link-performance/vite.ssr.config.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { createLinkPerformanceConfig } from './config'
-
-export default createLinkPerformanceConfig('ssr')
diff --git a/benchmarks/client-nav/link-performance/vitest.config.ts b/benchmarks/client-nav/link-performance/vitest.config.ts
deleted file mode 100644
index f8454c819d..0000000000
--- a/benchmarks/client-nav/link-performance/vitest.config.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import { fileURLToPath } from 'node:url'
-import { defineConfig } from 'vitest/config'
-
-export default defineConfig({
- root: fileURLToPath(new URL('.', import.meta.url)),
- test: {
- watch: false,
- environment: 'node',
- include: ['*.test.ts'],
- },
-})
diff --git a/benchmarks/client-nav/link-performance/worker-protocol.ts b/benchmarks/client-nav/link-performance/worker-protocol.ts
deleted file mode 100644
index 474858a529..0000000000
--- a/benchmarks/client-nav/link-performance/worker-protocol.ts
+++ /dev/null
@@ -1,28 +0,0 @@
-import type { LinkCaseId } from './cases'
-
-export type Mode = 'client' | 'ssr'
-export type Variant = 0 | 1
-
-export type WorkerRequest =
- | {
- kind: 'init'
- mode: Mode
- caseId: LinkCaseId
- bundle: string
- variant: Variant
- }
- | { kind: 'measure'; iterations: number; variant: Variant }
- | { kind: 'stop' }
-
-export interface BlockSample {
- wallMs: number
- cpuMs: number
- processCpuMs: number
- iterations: number
-}
-
-export type WorkerResponse =
- | { kind: 'ready'; batchMs: number }
- | { kind: 'sample'; sample: BlockSample }
- | { kind: 'stopped' }
- | { kind: 'error'; message: string }
diff --git a/benchmarks/client-nav/package.json b/benchmarks/client-nav/package.json
index 1f878adc67..386028271f 100644
--- a/benchmarks/client-nav/package.json
+++ b/benchmarks/client-nav/package.json
@@ -9,16 +9,17 @@
"test:flame:react": "NODE_ENV=production flame run --md-format=detailed --delay=none --node-options=\"--stack-size=65500\" ./react/speed.flame.ts",
"test:flame:solid": "NODE_ENV=production flame run --md-format=detailed --delay=none --node-options=\"--stack-size=65500\" ./solid/speed.flame.ts",
"test:flame:vue": "NODE_ENV=production flame run --md-format=detailed --delay=none --node-options=\"--stack-size=65500\" ./vue/speed.flame.ts",
- "test:perf": "NODE_ENV=production vitest bench --mode benchmark --config ./vitest.config.ts",
- "test:perf:react": "NODE_ENV=production vitest bench --mode benchmark --config ./vitest.react.config.ts",
- "test:perf:solid": "NODE_ENV=production vitest bench --mode benchmark --config ./vitest.solid.config.ts",
- "test:perf:vue": "NODE_ENV=production vitest bench --mode benchmark --config ./vitest.vue.config.ts",
+ "test:perf": "NODE_ENV=production vitest bench --config ./vitest.config.ts",
+ "test:perf:react": "NODE_ENV=production vitest bench --config ./vitest.react.config.ts",
+ "test:perf:solid": "NODE_ENV=production vitest bench --config ./vitest.solid.config.ts",
+ "test:perf:vue": "NODE_ENV=production vitest bench --config ./vitest.vue.config.ts",
"test:types": "pnpm run test:types:react && pnpm run test:types:solid && pnpm run test:types:vue",
"test:types:react": "tsc -p ./react/tsconfig.json --noEmit",
"test:types:solid": "tsc -p ./solid/tsconfig.json --noEmit",
"test:types:vue": "tsc -p ./vue/tsconfig.json --noEmit"
},
"dependencies": {
+ "@solidjs/web": "^2.0.0-rc.20",
"@tanstack/history": "workspace:^",
"@tanstack/react-router": "workspace:^",
"@tanstack/router-core": "workspace:^",
@@ -26,26 +27,24 @@
"@tanstack/vue-router": "workspace:^",
"react": "^19.0.0",
"react-dom": "^19.0.0",
- "solid-js": "^1.9.10",
+ "solid-js": "^2.0.0-rc.20",
"vue": "^3.5.16"
},
"devDependencies": {
+ "@codspeed/vitest-plugin": "^5.5.0",
"@platformatic/flame": "^1.6.0",
- "@codspeed/vitest-plugin": "^6.0.1",
+ "@solidjs/vite-plugin": "^3.0.0-next.54",
"@tanstack/router-plugin": "workspace:^",
"@testing-library/react": "^16.2.0",
+ "@types/jsdom": "28.0.0",
"@vitejs/plugin-react": "^6.0.1",
"@vitejs/plugin-vue": "^6.0.5",
"@vitejs/plugin-vue-jsx": "^5.1.5",
- "@types/jsdom": "28.0.0",
- "@types/react": "catalog:",
- "@types/react-dom": "catalog:",
"@typescript/native": "npm:typescript@^7.0.2",
"jsdom": "^29.1.1",
"typescript": "npm:@typescript/typescript6@^6.0.2",
"vite": "^8.0.14",
- "vite-plugin-solid": "^2.11.11",
- "vitest": "catalog:"
+ "vitest": "^4.1.4"
},
"nx": {
"targets": {
@@ -64,8 +63,6 @@
"@benchmarks/client-nav-control-flow-react",
"@benchmarks/client-nav-head-react",
"@benchmarks/client-nav-history-react",
- "@benchmarks/client-nav-hydration-react",
- "@benchmarks/client-nav-link-churn-react",
"@benchmarks/client-nav-links-react",
"@benchmarks/client-nav-loaders-react",
"@benchmarks/client-nav-mount-react",
@@ -94,8 +91,6 @@
"@benchmarks/client-nav-control-flow-solid",
"@benchmarks/client-nav-head-solid",
"@benchmarks/client-nav-history-solid",
- "@benchmarks/client-nav-hydration-solid",
- "@benchmarks/client-nav-link-churn-solid",
"@benchmarks/client-nav-links-solid",
"@benchmarks/client-nav-loaders-solid",
"@benchmarks/client-nav-mount-solid",
@@ -124,7 +119,6 @@
"@benchmarks/client-nav-control-flow-vue",
"@benchmarks/client-nav-head-vue",
"@benchmarks/client-nav-history-vue",
- "@benchmarks/client-nav-link-churn-vue",
"@benchmarks/client-nav-links-vue",
"@benchmarks/client-nav-loaders-vue",
"@benchmarks/client-nav-mount-vue",
@@ -183,13 +177,7 @@
]
},
"test:types": {
- "inputs": [
- "default",
- "^production",
- "{workspaceRoot}/eslint.config.js",
- "{workspaceRoot}/benchmarks/cpu-simulation.ts",
- "dependentTaskOutputs"
- ],
+ "cache": false,
"dependsOn": [
"^build",
{
@@ -206,13 +194,8 @@
"@benchmarks/client-nav-history-react",
"@benchmarks/client-nav-history-solid",
"@benchmarks/client-nav-history-vue",
- "@benchmarks/client-nav-hydration-react",
- "@benchmarks/client-nav-hydration-solid",
- "@benchmarks/client-nav-link-churn-react",
"@benchmarks/client-nav-links-react",
- "@benchmarks/client-nav-link-churn-solid",
"@benchmarks/client-nav-links-solid",
- "@benchmarks/client-nav-link-churn-vue",
"@benchmarks/client-nav-links-vue",
"@benchmarks/client-nav-loaders-react",
"@benchmarks/client-nav-loaders-solid",
diff --git a/benchmarks/client-nav/react/speed.bench.ts b/benchmarks/client-nav/react/speed.bench.ts
index 944f182734..fcc15b5fbc 100644
--- a/benchmarks/client-nav/react/speed.bench.ts
+++ b/benchmarks/client-nav/react/speed.bench.ts
@@ -1,19 +1,34 @@
-import { test } from 'vitest'
+import { afterAll, beforeAll, bench, describe } from 'vitest'
import { setup } from './setup'
-test('client-nav', async ({ bench }) => {
- const scenario = setup()
+describe('client-nav', () => {
+ const test = setup()
- await bench(
+ /**
+ * Running `vitest bench` ignores "suite hooks" like `beforeAll` and `afterAll`,
+ * so we use tinybench's `setup` and `teardown` options to run our setup and teardown logic.
+ *
+ * But CodSpeed calls the benchmarked function directly, bypassing `setup` and `teardown`,
+ * but it does support `beforeAll` and `afterAll`.
+ *
+ * So it looks like we're setting up in duplicate, but in reality, it's only running once per environment, as intended.
+ */
+
+ beforeAll(test.before)
+ afterAll(test.after)
+
+ bench(
'client-side navigation loop (react)',
- { beforeAll: scenario.before, afterAll: scenario.after },
async () => {
for (let i = 0; i < 10; i++) {
- await scenario.tick()
+ await test.tick()
}
},
- ).run({
- warmupIterations: 100,
- time: 10_000,
- })
+ {
+ warmupIterations: 100,
+ time: 10_000,
+ setup: test.before,
+ teardown: test.after,
+ },
+ )
})
diff --git a/benchmarks/client-nav/react/vite.config.ts b/benchmarks/client-nav/react/vite.config.ts
index 7df3f80e71..adc31ddd64 100644
--- a/benchmarks/client-nav/react/vite.config.ts
+++ b/benchmarks/client-nav/react/vite.config.ts
@@ -2,7 +2,6 @@ import { fileURLToPath } from 'node:url'
import { defineConfig } from 'vitest/config'
import react from '@vitejs/plugin-react'
import codspeedPlugin from '@codspeed/vitest-plugin'
-import { cpuSimulationExecArgv } from '../../cpu-simulation'
// Anchor the project root to the package directory so this config resolves
// identically when run directly and as part of an aggregate `projects` config.
@@ -29,11 +28,9 @@ export default defineConfig({
},
},
test: {
- execArgv: cpuSimulationExecArgv(),
name: '@benchmarks/client-nav (react)',
watch: false,
environment: 'jsdom',
setupFiles: [`${rootDir}vitest.setup.ts`],
- benchmark: { include: ['react/speed.bench.ts'] },
},
})
diff --git a/benchmarks/client-nav/scenarios/async-pipeline/react/speed.bench.ts b/benchmarks/client-nav/scenarios/async-pipeline/react/speed.bench.ts
index 65dab0781e..c3f4c5231c 100644
--- a/benchmarks/client-nav/scenarios/async-pipeline/react/speed.bench.ts
+++ b/benchmarks/client-nav/scenarios/async-pipeline/react/speed.bench.ts
@@ -1,19 +1,32 @@
-import { test } from 'vitest'
-import { benchLifecycle } from '../../../../cpu-simulation'
+import { afterEach, beforeEach, bench, describe } from 'vitest'
import { benchOptions, ticksPerIteration } from '../shared'
import { setup } from './setup'
-test('client-async-pipeline', async ({ bench }) => {
- const scenario = setup()
+describe('client-async-pipeline', () => {
+ const test = setup()
- await bench(
+ /**
+ * Running `vitest bench` ignores suite hooks, so Tinybench uses the `setup`
+ * and `teardown` options below. CodSpeed bypasses those options but supports
+ * `beforeEach` and `afterEach`. Only one lifecycle path runs in either
+ * environment, and every measured invocation receives fresh application state.
+ */
+
+ beforeEach(test.before)
+ afterEach(test.after)
+
+ bench(
'client-async-pipeline navigation loop (react)',
- benchLifecycle(scenario),
async () => {
for (let i = 0; i < ticksPerIteration; i++) {
- await scenario.tick()
+ await test.tick()
}
- await scenario.finishBatch()
+ await test.finishBatch()
},
- ).run(benchOptions)
+ {
+ ...benchOptions,
+ setup: test.before,
+ teardown: test.after,
+ },
+ )
})
diff --git a/benchmarks/client-nav/scenarios/async-pipeline/react/vite.config.ts b/benchmarks/client-nav/scenarios/async-pipeline/react/vite.config.ts
index e36a5244b1..7161c9a13d 100644
--- a/benchmarks/client-nav/scenarios/async-pipeline/react/vite.config.ts
+++ b/benchmarks/client-nav/scenarios/async-pipeline/react/vite.config.ts
@@ -3,7 +3,6 @@ import { defineConfig } from 'vitest/config'
import react from '@vitejs/plugin-react'
import codspeedPlugin from '@codspeed/vitest-plugin'
import { tanstackRouter } from '@tanstack/router-plugin/vite'
-import { cpuSimulationExecArgv } from '../../../../cpu-simulation'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -33,7 +32,6 @@ export default defineConfig({
},
},
test: {
- execArgv: cpuSimulationExecArgv(),
name: '@benchmarks/client-nav async-pipeline (react)',
watch: false,
environment: 'jsdom',
diff --git a/benchmarks/client-nav/scenarios/async-pipeline/solid/speed.bench.ts b/benchmarks/client-nav/scenarios/async-pipeline/solid/speed.bench.ts
index acef710469..96082e9963 100644
--- a/benchmarks/client-nav/scenarios/async-pipeline/solid/speed.bench.ts
+++ b/benchmarks/client-nav/scenarios/async-pipeline/solid/speed.bench.ts
@@ -1,19 +1,32 @@
-import { test } from 'vitest'
-import { benchLifecycle } from '../../../../cpu-simulation'
+import { afterEach, beforeEach, bench, describe } from 'vitest'
import { benchOptions, ticksPerIteration } from '../shared'
import { setup } from './setup'
-test('client-async-pipeline', async ({ bench }) => {
- const scenario = setup()
+describe('client-async-pipeline', () => {
+ const test = setup()
- await bench(
+ /**
+ * Running `vitest bench` ignores suite hooks, so Tinybench uses the `setup`
+ * and `teardown` options below. CodSpeed bypasses those options but supports
+ * `beforeEach` and `afterEach`. Only one lifecycle path runs in either
+ * environment, and every measured invocation receives fresh application state.
+ */
+
+ beforeEach(test.before)
+ afterEach(test.after)
+
+ bench(
'client-async-pipeline navigation loop (solid)',
- benchLifecycle(scenario),
async () => {
for (let i = 0; i < ticksPerIteration; i++) {
- await scenario.tick()
+ await test.tick()
}
- await scenario.finishBatch()
+ await test.finishBatch()
},
- ).run(benchOptions)
+ {
+ ...benchOptions,
+ setup: test.before,
+ teardown: test.after,
+ },
+ )
})
diff --git a/benchmarks/client-nav/scenarios/async-pipeline/solid/src/main.tsx b/benchmarks/client-nav/scenarios/async-pipeline/solid/src/main.tsx
index 4c6d49f501..4f6d12dba4 100644
--- a/benchmarks/client-nav/scenarios/async-pipeline/solid/src/main.tsx
+++ b/benchmarks/client-nav/scenarios/async-pipeline/solid/src/main.tsx
@@ -1,5 +1,5 @@
import type { RouterHistory } from '@tanstack/history'
-import { render } from 'solid-js/web'
+import { render } from '@solidjs/web'
import { RouterProvider, createRouter } from '@tanstack/solid-router'
import { routeTree } from './routeTree.gen'
diff --git a/benchmarks/client-nav/scenarios/async-pipeline/solid/src/routeTree.gen.ts b/benchmarks/client-nav/scenarios/async-pipeline/solid/src/routeTree.gen.ts
index 27b9498b11..7c15baf4e9 100644
--- a/benchmarks/client-nav/scenarios/async-pipeline/solid/src/routeTree.gen.ts
+++ b/benchmarks/client-nav/scenarios/async-pipeline/solid/src/routeTree.gen.ts
@@ -9,25 +9,25 @@
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
import { Route as rootRouteImport } from './routes/__root'
-import { Route as IndexRouteImport } from './routes/index'
import { Route as NestedRouteImport } from './routes/nested'
-import { Route as CtxIdRouteImport } from './routes/ctx.$id'
-import { Route as NestedIdRouteImport } from './routes/nested.$id'
+import { Route as IndexRouteImport } from './routes/index'
import { Route as SlowIdRouteImport } from './routes/slow.$id'
+import { Route as NestedIdRouteImport } from './routes/nested.$id'
+import { Route as CtxIdRouteImport } from './routes/ctx.$id'
-const IndexRoute = IndexRouteImport.update({
- id: '/',
- path: '/',
- getParentRoute: () => rootRouteImport,
-} as any)
const NestedRoute = NestedRouteImport.update({
id: '/nested',
path: '/nested',
getParentRoute: () => rootRouteImport,
} as any)
-const CtxIdRoute = CtxIdRouteImport.update({
- id: '/ctx/$id',
- path: '/ctx/$id',
+const IndexRoute = IndexRouteImport.update({
+ id: '/',
+ path: '/',
+ getParentRoute: () => rootRouteImport,
+} as any)
+const SlowIdRoute = SlowIdRouteImport.update({
+ id: '/slow/$id',
+ path: '/slow/$id',
getParentRoute: () => rootRouteImport,
} as any)
const NestedIdRoute = NestedIdRouteImport.update({
@@ -35,9 +35,9 @@ const NestedIdRoute = NestedIdRouteImport.update({
path: '/$id',
getParentRoute: () => NestedRoute,
} as any)
-const SlowIdRoute = SlowIdRouteImport.update({
- id: '/slow/$id',
- path: '/slow/$id',
+const CtxIdRoute = CtxIdRouteImport.update({
+ id: '/ctx/$id',
+ path: '/ctx/$id',
getParentRoute: () => rootRouteImport,
} as any)
@@ -80,13 +80,6 @@ export interface RootRouteChildren {
declare module '@tanstack/solid-router' {
interface FileRoutesByPath {
- '/': {
- id: '/'
- path: '/'
- fullPath: '/'
- preLoaderRoute: typeof IndexRouteImport
- parentRoute: typeof rootRouteImport
- }
'/nested': {
id: '/nested'
path: '/nested'
@@ -94,11 +87,18 @@ declare module '@tanstack/solid-router' {
preLoaderRoute: typeof NestedRouteImport
parentRoute: typeof rootRouteImport
}
- '/ctx/$id': {
- id: '/ctx/$id'
- path: '/ctx/$id'
- fullPath: '/ctx/$id'
- preLoaderRoute: typeof CtxIdRouteImport
+ '/': {
+ id: '/'
+ path: '/'
+ fullPath: '/'
+ preLoaderRoute: typeof IndexRouteImport
+ parentRoute: typeof rootRouteImport
+ }
+ '/slow/$id': {
+ id: '/slow/$id'
+ path: '/slow/$id'
+ fullPath: '/slow/$id'
+ preLoaderRoute: typeof SlowIdRouteImport
parentRoute: typeof rootRouteImport
}
'/nested/$id': {
@@ -108,11 +108,11 @@ declare module '@tanstack/solid-router' {
preLoaderRoute: typeof NestedIdRouteImport
parentRoute: typeof NestedRoute
}
- '/slow/$id': {
- id: '/slow/$id'
- path: '/slow/$id'
- fullPath: '/slow/$id'
- preLoaderRoute: typeof SlowIdRouteImport
+ '/ctx/$id': {
+ id: '/ctx/$id'
+ path: '/ctx/$id'
+ fullPath: '/ctx/$id'
+ preLoaderRoute: typeof CtxIdRouteImport
parentRoute: typeof rootRouteImport
}
}
diff --git a/benchmarks/client-nav/scenarios/async-pipeline/solid/tsconfig.json b/benchmarks/client-nav/scenarios/async-pipeline/solid/tsconfig.json
index 98d76ad6b8..8c57ff876a 100644
--- a/benchmarks/client-nav/scenarios/async-pipeline/solid/tsconfig.json
+++ b/benchmarks/client-nav/scenarios/async-pipeline/solid/tsconfig.json
@@ -2,7 +2,7 @@
"extends": "../../../../../tsconfig.json",
"compilerOptions": {
"jsx": "preserve",
- "jsxImportSource": "solid-js",
+ "jsxImportSource": "@solidjs/web",
"allowImportingTsExtensions": true,
"types": ["node", "vite/client", "vitest/globals"]
},
diff --git a/benchmarks/client-nav/scenarios/async-pipeline/solid/vite.config.ts b/benchmarks/client-nav/scenarios/async-pipeline/solid/vite.config.ts
index 214da8042e..a53f61652b 100644
--- a/benchmarks/client-nav/scenarios/async-pipeline/solid/vite.config.ts
+++ b/benchmarks/client-nav/scenarios/async-pipeline/solid/vite.config.ts
@@ -1,9 +1,8 @@
import { fileURLToPath } from 'node:url'
import { defineConfig } from 'vitest/config'
-import solid from 'vite-plugin-solid'
+import solid from '@solidjs/vite-plugin'
import codspeedPlugin from '@codspeed/vitest-plugin'
import { tanstackRouter } from '@tanstack/router-plugin/vite'
-import { cpuSimulationExecArgv } from '../../../../cpu-simulation'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -20,7 +19,7 @@ export default defineConfig({
routesDirectory: `${rootDir}src/routes`,
generatedRouteTree: `${rootDir}src/routeTree.gen.ts`,
}),
- solid({ hot: false, dev: false }),
+ solid({ refresh: false, dev: false }),
],
build: {
outDir: './dist',
@@ -36,7 +35,6 @@ export default defineConfig({
conditions: ['solid', 'browser'],
},
test: {
- execArgv: cpuSimulationExecArgv(),
name: '@benchmarks/client-nav async-pipeline (solid)',
watch: false,
environment: 'jsdom',
diff --git a/benchmarks/client-nav/scenarios/async-pipeline/vue/speed.bench.ts b/benchmarks/client-nav/scenarios/async-pipeline/vue/speed.bench.ts
index f0fd3e58df..193a3837df 100644
--- a/benchmarks/client-nav/scenarios/async-pipeline/vue/speed.bench.ts
+++ b/benchmarks/client-nav/scenarios/async-pipeline/vue/speed.bench.ts
@@ -1,19 +1,32 @@
-import { test } from 'vitest'
-import { benchLifecycle } from '../../../../cpu-simulation'
+import { afterEach, beforeEach, bench, describe } from 'vitest'
import { benchOptions, ticksPerIteration } from '../shared'
import { setup } from './setup'
-test('client-async-pipeline', async ({ bench }) => {
- const scenario = setup()
+describe('client-async-pipeline', () => {
+ const test = setup()
- await bench(
+ /**
+ * Running `vitest bench` ignores suite hooks, so Tinybench uses the `setup`
+ * and `teardown` options below. CodSpeed bypasses those options but supports
+ * `beforeEach` and `afterEach`. Only one lifecycle path runs in either
+ * environment, and every measured invocation receives fresh application state.
+ */
+
+ beforeEach(test.before)
+ afterEach(test.after)
+
+ bench(
'client-async-pipeline navigation loop (vue)',
- benchLifecycle(scenario),
async () => {
for (let i = 0; i < ticksPerIteration; i++) {
- await scenario.tick()
+ await test.tick()
}
- await scenario.finishBatch()
+ await test.finishBatch()
},
- ).run(benchOptions)
+ {
+ ...benchOptions,
+ setup: test.before,
+ teardown: test.after,
+ },
+ )
})
diff --git a/benchmarks/client-nav/scenarios/async-pipeline/vue/src/routeTree.gen.ts b/benchmarks/client-nav/scenarios/async-pipeline/vue/src/routeTree.gen.ts
index 66b9efd7aa..ce26dc62d1 100644
--- a/benchmarks/client-nav/scenarios/async-pipeline/vue/src/routeTree.gen.ts
+++ b/benchmarks/client-nav/scenarios/async-pipeline/vue/src/routeTree.gen.ts
@@ -9,25 +9,25 @@
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
import { Route as rootRouteImport } from './routes/__root'
-import { Route as IndexRouteImport } from './routes/index'
import { Route as NestedRouteImport } from './routes/nested'
-import { Route as CtxIdRouteImport } from './routes/ctx.$id'
-import { Route as NestedIdRouteImport } from './routes/nested.$id'
+import { Route as IndexRouteImport } from './routes/index'
import { Route as SlowIdRouteImport } from './routes/slow.$id'
+import { Route as NestedIdRouteImport } from './routes/nested.$id'
+import { Route as CtxIdRouteImport } from './routes/ctx.$id'
-const IndexRoute = IndexRouteImport.update({
- id: '/',
- path: '/',
- getParentRoute: () => rootRouteImport,
-} as any)
const NestedRoute = NestedRouteImport.update({
id: '/nested',
path: '/nested',
getParentRoute: () => rootRouteImport,
} as any)
-const CtxIdRoute = CtxIdRouteImport.update({
- id: '/ctx/$id',
- path: '/ctx/$id',
+const IndexRoute = IndexRouteImport.update({
+ id: '/',
+ path: '/',
+ getParentRoute: () => rootRouteImport,
+} as any)
+const SlowIdRoute = SlowIdRouteImport.update({
+ id: '/slow/$id',
+ path: '/slow/$id',
getParentRoute: () => rootRouteImport,
} as any)
const NestedIdRoute = NestedIdRouteImport.update({
@@ -35,9 +35,9 @@ const NestedIdRoute = NestedIdRouteImport.update({
path: '/$id',
getParentRoute: () => NestedRoute,
} as any)
-const SlowIdRoute = SlowIdRouteImport.update({
- id: '/slow/$id',
- path: '/slow/$id',
+const CtxIdRoute = CtxIdRouteImport.update({
+ id: '/ctx/$id',
+ path: '/ctx/$id',
getParentRoute: () => rootRouteImport,
} as any)
@@ -80,13 +80,6 @@ export interface RootRouteChildren {
declare module '@tanstack/vue-router' {
interface FileRoutesByPath {
- '/': {
- id: '/'
- path: '/'
- fullPath: '/'
- preLoaderRoute: typeof IndexRouteImport
- parentRoute: typeof rootRouteImport
- }
'/nested': {
id: '/nested'
path: '/nested'
@@ -94,11 +87,18 @@ declare module '@tanstack/vue-router' {
preLoaderRoute: typeof NestedRouteImport
parentRoute: typeof rootRouteImport
}
- '/ctx/$id': {
- id: '/ctx/$id'
- path: '/ctx/$id'
- fullPath: '/ctx/$id'
- preLoaderRoute: typeof CtxIdRouteImport
+ '/': {
+ id: '/'
+ path: '/'
+ fullPath: '/'
+ preLoaderRoute: typeof IndexRouteImport
+ parentRoute: typeof rootRouteImport
+ }
+ '/slow/$id': {
+ id: '/slow/$id'
+ path: '/slow/$id'
+ fullPath: '/slow/$id'
+ preLoaderRoute: typeof SlowIdRouteImport
parentRoute: typeof rootRouteImport
}
'/nested/$id': {
@@ -108,11 +108,11 @@ declare module '@tanstack/vue-router' {
preLoaderRoute: typeof NestedIdRouteImport
parentRoute: typeof NestedRoute
}
- '/slow/$id': {
- id: '/slow/$id'
- path: '/slow/$id'
- fullPath: '/slow/$id'
- preLoaderRoute: typeof SlowIdRouteImport
+ '/ctx/$id': {
+ id: '/ctx/$id'
+ path: '/ctx/$id'
+ fullPath: '/ctx/$id'
+ preLoaderRoute: typeof CtxIdRouteImport
parentRoute: typeof rootRouteImport
}
}
diff --git a/benchmarks/client-nav/scenarios/async-pipeline/vue/vite.config.ts b/benchmarks/client-nav/scenarios/async-pipeline/vue/vite.config.ts
index ce4fa7318a..e16a8ee828 100644
--- a/benchmarks/client-nav/scenarios/async-pipeline/vue/vite.config.ts
+++ b/benchmarks/client-nav/scenarios/async-pipeline/vue/vite.config.ts
@@ -4,7 +4,6 @@ import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import codspeedPlugin from '@codspeed/vitest-plugin'
import { tanstackRouter } from '@tanstack/router-plugin/vite'
-import { cpuSimulationExecArgv } from '../../../../cpu-simulation'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -35,7 +34,6 @@ export default defineConfig({
},
},
test: {
- execArgv: cpuSimulationExecArgv(),
name: '@benchmarks/client-nav async-pipeline (vue)',
watch: false,
environment: 'jsdom',
diff --git a/benchmarks/client-nav/scenarios/control-flow/react/speed.bench.ts b/benchmarks/client-nav/scenarios/control-flow/react/speed.bench.ts
index d6f2190be7..7f1153021f 100644
--- a/benchmarks/client-nav/scenarios/control-flow/react/speed.bench.ts
+++ b/benchmarks/client-nav/scenarios/control-flow/react/speed.bench.ts
@@ -1,19 +1,32 @@
-import { test } from 'vitest'
-import { benchLifecycle } from '../../../../cpu-simulation'
+import { afterEach, beforeEach, bench, describe } from 'vitest'
import { benchOptions, ticksPerIteration } from '../shared'
import { setup } from './setup'
-test('client-control-flow', async ({ bench }) => {
- const scenario = setup()
+describe('client-control-flow', () => {
+ const test = setup()
- await bench(
+ /**
+ * Running `vitest bench` ignores suite hooks, so Tinybench uses the `setup`
+ * and `teardown` options below. CodSpeed bypasses those options but supports
+ * `beforeEach` and `afterEach`. Only one lifecycle path runs in either
+ * environment, and every measured invocation receives fresh application state.
+ */
+
+ beforeEach(test.before)
+ afterEach(test.after)
+
+ bench(
'client-control-flow navigation loop (react)',
- benchLifecycle(scenario),
async () => {
for (let i = 0; i < ticksPerIteration; i++) {
- await scenario.tick()
+ await test.tick()
}
- await scenario.finishBatch()
+ await test.finishBatch()
},
- ).run(benchOptions)
+ {
+ ...benchOptions,
+ setup: test.before,
+ teardown: test.after,
+ },
+ )
})
diff --git a/benchmarks/client-nav/scenarios/control-flow/react/src/routes/broken.tsx b/benchmarks/client-nav/scenarios/control-flow/react/src/routes/broken.tsx
index b11bb845bc..2dc4a26486 100644
--- a/benchmarks/client-nav/scenarios/control-flow/react/src/routes/broken.tsx
+++ b/benchmarks/client-nav/scenarios/control-flow/react/src/routes/broken.tsx
@@ -12,9 +12,5 @@ export const Route = createFileRoute('/broken')({
})
function BrokenError(props: ErrorComponentProps) {
- return (
-
- {props.error instanceof Error ? props.error.message : String(props.error)}
-
- )
+ return {props.error.message}
}
diff --git a/benchmarks/client-nav/scenarios/control-flow/react/vite.config.ts b/benchmarks/client-nav/scenarios/control-flow/react/vite.config.ts
index 1eefca0fc3..1aa2c1fa35 100644
--- a/benchmarks/client-nav/scenarios/control-flow/react/vite.config.ts
+++ b/benchmarks/client-nav/scenarios/control-flow/react/vite.config.ts
@@ -3,7 +3,6 @@ import { defineConfig } from 'vitest/config'
import react from '@vitejs/plugin-react'
import codspeedPlugin from '@codspeed/vitest-plugin'
import { tanstackRouter } from '@tanstack/router-plugin/vite'
-import { cpuSimulationExecArgv } from '../../../../cpu-simulation'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -33,7 +32,6 @@ export default defineConfig({
},
},
test: {
- execArgv: cpuSimulationExecArgv(),
name: '@benchmarks/client-nav control-flow (react)',
watch: false,
environment: 'jsdom',
diff --git a/benchmarks/client-nav/scenarios/control-flow/solid/speed.bench.ts b/benchmarks/client-nav/scenarios/control-flow/solid/speed.bench.ts
index d803d2a313..a88093ca52 100644
--- a/benchmarks/client-nav/scenarios/control-flow/solid/speed.bench.ts
+++ b/benchmarks/client-nav/scenarios/control-flow/solid/speed.bench.ts
@@ -1,19 +1,32 @@
-import { test } from 'vitest'
-import { benchLifecycle } from '../../../../cpu-simulation'
+import { afterEach, beforeEach, bench, describe } from 'vitest'
import { benchOptions, ticksPerIteration } from '../shared'
import { setup } from './setup'
-test('client-control-flow', async ({ bench }) => {
- const scenario = setup()
+describe('client-control-flow', () => {
+ const test = setup()
- await bench(
+ /**
+ * Running `vitest bench` ignores suite hooks, so Tinybench uses the `setup`
+ * and `teardown` options below. CodSpeed bypasses those options but supports
+ * `beforeEach` and `afterEach`. Only one lifecycle path runs in either
+ * environment, and every measured invocation receives fresh application state.
+ */
+
+ beforeEach(test.before)
+ afterEach(test.after)
+
+ bench(
'client-control-flow navigation loop (solid)',
- benchLifecycle(scenario),
async () => {
for (let i = 0; i < ticksPerIteration; i++) {
- await scenario.tick()
+ await test.tick()
}
- await scenario.finishBatch()
+ await test.finishBatch()
},
- ).run(benchOptions)
+ {
+ ...benchOptions,
+ setup: test.before,
+ teardown: test.after,
+ },
+ )
})
diff --git a/benchmarks/client-nav/scenarios/control-flow/solid/src/main.tsx b/benchmarks/client-nav/scenarios/control-flow/solid/src/main.tsx
index fa9d239418..f7148011f5 100644
--- a/benchmarks/client-nav/scenarios/control-flow/solid/src/main.tsx
+++ b/benchmarks/client-nav/scenarios/control-flow/solid/src/main.tsx
@@ -1,5 +1,5 @@
import type { RouterHistory } from '@tanstack/history'
-import { render } from 'solid-js/web'
+import { render } from '@solidjs/web'
import { RouterProvider, createRouter } from '@tanstack/solid-router'
import { routeTree } from './routeTree.gen'
diff --git a/benchmarks/client-nav/scenarios/control-flow/solid/src/routeTree.gen.ts b/benchmarks/client-nav/scenarios/control-flow/solid/src/routeTree.gen.ts
index cd84f99d5d..44d88e9f8d 100644
--- a/benchmarks/client-nav/scenarios/control-flow/solid/src/routeTree.gen.ts
+++ b/benchmarks/client-nav/scenarios/control-flow/solid/src/routeTree.gen.ts
@@ -9,26 +9,16 @@
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
import { Route as rootRouteImport } from './routes/__root'
-import { Route as IndexRouteImport } from './routes/index'
-import { Route as BrokenRouteImport } from './routes/broken'
-import { Route as Hop1RouteImport } from './routes/hop1'
-import { Route as Hop2RouteImport } from './routes/hop2'
import { Route as TargetRouteImport } from './routes/target'
+import { Route as Hop2RouteImport } from './routes/hop2'
+import { Route as Hop1RouteImport } from './routes/hop1'
+import { Route as BrokenRouteImport } from './routes/broken'
+import { Route as IndexRouteImport } from './routes/index'
import { Route as MissingIdRouteImport } from './routes/missing.$id'
-const IndexRoute = IndexRouteImport.update({
- id: '/',
- path: '/',
- getParentRoute: () => rootRouteImport,
-} as any)
-const BrokenRoute = BrokenRouteImport.update({
- id: '/broken',
- path: '/broken',
- getParentRoute: () => rootRouteImport,
-} as any)
-const Hop1Route = Hop1RouteImport.update({
- id: '/hop1',
- path: '/hop1',
+const TargetRoute = TargetRouteImport.update({
+ id: '/target',
+ path: '/target',
getParentRoute: () => rootRouteImport,
} as any)
const Hop2Route = Hop2RouteImport.update({
@@ -36,9 +26,19 @@ const Hop2Route = Hop2RouteImport.update({
path: '/hop2',
getParentRoute: () => rootRouteImport,
} as any)
-const TargetRoute = TargetRouteImport.update({
- id: '/target',
- path: '/target',
+const Hop1Route = Hop1RouteImport.update({
+ id: '/hop1',
+ path: '/hop1',
+ getParentRoute: () => rootRouteImport,
+} as any)
+const BrokenRoute = BrokenRouteImport.update({
+ id: '/broken',
+ path: '/broken',
+ getParentRoute: () => rootRouteImport,
+} as any)
+const IndexRoute = IndexRouteImport.update({
+ id: '/',
+ path: '/',
getParentRoute: () => rootRouteImport,
} as any)
const MissingIdRoute = MissingIdRouteImport.update({
@@ -98,25 +98,11 @@ export interface RootRouteChildren {
declare module '@tanstack/solid-router' {
interface FileRoutesByPath {
- '/': {
- id: '/'
- path: '/'
- fullPath: '/'
- preLoaderRoute: typeof IndexRouteImport
- parentRoute: typeof rootRouteImport
- }
- '/broken': {
- id: '/broken'
- path: '/broken'
- fullPath: '/broken'
- preLoaderRoute: typeof BrokenRouteImport
- parentRoute: typeof rootRouteImport
- }
- '/hop1': {
- id: '/hop1'
- path: '/hop1'
- fullPath: '/hop1'
- preLoaderRoute: typeof Hop1RouteImport
+ '/target': {
+ id: '/target'
+ path: '/target'
+ fullPath: '/target'
+ preLoaderRoute: typeof TargetRouteImport
parentRoute: typeof rootRouteImport
}
'/hop2': {
@@ -126,11 +112,25 @@ declare module '@tanstack/solid-router' {
preLoaderRoute: typeof Hop2RouteImport
parentRoute: typeof rootRouteImport
}
- '/target': {
- id: '/target'
- path: '/target'
- fullPath: '/target'
- preLoaderRoute: typeof TargetRouteImport
+ '/hop1': {
+ id: '/hop1'
+ path: '/hop1'
+ fullPath: '/hop1'
+ preLoaderRoute: typeof Hop1RouteImport
+ parentRoute: typeof rootRouteImport
+ }
+ '/broken': {
+ id: '/broken'
+ path: '/broken'
+ fullPath: '/broken'
+ preLoaderRoute: typeof BrokenRouteImport
+ parentRoute: typeof rootRouteImport
+ }
+ '/': {
+ id: '/'
+ path: '/'
+ fullPath: '/'
+ preLoaderRoute: typeof IndexRouteImport
parentRoute: typeof rootRouteImport
}
'/missing/$id': {
diff --git a/benchmarks/client-nav/scenarios/control-flow/solid/tsconfig.json b/benchmarks/client-nav/scenarios/control-flow/solid/tsconfig.json
index 98d76ad6b8..8c57ff876a 100644
--- a/benchmarks/client-nav/scenarios/control-flow/solid/tsconfig.json
+++ b/benchmarks/client-nav/scenarios/control-flow/solid/tsconfig.json
@@ -2,7 +2,7 @@
"extends": "../../../../../tsconfig.json",
"compilerOptions": {
"jsx": "preserve",
- "jsxImportSource": "solid-js",
+ "jsxImportSource": "@solidjs/web",
"allowImportingTsExtensions": true,
"types": ["node", "vite/client", "vitest/globals"]
},
diff --git a/benchmarks/client-nav/scenarios/control-flow/solid/vite.config.ts b/benchmarks/client-nav/scenarios/control-flow/solid/vite.config.ts
index f4fa916154..d5e1af5470 100644
--- a/benchmarks/client-nav/scenarios/control-flow/solid/vite.config.ts
+++ b/benchmarks/client-nav/scenarios/control-flow/solid/vite.config.ts
@@ -1,9 +1,8 @@
import { fileURLToPath } from 'node:url'
import { defineConfig } from 'vitest/config'
-import solid from 'vite-plugin-solid'
+import solid from '@solidjs/vite-plugin'
import codspeedPlugin from '@codspeed/vitest-plugin'
import { tanstackRouter } from '@tanstack/router-plugin/vite'
-import { cpuSimulationExecArgv } from '../../../../cpu-simulation'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -20,7 +19,7 @@ export default defineConfig({
routesDirectory: `${rootDir}src/routes`,
generatedRouteTree: `${rootDir}src/routeTree.gen.ts`,
}),
- solid({ hot: false, dev: false }),
+ solid({ refresh: false, dev: false }),
],
build: {
outDir: './dist',
@@ -36,7 +35,6 @@ export default defineConfig({
conditions: ['solid', 'browser'],
},
test: {
- execArgv: cpuSimulationExecArgv(),
name: '@benchmarks/client-nav control-flow (solid)',
watch: false,
environment: 'jsdom',
diff --git a/benchmarks/client-nav/scenarios/control-flow/vue/speed.bench.ts b/benchmarks/client-nav/scenarios/control-flow/vue/speed.bench.ts
index 8a019945c7..9a335cfb87 100644
--- a/benchmarks/client-nav/scenarios/control-flow/vue/speed.bench.ts
+++ b/benchmarks/client-nav/scenarios/control-flow/vue/speed.bench.ts
@@ -1,19 +1,32 @@
-import { test } from 'vitest'
-import { benchLifecycle } from '../../../../cpu-simulation'
+import { afterEach, beforeEach, bench, describe } from 'vitest'
import { benchOptions, ticksPerIteration } from '../shared'
import { setup } from './setup'
-test('client-control-flow', async ({ bench }) => {
- const scenario = setup()
+describe('client-control-flow', () => {
+ const test = setup()
- await bench(
+ /**
+ * Running `vitest bench` ignores suite hooks, so Tinybench uses the `setup`
+ * and `teardown` options below. CodSpeed bypasses those options but supports
+ * `beforeEach` and `afterEach`. Only one lifecycle path runs in either
+ * environment, and every measured invocation receives fresh application state.
+ */
+
+ beforeEach(test.before)
+ afterEach(test.after)
+
+ bench(
'client-control-flow navigation loop (vue)',
- benchLifecycle(scenario),
async () => {
for (let i = 0; i < ticksPerIteration; i++) {
- await scenario.tick()
+ await test.tick()
}
- await scenario.finishBatch()
+ await test.finishBatch()
},
- ).run(benchOptions)
+ {
+ ...benchOptions,
+ setup: test.before,
+ teardown: test.after,
+ },
+ )
})
diff --git a/benchmarks/client-nav/scenarios/control-flow/vue/src/routeTree.gen.ts b/benchmarks/client-nav/scenarios/control-flow/vue/src/routeTree.gen.ts
index 6b53a6a203..60fc846f89 100644
--- a/benchmarks/client-nav/scenarios/control-flow/vue/src/routeTree.gen.ts
+++ b/benchmarks/client-nav/scenarios/control-flow/vue/src/routeTree.gen.ts
@@ -9,26 +9,16 @@
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
import { Route as rootRouteImport } from './routes/__root'
-import { Route as IndexRouteImport } from './routes/index'
-import { Route as BrokenRouteImport } from './routes/broken'
-import { Route as Hop1RouteImport } from './routes/hop1'
-import { Route as Hop2RouteImport } from './routes/hop2'
import { Route as TargetRouteImport } from './routes/target'
+import { Route as Hop2RouteImport } from './routes/hop2'
+import { Route as Hop1RouteImport } from './routes/hop1'
+import { Route as BrokenRouteImport } from './routes/broken'
+import { Route as IndexRouteImport } from './routes/index'
import { Route as MissingIdRouteImport } from './routes/missing.$id'
-const IndexRoute = IndexRouteImport.update({
- id: '/',
- path: '/',
- getParentRoute: () => rootRouteImport,
-} as any)
-const BrokenRoute = BrokenRouteImport.update({
- id: '/broken',
- path: '/broken',
- getParentRoute: () => rootRouteImport,
-} as any)
-const Hop1Route = Hop1RouteImport.update({
- id: '/hop1',
- path: '/hop1',
+const TargetRoute = TargetRouteImport.update({
+ id: '/target',
+ path: '/target',
getParentRoute: () => rootRouteImport,
} as any)
const Hop2Route = Hop2RouteImport.update({
@@ -36,9 +26,19 @@ const Hop2Route = Hop2RouteImport.update({
path: '/hop2',
getParentRoute: () => rootRouteImport,
} as any)
-const TargetRoute = TargetRouteImport.update({
- id: '/target',
- path: '/target',
+const Hop1Route = Hop1RouteImport.update({
+ id: '/hop1',
+ path: '/hop1',
+ getParentRoute: () => rootRouteImport,
+} as any)
+const BrokenRoute = BrokenRouteImport.update({
+ id: '/broken',
+ path: '/broken',
+ getParentRoute: () => rootRouteImport,
+} as any)
+const IndexRoute = IndexRouteImport.update({
+ id: '/',
+ path: '/',
getParentRoute: () => rootRouteImport,
} as any)
const MissingIdRoute = MissingIdRouteImport.update({
@@ -98,25 +98,11 @@ export interface RootRouteChildren {
declare module '@tanstack/vue-router' {
interface FileRoutesByPath {
- '/': {
- id: '/'
- path: '/'
- fullPath: '/'
- preLoaderRoute: typeof IndexRouteImport
- parentRoute: typeof rootRouteImport
- }
- '/broken': {
- id: '/broken'
- path: '/broken'
- fullPath: '/broken'
- preLoaderRoute: typeof BrokenRouteImport
- parentRoute: typeof rootRouteImport
- }
- '/hop1': {
- id: '/hop1'
- path: '/hop1'
- fullPath: '/hop1'
- preLoaderRoute: typeof Hop1RouteImport
+ '/target': {
+ id: '/target'
+ path: '/target'
+ fullPath: '/target'
+ preLoaderRoute: typeof TargetRouteImport
parentRoute: typeof rootRouteImport
}
'/hop2': {
@@ -126,11 +112,25 @@ declare module '@tanstack/vue-router' {
preLoaderRoute: typeof Hop2RouteImport
parentRoute: typeof rootRouteImport
}
- '/target': {
- id: '/target'
- path: '/target'
- fullPath: '/target'
- preLoaderRoute: typeof TargetRouteImport
+ '/hop1': {
+ id: '/hop1'
+ path: '/hop1'
+ fullPath: '/hop1'
+ preLoaderRoute: typeof Hop1RouteImport
+ parentRoute: typeof rootRouteImport
+ }
+ '/broken': {
+ id: '/broken'
+ path: '/broken'
+ fullPath: '/broken'
+ preLoaderRoute: typeof BrokenRouteImport
+ parentRoute: typeof rootRouteImport
+ }
+ '/': {
+ id: '/'
+ path: '/'
+ fullPath: '/'
+ preLoaderRoute: typeof IndexRouteImport
parentRoute: typeof rootRouteImport
}
'/missing/$id': {
diff --git a/benchmarks/client-nav/scenarios/control-flow/vue/vite.config.ts b/benchmarks/client-nav/scenarios/control-flow/vue/vite.config.ts
index 3c2750d2a6..4694cf69c8 100644
--- a/benchmarks/client-nav/scenarios/control-flow/vue/vite.config.ts
+++ b/benchmarks/client-nav/scenarios/control-flow/vue/vite.config.ts
@@ -4,7 +4,6 @@ import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import codspeedPlugin from '@codspeed/vitest-plugin'
import { tanstackRouter } from '@tanstack/router-plugin/vite'
-import { cpuSimulationExecArgv } from '../../../../cpu-simulation'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -35,7 +34,6 @@ export default defineConfig({
},
},
test: {
- execArgv: cpuSimulationExecArgv(),
name: '@benchmarks/client-nav control-flow (vue)',
watch: false,
environment: 'jsdom',
diff --git a/benchmarks/client-nav/scenarios/head/react/speed.bench.ts b/benchmarks/client-nav/scenarios/head/react/speed.bench.ts
index d0d731a09f..97c76a1a11 100644
--- a/benchmarks/client-nav/scenarios/head/react/speed.bench.ts
+++ b/benchmarks/client-nav/scenarios/head/react/speed.bench.ts
@@ -1,19 +1,32 @@
-import { test } from 'vitest'
-import { benchLifecycle } from '../../../../cpu-simulation'
+import { afterEach, beforeEach, bench, describe } from 'vitest'
import { benchOptions, ticksPerIteration } from '../shared'
import { setup } from './setup'
-test('client-head', async ({ bench }) => {
- const scenario = setup()
+describe('client-head', () => {
+ const test = setup()
- await bench(
+ /**
+ * Running `vitest bench` ignores suite hooks, so Tinybench uses the `setup`
+ * and `teardown` options below. CodSpeed bypasses those options but supports
+ * `beforeEach` and `afterEach`. Only one lifecycle path runs in either
+ * environment, and every measured invocation receives fresh application state.
+ */
+
+ beforeEach(test.before)
+ afterEach(test.after)
+
+ bench(
'client-head navigation loop (react)',
- benchLifecycle(scenario),
async () => {
for (let i = 0; i < ticksPerIteration; i++) {
- await scenario.tick()
+ await test.tick()
}
- await scenario.finishBatch()
+ await test.finishBatch()
},
- ).run(benchOptions)
+ {
+ ...benchOptions,
+ setup: test.before,
+ teardown: test.after,
+ },
+ )
})
diff --git a/benchmarks/client-nav/scenarios/head/react/vite.config.ts b/benchmarks/client-nav/scenarios/head/react/vite.config.ts
index 7c8d6d4c15..086bd60bb4 100644
--- a/benchmarks/client-nav/scenarios/head/react/vite.config.ts
+++ b/benchmarks/client-nav/scenarios/head/react/vite.config.ts
@@ -3,7 +3,6 @@ import { defineConfig } from 'vitest/config'
import react from '@vitejs/plugin-react'
import codspeedPlugin from '@codspeed/vitest-plugin'
import { tanstackRouter } from '@tanstack/router-plugin/vite'
-import { cpuSimulationExecArgv } from '../../../../cpu-simulation'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -33,7 +32,6 @@ export default defineConfig({
},
},
test: {
- execArgv: cpuSimulationExecArgv(),
name: '@benchmarks/client-nav head (react)',
watch: false,
environment: 'jsdom',
diff --git a/benchmarks/client-nav/scenarios/head/solid/speed.bench.ts b/benchmarks/client-nav/scenarios/head/solid/speed.bench.ts
index ca156c950b..075e7673de 100644
--- a/benchmarks/client-nav/scenarios/head/solid/speed.bench.ts
+++ b/benchmarks/client-nav/scenarios/head/solid/speed.bench.ts
@@ -1,19 +1,32 @@
-import { test } from 'vitest'
-import { benchLifecycle } from '../../../../cpu-simulation'
+import { afterEach, beforeEach, bench, describe } from 'vitest'
import { benchOptions, ticksPerIteration } from '../shared'
import { setup } from './setup'
-test('client-head', async ({ bench }) => {
- const scenario = setup()
+describe('client-head', () => {
+ const test = setup()
- await bench(
+ /**
+ * Running `vitest bench` ignores suite hooks, so Tinybench uses the `setup`
+ * and `teardown` options below. CodSpeed bypasses those options but supports
+ * `beforeEach` and `afterEach`. Only one lifecycle path runs in either
+ * environment, and every measured invocation receives fresh application state.
+ */
+
+ beforeEach(test.before)
+ afterEach(test.after)
+
+ bench(
'client-head navigation loop (solid)',
- benchLifecycle(scenario),
async () => {
for (let i = 0; i < ticksPerIteration; i++) {
- await scenario.tick()
+ await test.tick()
}
- await scenario.finishBatch()
+ await test.finishBatch()
},
- ).run(benchOptions)
+ {
+ ...benchOptions,
+ setup: test.before,
+ teardown: test.after,
+ },
+ )
})
diff --git a/benchmarks/client-nav/scenarios/head/solid/src/main.tsx b/benchmarks/client-nav/scenarios/head/solid/src/main.tsx
index fa9d239418..f7148011f5 100644
--- a/benchmarks/client-nav/scenarios/head/solid/src/main.tsx
+++ b/benchmarks/client-nav/scenarios/head/solid/src/main.tsx
@@ -1,5 +1,5 @@
import type { RouterHistory } from '@tanstack/history'
-import { render } from 'solid-js/web'
+import { render } from '@solidjs/web'
import { RouterProvider, createRouter } from '@tanstack/solid-router'
import { routeTree } from './routeTree.gen'
diff --git a/benchmarks/client-nav/scenarios/head/solid/src/routeTree.gen.ts b/benchmarks/client-nav/scenarios/head/solid/src/routeTree.gen.ts
index b6f217e527..ead6a4436a 100644
--- a/benchmarks/client-nav/scenarios/head/solid/src/routeTree.gen.ts
+++ b/benchmarks/client-nav/scenarios/head/solid/src/routeTree.gen.ts
@@ -9,15 +9,15 @@
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
import { Route as rootRouteImport } from './routes/__root'
-import { Route as IndexRouteImport } from './routes/index'
-import { Route as DocsRouteImport } from './routes/docs'
import { Route as SettingsRouteImport } from './routes/settings'
-import { Route as ArticlesIdRouteImport } from './routes/articles.$id'
+import { Route as DocsRouteImport } from './routes/docs'
+import { Route as IndexRouteImport } from './routes/index'
import { Route as DocsSectionRouteImport } from './routes/docs.$section'
+import { Route as ArticlesIdRouteImport } from './routes/articles.$id'
-const IndexRoute = IndexRouteImport.update({
- id: '/',
- path: '/',
+const SettingsRoute = SettingsRouteImport.update({
+ id: '/settings',
+ path: '/settings',
getParentRoute: () => rootRouteImport,
} as any)
const DocsRoute = DocsRouteImport.update({
@@ -25,14 +25,9 @@ const DocsRoute = DocsRouteImport.update({
path: '/docs',
getParentRoute: () => rootRouteImport,
} as any)
-const SettingsRoute = SettingsRouteImport.update({
- id: '/settings',
- path: '/settings',
- getParentRoute: () => rootRouteImport,
-} as any)
-const ArticlesIdRoute = ArticlesIdRouteImport.update({
- id: '/articles/$id',
- path: '/articles/$id',
+const IndexRoute = IndexRouteImport.update({
+ id: '/',
+ path: '/',
getParentRoute: () => rootRouteImport,
} as any)
const DocsSectionRoute = DocsSectionRouteImport.update({
@@ -40,6 +35,11 @@ const DocsSectionRoute = DocsSectionRouteImport.update({
path: '/$section',
getParentRoute: () => DocsRoute,
} as any)
+const ArticlesIdRoute = ArticlesIdRouteImport.update({
+ id: '/articles/$id',
+ path: '/articles/$id',
+ getParentRoute: () => rootRouteImport,
+} as any)
export interface FileRoutesByFullPath {
'/': typeof IndexRoute
@@ -86,11 +86,11 @@ export interface RootRouteChildren {
declare module '@tanstack/solid-router' {
interface FileRoutesByPath {
- '/': {
- id: '/'
- path: '/'
- fullPath: '/'
- preLoaderRoute: typeof IndexRouteImport
+ '/settings': {
+ id: '/settings'
+ path: '/settings'
+ fullPath: '/settings'
+ preLoaderRoute: typeof SettingsRouteImport
parentRoute: typeof rootRouteImport
}
'/docs': {
@@ -100,18 +100,11 @@ declare module '@tanstack/solid-router' {
preLoaderRoute: typeof DocsRouteImport
parentRoute: typeof rootRouteImport
}
- '/settings': {
- id: '/settings'
- path: '/settings'
- fullPath: '/settings'
- preLoaderRoute: typeof SettingsRouteImport
- parentRoute: typeof rootRouteImport
- }
- '/articles/$id': {
- id: '/articles/$id'
- path: '/articles/$id'
- fullPath: '/articles/$id'
- preLoaderRoute: typeof ArticlesIdRouteImport
+ '/': {
+ id: '/'
+ path: '/'
+ fullPath: '/'
+ preLoaderRoute: typeof IndexRouteImport
parentRoute: typeof rootRouteImport
}
'/docs/$section': {
@@ -121,6 +114,13 @@ declare module '@tanstack/solid-router' {
preLoaderRoute: typeof DocsSectionRouteImport
parentRoute: typeof DocsRoute
}
+ '/articles/$id': {
+ id: '/articles/$id'
+ path: '/articles/$id'
+ fullPath: '/articles/$id'
+ preLoaderRoute: typeof ArticlesIdRouteImport
+ parentRoute: typeof rootRouteImport
+ }
}
}
diff --git a/benchmarks/client-nav/scenarios/head/solid/tsconfig.json b/benchmarks/client-nav/scenarios/head/solid/tsconfig.json
index 98d76ad6b8..8c57ff876a 100644
--- a/benchmarks/client-nav/scenarios/head/solid/tsconfig.json
+++ b/benchmarks/client-nav/scenarios/head/solid/tsconfig.json
@@ -2,7 +2,7 @@
"extends": "../../../../../tsconfig.json",
"compilerOptions": {
"jsx": "preserve",
- "jsxImportSource": "solid-js",
+ "jsxImportSource": "@solidjs/web",
"allowImportingTsExtensions": true,
"types": ["node", "vite/client", "vitest/globals"]
},
diff --git a/benchmarks/client-nav/scenarios/head/solid/vite.config.ts b/benchmarks/client-nav/scenarios/head/solid/vite.config.ts
index 986b2de2b0..fc3876b03e 100644
--- a/benchmarks/client-nav/scenarios/head/solid/vite.config.ts
+++ b/benchmarks/client-nav/scenarios/head/solid/vite.config.ts
@@ -1,9 +1,8 @@
import { fileURLToPath } from 'node:url'
import { defineConfig } from 'vitest/config'
-import solid from 'vite-plugin-solid'
+import solid from '@solidjs/vite-plugin'
import codspeedPlugin from '@codspeed/vitest-plugin'
import { tanstackRouter } from '@tanstack/router-plugin/vite'
-import { cpuSimulationExecArgv } from '../../../../cpu-simulation'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -20,7 +19,7 @@ export default defineConfig({
routesDirectory: `${rootDir}src/routes`,
generatedRouteTree: `${rootDir}src/routeTree.gen.ts`,
}),
- solid({ hot: false, dev: false }),
+ solid({ refresh: false, dev: false }),
],
build: {
outDir: './dist',
@@ -36,7 +35,6 @@ export default defineConfig({
conditions: ['solid', 'browser'],
},
test: {
- execArgv: cpuSimulationExecArgv(),
name: '@benchmarks/client-nav head (solid)',
watch: false,
environment: 'jsdom',
diff --git a/benchmarks/client-nav/scenarios/head/vue/speed.bench.ts b/benchmarks/client-nav/scenarios/head/vue/speed.bench.ts
index d188a9dd7a..7080b4ea7d 100644
--- a/benchmarks/client-nav/scenarios/head/vue/speed.bench.ts
+++ b/benchmarks/client-nav/scenarios/head/vue/speed.bench.ts
@@ -1,19 +1,32 @@
-import { test } from 'vitest'
-import { benchLifecycle } from '../../../../cpu-simulation'
+import { afterEach, beforeEach, bench, describe } from 'vitest'
import { benchOptions, ticksPerIteration } from '../shared'
import { setup } from './setup'
-test('client-head', async ({ bench }) => {
- const scenario = setup()
+describe('client-head', () => {
+ const test = setup()
- await bench(
+ /**
+ * Running `vitest bench` ignores suite hooks, so Tinybench uses the `setup`
+ * and `teardown` options below. CodSpeed bypasses those options but supports
+ * `beforeEach` and `afterEach`. Only one lifecycle path runs in either
+ * environment, and every measured invocation receives fresh application state.
+ */
+
+ beforeEach(test.before)
+ afterEach(test.after)
+
+ bench(
'client-head navigation loop (vue)',
- benchLifecycle(scenario),
async () => {
for (let i = 0; i < ticksPerIteration; i++) {
- await scenario.tick()
+ await test.tick()
}
- await scenario.finishBatch()
+ await test.finishBatch()
},
- ).run(benchOptions)
+ {
+ ...benchOptions,
+ setup: test.before,
+ teardown: test.after,
+ },
+ )
})
diff --git a/benchmarks/client-nav/scenarios/head/vue/src/routeTree.gen.ts b/benchmarks/client-nav/scenarios/head/vue/src/routeTree.gen.ts
index 161f99a65c..b115854c26 100644
--- a/benchmarks/client-nav/scenarios/head/vue/src/routeTree.gen.ts
+++ b/benchmarks/client-nav/scenarios/head/vue/src/routeTree.gen.ts
@@ -9,15 +9,15 @@
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
import { Route as rootRouteImport } from './routes/__root'
-import { Route as IndexRouteImport } from './routes/index'
-import { Route as DocsRouteImport } from './routes/docs'
import { Route as SettingsRouteImport } from './routes/settings'
-import { Route as ArticlesIdRouteImport } from './routes/articles.$id'
+import { Route as DocsRouteImport } from './routes/docs'
+import { Route as IndexRouteImport } from './routes/index'
import { Route as DocsSectionRouteImport } from './routes/docs.$section'
+import { Route as ArticlesIdRouteImport } from './routes/articles.$id'
-const IndexRoute = IndexRouteImport.update({
- id: '/',
- path: '/',
+const SettingsRoute = SettingsRouteImport.update({
+ id: '/settings',
+ path: '/settings',
getParentRoute: () => rootRouteImport,
} as any)
const DocsRoute = DocsRouteImport.update({
@@ -25,14 +25,9 @@ const DocsRoute = DocsRouteImport.update({
path: '/docs',
getParentRoute: () => rootRouteImport,
} as any)
-const SettingsRoute = SettingsRouteImport.update({
- id: '/settings',
- path: '/settings',
- getParentRoute: () => rootRouteImport,
-} as any)
-const ArticlesIdRoute = ArticlesIdRouteImport.update({
- id: '/articles/$id',
- path: '/articles/$id',
+const IndexRoute = IndexRouteImport.update({
+ id: '/',
+ path: '/',
getParentRoute: () => rootRouteImport,
} as any)
const DocsSectionRoute = DocsSectionRouteImport.update({
@@ -40,6 +35,11 @@ const DocsSectionRoute = DocsSectionRouteImport.update({
path: '/$section',
getParentRoute: () => DocsRoute,
} as any)
+const ArticlesIdRoute = ArticlesIdRouteImport.update({
+ id: '/articles/$id',
+ path: '/articles/$id',
+ getParentRoute: () => rootRouteImport,
+} as any)
export interface FileRoutesByFullPath {
'/': typeof IndexRoute
@@ -86,11 +86,11 @@ export interface RootRouteChildren {
declare module '@tanstack/vue-router' {
interface FileRoutesByPath {
- '/': {
- id: '/'
- path: '/'
- fullPath: '/'
- preLoaderRoute: typeof IndexRouteImport
+ '/settings': {
+ id: '/settings'
+ path: '/settings'
+ fullPath: '/settings'
+ preLoaderRoute: typeof SettingsRouteImport
parentRoute: typeof rootRouteImport
}
'/docs': {
@@ -100,18 +100,11 @@ declare module '@tanstack/vue-router' {
preLoaderRoute: typeof DocsRouteImport
parentRoute: typeof rootRouteImport
}
- '/settings': {
- id: '/settings'
- path: '/settings'
- fullPath: '/settings'
- preLoaderRoute: typeof SettingsRouteImport
- parentRoute: typeof rootRouteImport
- }
- '/articles/$id': {
- id: '/articles/$id'
- path: '/articles/$id'
- fullPath: '/articles/$id'
- preLoaderRoute: typeof ArticlesIdRouteImport
+ '/': {
+ id: '/'
+ path: '/'
+ fullPath: '/'
+ preLoaderRoute: typeof IndexRouteImport
parentRoute: typeof rootRouteImport
}
'/docs/$section': {
@@ -121,6 +114,13 @@ declare module '@tanstack/vue-router' {
preLoaderRoute: typeof DocsSectionRouteImport
parentRoute: typeof DocsRoute
}
+ '/articles/$id': {
+ id: '/articles/$id'
+ path: '/articles/$id'
+ fullPath: '/articles/$id'
+ preLoaderRoute: typeof ArticlesIdRouteImport
+ parentRoute: typeof rootRouteImport
+ }
}
}
diff --git a/benchmarks/client-nav/scenarios/head/vue/vite.config.ts b/benchmarks/client-nav/scenarios/head/vue/vite.config.ts
index bb1126d85f..0ad2067925 100644
--- a/benchmarks/client-nav/scenarios/head/vue/vite.config.ts
+++ b/benchmarks/client-nav/scenarios/head/vue/vite.config.ts
@@ -4,7 +4,6 @@ import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import codspeedPlugin from '@codspeed/vitest-plugin'
import { tanstackRouter } from '@tanstack/router-plugin/vite'
-import { cpuSimulationExecArgv } from '../../../../cpu-simulation'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -35,7 +34,6 @@ export default defineConfig({
},
},
test: {
- execArgv: cpuSimulationExecArgv(),
name: '@benchmarks/client-nav head (vue)',
watch: false,
environment: 'jsdom',
diff --git a/benchmarks/client-nav/scenarios/history/react/speed.bench.ts b/benchmarks/client-nav/scenarios/history/react/speed.bench.ts
index 6ec7031857..9192258b66 100644
--- a/benchmarks/client-nav/scenarios/history/react/speed.bench.ts
+++ b/benchmarks/client-nav/scenarios/history/react/speed.bench.ts
@@ -1,19 +1,32 @@
-import { test } from 'vitest'
-import { benchLifecycle } from '../../../../cpu-simulation'
+import { afterEach, beforeEach, bench, describe } from 'vitest'
import { benchOptions, ticksPerIteration } from '../shared'
import { setup } from './setup'
-test('client-history', async ({ bench }) => {
- const scenario = setup()
+describe('client-history', () => {
+ const test = setup()
- await bench(
+ /**
+ * Running `vitest bench` ignores suite hooks, so Tinybench uses the `setup`
+ * and `teardown` options below. CodSpeed bypasses those options but supports
+ * `beforeEach` and `afterEach`. Only one lifecycle path runs in either
+ * environment, and every measured invocation receives fresh application state.
+ */
+
+ beforeEach(test.before)
+ afterEach(test.after)
+
+ bench(
'client-history navigation loop (react)',
- benchLifecycle(scenario),
async () => {
for (let i = 0; i < ticksPerIteration; i++) {
- await scenario.tick()
+ await test.tick()
}
- await scenario.finishBatch()
+ await test.finishBatch()
},
- ).run(benchOptions)
+ {
+ ...benchOptions,
+ setup: test.before,
+ teardown: test.after,
+ },
+ )
})
diff --git a/benchmarks/client-nav/scenarios/history/react/vite.config.ts b/benchmarks/client-nav/scenarios/history/react/vite.config.ts
index bdbde9c668..61a1b2feef 100644
--- a/benchmarks/client-nav/scenarios/history/react/vite.config.ts
+++ b/benchmarks/client-nav/scenarios/history/react/vite.config.ts
@@ -3,7 +3,6 @@ import { defineConfig } from 'vitest/config'
import react from '@vitejs/plugin-react'
import codspeedPlugin from '@codspeed/vitest-plugin'
import { tanstackRouter } from '@tanstack/router-plugin/vite'
-import { cpuSimulationExecArgv } from '../../../../cpu-simulation'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -33,7 +32,6 @@ export default defineConfig({
},
},
test: {
- execArgv: cpuSimulationExecArgv(),
name: '@benchmarks/client-nav history (react)',
watch: false,
environment: 'jsdom',
diff --git a/benchmarks/client-nav/scenarios/history/solid/speed.bench.ts b/benchmarks/client-nav/scenarios/history/solid/speed.bench.ts
index 56af035b2b..d7f4fd898d 100644
--- a/benchmarks/client-nav/scenarios/history/solid/speed.bench.ts
+++ b/benchmarks/client-nav/scenarios/history/solid/speed.bench.ts
@@ -1,19 +1,32 @@
-import { test } from 'vitest'
-import { benchLifecycle } from '../../../../cpu-simulation'
+import { afterEach, beforeEach, bench, describe } from 'vitest'
import { benchOptions, ticksPerIteration } from '../shared'
import { setup } from './setup'
-test('client-history', async ({ bench }) => {
- const scenario = setup()
+describe('client-history', () => {
+ const test = setup()
- await bench(
+ /**
+ * Running `vitest bench` ignores suite hooks, so Tinybench uses the `setup`
+ * and `teardown` options below. CodSpeed bypasses those options but supports
+ * `beforeEach` and `afterEach`. Only one lifecycle path runs in either
+ * environment, and every measured invocation receives fresh application state.
+ */
+
+ beforeEach(test.before)
+ afterEach(test.after)
+
+ bench(
'client-history navigation loop (solid)',
- benchLifecycle(scenario),
async () => {
for (let i = 0; i < ticksPerIteration; i++) {
- await scenario.tick()
+ await test.tick()
}
- await scenario.finishBatch()
+ await test.finishBatch()
},
- ).run(benchOptions)
+ {
+ ...benchOptions,
+ setup: test.before,
+ teardown: test.after,
+ },
+ )
})
diff --git a/benchmarks/client-nav/scenarios/history/solid/src/main.tsx b/benchmarks/client-nav/scenarios/history/solid/src/main.tsx
index fa9d239418..f7148011f5 100644
--- a/benchmarks/client-nav/scenarios/history/solid/src/main.tsx
+++ b/benchmarks/client-nav/scenarios/history/solid/src/main.tsx
@@ -1,5 +1,5 @@
import type { RouterHistory } from '@tanstack/history'
-import { render } from 'solid-js/web'
+import { render } from '@solidjs/web'
import { RouterProvider, createRouter } from '@tanstack/solid-router'
import { routeTree } from './routeTree.gen'
diff --git a/benchmarks/client-nav/scenarios/history/solid/src/routeTree.gen.ts b/benchmarks/client-nav/scenarios/history/solid/src/routeTree.gen.ts
index af253f4a15..a6ab2a4fc8 100644
--- a/benchmarks/client-nav/scenarios/history/solid/src/routeTree.gen.ts
+++ b/benchmarks/client-nav/scenarios/history/solid/src/routeTree.gen.ts
@@ -9,24 +9,19 @@
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
import { Route as rootRouteImport } from './routes/__root'
-import { Route as IndexRouteImport } from './routes/index'
import { Route as GalleryRouteImport } from './routes/gallery'
-import { Route as PagesNRouteImport } from './routes/pages.$n'
+import { Route as IndexRouteImport } from './routes/index'
import { Route as PhotosPhotoIdRouteImport } from './routes/photos.$photoId'
+import { Route as PagesNRouteImport } from './routes/pages.$n'
-const IndexRoute = IndexRouteImport.update({
- id: '/',
- path: '/',
- getParentRoute: () => rootRouteImport,
-} as any)
const GalleryRoute = GalleryRouteImport.update({
id: '/gallery',
path: '/gallery',
getParentRoute: () => rootRouteImport,
} as any)
-const PagesNRoute = PagesNRouteImport.update({
- id: '/pages/$n',
- path: '/pages/$n',
+const IndexRoute = IndexRouteImport.update({
+ id: '/',
+ path: '/',
getParentRoute: () => rootRouteImport,
} as any)
const PhotosPhotoIdRoute = PhotosPhotoIdRouteImport.update({
@@ -34,6 +29,11 @@ const PhotosPhotoIdRoute = PhotosPhotoIdRouteImport.update({
path: '/photos/$photoId',
getParentRoute: () => rootRouteImport,
} as any)
+const PagesNRoute = PagesNRouteImport.update({
+ id: '/pages/$n',
+ path: '/pages/$n',
+ getParentRoute: () => rootRouteImport,
+} as any)
export interface FileRoutesByFullPath {
'/': typeof IndexRoute
@@ -71,13 +71,6 @@ export interface RootRouteChildren {
declare module '@tanstack/solid-router' {
interface FileRoutesByPath {
- '/': {
- id: '/'
- path: '/'
- fullPath: '/'
- preLoaderRoute: typeof IndexRouteImport
- parentRoute: typeof rootRouteImport
- }
'/gallery': {
id: '/gallery'
path: '/gallery'
@@ -85,11 +78,11 @@ declare module '@tanstack/solid-router' {
preLoaderRoute: typeof GalleryRouteImport
parentRoute: typeof rootRouteImport
}
- '/pages/$n': {
- id: '/pages/$n'
- path: '/pages/$n'
- fullPath: '/pages/$n'
- preLoaderRoute: typeof PagesNRouteImport
+ '/': {
+ id: '/'
+ path: '/'
+ fullPath: '/'
+ preLoaderRoute: typeof IndexRouteImport
parentRoute: typeof rootRouteImport
}
'/photos/$photoId': {
@@ -99,6 +92,13 @@ declare module '@tanstack/solid-router' {
preLoaderRoute: typeof PhotosPhotoIdRouteImport
parentRoute: typeof rootRouteImport
}
+ '/pages/$n': {
+ id: '/pages/$n'
+ path: '/pages/$n'
+ fullPath: '/pages/$n'
+ preLoaderRoute: typeof PagesNRouteImport
+ parentRoute: typeof rootRouteImport
+ }
}
}
diff --git a/benchmarks/client-nav/scenarios/history/solid/tsconfig.json b/benchmarks/client-nav/scenarios/history/solid/tsconfig.json
index 98d76ad6b8..8c57ff876a 100644
--- a/benchmarks/client-nav/scenarios/history/solid/tsconfig.json
+++ b/benchmarks/client-nav/scenarios/history/solid/tsconfig.json
@@ -2,7 +2,7 @@
"extends": "../../../../../tsconfig.json",
"compilerOptions": {
"jsx": "preserve",
- "jsxImportSource": "solid-js",
+ "jsxImportSource": "@solidjs/web",
"allowImportingTsExtensions": true,
"types": ["node", "vite/client", "vitest/globals"]
},
diff --git a/benchmarks/client-nav/scenarios/history/solid/vite.config.ts b/benchmarks/client-nav/scenarios/history/solid/vite.config.ts
index 4da589ff0e..8ddc9e6a0c 100644
--- a/benchmarks/client-nav/scenarios/history/solid/vite.config.ts
+++ b/benchmarks/client-nav/scenarios/history/solid/vite.config.ts
@@ -1,9 +1,8 @@
import { fileURLToPath } from 'node:url'
import { defineConfig } from 'vitest/config'
-import solid from 'vite-plugin-solid'
+import solid from '@solidjs/vite-plugin'
import codspeedPlugin from '@codspeed/vitest-plugin'
import { tanstackRouter } from '@tanstack/router-plugin/vite'
-import { cpuSimulationExecArgv } from '../../../../cpu-simulation'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -20,7 +19,7 @@ export default defineConfig({
routesDirectory: `${rootDir}src/routes`,
generatedRouteTree: `${rootDir}src/routeTree.gen.ts`,
}),
- solid({ hot: false, dev: false }),
+ solid({ refresh: false, dev: false }),
],
build: {
outDir: './dist',
@@ -36,7 +35,6 @@ export default defineConfig({
conditions: ['solid', 'browser'],
},
test: {
- execArgv: cpuSimulationExecArgv(),
name: '@benchmarks/client-nav history (solid)',
watch: false,
environment: 'jsdom',
diff --git a/benchmarks/client-nav/scenarios/history/vue/speed.bench.ts b/benchmarks/client-nav/scenarios/history/vue/speed.bench.ts
index 3d36ac4cfa..a378e45ac5 100644
--- a/benchmarks/client-nav/scenarios/history/vue/speed.bench.ts
+++ b/benchmarks/client-nav/scenarios/history/vue/speed.bench.ts
@@ -1,19 +1,32 @@
-import { test } from 'vitest'
-import { benchLifecycle } from '../../../../cpu-simulation'
+import { afterEach, beforeEach, bench, describe } from 'vitest'
import { benchOptions, ticksPerIteration } from '../shared'
import { setup } from './setup'
-test('client-history', async ({ bench }) => {
- const scenario = setup()
+describe('client-history', () => {
+ const test = setup()
- await bench(
+ /**
+ * Running `vitest bench` ignores suite hooks, so Tinybench uses the `setup`
+ * and `teardown` options below. CodSpeed bypasses those options but supports
+ * `beforeEach` and `afterEach`. Only one lifecycle path runs in either
+ * environment, and every measured invocation receives fresh application state.
+ */
+
+ beforeEach(test.before)
+ afterEach(test.after)
+
+ bench(
'client-history navigation loop (vue)',
- benchLifecycle(scenario),
async () => {
for (let i = 0; i < ticksPerIteration; i++) {
- await scenario.tick()
+ await test.tick()
}
- await scenario.finishBatch()
+ await test.finishBatch()
},
- ).run(benchOptions)
+ {
+ ...benchOptions,
+ setup: test.before,
+ teardown: test.after,
+ },
+ )
})
diff --git a/benchmarks/client-nav/scenarios/history/vue/src/routeTree.gen.ts b/benchmarks/client-nav/scenarios/history/vue/src/routeTree.gen.ts
index 519aef7c8f..cee1b68870 100644
--- a/benchmarks/client-nav/scenarios/history/vue/src/routeTree.gen.ts
+++ b/benchmarks/client-nav/scenarios/history/vue/src/routeTree.gen.ts
@@ -9,24 +9,19 @@
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
import { Route as rootRouteImport } from './routes/__root'
-import { Route as IndexRouteImport } from './routes/index'
import { Route as GalleryRouteImport } from './routes/gallery'
-import { Route as PagesNRouteImport } from './routes/pages.$n'
+import { Route as IndexRouteImport } from './routes/index'
import { Route as PhotosPhotoIdRouteImport } from './routes/photos.$photoId'
+import { Route as PagesNRouteImport } from './routes/pages.$n'
-const IndexRoute = IndexRouteImport.update({
- id: '/',
- path: '/',
- getParentRoute: () => rootRouteImport,
-} as any)
const GalleryRoute = GalleryRouteImport.update({
id: '/gallery',
path: '/gallery',
getParentRoute: () => rootRouteImport,
} as any)
-const PagesNRoute = PagesNRouteImport.update({
- id: '/pages/$n',
- path: '/pages/$n',
+const IndexRoute = IndexRouteImport.update({
+ id: '/',
+ path: '/',
getParentRoute: () => rootRouteImport,
} as any)
const PhotosPhotoIdRoute = PhotosPhotoIdRouteImport.update({
@@ -34,6 +29,11 @@ const PhotosPhotoIdRoute = PhotosPhotoIdRouteImport.update({
path: '/photos/$photoId',
getParentRoute: () => rootRouteImport,
} as any)
+const PagesNRoute = PagesNRouteImport.update({
+ id: '/pages/$n',
+ path: '/pages/$n',
+ getParentRoute: () => rootRouteImport,
+} as any)
export interface FileRoutesByFullPath {
'/': typeof IndexRoute
@@ -71,13 +71,6 @@ export interface RootRouteChildren {
declare module '@tanstack/vue-router' {
interface FileRoutesByPath {
- '/': {
- id: '/'
- path: '/'
- fullPath: '/'
- preLoaderRoute: typeof IndexRouteImport
- parentRoute: typeof rootRouteImport
- }
'/gallery': {
id: '/gallery'
path: '/gallery'
@@ -85,11 +78,11 @@ declare module '@tanstack/vue-router' {
preLoaderRoute: typeof GalleryRouteImport
parentRoute: typeof rootRouteImport
}
- '/pages/$n': {
- id: '/pages/$n'
- path: '/pages/$n'
- fullPath: '/pages/$n'
- preLoaderRoute: typeof PagesNRouteImport
+ '/': {
+ id: '/'
+ path: '/'
+ fullPath: '/'
+ preLoaderRoute: typeof IndexRouteImport
parentRoute: typeof rootRouteImport
}
'/photos/$photoId': {
@@ -99,6 +92,13 @@ declare module '@tanstack/vue-router' {
preLoaderRoute: typeof PhotosPhotoIdRouteImport
parentRoute: typeof rootRouteImport
}
+ '/pages/$n': {
+ id: '/pages/$n'
+ path: '/pages/$n'
+ fullPath: '/pages/$n'
+ preLoaderRoute: typeof PagesNRouteImport
+ parentRoute: typeof rootRouteImport
+ }
}
}
diff --git a/benchmarks/client-nav/scenarios/history/vue/vite.config.ts b/benchmarks/client-nav/scenarios/history/vue/vite.config.ts
index c5f1ca9807..58986d6526 100644
--- a/benchmarks/client-nav/scenarios/history/vue/vite.config.ts
+++ b/benchmarks/client-nav/scenarios/history/vue/vite.config.ts
@@ -4,7 +4,6 @@ import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import codspeedPlugin from '@codspeed/vitest-plugin'
import { tanstackRouter } from '@tanstack/router-plugin/vite'
-import { cpuSimulationExecArgv } from '../../../../cpu-simulation'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -35,7 +34,6 @@ export default defineConfig({
},
},
test: {
- execArgv: cpuSimulationExecArgv(),
name: '@benchmarks/client-nav history (vue)',
watch: false,
environment: 'jsdom',
diff --git a/benchmarks/client-nav/scenarios/hydration/react/fixture.ts b/benchmarks/client-nav/scenarios/hydration/react/fixture.ts
deleted file mode 100644
index 950c870a1c..0000000000
--- a/benchmarks/client-nav/scenarios/hydration/react/fixture.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-export const ordinaryLinkCount = 192
-export const hashLinkCount = 8
-export const serverUrl = '/teams/team-7/items/item-42?view=summary'
-export const clientUrl = `${serverUrl}#details`
-
-export interface Diagnostics {
- beforeLoads: number
- loaders: number
- mounted: boolean
- clicks: number
- ordinaryRenders: number
- hashRenders: number
- countRenders: boolean
-}
-
-export function createDiagnostics(countRenders = false): Diagnostics {
- return {
- beforeLoads: 0,
- loaders: 0,
- mounted: false,
- clicks: 0,
- ordinaryRenders: 0,
- hashRenders: 0,
- countRenders,
- }
-}
-
-export interface FixtureArtifact {
- html: string
- scripts: Array
-}
diff --git a/benchmarks/client-nav/scenarios/hydration/react/generate-fixture.mjs b/benchmarks/client-nav/scenarios/hydration/react/generate-fixture.mjs
deleted file mode 100644
index fbc67c5a08..0000000000
--- a/benchmarks/client-nav/scenarios/hydration/react/generate-fixture.mjs
+++ /dev/null
@@ -1,23 +0,0 @@
-import assert from 'node:assert/strict'
-import { writeFile } from 'node:fs/promises'
-import { JSDOM } from 'jsdom'
-
-if (process.env.NODE_ENV !== 'production') {
- throw new Error('Generate the hydration fixture in production mode')
-}
-const { renderFixture } = await import('./dist/server/server.js')
-const html = await renderFixture()
-const dom = new JSDOM(html)
-try {
- const scriptElements = [...dom.window.document.querySelectorAll('script')]
- assert.ok(scriptElements.length > 0)
- assert.ok(scriptElements.every((script) => !script.src))
- const scripts = scriptElements.map((script) => script.textContent)
- assert.ok(scripts.some((script) => script.includes('$_TSR')))
- await writeFile(
- new URL('./dist/fixture.json', import.meta.url),
- JSON.stringify({ html, scripts }),
- )
-} finally {
- dom.window.close()
-}
diff --git a/benchmarks/client-nav/scenarios/hydration/react/hydration.test.ts b/benchmarks/client-nav/scenarios/hydration/react/hydration.test.ts
deleted file mode 100644
index 7e466cbaed..0000000000
--- a/benchmarks/client-nav/scenarios/hydration/react/hydration.test.ts
+++ /dev/null
@@ -1,93 +0,0 @@
-import { expect, test } from 'vitest'
-import { hashLinkCount, ordinaryLinkCount } from './fixture'
-import { setup } from './setup'
-import { settleHydration } from './settle'
-
-const turn = () => new Promise((resolve) => setImmediate(resolve))
-
-test('restores data and context into fresh DOMs and includes follow-up renders', async () => {
- const scenario = setup({ countRenders: true })
- const schedulerTasks = new Set()
- for (let iteration = 0; iteration < 3; iteration++) {
- await scenario.before()
- try {
- expect(scenario.snapshot().diagnostics.mounted).toBe(false)
- expect(scenario.snapshot().matches).toBeUndefined()
- await scenario.run()
- schedulerTasks.add(scenario.schedulerTasks())
- const completed = scenario.snapshot()
- // Supports both main's extra Link update and the optimized snapshot.
- expect([ordinaryLinkCount, ordinaryLinkCount * 2]).toContain(
- completed.diagnostics.ordinaryRenders,
- )
- expect(completed.diagnostics.hashRenders).toBeGreaterThanOrEqual(
- hashLinkCount + hashLinkCount / 2,
- )
- for (let index = 0; index < 4; index++) {
- await turn()
- }
- expect(scenario.snapshot()).toEqual(completed)
- await expect(scenario.run()).rejects.toThrow('newly prepared sample')
- } finally {
- await scenario.after()
- }
- }
- // React yields on its pinned clock, never on wall time spent hydrating.
- expect(schedulerTasks.size).toBe(1)
-})
-
-test('rejects an empty measurement and still releases its sample', async () => {
- const scenario = setup()
- await scenario.before()
- await expect(scenario.after()).rejects.toThrow(
- 'Hydration sample was not completed',
- )
- await scenario.before()
- try {
- await scenario.run()
- } finally {
- await scenario.after()
- }
-})
-
-test('waits for a commit and scheduler work lasting more than 100 turns', async () => {
- let committed = false
- const commit = (async () => {
- for (let index = 0; index < 150; index++) {
- await turn()
- }
- committed = true
- })()
- let remainingCallbacks = 150
- await settleHydration(
- commit,
- () => {
- expect(committed).toBe(true)
- return remainingCallbacks-- <= 0
- },
- () => 'delayed commit',
- )
- expect(remainingCallbacks).toBeLessThan(0)
-})
-
-test('retains a watchdog for a commit that never completes', async () => {
- await expect(
- settleHydration(
- new Promise(() => {}),
- () => true,
- () => 'commit pending',
- 10,
- ),
- ).rejects.toThrow('Hydration did not settle within 10ms: commit pending')
-})
-
-test('retains a watchdog when scheduler work never becomes idle', async () => {
- await expect(
- settleHydration(
- Promise.resolve(),
- () => false,
- () => 'callbacks pending',
- 10,
- ),
- ).rejects.toThrow('Hydration did not settle within 10ms: callbacks pending')
-})
diff --git a/benchmarks/client-nav/scenarios/hydration/react/project.json b/benchmarks/client-nav/scenarios/hydration/react/project.json
deleted file mode 100644
index ca23838c0f..0000000000
--- a/benchmarks/client-nav/scenarios/hydration/react/project.json
+++ /dev/null
@@ -1,40 +0,0 @@
-{
- "name": "@benchmarks/client-nav-hydration-react",
- "projectType": "application",
- "targets": {
- "build:client": {
- "executor": "nx:run-commands",
- "cache": false,
- "dependsOn": [
- { "projects": ["@tanstack/react-router"], "target": "build" }
- ],
- "options": {
- "command": "NODE_ENV=production vite build --config {projectRoot}/vite.server.config.ts && NODE_ENV=production node {projectRoot}/generate-fixture.mjs && NODE_ENV=production vite build --config {projectRoot}/vite.config.ts"
- }
- },
- "test:unit": {
- "executor": "nx:run-commands",
- "dependsOn": ["build:client"],
- "options": {
- "command": "vitest run --config ./scenarios/hydration/react/vite.config.ts",
- "cwd": "benchmarks/client-nav"
- }
- },
- "test:perf": {
- "executor": "nx:run-commands",
- "cache": false,
- "dependsOn": ["build:client"],
- "options": {
- "command": "NODE_ENV=production vitest bench --mode benchmark --run --config ./scenarios/hydration/react/vite.config.ts",
- "cwd": "benchmarks/client-nav"
- }
- },
- "test:types:client": {
- "executor": "nx:run-commands",
- "dependsOn": [
- { "projects": ["@tanstack/react-router"], "target": "build" }
- ],
- "options": { "command": "tsc -p {projectRoot}/tsconfig.json --noEmit" }
- }
- }
-}
diff --git a/benchmarks/client-nav/scenarios/hydration/react/settle.ts b/benchmarks/client-nav/scenarios/hydration/react/settle.ts
deleted file mode 100644
index cc4c09a72d..0000000000
--- a/benchmarks/client-nav/scenarios/hydration/react/settle.ts
+++ /dev/null
@@ -1,35 +0,0 @@
-const turn = () => new Promise((resolve) => setImmediate(resolve))
-
-export async function settleHydration(
- committed: Promise,
- isIdle: () => boolean,
- describeProgress: () => string,
- timeoutMs = 60_000,
-) {
- let timeoutError: Error | undefined
- let watchdog: ReturnType | undefined
- const timeout = new Promise((_, reject) => {
- watchdog = setTimeout(() => {
- timeoutError = new Error(
- `Hydration did not settle within ${timeoutMs}ms: ${describeProgress()}`,
- )
- reject(timeoutError)
- }, timeoutMs)
- })
- try {
- // Concurrent hydration can need many more scheduler turns under CPU
- // instrumentation. Await its commit instead of limiting successful work
- // to an arbitrary number of event-loop polls.
- await Promise.race([committed, timeout])
- let idleTurns = 0
- while (idleTurns < 2) {
- await turn()
- if (timeoutError) {
- throw timeoutError
- }
- idleTurns = isIdle() ? idleTurns + 1 : 0
- }
- } finally {
- clearTimeout(watchdog)
- }
-}
diff --git a/benchmarks/client-nav/scenarios/hydration/react/setup.ts b/benchmarks/client-nav/scenarios/hydration/react/setup.ts
deleted file mode 100644
index 7c588af3fd..0000000000
--- a/benchmarks/client-nav/scenarios/hydration/react/setup.ts
+++ /dev/null
@@ -1,316 +0,0 @@
-import assert from 'node:assert/strict'
-import { readFileSync } from 'node:fs'
-import { fileURLToPath } from 'node:url'
-import { Script } from 'node:vm'
-import { JSDOM, VirtualConsole } from 'jsdom'
-import { clientUrl, hashLinkCount, ordinaryLinkCount } from './fixture'
-import { settleHydration } from './settle'
-import type { FixtureArtifact } from './fixture'
-import type * as Client from './src/client'
-
-type ClientApp = typeof Client
-const turn = () => new Promise((resolve) => setImmediate(resolve))
-
-// React's scheduler ends a time slice once performance.now() has advanced 5 ms.
-// Under CodSpeed's CPU simulation the wall clock advances much further per
-// instruction, by a runner-dependent factor, so real time turned identical
-// samples into different numbers of yields, scheduler tasks and event-loop
-// turns. With a frozen clock React yields only to paint after a commit, as on
-// a fast host. 1 s is past React's initial 300 ms fallback throttle. Only the
-// window's performance clock is pinned: Date.now(), which the Router uses for
-// match timestamps, is unchanged.
-const schedulerTime = 1_000
-
-export function setup({ countRenders = false } = {}) {
- // Compile once, outside measurement. Evaluation below creates fresh objects
- // in each window's realm; neither the payload nor module state is reused.
- const artifact: FixtureArtifact = JSON.parse(
- readFileSync(new URL('./dist/fixture.json', import.meta.url), 'utf8'),
- )
- const clientPath = new URL('./dist/client/client.js', import.meta.url)
- const clientScript = new Script(readFileSync(clientPath, 'utf8'), {
- filename: fileURLToPath(clientPath),
- })
- const bootstrapScripts = artifact.scripts.map(
- (source, index) =>
- new Script(source, {
- filename: `hydration-bootstrap-${index}.js`,
- }),
- )
- let current: Awaited> | undefined
-
- async function prepare() {
- const errors: Array = []
- const virtualConsole = new VirtualConsole()
- virtualConsole.on('jsdomError', (error) => errors.push(String(error)))
- virtualConsole.on('error', (...args) =>
- errors.push(args.map(String).join(' ')),
- )
- const dom = new JSDOM(artifact.html, {
- url: `http://localhost${clientUrl}`,
- runScripts: 'outside-only',
- virtualConsole,
- })
- const immediates = new Set()
- const scheduler = { tasks: 0 }
- try {
- Object.assign(dom.window, {
- TextEncoder,
- TextDecoder,
- ReadableStream,
- WritableStream,
- TransformStream,
- // Let React's production scheduler use the same task-turn primitive as
- // the existing Node client benchmarks, without a real-delay timer.
- setImmediate(
- callback: (...args: Array) => void,
- ...args: Array
- ) {
- scheduler.tasks++
- const handle = setImmediate(() => {
- immediates.delete(handle)
- callback(...args)
- })
- immediates.add(handle)
- return handle
- },
- clearImmediate(handle: NodeJS.Immediate) {
- immediates.delete(handle)
- clearImmediate(handle)
- },
- fetch() {
- throw new Error('Hydration attempted a network request')
- },
- scrollTo() {},
- })
- dom.window.performance.now = () => schedulerTime
- const context = dom.getInternalVMContext()
- // jsdom has no layout/scroll implementation; only hydration CPU is measured.
- dom.window.HTMLElement.prototype.scrollIntoView = () => {}
- clientScript.runInContext(context)
- const app = (dom.window as unknown as { HydrationBenchmark: ClientApp })
- .HydrationBenchmark
- assert.equal(app.serverEnvironment, false)
- const anchors = Array.from(dom.window.document.querySelectorAll('a'))
- const scriptElements = Array.from(
- dom.window.document.querySelectorAll('script'),
- )
- const executingScript = { current: null as HTMLScriptElement | null }
- Object.defineProperty(dom.window.document, 'currentScript', {
- configurable: true,
- get: () => executingScript.current,
- })
- assert.equal(anchors.length, ordinaryLinkCount + hashLinkCount)
- const content = dom.window.document.getElementById('hydration-content')
- assert.ok(content)
- // Finish jsdom's initial document lifecycle before opening the measure.
- await turn()
- assert.equal(dom.window.document.readyState, 'complete')
- assert.equal(app.ready(), false)
- return {
- dom,
- context,
- app,
- anchors,
- content,
- scriptElements,
- executingScript,
- immediates,
- scheduler,
- errors,
- started: false,
- completed: false,
- failed: false,
- }
- } catch (error) {
- for (const handle of immediates) {
- clearImmediate(handle)
- }
- dom.window.close()
- throw error
- }
- }
-
- async function before() {
- if (current) {
- throw new Error('Previous hydration sample was not disposed')
- }
- current = await prepare()
- }
-
- async function run() {
- const sample = current
- if (!sample || sample.started) {
- throw new Error('Hydration requires a newly prepared sample')
- }
- sample.started = true
- try {
- // HTML parsing/module evaluation are already done. Payload execution,
- // router initialization/restoration and React hydration are measured.
- for (let index = 0; index < bootstrapScripts.length; index++) {
- // SSR bootstrap scripts remove their own script element after running.
- sample.executingScript.current = sample.scriptElements[index]!
- try {
- bootstrapScripts[index]!.runInContext(sample.context)
- } finally {
- sample.executingScript.current = null
- }
- }
- await settleHydration(
- sample.app.start(countRenders),
- () => sample.immediates.size === 0,
- () => {
- const progress = sample.app.snapshot()
- return JSON.stringify({
- diagnostics: progress.diagnostics,
- errors: [...sample.errors, ...progress.errors],
- restoredMatches: progress.matches?.length,
- pendingSchedulerCallbacks: sample.immediates.size,
- })
- },
- )
- if (sample.errors.length) {
- throw new Error(sample.errors.join('\n'))
- }
- assert.ok(
- sample.app.ready(),
- 'Hydration committed without the expected active links',
- )
- sample.completed = true
- } catch (error) {
- sample.failed = true
- throw error
- }
- }
-
- function snapshot() {
- if (!current) {
- throw new Error('No hydration sample')
- }
- // Normalize realm prototypes only for untimed assertions.
- return JSON.parse(JSON.stringify(current.app.snapshot())) as ReturnType<
- ClientApp['snapshot']
- >
- }
-
- function schedulerTasks() {
- if (!current) {
- throw new Error('No hydration sample')
- }
- return current.scheduler.tasks
- }
-
- function validate() {
- assert.ok(current?.started)
- const { dom, anchors, content, errors } = current
- const doc = dom.window.document
- const result = snapshot()
- assert.deepEqual(errors, [])
- assert.deepEqual(result.errors, [])
- assert.equal(result.diagnostics.beforeLoads, 0)
- assert.equal(result.diagnostics.loaders, 0)
- assert.equal(result.diagnostics.mounted, true)
- assert.equal(result.location, clientUrl)
- assert.equal(result.matches?.length, 3)
- for (const match of result.matches) {
- assert.equal(match.status, 'success')
- assert.deepEqual(match.context.viewer, {
- id: 'viewer-3',
- name: 'Ada',
- role: 'editor',
- })
- }
- assert.deepEqual(result.matches[1]!.context.team, {
- id: 'team-7',
- member: 'viewer-3',
- })
- assert.deepEqual(result.matches[2]!.context.permissions, { edit: true })
- assert.deepEqual(result.matches[1]!.loaderData, {
- title: 'Team team-7',
- categories: ['open', 'closed'],
- })
- const data = result.matches[2]!.loaderData as {
- owner: string
- selected: string
- rows: Array<{
- id: string
- label: string
- details: { score: number; open: boolean }
- }>
- }
- assert.equal(data.owner, 'viewer-3')
- assert.equal(data.selected, 'item-42')
- assert.equal(data.rows.length, ordinaryLinkCount)
- assert.equal(doc.getElementById('hydration-content'), content)
- assert.equal(doc.querySelectorAll('a').length, anchors.length)
- assert.equal(doc.getElementById('viewer')?.textContent, 'Ada')
- assert.equal(doc.getElementById('permission')?.textContent, 'Editable')
- for (const anchor of anchors) {
- assert.equal(doc.getElementById(anchor.id), anchor)
- }
- for (let index = 0; index < ordinaryLinkCount; index++) {
- const anchor = doc.getElementById(`ordinary-item-${index}`)!
- assert.equal(
- anchor.getAttribute('href'),
- `/teams/team-7/items/item-${index}?view=summary`,
- )
- assert.equal(anchor.textContent, `Item ${index}`)
- assert.equal(
- anchor.getAttribute('data-status'),
- index === 42 ? 'active' : null,
- )
- assert.deepEqual(data.rows[index], {
- id: `item-${index}`,
- label: `Item ${index}`,
- details: { score: index * 3, open: index % 2 === 0 },
- })
- }
- for (let index = 0; index < hashLinkCount; index++) {
- assert.equal(
- doc.getElementById(`hash-${index}`)?.getAttribute('data-status'),
- index % 2 === 0 ? 'active' : null,
- )
- }
- doc
- .getElementById('interactive')!
- .dispatchEvent(new dom.window.MouseEvent('click', { bubbles: true }))
- assert.equal(
- current.app.snapshot().diagnostics.clicks,
- result.diagnostics.clicks + 1,
- )
- }
-
- async function after() {
- const sample = current
- if (!sample) {
- return
- }
- try {
- if (!sample.failed) {
- assert.ok(sample.completed, 'Hydration sample was not completed')
- validate()
- }
- } finally {
- current = undefined
- try {
- sample.app.dispose()
- // Unmount work and its scheduled effects stay outside the measure.
- await turn()
- await turn()
- } finally {
- for (const handle of sample.immediates) {
- clearImmediate(handle)
- }
- sample.dom.window.close()
- }
- }
- }
-
- return {
- before,
- run,
- after,
- snapshot,
- schedulerTasks,
- }
-}
diff --git a/benchmarks/client-nav/scenarios/hydration/react/speed.bench.ts b/benchmarks/client-nav/scenarios/hydration/react/speed.bench.ts
deleted file mode 100644
index 643877760e..0000000000
--- a/benchmarks/client-nav/scenarios/hydration/react/speed.bench.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import { test } from 'vitest'
-import { setup } from './setup'
-
-test('client-hydration', async ({ bench }) => {
- const scenario = setup()
-
- await bench(
- 'hydrate restored route state and mixed Links (react)',
- { beforeEach: scenario.before, afterEach: scenario.after },
- async () => {
- await scenario.run()
- },
- ).run({
- time: 5000,
- warmupTime: 1000,
- warmupIterations: 20,
- throws: true,
- })
-})
diff --git a/benchmarks/client-nav/scenarios/hydration/react/src/app.tsx b/benchmarks/client-nav/scenarios/hydration/react/src/app.tsx
deleted file mode 100644
index e9797f71fa..0000000000
--- a/benchmarks/client-nav/scenarios/hydration/react/src/app.tsx
+++ /dev/null
@@ -1,216 +0,0 @@
-import { useEffect } from 'react'
-import {
- HeadContent,
- Link,
- Outlet,
- Scripts,
- createMemoryHistory,
- createRootRoute,
- createRoute,
- createRouter,
- useHydrated,
-} from '@tanstack/react-router'
-import {
- clientUrl,
- hashLinkCount,
- ordinaryLinkCount,
- serverUrl,
-} from '../fixture'
-import type { ReactNode } from 'react'
-import type { Diagnostics } from '../fixture'
-
-export function createFixtureRouter(
- server: boolean,
- diagnostics: Diagnostics,
- onHydrated: () => void = () => {},
-) {
- function beforeLoad() {
- diagnostics.beforeLoads++
- if (!server) {
- throw new Error('Hydration reran beforeLoad instead of restoring context')
- }
- }
-
- function loader() {
- diagnostics.loaders++
- if (!server) {
- throw new Error('Hydration reran a loader instead of restoring data')
- }
- }
-
- const root = createRootRoute({
- beforeLoad: () => {
- beforeLoad()
- return { viewer: { id: 'viewer-3', name: 'Ada', role: 'editor' } }
- },
- head: () => ({
- meta: [{ charSet: 'utf-8' }, { title: 'Hydration benchmark' }],
- }),
- shellComponent: Document,
- })
- const team = createRoute({
- getParentRoute: () => root,
- path: '/teams/$teamId',
- beforeLoad: ({ context, params }) => {
- beforeLoad()
- return { team: { id: params.teamId, member: context.viewer.id } }
- },
- loader: ({ context }) => {
- loader()
- return {
- title: `Team ${context.team.id}`,
- categories: ['open', 'closed'],
- }
- },
- component: Team,
- })
- const items = createRoute({
- getParentRoute: () => team,
- path: 'items/$itemId',
- validateSearch: (search: Record) => ({
- view: search.view === 'details' ? 'details' : 'summary',
- }),
- beforeLoad: ({ context }) => {
- beforeLoad()
- return { permissions: { edit: context.viewer.role === 'editor' } }
- },
- loader: ({ context, params }) => {
- loader()
- return {
- selected: params.itemId,
- owner: context.team.member,
- rows: Array.from({ length: ordinaryLinkCount }, (_, index) => ({
- id: `item-${index}`,
- label: `Item ${index}`,
- details: { score: index * 3, open: index % 2 === 0 },
- })),
- }
- },
- component: Items,
- })
-
- function Document({ children }: { children: ReactNode }) {
- return (
-
-
-
-
-
- {children}
-
-
-
- )
- }
-
- function Team() {
- const context = team.useRouteContext()
- const data = team.useLoaderData()
- return (
-
- {data.title}
- {context.viewer.name}
-
-
- )
- }
-
- function Items() {
- const data = items.useLoaderData()
- const context = items.useRouteContext()
- useEffect(() => {
- diagnostics.mounted = true
- }, [])
- return (
- <>
-
- {context.permissions.edit ? 'Editable' : 'Read only'}
-
- {
- diagnostics.clicks++
- }}
- >
- Ready
-
-
-
- {data.rows.map((row) => (
-
- {row.id}
- {row.details.score}
-
-
- {diagnostics.countRenders
- ? () => {
- diagnostics.ordinaryRenders++
- return row.label
- }
- : row.label}
-
-
-
- ))}
-
-
-
- {Array.from({ length: hashLinkCount }, (_, index) => (
-
- {diagnostics.countRenders
- ? () => {
- diagnostics.hashRenders++
- return `Section ${index}`
- }
- : `Section ${index}`}
-
- ))}
-
-
-
- >
- )
- }
-
- function HydrationComplete() {
- const hydrated = useHydrated()
- useEffect(() => {
- if (hydrated) {
- onHydrated()
- }
- }, [hydrated])
- return null
- }
-
- return createRouter({
- routeTree: root.addChildren([team.addChildren([items])]),
- history: createMemoryHistory({
- initialEntries: [server ? serverUrl : clientUrl],
- }),
- isServer: server,
- scrollRestoration: false,
- defaultHashScrollIntoView: false,
- defaultPreload: false,
- })
-}
-
-declare module '@tanstack/react-router' {
- interface Register {
- router: ReturnType
- }
-}
diff --git a/benchmarks/client-nav/scenarios/hydration/react/src/client.tsx b/benchmarks/client-nav/scenarios/hydration/react/src/client.tsx
deleted file mode 100644
index 42c5a5104e..0000000000
--- a/benchmarks/client-nav/scenarios/hydration/react/src/client.tsx
+++ /dev/null
@@ -1,83 +0,0 @@
-import { startTransition } from 'react'
-import { hydrateRoot } from 'react-dom/client'
-import { RouterProvider } from '@tanstack/react-router'
-import { hydrate } from '@tanstack/react-router/ssr/client'
-import { isServer } from '@tanstack/router-core/isServer'
-import { createDiagnostics, hashLinkCount } from '../fixture'
-import { createFixtureRouter } from './app'
-
-export const serverEnvironment = isServer
-let router: ReturnType | undefined
-let root: ReturnType | undefined
-let diagnostics = createDiagnostics()
-const errors: Array = []
-
-export async function start(countRenders = false) {
- if (router) {
- throw new Error('A hydration sample must use a fresh client realm')
- }
- if (!window.$_TSR?.router) {
- throw new Error('Missing SSR hydration payload')
- }
- diagnostics = createDiagnostics(countRenders)
- let resolveHydrated!: () => void
- let rejectHydrated!: (error: unknown) => void
- const hydrated = new Promise((resolve, reject) => {
- resolveHydrated = resolve
- rejectHydrated = reject
- })
- router = createFixtureRouter(false, diagnostics, resolveHydrated)
- // This is the same restoration path used by Start, without a module-cached
- // RouterClient/StartClient promise or a live server in the worker.
- await hydrate(router)
- window.$_TSR.h()
- startTransition(() => {
- root = hydrateRoot(document, , {
- onRecoverableError: (error) => {
- errors.push(String(error))
- rejectHydrated(error)
- },
- onUncaughtError: (error) => {
- errors.push(String(error))
- rejectHydrated(error)
- },
- })
- })
- await hydrated
-}
-
-export function ready() {
- if (!diagnostics.mounted) {
- return false
- }
- // Matching hash Links only become active in the follow-up hydration commit.
- // Ending at the first mount effect would miss the work this scenario targets.
- for (let index = 0; index < hashLinkCount; index += 2) {
- if (
- document.getElementById(`hash-${index}`)?.getAttribute('data-status') !==
- 'active'
- ) {
- return false
- }
- }
- return true
-}
-
-export function snapshot() {
- const matches = router?.stores.matches.get()
- return {
- diagnostics: { ...diagnostics },
- errors: [...errors],
- location: router?.stores.location.get().href,
- matches: matches?.map((match) => ({
- status: match.status,
- context: match.context,
- loaderData: match.loaderData,
- })),
- }
-}
-
-export function dispose() {
- root?.unmount()
- router?.history.destroy()
-}
diff --git a/benchmarks/client-nav/scenarios/hydration/react/src/server.tsx b/benchmarks/client-nav/scenarios/hydration/react/src/server.tsx
deleted file mode 100644
index 713b0a77f2..0000000000
--- a/benchmarks/client-nav/scenarios/hydration/react/src/server.tsx
+++ /dev/null
@@ -1,29 +0,0 @@
-import {
- createRequestHandler,
- defaultStreamHandler,
-} from '@tanstack/react-router/ssr/server'
-import { isServer } from '@tanstack/router-core/isServer'
-import { createDiagnostics, serverUrl } from '../fixture'
-import { createFixtureRouter } from './app'
-
-export async function renderFixture() {
- if ((isServer as boolean | undefined) !== true) {
- throw new Error('Fixture generation requires the production server build')
- }
- const diagnostics = createDiagnostics()
- const response = await createRequestHandler({
- createRouter: () => createFixtureRouter(true, diagnostics),
- request: new Request(`http://localhost${serverUrl}`),
- })(defaultStreamHandler)
- const html = await response.text()
- if (
- response.status !== 200 ||
- diagnostics.beforeLoads !== 3 ||
- diagnostics.loaders !== 2
- ) {
- throw new Error(
- 'SSR fixture did not execute its beforeLoad and loader functions',
- )
- }
- return html
-}
diff --git a/benchmarks/client-nav/scenarios/hydration/react/tsconfig.json b/benchmarks/client-nav/scenarios/hydration/react/tsconfig.json
deleted file mode 100644
index 23dd08de8b..0000000000
--- a/benchmarks/client-nav/scenarios/hydration/react/tsconfig.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "extends": "../../../../../tsconfig.json",
- "compilerOptions": {
- "jsx": "react-jsx",
- "jsxImportSource": "react",
- "allowImportingTsExtensions": true,
- "types": ["node", "vite/client", "vitest/globals"]
- },
- "include": ["./*.ts", "./src/**/*"]
-}
diff --git a/benchmarks/client-nav/scenarios/hydration/react/vite.config.ts b/benchmarks/client-nav/scenarios/hydration/react/vite.config.ts
deleted file mode 100644
index 62ab87115b..0000000000
--- a/benchmarks/client-nav/scenarios/hydration/react/vite.config.ts
+++ /dev/null
@@ -1,36 +0,0 @@
-import { fileURLToPath } from 'node:url'
-import { defineConfig } from 'vitest/config'
-import react from '@vitejs/plugin-react'
-import codspeedPlugin from '@codspeed/vitest-plugin'
-import { cpuSimulationExecArgv } from '../../../../cpu-simulation'
-
-export default defineConfig({
- root: fileURLToPath(new URL('.', import.meta.url)),
- define: { 'process.env.NODE_ENV': JSON.stringify('production') },
- plugins: [
- !!(process.env.VITEST && process.env.WITH_INSTRUMENTATION) &&
- codspeedPlugin(),
- react(),
- ],
- resolve: { conditions: ['browser', 'production'] },
- build: {
- outDir: './dist/client',
- emptyOutDir: true,
- minify: false,
- lib: {
- entry: './src/client.tsx',
- name: 'HydrationBenchmark',
- formats: ['iife'],
- fileName: () => 'client.js',
- },
- },
- test: {
- execArgv: cpuSimulationExecArgv(),
- name: '@benchmarks/client-nav hydration (react)',
- watch: false,
- environment: 'node',
- isolate: true,
- include: ['hydration.test.ts'],
- benchmark: { include: ['speed.bench.ts'] },
- },
-})
diff --git a/benchmarks/client-nav/scenarios/hydration/react/vite.server.config.ts b/benchmarks/client-nav/scenarios/hydration/react/vite.server.config.ts
deleted file mode 100644
index fbf6a149b9..0000000000
--- a/benchmarks/client-nav/scenarios/hydration/react/vite.server.config.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-import { fileURLToPath } from 'node:url'
-import { defineConfig } from 'vite'
-import react from '@vitejs/plugin-react'
-
-export default defineConfig({
- root: fileURLToPath(new URL('.', import.meta.url)),
- define: { 'process.env.NODE_ENV': JSON.stringify('production') },
- plugins: [react()],
- resolve: { conditions: ['node', 'production'] },
- ssr: { noExternal: true },
- build: {
- ssr: true,
- outDir: './dist/server',
- emptyOutDir: true,
- minify: false,
- lib: {
- entry: './src/server.tsx',
- formats: ['es'],
- fileName: () => 'server.js',
- },
- rolldownOptions: {
- platform: 'node',
- external: [/^node:/, /^react(?:\/|$)/, /^react-dom(?:\/|$)/],
- },
- },
-})
diff --git a/benchmarks/client-nav/scenarios/hydration/solid/fixture.ts b/benchmarks/client-nav/scenarios/hydration/solid/fixture.ts
deleted file mode 100644
index 4c86d0e2f4..0000000000
--- a/benchmarks/client-nav/scenarios/hydration/solid/fixture.ts
+++ /dev/null
@@ -1,35 +0,0 @@
-export {
- clientUrl,
- hashLinkCount,
- ordinaryLinkCount,
- serverUrl,
-} from '../react/fixture'
-export type { FixtureArtifact } from '../react/fixture'
-
-export interface Diagnostics {
- beforeLoads: number
- loaders: number
- mounted: boolean
- rendered: number
- clicks: number
- countUpdates: boolean
- ordinaryEvaluations: number
- hashEvaluations: number
- initialHashStates: Array
- hashStates: Array
-}
-
-export function createDiagnostics(countUpdates = false): Diagnostics {
- return {
- beforeLoads: 0,
- loaders: 0,
- mounted: false,
- rendered: 0,
- clicks: 0,
- countUpdates,
- ordinaryEvaluations: 0,
- hashEvaluations: 0,
- initialHashStates: [],
- hashStates: [],
- }
-}
diff --git a/benchmarks/client-nav/scenarios/hydration/solid/generate-fixture.mjs b/benchmarks/client-nav/scenarios/hydration/solid/generate-fixture.mjs
deleted file mode 100644
index 63647e1be7..0000000000
--- a/benchmarks/client-nav/scenarios/hydration/solid/generate-fixture.mjs
+++ /dev/null
@@ -1,30 +0,0 @@
-import assert from 'node:assert/strict'
-import { writeFile } from 'node:fs/promises'
-import { JSDOM } from 'jsdom'
-
-if (process.env.NODE_ENV !== 'production') {
- throw new Error('Generate the hydration fixture in production mode')
-}
-const { renderFixture } = await import('./dist/server/server.js')
-const html = await renderFixture()
-const dom = new JSDOM(html)
-try {
- const doc = dom.window.document
- const scriptElements = [...doc.querySelectorAll('script')]
- assert.ok(scriptElements.length > 0)
- assert.ok(scriptElements.every((script) => !script.src))
- const scripts = scriptElements.map((script) => script.textContent)
- assert.ok(scripts.some((script) => script.includes('$_TSR')))
- assert.ok(scripts.some((script) => script.includes('_$HY')))
- assert.ok(doc.documentElement.hasAttribute('data-hk'))
- assert.ok(doc.getElementById('hydration-content')?.hasAttribute('data-hk'))
- assert.ok(
- [...doc.querySelectorAll('a')].every((a) => a.hasAttribute('data-hk')),
- )
- await writeFile(
- new URL('./dist/fixture.json', import.meta.url),
- JSON.stringify({ html, scripts }),
- )
-} finally {
- dom.window.close()
-}
diff --git a/benchmarks/client-nav/scenarios/hydration/solid/hydration.test.ts b/benchmarks/client-nav/scenarios/hydration/solid/hydration.test.ts
deleted file mode 100644
index 4e5f3208ca..0000000000
--- a/benchmarks/client-nav/scenarios/hydration/solid/hydration.test.ts
+++ /dev/null
@@ -1,81 +0,0 @@
-import { expect, test } from 'vitest'
-import { hashLinkCount, ordinaryLinkCount } from './fixture'
-import { setup } from './setup'
-
-const turn = () => new Promise((resolve) => setImmediate(resolve))
-
-test('restores fresh DOMs and route state and completes hash-link reactivity', async () => {
- const scenario = setup({ countUpdates: true })
- let previous: ReturnType | undefined
- for (let iteration = 0; iteration < 3; iteration++) {
- await scenario.before()
- try {
- const initial = scenario.snapshot()
- expect(initial.matches).toBeUndefined()
- expect(initial.diagnostics.mounted).toBe(false)
- expect(initial.diagnostics.rendered).toBe(0)
- expect(initial.diagnostics.clicks).toBe(0)
- expect(initial.diagnostics.ordinaryEvaluations).toBe(0)
- expect(initial.diagnostics.hashEvaluations).toBe(0)
- expect(initial.diagnostics.initialHashStates).toEqual([])
- await scenario.run()
- const completed = scenario.snapshot()
- expect(completed.diagnostics.ordinaryEvaluations).toBeGreaterThanOrEqual(
- ordinaryLinkCount,
- )
- expect(completed.diagnostics.initialHashStates).toEqual(
- Array.from({ length: hashLinkCount }, () => false),
- )
- expect(completed.diagnostics.hashStates).toEqual(
- Array.from({ length: hashLinkCount }, (_, index) => index % 2 === 0),
- )
- expect(completed.diagnostics.hashEvaluations).toBeGreaterThanOrEqual(
- hashLinkCount + hashLinkCount / 2,
- )
- expect(completed.hydrating).toBe(false)
- for (let index = 0; index < 4; index++) {
- await turn()
- }
- expect(scenario.snapshot()).toEqual(completed)
- if (previous) {
- expect(completed).toEqual(previous)
- }
- previous = completed
- await expect(scenario.run()).rejects.toThrow('newly prepared sample')
- } finally {
- // Untimed assertions include DOM identity, all restored data/context,
- // native event handling, and the absence of hydration diagnostics.
- await scenario.after()
- }
- }
-})
-
-test('prepares every sample without counting diagnostics', async () => {
- const scenario = setup()
- for (let iteration = 0; iteration < 2; iteration++) {
- await scenario.before()
- try {
- expect(scenario.snapshot().diagnostics.mounted).toBe(false)
- expect(scenario.snapshot().diagnostics.clicks).toBe(0)
- await scenario.run()
- expect(scenario.snapshot().diagnostics.hashEvaluations).toBe(0)
- } finally {
- await scenario.after()
- }
- }
-})
-
-test('rejects an empty measurement and still releases its sample', async () => {
- const scenario = setup()
- await scenario.before()
- await expect(scenario.after()).rejects.toThrow(
- 'Hydration sample was not completed',
- )
- await scenario.before()
- try {
- await expect(scenario.before()).rejects.toThrow('was not disposed')
- await scenario.run()
- } finally {
- await scenario.after()
- }
-})
diff --git a/benchmarks/client-nav/scenarios/hydration/solid/project.json b/benchmarks/client-nav/scenarios/hydration/solid/project.json
deleted file mode 100644
index 1fa162771b..0000000000
--- a/benchmarks/client-nav/scenarios/hydration/solid/project.json
+++ /dev/null
@@ -1,40 +0,0 @@
-{
- "name": "@benchmarks/client-nav-hydration-solid",
- "projectType": "application",
- "targets": {
- "build:client": {
- "executor": "nx:run-commands",
- "cache": false,
- "dependsOn": [
- { "projects": ["@tanstack/solid-router"], "target": "build" }
- ],
- "options": {
- "command": "NODE_ENV=production vite build --config {projectRoot}/vite.server.config.ts && NODE_ENV=production node {projectRoot}/generate-fixture.mjs && NODE_ENV=production vite build --config {projectRoot}/vite.config.ts"
- }
- },
- "test:unit": {
- "executor": "nx:run-commands",
- "dependsOn": ["build:client"],
- "options": {
- "command": "vitest run --config ./scenarios/hydration/solid/vite.config.ts",
- "cwd": "benchmarks/client-nav"
- }
- },
- "test:perf": {
- "executor": "nx:run-commands",
- "cache": false,
- "dependsOn": ["build:client"],
- "options": {
- "command": "NODE_ENV=production vitest bench --mode benchmark --run --config ./scenarios/hydration/solid/vite.config.ts",
- "cwd": "benchmarks/client-nav"
- }
- },
- "test:types:client": {
- "executor": "nx:run-commands",
- "dependsOn": [
- { "projects": ["@tanstack/solid-router"], "target": "build" }
- ],
- "options": { "command": "tsc -p {projectRoot}/tsconfig.json --noEmit" }
- }
- }
-}
diff --git a/benchmarks/client-nav/scenarios/hydration/solid/setup.ts b/benchmarks/client-nav/scenarios/hydration/solid/setup.ts
deleted file mode 100644
index ebdbc8e9b2..0000000000
--- a/benchmarks/client-nav/scenarios/hydration/solid/setup.ts
+++ /dev/null
@@ -1,326 +0,0 @@
-import assert from 'node:assert/strict'
-import { readFileSync } from 'node:fs'
-import { fileURLToPath } from 'node:url'
-import { Script } from 'node:vm'
-import { JSDOM, VirtualConsole } from 'jsdom'
-import { clientUrl, hashLinkCount, ordinaryLinkCount } from './fixture'
-import type { FixtureArtifact } from './fixture'
-import type * as Client from './src/client'
-
-type ClientApp = typeof Client
-const turn = () => new Promise((resolve) => setImmediate(resolve))
-const maxSettleTurns = 100
-
-export function setup({ countUpdates = false } = {}) {
- // Compile once, outside measurement; evaluate the entire production bundle
- // anew in every window, including Solid's module-level hydration state.
- const artifact: FixtureArtifact = JSON.parse(
- readFileSync(new URL('./dist/fixture.json', import.meta.url), 'utf8'),
- )
- const clientPath = new URL('./dist/client/client.js', import.meta.url)
- const clientScript = new Script(readFileSync(clientPath, 'utf8'), {
- filename: fileURLToPath(clientPath),
- })
- const bootstrapScripts = artifact.scripts.map(
- (source, index) =>
- new Script(source, {
- filename: `solid-hydration-bootstrap-${index}.js`,
- }),
- )
- let current: Awaited> | undefined
-
- async function prepare() {
- const errors: Array = []
- const virtualConsole = new VirtualConsole()
- virtualConsole.on('jsdomError', (error) => errors.push(String(error)))
- for (const event of ['error', 'warn'] as const) {
- virtualConsole.on(event, (...args) =>
- errors.push(args.map(String).join(' ')),
- )
- }
- const dom = new JSDOM(artifact.html, {
- url: `http://localhost${clientUrl}`,
- runScripts: 'outside-only',
- virtualConsole,
- })
- const immediates = new Set()
- try {
- Object.assign(dom.window, {
- TextEncoder,
- TextDecoder,
- ReadableStream,
- WritableStream,
- TransformStream,
- setImmediate(
- callback: (...args: Array) => void,
- ...args: Array
- ) {
- const handle = setImmediate(() => {
- immediates.delete(handle)
- callback(...args)
- })
- immediates.add(handle)
- return handle
- },
- clearImmediate(handle: NodeJS.Immediate) {
- immediates.delete(handle)
- clearImmediate(handle)
- },
- fetch() {
- throw new Error('Hydration attempted a network request')
- },
- scrollTo() {},
- })
- dom.window.addEventListener('unhandledrejection', (event) => {
- errors.push(String(event.reason))
- })
- dom.window.HTMLElement.prototype.scrollIntoView = () => {}
- const context = dom.getInternalVMContext()
- clientScript.runInContext(context)
- const app = (dom.window as unknown as { HydrationBenchmark: ClientApp })
- .HydrationBenchmark
- assert.equal(app.serverEnvironment, false)
- assert.equal(app.solidServerEnvironment, false)
- const doc = dom.window.document
- const anchors = Array.from(doc.querySelectorAll('a'))
- const scriptElements = Array.from(doc.querySelectorAll('script'))
- assert.equal(scriptElements.length, bootstrapScripts.length)
- const executingScript = { current: null as HTMLScriptElement | null }
- Object.defineProperty(doc, 'currentScript', {
- configurable: true,
- get: () => executingScript.current,
- })
- assert.equal(anchors.length, ordinaryLinkCount + hashLinkCount)
- const content = doc.getElementById('hydration-content')
- assert.ok(content)
- assert.ok(content.hasAttribute('data-hk'))
- assert.ok(anchors.every((anchor) => anchor.hasAttribute('data-hk')))
- for (let index = 0; index < hashLinkCount; index++) {
- assert.equal(
- doc.getElementById(`hash-${index}`)?.getAttribute('data-status'),
- null,
- )
- }
- // Production Solid can fall back to templates for missing hydration keys.
- // Retain every workload element, not only the parent and the anchors.
- const elements = Array.from(content.querySelectorAll('*'))
- const documentElement = doc.documentElement
- await turn()
- assert.equal(doc.readyState, 'complete')
- assert.equal(app.ready(), false)
- assert.deepEqual(errors, [])
- return {
- dom,
- context,
- app,
- anchors,
- content,
- elements,
- documentElement,
- scriptElements,
- executingScript,
- immediates,
- errors,
- started: false,
- completed: false,
- failed: false,
- }
- } catch (error) {
- for (const handle of immediates) {
- clearImmediate(handle)
- }
- dom.window.close()
- throw error
- }
- }
-
- async function before() {
- if (current) {
- throw new Error('Previous hydration sample was not disposed')
- }
- current = await prepare()
- }
-
- async function run() {
- const sample = current
- if (!sample || sample.started) {
- throw new Error('Hydration requires a newly prepared sample')
- }
- sample.started = true
- try {
- // Parsing/evaluation are done. Execute both native Solid bootstrap and
- // Router payload, then create/restore the router and hydrate the DOM.
- for (let index = 0; index < bootstrapScripts.length; index++) {
- // Router scripts remove document.currentScript. Keep the original
- // script nodes and order, including Solid's bootstrap and markers.
- sample.executingScript.current = sample.scriptElements[index]!
- try {
- bootstrapScripts[index]!.runInContext(sample.context)
- } finally {
- sample.executingScript.current = null
- }
- }
- await sample.app.start(countUpdates)
- let idleTurns = 0
- for (let index = 0; index < maxSettleTurns; index++) {
- await turn()
- if (sample.errors.length) {
- throw new Error(sample.errors.join('\n'))
- }
- if (sample.app.ready() && sample.immediates.size === 0) {
- if (++idleTurns === 2) {
- sample.completed = true
- return
- }
- } else {
- idleTurns = 0
- }
- }
- throw new Error(
- `Hydration did not settle: ${JSON.stringify(sample.app.snapshot())}`,
- )
- } catch (error) {
- sample.failed = true
- throw error
- }
- }
-
- function snapshot() {
- if (!current) {
- throw new Error('No hydration sample')
- }
- // Normalize realm prototypes only for untimed assertions.
- return JSON.parse(JSON.stringify(current.app.snapshot())) as ReturnType<
- ClientApp['snapshot']
- >
- }
-
- function validate() {
- assert.ok(current?.started)
- const { dom, anchors, content, elements, documentElement, errors } = current
- const doc = dom.window.document
- const result = snapshot()
- assert.deepEqual(errors, [])
- assert.equal(result.diagnostics.beforeLoads, 0)
- assert.equal(result.diagnostics.loaders, 0)
- assert.equal(result.diagnostics.mounted, true)
- assert.ok(result.diagnostics.rendered > 0)
- assert.equal(result.hydrating, false)
- assert.equal(result.location, clientUrl)
- assert.equal(result.resolvedLocation, clientUrl)
- assert.equal(result.matches?.length, 3)
- for (const match of result.matches) {
- assert.equal(match.status, 'success')
- assert.deepEqual(match.context.viewer, {
- id: 'viewer-3',
- name: 'Ada',
- role: 'editor',
- })
- }
- const teamContext = { id: 'team-7', member: 'viewer-3' }
- assert.deepEqual(result.matches[1]!.context.team, teamContext)
- assert.deepEqual(result.matches[2]!.context.team, teamContext)
- assert.deepEqual(result.matches[2]!.context.permissions, { edit: true })
- assert.deepEqual(result.matches[1]!.loaderData, {
- title: 'Team team-7',
- categories: ['open', 'closed'],
- })
- const data = result.matches[2]!.loaderData as {
- owner: string
- selected: string
- rows: Array<{
- id: string
- label: string
- details: { score: number; open: boolean }
- }>
- }
- assert.equal(data.owner, 'viewer-3')
- assert.equal(data.selected, 'item-42')
- assert.equal(data.rows.length, ordinaryLinkCount)
- assert.equal(doc.documentElement, documentElement)
- assert.equal(doc.getElementById('hydration-content'), content)
- const hydratedElements = Array.from(content.querySelectorAll('*'))
- assert.equal(hydratedElements.length, elements.length)
- elements.forEach((element, index) => {
- assert.equal(hydratedElements[index], element)
- })
- assert.equal(doc.querySelectorAll('a').length, anchors.length)
- assert.equal(doc.title, 'Hydration benchmark')
- assert.equal(content.querySelector('h1')?.textContent, 'Team team-7')
- assert.equal(doc.getElementById('viewer')?.textContent, 'Ada')
- assert.equal(doc.getElementById('permission')?.textContent, 'Editable')
- for (const anchor of anchors) {
- assert.equal(doc.getElementById(anchor.id), anchor)
- }
- for (let index = 0; index < ordinaryLinkCount; index++) {
- const anchor = doc.getElementById(`ordinary-item-${index}`)!
- assert.equal(
- anchor.getAttribute('href'),
- `/teams/team-7/items/item-${index}?view=summary`,
- )
- assert.equal(anchor.textContent, `Item ${index}`)
- assert.equal(
- anchor.getAttribute('data-status'),
- index === 42 ? 'active' : null,
- )
- assert.deepEqual(data.rows[index], {
- id: `item-${index}`,
- label: `Item ${index}`,
- details: { score: index * 3, open: index % 2 === 0 },
- })
- }
- for (let index = 0; index < hashLinkCount; index++) {
- const anchor = doc.getElementById(`hash-${index}`)!
- assert.equal(
- anchor.getAttribute('data-status'),
- index % 2 === 0 ? 'active' : null,
- )
- assert.equal(
- anchor.getAttribute('href'),
- `/teams/team-7/items/item-42?view=summary#${index % 2 === 0 ? 'details' : 'other'}`,
- )
- assert.equal(anchor.textContent, `Section ${index}`)
- }
- assert.equal(result.diagnostics.clicks, 0)
- doc
- .getElementById('interactive')!
- .dispatchEvent(new dom.window.MouseEvent('click', { bubbles: true }))
- assert.equal(current.app.snapshot().diagnostics.clicks, 1)
- assert.deepEqual(errors, [])
- }
-
- async function after() {
- const sample = current
- if (!sample) {
- return
- }
- try {
- if (!sample.failed) {
- assert.ok(sample.completed, 'Hydration sample was not completed')
- validate()
- }
- } finally {
- current = undefined
- try {
- sample.app.dispose()
- await turn()
- await turn()
- if (!sample.failed) {
- assert.deepEqual(sample.errors, [])
- }
- } finally {
- for (const handle of sample.immediates) {
- clearImmediate(handle)
- }
- sample.dom.window.close()
- }
- }
- }
-
- return {
- before,
- run,
- after,
- snapshot,
- }
-}
diff --git a/benchmarks/client-nav/scenarios/hydration/solid/speed.bench.ts b/benchmarks/client-nav/scenarios/hydration/solid/speed.bench.ts
deleted file mode 100644
index b386cb8215..0000000000
--- a/benchmarks/client-nav/scenarios/hydration/solid/speed.bench.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import { test } from 'vitest'
-import { setup } from './setup'
-
-test('client-hydration', async ({ bench }) => {
- const scenario = setup()
-
- await bench(
- 'hydrate restored route state and mixed Links (solid)',
- { beforeEach: scenario.before, afterEach: scenario.after },
- async () => {
- await scenario.run()
- },
- ).run({
- time: 5000,
- warmupTime: 1000,
- warmupIterations: 20,
- throws: true,
- })
-})
diff --git a/benchmarks/client-nav/scenarios/hydration/solid/src/app.tsx b/benchmarks/client-nav/scenarios/hydration/solid/src/app.tsx
deleted file mode 100644
index cb772d6b5b..0000000000
--- a/benchmarks/client-nav/scenarios/hydration/solid/src/app.tsx
+++ /dev/null
@@ -1,213 +0,0 @@
-import { For, onMount } from 'solid-js'
-import { HydrationScript } from 'solid-js/web'
-import {
- HeadContent,
- Link,
- Outlet,
- Scripts,
- createMemoryHistory,
- createRootRoute,
- createRoute,
- createRouter,
-} from '@tanstack/solid-router'
-import {
- clientUrl,
- hashLinkCount,
- ordinaryLinkCount,
- serverUrl,
-} from '../fixture'
-import type { JSX } from 'solid-js'
-import type { Diagnostics } from '../fixture'
-
-export function createFixtureRouter(server: boolean, diagnostics: Diagnostics) {
- function beforeLoad() {
- diagnostics.beforeLoads++
- if (!server) {
- throw new Error('Hydration reran beforeLoad instead of restoring context')
- }
- }
-
- function loader() {
- diagnostics.loaders++
- if (!server) {
- throw new Error('Hydration reran a loader instead of restoring data')
- }
- }
-
- const root = createRootRoute({
- beforeLoad: () => {
- beforeLoad()
- return { viewer: { id: 'viewer-3', name: 'Ada', role: 'editor' } }
- },
- head: () => ({
- meta: [{ charset: 'utf-8' }, { title: 'Hydration benchmark' }],
- }),
- shellComponent: Document,
- })
- const team = createRoute({
- getParentRoute: () => root,
- path: '/teams/$teamId',
- beforeLoad: ({ context, params }) => {
- beforeLoad()
- return { team: { id: params.teamId, member: context.viewer.id } }
- },
- loader: ({ context }) => {
- loader()
- return {
- title: `Team ${context.team.id}`,
- categories: ['open', 'closed'],
- }
- },
- component: Team,
- })
- const items = createRoute({
- getParentRoute: () => team,
- path: 'items/$itemId',
- validateSearch: (search: Record) => ({
- view: search.view === 'details' ? 'details' : 'summary',
- }),
- beforeLoad: ({ context }) => {
- beforeLoad()
- return { permissions: { edit: context.viewer.role === 'editor' } }
- },
- loader: ({ context, params }) => {
- loader()
- return {
- selected: params.itemId,
- owner: context.team.member,
- rows: Array.from({ length: ordinaryLinkCount }, (_, index) => ({
- id: `item-${index}`,
- label: `Item ${index}`,
- details: { score: index * 3, open: index % 2 === 0 },
- })),
- }
- },
- component: Items,
- })
-
- function Document(props: { children: JSX.Element }) {
- return (
-
-
-
-
-
-
- {props.children}
-
-
-
- )
- }
-
- function Team() {
- const context = team.useRouteContext()
- const data = team.useLoaderData()
- return (
-
- {data().title}
- {context().viewer.name}
-
-
- )
- }
-
- function Items() {
- const data = items.useLoaderData()
- const context = items.useRouteContext()
- onMount(() => {
- diagnostics.mounted = true
- })
- return (
- <>
-
- {context().permissions.edit ? 'Editable' : 'Read only'}
-
- {
- diagnostics.clicks++
- }}
- >
- Ready
-
-
-
-
- {(row) => (
-
- {row.id}
- {row.details.score}
-
-
- {diagnostics.countUpdates
- ? (state) => {
- // Read the getter so this unit-only probe observes
- // Link reactivity, rather than component execution.
- void state.isActive
- diagnostics.ordinaryEvaluations++
- return row.label
- }
- : row.label}
-
-
-
- )}
-
-
-
-
- index)}
- >
- {(index) => (
-
- {diagnostics.countUpdates
- ? (state) => {
- const active = state.isActive
- diagnostics.hashEvaluations++
- diagnostics.initialHashStates[index] ??= active
- diagnostics.hashStates[index] = active
- return `Section ${index}`
- }
- : `Section ${index}`}
-
- )}
-
-
-
- >
- )
- }
-
- return createRouter({
- routeTree: root.addChildren([team.addChildren([items])]),
- history: createMemoryHistory({
- initialEntries: [server ? serverUrl : clientUrl],
- }),
- isServer: server,
- scrollRestoration: false,
- defaultHashScrollIntoView: false,
- defaultPreload: false,
- })
-}
-
-declare module '@tanstack/solid-router' {
- interface Register {
- router: ReturnType
- }
-}
diff --git a/benchmarks/client-nav/scenarios/hydration/solid/src/client.tsx b/benchmarks/client-nav/scenarios/hydration/solid/src/client.tsx
deleted file mode 100644
index ef0f5268d6..0000000000
--- a/benchmarks/client-nav/scenarios/hydration/solid/src/client.tsx
+++ /dev/null
@@ -1,91 +0,0 @@
-import { sharedConfig } from 'solid-js'
-import { hydrate as hydrateDOM, isServer as solidIsServer } from 'solid-js/web'
-import { RouterProvider } from '@tanstack/solid-router'
-import { hydrate } from '@tanstack/router-core/ssr/client'
-import { isServer } from '@tanstack/router-core/isServer'
-import { createDiagnostics, hashLinkCount } from '../fixture'
-import { createFixtureRouter } from './app'
-
-export const serverEnvironment = isServer
-export const solidServerEnvironment = solidIsServer
-let router: ReturnType | undefined
-let disposeRoot: (() => void) | undefined
-let unsubscribe: (() => void) | undefined
-let diagnostics = createDiagnostics()
-
-type HydrationWindow = Window & {
- _$HY?: { done?: boolean; events?: Array; r: object }
-}
-
-export async function start(countUpdates = false) {
- if (router) {
- throw new Error('A hydration sample must use a fresh client realm')
- }
- if (!window.$_TSR?.router) {
- throw new Error('Missing SSR hydration payload')
- }
- const bootstrap = (window as HydrationWindow)._$HY
- if (!bootstrap || bootstrap.done || sharedConfig.context) {
- throw new Error('Missing or already consumed Solid hydration bootstrap')
- }
- diagnostics = createDiagnostics(countUpdates)
- router = createFixtureRouter(false, diagnostics)
- unsubscribe = router.subscribe('onRendered', () => {
- diagnostics.rendered++
- })
- // Solid's RouterClient uses this core restoration API. Await it directly so
- // the shell has the same component/key hierarchy as the server provider.
- await hydrate(router)
- window.$_TSR.h()
- disposeRoot = hydrateDOM(() => , document)
-}
-
-export function ready() {
- if (
- !diagnostics.mounted ||
- !diagnostics.rendered ||
- sharedConfig.context ||
- router?.stores.status.get() === 'pending'
- ) {
- return false
- }
- // Each Link's onMount updates its hydration signal. Solid updates attributes
- // through fine-grained effects, without rerendering the route components.
- for (let index = 0; index < hashLinkCount; index++) {
- const anchor = document.getElementById(`hash-${index}`)
- if (
- !anchor ||
- anchor.getAttribute('data-status') !== (index % 2 === 0 ? 'active' : null)
- ) {
- return false
- }
- }
- return true
-}
-
-export function snapshot() {
- return {
- diagnostics: {
- ...diagnostics,
- initialHashStates: [...diagnostics.initialHashStates],
- hashStates: [...diagnostics.hashStates],
- },
- hydrating: !!sharedConfig.context,
- location: router?.stores.location.get().href,
- resolvedLocation: router?.stores.resolvedLocation.get()?.href,
- matches: router?.stores.matches.get().map((match) => ({
- status: match.status,
- context: match.context,
- loaderData: match.loaderData,
- })),
- }
-}
-
-export function dispose() {
- try {
- disposeRoot?.()
- } finally {
- unsubscribe?.()
- router?.history.destroy()
- }
-}
diff --git a/benchmarks/client-nav/scenarios/hydration/solid/src/server.tsx b/benchmarks/client-nav/scenarios/hydration/solid/src/server.tsx
deleted file mode 100644
index 6052c48eac..0000000000
--- a/benchmarks/client-nav/scenarios/hydration/solid/src/server.tsx
+++ /dev/null
@@ -1,40 +0,0 @@
-import { RouterProvider } from '@tanstack/solid-router'
-import {
- createRequestHandler,
- renderRouterToStream,
-} from '@tanstack/solid-router/ssr/server'
-import { isServer } from '@tanstack/router-core/isServer'
-import { isServer as solidIsServer } from 'solid-js/web'
-import { createDiagnostics, serverUrl } from '../fixture'
-import { createFixtureRouter } from './app'
-
-export async function renderFixture() {
- if ((isServer as boolean | undefined) !== true || !solidIsServer) {
- throw new Error('Fixture generation requires the production server build')
- }
- const diagnostics = createDiagnostics()
- const response = await createRequestHandler({
- createRouter: () => createFixtureRouter(true, diagnostics),
- request: new Request(`http://localhost${serverUrl}`),
- })(({ request, router, responseHeaders }) =>
- renderRouterToStream({
- request,
- router,
- responseHeaders,
- // The route shell owns the document, as in Solid Start. Using the same
- // provider tree on both sides preserves Solid's hydration key sequence.
- children: () => ,
- }),
- )
- const html = await response.text()
- if (
- response.status !== 200 ||
- diagnostics.beforeLoads !== 3 ||
- diagnostics.loaders !== 2
- ) {
- throw new Error(
- 'SSR fixture did not execute its beforeLoad and loader functions',
- )
- }
- return html
-}
diff --git a/benchmarks/client-nav/scenarios/hydration/solid/tsconfig.json b/benchmarks/client-nav/scenarios/hydration/solid/tsconfig.json
deleted file mode 100644
index daf27ddf12..0000000000
--- a/benchmarks/client-nav/scenarios/hydration/solid/tsconfig.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "extends": "../../../../../tsconfig.json",
- "compilerOptions": {
- "jsx": "preserve",
- "jsxImportSource": "solid-js",
- "allowImportingTsExtensions": true,
- "types": ["node", "vite/client", "vitest/globals"]
- },
- "include": ["./*.ts", "./src/**/*"]
-}
diff --git a/benchmarks/client-nav/scenarios/hydration/solid/vite.config.ts b/benchmarks/client-nav/scenarios/hydration/solid/vite.config.ts
deleted file mode 100644
index 16e5ff95aa..0000000000
--- a/benchmarks/client-nav/scenarios/hydration/solid/vite.config.ts
+++ /dev/null
@@ -1,38 +0,0 @@
-import { fileURLToPath } from 'node:url'
-import { defineConfig } from 'vitest/config'
-import solid from 'vite-plugin-solid'
-import codspeedPlugin from '@codspeed/vitest-plugin'
-import { cpuSimulationExecArgv } from '../../../../cpu-simulation'
-
-export default defineConfig({
- root: fileURLToPath(new URL('.', import.meta.url)),
- define: { 'process.env.NODE_ENV': JSON.stringify('production') },
- plugins: [
- !!(process.env.VITEST && process.env.WITH_INSTRUMENTATION) &&
- codspeedPlugin(),
- // The Node worker evaluates the prebuilt bundle and needs no JSX transform
- // or browser test setup injected by vite-plugin-solid.
- !process.env.VITEST && solid({ ssr: true, hot: false, dev: false }),
- ],
- resolve: { conditions: ['solid', 'browser', 'production'] },
- build: {
- outDir: './dist/client',
- emptyOutDir: true,
- minify: false,
- lib: {
- entry: './src/client.tsx',
- name: 'HydrationBenchmark',
- formats: ['iife'],
- fileName: () => 'client.js',
- },
- },
- test: {
- execArgv: cpuSimulationExecArgv(),
- name: '@benchmarks/client-nav hydration (solid)',
- watch: false,
- environment: 'node',
- isolate: true,
- include: ['hydration.test.ts'],
- benchmark: { include: ['speed.bench.ts'] },
- },
-})
diff --git a/benchmarks/client-nav/scenarios/hydration/solid/vite.server.config.ts b/benchmarks/client-nav/scenarios/hydration/solid/vite.server.config.ts
deleted file mode 100644
index 9787cbb4e2..0000000000
--- a/benchmarks/client-nav/scenarios/hydration/solid/vite.server.config.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-import { fileURLToPath } from 'node:url'
-import { defineConfig } from 'vite'
-import solid from 'vite-plugin-solid'
-
-export default defineConfig({
- root: fileURLToPath(new URL('.', import.meta.url)),
- define: { 'process.env.NODE_ENV': JSON.stringify('production') },
- plugins: [solid({ ssr: true, hot: false, dev: false })],
- resolve: { conditions: ['solid', 'node', 'production'] },
- ssr: {
- noExternal: true,
- resolve: { conditions: ['solid', 'node', 'production'] },
- },
- build: {
- ssr: true,
- outDir: './dist/server',
- emptyOutDir: true,
- minify: false,
- lib: {
- entry: './src/server.tsx',
- formats: ['es'],
- fileName: () => 'server.js',
- },
- rolldownOptions: {
- platform: 'node',
- external: [/^node:/],
- },
- },
-})
diff --git a/benchmarks/client-nav/scenarios/link-churn/react/project.json b/benchmarks/client-nav/scenarios/link-churn/react/project.json
deleted file mode 100644
index 1606b2c456..0000000000
--- a/benchmarks/client-nav/scenarios/link-churn/react/project.json
+++ /dev/null
@@ -1,40 +0,0 @@
-{
- "name": "@benchmarks/client-nav-link-churn-react",
- "projectType": "application",
- "targets": {
- "build:client": {
- "executor": "nx:run-commands",
- "cache": false,
- "dependsOn": [
- {
- "projects": ["@tanstack/react-router", "@tanstack/router-plugin"],
- "target": "build"
- }
- ],
- "options": {
- "command": "NODE_ENV=production vite build --config {projectRoot}/vite.config.ts"
- }
- },
- "test:types:client": {
- "executor": "nx:run-commands",
- "dependsOn": [
- {
- "projects": ["@tanstack/react-router", "@tanstack/router-plugin"],
- "target": "build"
- }
- ],
- "options": {
- "command": "tsc -p {projectRoot}/tsconfig.json --noEmit"
- }
- },
- "test:flame": {
- "executor": "nx:run-commands",
- "cache": false,
- "dependsOn": ["build:client"],
- "options": {
- "command": "NODE_ENV=production flame run --md-format=detailed --delay=none --node-options=\"--stack-size=65500\" ./scenarios/link-churn/react/speed.flame.ts",
- "cwd": "benchmarks/client-nav"
- }
- }
- }
-}
diff --git a/benchmarks/client-nav/scenarios/link-churn/react/setup.ts b/benchmarks/client-nav/scenarios/link-churn/react/setup.ts
deleted file mode 100644
index 59221603da..0000000000
--- a/benchmarks/client-nav/scenarios/link-churn/react/setup.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import { createScenarioSetup } from '../../harness'
-import { assertStepResult, initialUrl, scenarioSteps } from '../shared'
-import type * as App from './src/main'
-
-const appModulePath = './dist/app.js'
-const { mountTestApp } = (await import(
- /* @vite-ignore */ appModulePath
-)) as typeof App
-
-export function setup() {
- return createScenarioSetup({
- frameworkLabel: 'React',
- mount: mountTestApp,
- steps: scenarioSteps,
- assertAfterStep: assertStepResult,
- initialUrl,
- })
-}
diff --git a/benchmarks/client-nav/scenarios/link-churn/react/speed.bench.ts b/benchmarks/client-nav/scenarios/link-churn/react/speed.bench.ts
deleted file mode 100644
index ca0b370528..0000000000
--- a/benchmarks/client-nav/scenarios/link-churn/react/speed.bench.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import { test } from 'vitest'
-import { benchLifecycle } from '../../../../cpu-simulation'
-import { benchOptions, ticksPerIteration } from '../shared'
-import { setup } from './setup'
-
-test('client-link-churn', async ({ bench }) => {
- const scenario = setup()
-
- await bench(
- 'client-link-churn navigation loop (react)',
- benchLifecycle(scenario),
- async () => {
- for (let i = 0; i < ticksPerIteration; i++) {
- await scenario.tick()
- }
- await scenario.finishBatch()
- },
- ).run(benchOptions)
-})
diff --git a/benchmarks/client-nav/scenarios/link-churn/react/speed.flame.ts b/benchmarks/client-nav/scenarios/link-churn/react/speed.flame.ts
deleted file mode 100644
index f4a0b4e6ff..0000000000
--- a/benchmarks/client-nav/scenarios/link-churn/react/speed.flame.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import { window } from '../../../jsdom.ts'
-import { setup } from './setup.ts'
-
-const DURATION_MS = 10_000
-
-const test = setup()
-
-try {
- await test.before()
-
- const startedAt = performance.now()
- while (performance.now() - startedAt < DURATION_MS) {
- await test.tick()
- }
-} finally {
- test.after()
- window.close()
-}
diff --git a/benchmarks/client-nav/scenarios/link-churn/react/src/main.tsx b/benchmarks/client-nav/scenarios/link-churn/react/src/main.tsx
deleted file mode 100644
index 5febd6f795..0000000000
--- a/benchmarks/client-nav/scenarios/link-churn/react/src/main.tsx
+++ /dev/null
@@ -1,37 +0,0 @@
-import type { RouterHistory } from '@tanstack/history'
-import { RouterProvider, createRouter } from '@tanstack/react-router'
-import { createRoot } from 'react-dom/client'
-import { routeTree } from './routeTree.gen'
-
-export function createTestRouter(history: RouterHistory) {
- return createRouter({
- routeTree,
- history,
- scrollRestoration: true,
- // Key the scroll-restoration cache by pathname instead of the default
- // random per-entry location key: with push navigations the default mints
- // a fresh key per navigation and the module-level cache grows one entry
- // per push for the whole run, which is non-stationary.
- getScrollRestorationKey: (location) => location.pathname,
- })
-}
-
-declare module '@tanstack/react-router' {
- interface Register {
- router: ReturnType
- }
-}
-
-export function mountTestApp(container: HTMLElement, history: RouterHistory) {
- const router = createTestRouter(history)
-
- const reactRoot = createRoot(container)
- reactRoot.render( )
-
- return {
- router,
- unmount() {
- reactRoot.unmount()
- },
- }
-}
diff --git a/benchmarks/client-nav/scenarios/link-churn/react/src/routeTree.gen.ts b/benchmarks/client-nav/scenarios/link-churn/react/src/routeTree.gen.ts
deleted file mode 100644
index 4535430b61..0000000000
--- a/benchmarks/client-nav/scenarios/link-churn/react/src/routeTree.gen.ts
+++ /dev/null
@@ -1,121 +0,0 @@
-/* eslint-disable */
-
-// @ts-nocheck
-
-// noinspection JSUnusedGlobalSymbols
-
-// This file was automatically generated by TanStack Router.
-// You should NOT make any changes in this file as it will be overwritten.
-// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
-
-import { Route as rootRouteImport } from './routes/__root'
-import { Route as HubRouteImport } from './routes/hub'
-import { Route as OtherRouteImport } from './routes/other'
-import { Route as HubListRouteImport } from './routes/hub.list'
-import { Route as HubDetailIdRouteImport } from './routes/hub.detail.$id'
-
-const HubRoute = HubRouteImport.update({
- id: '/hub',
- path: '/hub',
- getParentRoute: () => rootRouteImport,
-} as any)
-const OtherRoute = OtherRouteImport.update({
- id: '/other',
- path: '/other',
- getParentRoute: () => rootRouteImport,
-} as any)
-const HubListRoute = HubListRouteImport.update({
- id: '/list',
- path: '/list',
- getParentRoute: () => HubRoute,
-} as any)
-const HubDetailIdRoute = HubDetailIdRouteImport.update({
- id: '/detail/$id',
- path: '/detail/$id',
- getParentRoute: () => HubRoute,
-} as any)
-
-export interface FileRoutesByFullPath {
- '/hub': typeof HubRouteWithChildren
- '/other': typeof OtherRoute
- '/hub/list': typeof HubListRoute
- '/hub/detail/$id': typeof HubDetailIdRoute
-}
-export interface FileRoutesByTo {
- '/hub': typeof HubRouteWithChildren
- '/other': typeof OtherRoute
- '/hub/list': typeof HubListRoute
- '/hub/detail/$id': typeof HubDetailIdRoute
-}
-export interface FileRoutesById {
- __root__: typeof rootRouteImport
- '/hub': typeof HubRouteWithChildren
- '/other': typeof OtherRoute
- '/hub/list': typeof HubListRoute
- '/hub/detail/$id': typeof HubDetailIdRoute
-}
-export interface FileRouteTypes {
- fileRoutesByFullPath: FileRoutesByFullPath
- fullPaths: '/hub' | '/other' | '/hub/list' | '/hub/detail/$id'
- fileRoutesByTo: FileRoutesByTo
- to: '/hub' | '/other' | '/hub/list' | '/hub/detail/$id'
- id: '__root__' | '/hub' | '/other' | '/hub/list' | '/hub/detail/$id'
- fileRoutesById: FileRoutesById
-}
-export interface RootRouteChildren {
- HubRoute: typeof HubRouteWithChildren
- OtherRoute: typeof OtherRoute
-}
-
-declare module '@tanstack/react-router' {
- interface FileRoutesByPath {
- '/hub': {
- id: '/hub'
- path: '/hub'
- fullPath: '/hub'
- preLoaderRoute: typeof HubRouteImport
- parentRoute: typeof rootRouteImport
- }
- '/other': {
- id: '/other'
- path: '/other'
- fullPath: '/other'
- preLoaderRoute: typeof OtherRouteImport
- parentRoute: typeof rootRouteImport
- }
- '/hub/list': {
- id: '/hub/list'
- path: '/list'
- fullPath: '/hub/list'
- preLoaderRoute: typeof HubListRouteImport
- parentRoute: typeof HubRoute
- }
- '/hub/detail/$id': {
- id: '/hub/detail/$id'
- path: '/detail/$id'
- fullPath: '/hub/detail/$id'
- preLoaderRoute: typeof HubDetailIdRouteImport
- parentRoute: typeof HubRoute
- }
- }
-}
-
-interface HubRouteChildren {
- HubListRoute: typeof HubListRoute
- HubDetailIdRoute: typeof HubDetailIdRoute
-}
-
-const HubRouteChildren: HubRouteChildren = {
- HubListRoute: HubListRoute,
- HubDetailIdRoute: HubDetailIdRoute,
-}
-
-const HubRouteWithChildren = HubRoute._addFileChildren(HubRouteChildren)
-
-const rootRouteChildren: RootRouteChildren = {
- HubRoute: HubRouteWithChildren,
- OtherRoute: OtherRoute,
-}
-export const routeTree = rootRouteImport
- ._addFileChildren(rootRouteChildren)
- ._addFileTypes()
diff --git a/benchmarks/client-nav/scenarios/link-churn/react/src/routes/__root.tsx b/benchmarks/client-nav/scenarios/link-churn/react/src/routes/__root.tsx
deleted file mode 100644
index 199cf1ff73..0000000000
--- a/benchmarks/client-nav/scenarios/link-churn/react/src/routes/__root.tsx
+++ /dev/null
@@ -1,39 +0,0 @@
-import { Link, Outlet, createRootRoute } from '@tanstack/react-router'
-import { sortedSearch } from '../../../shared'
-
-export const Route = createRootRoute({
- component: RootComponent,
-})
-
-function RootComponent() {
- return (
- <>
-
-
- List
-
-
- List sorted
-
-
- Detail 1
-
-
- Detail 2
-
-
- Other
-
-
-
- >
- )
-}
diff --git a/benchmarks/client-nav/scenarios/link-churn/react/src/routes/hub.detail.$id.tsx b/benchmarks/client-nav/scenarios/link-churn/react/src/routes/hub.detail.$id.tsx
deleted file mode 100644
index 143cb39a7a..0000000000
--- a/benchmarks/client-nav/scenarios/link-churn/react/src/routes/hub.detail.$id.tsx
+++ /dev/null
@@ -1,21 +0,0 @@
-import { Link, createFileRoute } from '@tanstack/react-router'
-import { detailMarker } from '../../../shared'
-
-export const Route = createFileRoute('/hub/detail/$id')({
- component: DetailPage,
-})
-
-function DetailPage() {
- const params = Route.useParams()
-
- return (
-
- {detailMarker(params.id)}
- Back to list
-
- Next
-
- Elsewhere
-
- )
-}
diff --git a/benchmarks/client-nav/scenarios/link-churn/react/src/routes/hub.list.tsx b/benchmarks/client-nav/scenarios/link-churn/react/src/routes/hub.list.tsx
deleted file mode 100644
index 5aa37b20a7..0000000000
--- a/benchmarks/client-nav/scenarios/link-churn/react/src/routes/hub.list.tsx
+++ /dev/null
@@ -1,65 +0,0 @@
-import { Link, createFileRoute } from '@tanstack/react-router'
-import {
- listItemIds,
- listMarker,
- listRelativeTestId,
- listSortedMarker,
-} from '../../../shared'
-
-export const Route = createFileRoute('/hub/list')({
- component: ListPage,
-})
-
-const ascSearch = { sort: 'asc' } as const
-
-// List Links depart whenever the list leaf is left.
-function ListLinks() {
- return (
-
- {listItemIds.map((id) => {
- const page = Number(id)
- return (
-
-
- {`Item ${id}`}
-
-
- {`Item ${id} asc`}
-
-
- {`Item ${id} exact`}
-
- ({ ...prev, page })}>
- {`Page ${id}`}
-
- ({ ...prev, page, sort: 'asc' as const })}
- data-testid={id === '1' ? listRelativeTestId : undefined}
- >
- {`Page ${id} asc`}
-
-
- )
- })}
-
- )
-}
-
-function ListPage() {
- const sort = Route.useSearch({ select: (search) => search.sort })
-
- return (
-
-
- {sort === 'desc' ? listSortedMarker : listMarker}
-
-
-
- )
-}
diff --git a/benchmarks/client-nav/scenarios/link-churn/react/src/routes/hub.tsx b/benchmarks/client-nav/scenarios/link-churn/react/src/routes/hub.tsx
deleted file mode 100644
index ac12eae2da..0000000000
--- a/benchmarks/client-nav/scenarios/link-churn/react/src/routes/hub.tsx
+++ /dev/null
@@ -1,64 +0,0 @@
-import { Link, Outlet, createFileRoute } from '@tanstack/react-router'
-import {
- hubItemIds,
- hubRelativeTestId,
- validateHubSearch,
-} from '../../../shared'
-
-export const Route = createFileRoute('/hub')({
- validateSearch: validateHubSearch,
- component: HubLayout,
-})
-
-// Layout Links stay mounted while the hub leaves change.
-function HubLinks() {
- return (
-
- {hubItemIds.map((id) => {
- const page = Number(id)
- return (
-
-
- {`Detail ${id}`}
-
-
- {`Detail ${id} exact`}
-
-
- {`List page ${id}`}
-
- ({ ...prev, page })}>
- {`List keep ${id}`}
-
- ({ ...prev, page })}
- data-testid={id === '1' ? hubRelativeTestId : undefined}
- >
- {`Here page ${id}`}
-
-
- )
- })}
-
- )
-}
-
-function HubLayout() {
- return (
-
- )
-}
diff --git a/benchmarks/client-nav/scenarios/link-churn/react/src/routes/other.tsx b/benchmarks/client-nav/scenarios/link-churn/react/src/routes/other.tsx
deleted file mode 100644
index 1f146b789f..0000000000
--- a/benchmarks/client-nav/scenarios/link-churn/react/src/routes/other.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { createFileRoute } from '@tanstack/react-router'
-import { otherMarker } from '../../../shared'
-
-export const Route = createFileRoute('/other')({
- component: OtherPage,
-})
-
-function OtherPage() {
- return (
-
- {otherMarker}
-
- )
-}
diff --git a/benchmarks/client-nav/scenarios/link-churn/react/tsconfig.json b/benchmarks/client-nav/scenarios/link-churn/react/tsconfig.json
deleted file mode 100644
index 1d59cbb450..0000000000
--- a/benchmarks/client-nav/scenarios/link-churn/react/tsconfig.json
+++ /dev/null
@@ -1,21 +0,0 @@
-{
- "extends": "../../../../../tsconfig.json",
- "compilerOptions": {
- "jsx": "react-jsx",
- "jsxImportSource": "react",
- "allowImportingTsExtensions": true,
- "types": ["node", "vite/client", "vitest/globals"]
- },
- "include": [
- "speed.bench.ts",
- "speed.flame.ts",
- "setup.ts",
- "vite.config.ts",
- "../shared.ts",
- "../../harness.ts",
- "../../../setup-helpers.ts",
- "../../../jsdom.ts",
- "../../../vitest.setup.ts",
- "./src/**/*"
- ]
-}
diff --git a/benchmarks/client-nav/scenarios/link-churn/react/vite.config.ts b/benchmarks/client-nav/scenarios/link-churn/react/vite.config.ts
deleted file mode 100644
index 344974ebf9..0000000000
--- a/benchmarks/client-nav/scenarios/link-churn/react/vite.config.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-import { fileURLToPath } from 'node:url'
-import { defineConfig } from 'vitest/config'
-import react from '@vitejs/plugin-react'
-import codspeedPlugin from '@codspeed/vitest-plugin'
-import { tanstackRouter } from '@tanstack/router-plugin/vite'
-import { cpuSimulationExecArgv } from '../../../../cpu-simulation'
-
-const rootDir = fileURLToPath(new URL('.', import.meta.url))
-
-export default defineConfig({
- root: rootDir,
- define: {
- 'process.env.NODE_ENV': JSON.stringify('production'),
- },
- plugins: [
- !!(process.env.VITEST && process.env.WITH_INSTRUMENTATION) &&
- codspeedPlugin(),
- tanstackRouter({
- target: 'react',
- routesDirectory: `${rootDir}src/routes`,
- generatedRouteTree: `${rootDir}src/routeTree.gen.ts`,
- }),
- react(),
- ],
- build: {
- outDir: './dist',
- emptyOutDir: true,
- minify: false,
- lib: {
- entry: './src/main.tsx',
- formats: ['es'],
- fileName: 'app',
- },
- },
- test: {
- execArgv: cpuSimulationExecArgv(),
- name: '@benchmarks/client-nav link-churn (react)',
- watch: false,
- environment: 'jsdom',
- setupFiles: ['../../../vitest.setup.ts'],
- },
-})
diff --git a/benchmarks/client-nav/scenarios/link-churn/shared.ts b/benchmarks/client-nav/scenarios/link-churn/shared.ts
deleted file mode 100644
index d936af35cc..0000000000
--- a/benchmarks/client-nav/scenarios/link-churn/shared.ts
+++ /dev/null
@@ -1,178 +0,0 @@
-/**
- * Shared definition of the `link-churn` scenario: Links that leave, stay and
- * arrive across navigations. A `/hub` layout renders Links that stay mounted
- * while its leaves change; the `/hub/list` leaf renders Links that depart when
- * leaving it and mount again when returning; `/other` sits outside the layout
- * so leaving the list there unmounts layout and leaf Links together. The
- * existing `links` scenario keeps all its Links in the root layout, so none of
- * them ever departs or remounts. The three framework apps consume these
- * constants so the workload is identical modulo the rendering layer.
- */
-import type { ScenarioStep } from '../harness'
-
-// Layout (staying) Links: HUB_ITEM_COUNT ids x 5 variants.
-export const HUB_ITEM_COUNT = 6
-// List leaf (departing) Links: LIST_ITEM_COUNT ids x 5 variants.
-export const LIST_ITEM_COUNT = 20
-
-const ids = (count: number) =>
- Array.from({ length: count }, (_, index) => String(index + 1))
-
-export const hubItemIds = ids(HUB_ITEM_COUNT)
-export const listItemIds = ids(LIST_ITEM_COUNT)
-
-export interface HubSearch {
- page?: number
- sort?: 'asc' | 'desc'
-}
-
-/** Search validation of the `/hub` layout, inherited by its leaves. */
-export function validateHubSearch(search: Record): HubSearch {
- const result: HubSearch = {}
- if (typeof search.page === 'number') {
- result.page = search.page
- }
- if (search.sort === 'asc' || search.sort === 'desc') {
- result.sort = search.sort
- }
- return result
-}
-
-export const sortedSearch = { sort: 'desc' } as const
-
-export function detailMarker(id: string) {
- return `detail-${id}`
-}
-
-export const listMarker = 'list'
-export const listSortedMarker = 'list-desc'
-export const otherMarker = 'other'
-
-// Sampled Links whose href depends on the current location: the first layout
-// `to="."` updater Link and the first list `to="."` updater Link.
-export const hubRelativeTestId = 'hub-relative-1'
-export const listRelativeTestId = 'list-relative-1'
-
-interface StepDef {
- testId: string
- marker: string
- /** Expected number of `.active-link` elements after the step. */
- activeCount: number
- /** Expected href of the sampled layout updater Link (null: not mounted). */
- hubRelativeHref: string | null
- /** Expected href of the sampled list updater Link (null: not mounted). */
- listRelativeHref: string | null
-}
-
-// On the list, every layout `includeSearch: false` Link to the list is active.
-const listActiveCount = HUB_ITEM_COUNT
-
-export const stepDefs: ReadonlyArray = [
- // 1. list -> detail/1: list Links depart, layout Links stay and update.
- {
- testId: 'go-detail-1',
- marker: detailMarker('1'),
- activeCount: 1,
- hubRelativeHref: '/hub/detail/1?page=1',
- listRelativeHref: null,
- },
- // 2. detail/1 -> detail/2: same route, new param; every Link stays.
- {
- testId: 'go-detail-2',
- marker: detailMarker('2'),
- activeCount: 1,
- hubRelativeHref: '/hub/detail/2?page=1',
- listRelativeHref: null,
- },
- // 3. detail/2 -> list: list Links mount.
- {
- testId: 'go-list',
- marker: listMarker,
- activeCount: listActiveCount,
- hubRelativeHref: '/hub/list?page=1',
- listRelativeHref: '/hub/list?page=1&sort=asc',
- },
- // 4. list -> other: layout and list Links depart together.
- {
- testId: 'go-other',
- marker: otherMarker,
- activeCount: 0,
- hubRelativeHref: null,
- listRelativeHref: null,
- },
- // 5. other -> list: layout and list Links all mount.
- {
- testId: 'go-list',
- marker: listMarker,
- activeCount: listActiveCount,
- hubRelativeHref: '/hub/list?page=1',
- listRelativeHref: '/hub/list?page=1&sort=asc',
- },
- // 6a. list -> list?sort=desc: nothing departs, updater Links rebuild.
- {
- testId: 'go-list-sorted',
- marker: listSortedMarker,
- activeCount: listActiveCount,
- hubRelativeHref: '/hub/list?sort=desc&page=1',
- listRelativeHref: '/hub/list?sort=asc&page=1',
- },
- // 6b. back to the plain list so the lap ends on the initial location.
- {
- testId: 'go-list',
- marker: listMarker,
- activeCount: listActiveCount,
- hubRelativeHref: '/hub/list?page=1',
- listRelativeHref: '/hub/list?page=1&sort=asc',
- },
-]
-
-export const initialUrl = '/hub/list'
-
-export const scenarioSteps: ReadonlyArray = stepDefs.map(
- (step) => step.testId,
-)
-
-function assertHref(
- container: HTMLElement,
- testId: string,
- expected: string | null,
- stepIndex: number,
-) {
- const link = container.querySelector(`[data-testid="${testId}"]`)
- const href = link ? link.getAttribute('href') : null
- if (href !== expected) {
- throw new Error(
- `Expected "${testId}" href ${JSON.stringify(expected)} after step ${stepIndex}, received ${JSON.stringify(href)}`,
- )
- }
-}
-
-export function assertStepResult(stepIndex: number, container: HTMLElement) {
- const step = stepDefs[stepIndex]!
-
- const marker = container.querySelector('[data-testid="page-state"]')
- if (marker?.textContent !== step.marker) {
- throw new Error(
- `Expected page marker "${step.marker}" after step ${stepIndex}, received "${marker?.textContent}"`,
- )
- }
-
- const activeLinks = container.querySelectorAll('a.active-link')
- if (activeLinks.length !== step.activeCount) {
- throw new Error(
- `Expected ${step.activeCount} active link(s) after step ${stepIndex}, received ${activeLinks.length}`,
- )
- }
-
- assertHref(container, hubRelativeTestId, step.hubRelativeHref, stepIndex)
- assertHref(container, listRelativeTestId, step.listRelativeHref, stepIndex)
-}
-
-// One lap through the 7-step sequence per benchmark iteration.
-export const ticksPerIteration = stepDefs.length
-
-export const benchOptions = {
- warmupIterations: 50,
- time: 10_000,
- throws: true,
-}
diff --git a/benchmarks/client-nav/scenarios/link-churn/solid/project.json b/benchmarks/client-nav/scenarios/link-churn/solid/project.json
deleted file mode 100644
index 4e46143b32..0000000000
--- a/benchmarks/client-nav/scenarios/link-churn/solid/project.json
+++ /dev/null
@@ -1,40 +0,0 @@
-{
- "name": "@benchmarks/client-nav-link-churn-solid",
- "projectType": "application",
- "targets": {
- "build:client": {
- "executor": "nx:run-commands",
- "cache": false,
- "dependsOn": [
- {
- "projects": ["@tanstack/solid-router", "@tanstack/router-plugin"],
- "target": "build"
- }
- ],
- "options": {
- "command": "NODE_ENV=production vite build --config {projectRoot}/vite.config.ts"
- }
- },
- "test:types:client": {
- "executor": "nx:run-commands",
- "dependsOn": [
- {
- "projects": ["@tanstack/solid-router", "@tanstack/router-plugin"],
- "target": "build"
- }
- ],
- "options": {
- "command": "tsc -p {projectRoot}/tsconfig.json --noEmit"
- }
- },
- "test:flame": {
- "executor": "nx:run-commands",
- "cache": false,
- "dependsOn": ["build:client"],
- "options": {
- "command": "NODE_ENV=production flame run --md-format=detailed --delay=none --node-options=\"--stack-size=65500\" ./scenarios/link-churn/solid/speed.flame.ts",
- "cwd": "benchmarks/client-nav"
- }
- }
- }
-}
diff --git a/benchmarks/client-nav/scenarios/link-churn/solid/setup.ts b/benchmarks/client-nav/scenarios/link-churn/solid/setup.ts
deleted file mode 100644
index a2a024341d..0000000000
--- a/benchmarks/client-nav/scenarios/link-churn/solid/setup.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import { createScenarioSetup } from '../../harness'
-import { assertStepResult, initialUrl, scenarioSteps } from '../shared'
-import type * as App from './src/main'
-
-const appModulePath = './dist/app.js'
-const { mountTestApp } = (await import(
- /* @vite-ignore */ appModulePath
-)) as typeof App
-
-export function setup() {
- return createScenarioSetup({
- frameworkLabel: 'Solid',
- mount: mountTestApp,
- steps: scenarioSteps,
- assertAfterStep: assertStepResult,
- initialUrl,
- })
-}
diff --git a/benchmarks/client-nav/scenarios/link-churn/solid/speed.bench.ts b/benchmarks/client-nav/scenarios/link-churn/solid/speed.bench.ts
deleted file mode 100644
index 80c4aaa6fd..0000000000
--- a/benchmarks/client-nav/scenarios/link-churn/solid/speed.bench.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import { test } from 'vitest'
-import { benchLifecycle } from '../../../../cpu-simulation'
-import { benchOptions, ticksPerIteration } from '../shared'
-import { setup } from './setup'
-
-test('client-link-churn', async ({ bench }) => {
- const scenario = setup()
-
- await bench(
- 'client-link-churn navigation loop (solid)',
- benchLifecycle(scenario),
- async () => {
- for (let i = 0; i < ticksPerIteration; i++) {
- await scenario.tick()
- }
- await scenario.finishBatch()
- },
- ).run(benchOptions)
-})
diff --git a/benchmarks/client-nav/scenarios/link-churn/solid/speed.flame.ts b/benchmarks/client-nav/scenarios/link-churn/solid/speed.flame.ts
deleted file mode 100644
index f4a0b4e6ff..0000000000
--- a/benchmarks/client-nav/scenarios/link-churn/solid/speed.flame.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import { window } from '../../../jsdom.ts'
-import { setup } from './setup.ts'
-
-const DURATION_MS = 10_000
-
-const test = setup()
-
-try {
- await test.before()
-
- const startedAt = performance.now()
- while (performance.now() - startedAt < DURATION_MS) {
- await test.tick()
- }
-} finally {
- test.after()
- window.close()
-}
diff --git a/benchmarks/client-nav/scenarios/link-churn/solid/src/main.tsx b/benchmarks/client-nav/scenarios/link-churn/solid/src/main.tsx
deleted file mode 100644
index fa9d239418..0000000000
--- a/benchmarks/client-nav/scenarios/link-churn/solid/src/main.tsx
+++ /dev/null
@@ -1,34 +0,0 @@
-import type { RouterHistory } from '@tanstack/history'
-import { render } from 'solid-js/web'
-import { RouterProvider, createRouter } from '@tanstack/solid-router'
-import { routeTree } from './routeTree.gen'
-
-export function createTestRouter(history: RouterHistory) {
- return createRouter({
- routeTree,
- history,
- scrollRestoration: true,
- // Key the scroll-restoration cache by pathname instead of the default
- // random per-entry location key: with push navigations the default mints
- // a fresh key per navigation and the module-level cache grows one entry
- // per push for the whole run, which is non-stationary.
- getScrollRestorationKey: (location) => location.pathname,
- })
-}
-
-declare module '@tanstack/solid-router' {
- interface Register {
- router: ReturnType
- }
-}
-
-export function mountTestApp(container: HTMLElement, history: RouterHistory) {
- const router = createTestRouter(history)
-
- const unmount = render(() => , container)
-
- return {
- router,
- unmount,
- }
-}
diff --git a/benchmarks/client-nav/scenarios/link-churn/solid/src/routeTree.gen.ts b/benchmarks/client-nav/scenarios/link-churn/solid/src/routeTree.gen.ts
deleted file mode 100644
index e3cb546963..0000000000
--- a/benchmarks/client-nav/scenarios/link-churn/solid/src/routeTree.gen.ts
+++ /dev/null
@@ -1,121 +0,0 @@
-/* eslint-disable */
-
-// @ts-nocheck
-
-// noinspection JSUnusedGlobalSymbols
-
-// This file was automatically generated by TanStack Router.
-// You should NOT make any changes in this file as it will be overwritten.
-// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
-
-import { Route as rootRouteImport } from './routes/__root'
-import { Route as HubRouteImport } from './routes/hub'
-import { Route as OtherRouteImport } from './routes/other'
-import { Route as HubListRouteImport } from './routes/hub.list'
-import { Route as HubDetailIdRouteImport } from './routes/hub.detail.$id'
-
-const HubRoute = HubRouteImport.update({
- id: '/hub',
- path: '/hub',
- getParentRoute: () => rootRouteImport,
-} as any)
-const OtherRoute = OtherRouteImport.update({
- id: '/other',
- path: '/other',
- getParentRoute: () => rootRouteImport,
-} as any)
-const HubListRoute = HubListRouteImport.update({
- id: '/list',
- path: '/list',
- getParentRoute: () => HubRoute,
-} as any)
-const HubDetailIdRoute = HubDetailIdRouteImport.update({
- id: '/detail/$id',
- path: '/detail/$id',
- getParentRoute: () => HubRoute,
-} as any)
-
-export interface FileRoutesByFullPath {
- '/hub': typeof HubRouteWithChildren
- '/other': typeof OtherRoute
- '/hub/list': typeof HubListRoute
- '/hub/detail/$id': typeof HubDetailIdRoute
-}
-export interface FileRoutesByTo {
- '/hub': typeof HubRouteWithChildren
- '/other': typeof OtherRoute
- '/hub/list': typeof HubListRoute
- '/hub/detail/$id': typeof HubDetailIdRoute
-}
-export interface FileRoutesById {
- __root__: typeof rootRouteImport
- '/hub': typeof HubRouteWithChildren
- '/other': typeof OtherRoute
- '/hub/list': typeof HubListRoute
- '/hub/detail/$id': typeof HubDetailIdRoute
-}
-export interface FileRouteTypes {
- fileRoutesByFullPath: FileRoutesByFullPath
- fullPaths: '/hub' | '/other' | '/hub/list' | '/hub/detail/$id'
- fileRoutesByTo: FileRoutesByTo
- to: '/hub' | '/other' | '/hub/list' | '/hub/detail/$id'
- id: '__root__' | '/hub' | '/other' | '/hub/list' | '/hub/detail/$id'
- fileRoutesById: FileRoutesById
-}
-export interface RootRouteChildren {
- HubRoute: typeof HubRouteWithChildren
- OtherRoute: typeof OtherRoute
-}
-
-declare module '@tanstack/solid-router' {
- interface FileRoutesByPath {
- '/hub': {
- id: '/hub'
- path: '/hub'
- fullPath: '/hub'
- preLoaderRoute: typeof HubRouteImport
- parentRoute: typeof rootRouteImport
- }
- '/other': {
- id: '/other'
- path: '/other'
- fullPath: '/other'
- preLoaderRoute: typeof OtherRouteImport
- parentRoute: typeof rootRouteImport
- }
- '/hub/list': {
- id: '/hub/list'
- path: '/list'
- fullPath: '/hub/list'
- preLoaderRoute: typeof HubListRouteImport
- parentRoute: typeof HubRoute
- }
- '/hub/detail/$id': {
- id: '/hub/detail/$id'
- path: '/detail/$id'
- fullPath: '/hub/detail/$id'
- preLoaderRoute: typeof HubDetailIdRouteImport
- parentRoute: typeof HubRoute
- }
- }
-}
-
-interface HubRouteChildren {
- HubListRoute: typeof HubListRoute
- HubDetailIdRoute: typeof HubDetailIdRoute
-}
-
-const HubRouteChildren: HubRouteChildren = {
- HubListRoute: HubListRoute,
- HubDetailIdRoute: HubDetailIdRoute,
-}
-
-const HubRouteWithChildren = HubRoute._addFileChildren(HubRouteChildren)
-
-const rootRouteChildren: RootRouteChildren = {
- HubRoute: HubRouteWithChildren,
- OtherRoute: OtherRoute,
-}
-export const routeTree = rootRouteImport
- ._addFileChildren(rootRouteChildren)
- ._addFileTypes()
diff --git a/benchmarks/client-nav/scenarios/link-churn/solid/src/routes/__root.tsx b/benchmarks/client-nav/scenarios/link-churn/solid/src/routes/__root.tsx
deleted file mode 100644
index a9de4ea356..0000000000
--- a/benchmarks/client-nav/scenarios/link-churn/solid/src/routes/__root.tsx
+++ /dev/null
@@ -1,39 +0,0 @@
-import { Link, Outlet, createRootRoute } from '@tanstack/solid-router'
-import { sortedSearch } from '../../../shared'
-
-export const Route = createRootRoute({
- component: RootComponent,
-})
-
-function RootComponent() {
- return (
- <>
-
-
- List
-
-
- List sorted
-
-
- Detail 1
-
-
- Detail 2
-
-
- Other
-
-
-
- >
- )
-}
diff --git a/benchmarks/client-nav/scenarios/link-churn/solid/src/routes/hub.detail.$id.tsx b/benchmarks/client-nav/scenarios/link-churn/solid/src/routes/hub.detail.$id.tsx
deleted file mode 100644
index 7aca4a9935..0000000000
--- a/benchmarks/client-nav/scenarios/link-churn/solid/src/routes/hub.detail.$id.tsx
+++ /dev/null
@@ -1,24 +0,0 @@
-import { Link, createFileRoute } from '@tanstack/solid-router'
-import { detailMarker } from '../../../shared'
-
-export const Route = createFileRoute('/hub/detail/$id')({
- component: DetailPage,
-})
-
-function DetailPage() {
- const params = Route.useParams()
-
- return (
-
- {detailMarker(params().id)}
- Back to list
-
- Next
-
- Elsewhere
-
- )
-}
diff --git a/benchmarks/client-nav/scenarios/link-churn/solid/src/routes/hub.list.tsx b/benchmarks/client-nav/scenarios/link-churn/solid/src/routes/hub.list.tsx
deleted file mode 100644
index 5796a50b02..0000000000
--- a/benchmarks/client-nav/scenarios/link-churn/solid/src/routes/hub.list.tsx
+++ /dev/null
@@ -1,68 +0,0 @@
-import { For } from 'solid-js'
-import { Link, createFileRoute } from '@tanstack/solid-router'
-import {
- listItemIds,
- listMarker,
- listRelativeTestId,
- listSortedMarker,
-} from '../../../shared'
-
-export const Route = createFileRoute('/hub/list')({
- component: ListPage,
-})
-
-const ascSearch = { sort: 'asc' } as const
-
-// List Links depart whenever the list leaf is left.
-function ListLinks() {
- return (
-
-
- {(id) => {
- const page = Number(id)
- return (
-
-
- {`Item ${id}`}
-
-
- {`Item ${id} asc`}
-
-
- {`Item ${id} exact`}
-
- ({ ...prev, page })}>
- {`Page ${id}`}
-
- ({ ...prev, page, sort: 'asc' as const })}
- data-testid={id === '1' ? listRelativeTestId : undefined}
- >
- {`Page ${id} asc`}
-
-
- )
- }}
-
-
- )
-}
-
-function ListPage() {
- const sort = Route.useSearch({ select: (search) => search.sort })
-
- return (
-
-
- {sort() === 'desc' ? listSortedMarker : listMarker}
-
-
-
- )
-}
diff --git a/benchmarks/client-nav/scenarios/link-churn/solid/src/routes/hub.tsx b/benchmarks/client-nav/scenarios/link-churn/solid/src/routes/hub.tsx
deleted file mode 100644
index 4682f85aae..0000000000
--- a/benchmarks/client-nav/scenarios/link-churn/solid/src/routes/hub.tsx
+++ /dev/null
@@ -1,67 +0,0 @@
-import { For } from 'solid-js'
-import { Link, Outlet, createFileRoute } from '@tanstack/solid-router'
-import {
- hubItemIds,
- hubRelativeTestId,
- validateHubSearch,
-} from '../../../shared'
-
-export const Route = createFileRoute('/hub')({
- validateSearch: validateHubSearch,
- component: HubLayout,
-})
-
-// Layout Links stay mounted while the hub leaves change.
-function HubLinks() {
- return (
-
-
- {(id) => {
- const page = Number(id)
- return (
-
-
- {`Detail ${id}`}
-
-
- {`Detail ${id} exact`}
-
-
- {`List page ${id}`}
-
- ({ ...prev, page })}>
- {`List keep ${id}`}
-
- ({ ...prev, page })}
- data-testid={id === '1' ? hubRelativeTestId : undefined}
- >
- {`Here page ${id}`}
-
-
- )
- }}
-
-
- )
-}
-
-function HubLayout() {
- return (
-
- )
-}
diff --git a/benchmarks/client-nav/scenarios/link-churn/solid/src/routes/other.tsx b/benchmarks/client-nav/scenarios/link-churn/solid/src/routes/other.tsx
deleted file mode 100644
index 2606089113..0000000000
--- a/benchmarks/client-nav/scenarios/link-churn/solid/src/routes/other.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { createFileRoute } from '@tanstack/solid-router'
-import { otherMarker } from '../../../shared'
-
-export const Route = createFileRoute('/other')({
- component: OtherPage,
-})
-
-function OtherPage() {
- return (
-
- {otherMarker}
-
- )
-}
diff --git a/benchmarks/client-nav/scenarios/link-churn/solid/tsconfig.json b/benchmarks/client-nav/scenarios/link-churn/solid/tsconfig.json
deleted file mode 100644
index 98d76ad6b8..0000000000
--- a/benchmarks/client-nav/scenarios/link-churn/solid/tsconfig.json
+++ /dev/null
@@ -1,21 +0,0 @@
-{
- "extends": "../../../../../tsconfig.json",
- "compilerOptions": {
- "jsx": "preserve",
- "jsxImportSource": "solid-js",
- "allowImportingTsExtensions": true,
- "types": ["node", "vite/client", "vitest/globals"]
- },
- "include": [
- "speed.bench.ts",
- "speed.flame.ts",
- "setup.ts",
- "vite.config.ts",
- "../shared.ts",
- "../../harness.ts",
- "../../../setup-helpers.ts",
- "../../../jsdom.ts",
- "../../../vitest.setup.ts",
- "./src/**/*"
- ]
-}
diff --git a/benchmarks/client-nav/scenarios/link-churn/solid/vite.config.ts b/benchmarks/client-nav/scenarios/link-churn/solid/vite.config.ts
deleted file mode 100644
index 37718a2d6a..0000000000
--- a/benchmarks/client-nav/scenarios/link-churn/solid/vite.config.ts
+++ /dev/null
@@ -1,50 +0,0 @@
-import { fileURLToPath } from 'node:url'
-import { defineConfig } from 'vitest/config'
-import solid from 'vite-plugin-solid'
-import codspeedPlugin from '@codspeed/vitest-plugin'
-import { tanstackRouter } from '@tanstack/router-plugin/vite'
-import { cpuSimulationExecArgv } from '../../../../cpu-simulation'
-
-const rootDir = fileURLToPath(new URL('.', import.meta.url))
-
-export default defineConfig({
- root: rootDir,
- define: {
- 'process.env.NODE_ENV': JSON.stringify('production'),
- },
- plugins: [
- !!(process.env.VITEST && process.env.WITH_INSTRUMENTATION) &&
- codspeedPlugin(),
- tanstackRouter({
- target: 'solid',
- routesDirectory: `${rootDir}src/routes`,
- generatedRouteTree: `${rootDir}src/routeTree.gen.ts`,
- }),
- solid({ hot: false, dev: false }),
- ],
- build: {
- outDir: './dist',
- emptyOutDir: true,
- minify: false,
- lib: {
- entry: './src/main.tsx',
- formats: ['es'],
- fileName: 'app',
- },
- },
- resolve: {
- conditions: ['solid', 'browser'],
- },
- test: {
- execArgv: cpuSimulationExecArgv(),
- name: '@benchmarks/client-nav link-churn (solid)',
- watch: false,
- environment: 'jsdom',
- setupFiles: ['../../../vitest.setup.ts'],
- server: {
- deps: {
- inline: [/@solidjs/, /@tanstack\/solid-store/],
- },
- },
- },
-})
diff --git a/benchmarks/client-nav/scenarios/link-churn/vue/project.json b/benchmarks/client-nav/scenarios/link-churn/vue/project.json
deleted file mode 100644
index fb890ddfb8..0000000000
--- a/benchmarks/client-nav/scenarios/link-churn/vue/project.json
+++ /dev/null
@@ -1,40 +0,0 @@
-{
- "name": "@benchmarks/client-nav-link-churn-vue",
- "projectType": "application",
- "targets": {
- "build:client": {
- "executor": "nx:run-commands",
- "cache": false,
- "dependsOn": [
- {
- "projects": ["@tanstack/vue-router", "@tanstack/router-plugin"],
- "target": "build"
- }
- ],
- "options": {
- "command": "NODE_ENV=production vite build --config {projectRoot}/vite.config.ts"
- }
- },
- "test:types:client": {
- "executor": "nx:run-commands",
- "dependsOn": [
- {
- "projects": ["@tanstack/vue-router", "@tanstack/router-plugin"],
- "target": "build"
- }
- ],
- "options": {
- "command": "tsc -p {projectRoot}/tsconfig.json --noEmit"
- }
- },
- "test:flame": {
- "executor": "nx:run-commands",
- "cache": false,
- "dependsOn": ["build:client"],
- "options": {
- "command": "NODE_ENV=production flame run --md-format=detailed --delay=none --node-options=\"--stack-size=65500\" ./scenarios/link-churn/vue/speed.flame.ts",
- "cwd": "benchmarks/client-nav"
- }
- }
- }
-}
diff --git a/benchmarks/client-nav/scenarios/link-churn/vue/setup.ts b/benchmarks/client-nav/scenarios/link-churn/vue/setup.ts
deleted file mode 100644
index 95cacb9ea8..0000000000
--- a/benchmarks/client-nav/scenarios/link-churn/vue/setup.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import { createScenarioSetup } from '../../harness'
-import { assertStepResult, initialUrl, scenarioSteps } from '../shared'
-import type * as App from './src/main'
-
-const appModulePath = './dist/app.js'
-const { mountTestApp } = (await import(
- /* @vite-ignore */ appModulePath
-)) as typeof App
-
-export function setup() {
- return createScenarioSetup({
- frameworkLabel: 'Vue',
- mount: mountTestApp,
- steps: scenarioSteps,
- assertAfterStep: assertStepResult,
- initialUrl,
- })
-}
diff --git a/benchmarks/client-nav/scenarios/link-churn/vue/speed.bench.ts b/benchmarks/client-nav/scenarios/link-churn/vue/speed.bench.ts
deleted file mode 100644
index dea511c24c..0000000000
--- a/benchmarks/client-nav/scenarios/link-churn/vue/speed.bench.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import { test } from 'vitest'
-import { benchLifecycle } from '../../../../cpu-simulation'
-import { benchOptions, ticksPerIteration } from '../shared'
-import { setup } from './setup'
-
-test('client-link-churn', async ({ bench }) => {
- const scenario = setup()
-
- await bench(
- 'client-link-churn navigation loop (vue)',
- benchLifecycle(scenario),
- async () => {
- for (let i = 0; i < ticksPerIteration; i++) {
- await scenario.tick()
- }
- await scenario.finishBatch()
- },
- ).run(benchOptions)
-})
diff --git a/benchmarks/client-nav/scenarios/link-churn/vue/speed.flame.ts b/benchmarks/client-nav/scenarios/link-churn/vue/speed.flame.ts
deleted file mode 100644
index f4a0b4e6ff..0000000000
--- a/benchmarks/client-nav/scenarios/link-churn/vue/speed.flame.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import { window } from '../../../jsdom.ts'
-import { setup } from './setup.ts'
-
-const DURATION_MS = 10_000
-
-const test = setup()
-
-try {
- await test.before()
-
- const startedAt = performance.now()
- while (performance.now() - startedAt < DURATION_MS) {
- await test.tick()
- }
-} finally {
- test.after()
- window.close()
-}
diff --git a/benchmarks/client-nav/scenarios/link-churn/vue/src/main.tsx b/benchmarks/client-nav/scenarios/link-churn/vue/src/main.tsx
deleted file mode 100644
index cae9b54f1d..0000000000
--- a/benchmarks/client-nav/scenarios/link-churn/vue/src/main.tsx
+++ /dev/null
@@ -1,41 +0,0 @@
-import type { RouterHistory } from '@tanstack/history'
-import * as Vue from 'vue'
-import { RouterProvider, createRouter } from '@tanstack/vue-router'
-import { routeTree } from './routeTree.gen'
-
-export function createTestRouter(history: RouterHistory) {
- return createRouter({
- routeTree,
- history,
- scrollRestoration: true,
- // Key the scroll-restoration cache by pathname instead of the default
- // random per-entry location key: with push navigations the default mints
- // a fresh key per navigation and the module-level cache grows one entry
- // per push for the whole run, which is non-stationary.
- getScrollRestorationKey: (location) => location.pathname,
- })
-}
-
-declare module '@tanstack/vue-router' {
- interface Register {
- router: ReturnType
- }
-}
-
-export function mountTestApp(container: HTMLElement, history: RouterHistory) {
- const router = createTestRouter(history)
-
- const component =
- const app = Vue.createApp({
- render: () => component,
- })
-
- app.mount(container)
-
- return {
- router,
- unmount() {
- app.unmount()
- },
- }
-}
diff --git a/benchmarks/client-nav/scenarios/link-churn/vue/src/routeTree.gen.ts b/benchmarks/client-nav/scenarios/link-churn/vue/src/routeTree.gen.ts
deleted file mode 100644
index 9327bbc01d..0000000000
--- a/benchmarks/client-nav/scenarios/link-churn/vue/src/routeTree.gen.ts
+++ /dev/null
@@ -1,121 +0,0 @@
-/* eslint-disable */
-
-// @ts-nocheck
-
-// noinspection JSUnusedGlobalSymbols
-
-// This file was automatically generated by TanStack Router.
-// You should NOT make any changes in this file as it will be overwritten.
-// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
-
-import { Route as rootRouteImport } from './routes/__root'
-import { Route as HubRouteImport } from './routes/hub'
-import { Route as OtherRouteImport } from './routes/other'
-import { Route as HubListRouteImport } from './routes/hub.list'
-import { Route as HubDetailIdRouteImport } from './routes/hub.detail.$id'
-
-const HubRoute = HubRouteImport.update({
- id: '/hub',
- path: '/hub',
- getParentRoute: () => rootRouteImport,
-} as any)
-const OtherRoute = OtherRouteImport.update({
- id: '/other',
- path: '/other',
- getParentRoute: () => rootRouteImport,
-} as any)
-const HubListRoute = HubListRouteImport.update({
- id: '/list',
- path: '/list',
- getParentRoute: () => HubRoute,
-} as any)
-const HubDetailIdRoute = HubDetailIdRouteImport.update({
- id: '/detail/$id',
- path: '/detail/$id',
- getParentRoute: () => HubRoute,
-} as any)
-
-export interface FileRoutesByFullPath {
- '/hub': typeof HubRouteWithChildren
- '/other': typeof OtherRoute
- '/hub/list': typeof HubListRoute
- '/hub/detail/$id': typeof HubDetailIdRoute
-}
-export interface FileRoutesByTo {
- '/hub': typeof HubRouteWithChildren
- '/other': typeof OtherRoute
- '/hub/list': typeof HubListRoute
- '/hub/detail/$id': typeof HubDetailIdRoute
-}
-export interface FileRoutesById {
- __root__: typeof rootRouteImport
- '/hub': typeof HubRouteWithChildren
- '/other': typeof OtherRoute
- '/hub/list': typeof HubListRoute
- '/hub/detail/$id': typeof HubDetailIdRoute
-}
-export interface FileRouteTypes {
- fileRoutesByFullPath: FileRoutesByFullPath
- fullPaths: '/hub' | '/other' | '/hub/list' | '/hub/detail/$id'
- fileRoutesByTo: FileRoutesByTo
- to: '/hub' | '/other' | '/hub/list' | '/hub/detail/$id'
- id: '__root__' | '/hub' | '/other' | '/hub/list' | '/hub/detail/$id'
- fileRoutesById: FileRoutesById
-}
-export interface RootRouteChildren {
- HubRoute: typeof HubRouteWithChildren
- OtherRoute: typeof OtherRoute
-}
-
-declare module '@tanstack/vue-router' {
- interface FileRoutesByPath {
- '/hub': {
- id: '/hub'
- path: '/hub'
- fullPath: '/hub'
- preLoaderRoute: typeof HubRouteImport
- parentRoute: typeof rootRouteImport
- }
- '/other': {
- id: '/other'
- path: '/other'
- fullPath: '/other'
- preLoaderRoute: typeof OtherRouteImport
- parentRoute: typeof rootRouteImport
- }
- '/hub/list': {
- id: '/hub/list'
- path: '/list'
- fullPath: '/hub/list'
- preLoaderRoute: typeof HubListRouteImport
- parentRoute: typeof HubRoute
- }
- '/hub/detail/$id': {
- id: '/hub/detail/$id'
- path: '/detail/$id'
- fullPath: '/hub/detail/$id'
- preLoaderRoute: typeof HubDetailIdRouteImport
- parentRoute: typeof HubRoute
- }
- }
-}
-
-interface HubRouteChildren {
- HubListRoute: typeof HubListRoute
- HubDetailIdRoute: typeof HubDetailIdRoute
-}
-
-const HubRouteChildren: HubRouteChildren = {
- HubListRoute: HubListRoute,
- HubDetailIdRoute: HubDetailIdRoute,
-}
-
-const HubRouteWithChildren = HubRoute._addFileChildren(HubRouteChildren)
-
-const rootRouteChildren: RootRouteChildren = {
- HubRoute: HubRouteWithChildren,
- OtherRoute: OtherRoute,
-}
-export const routeTree = rootRouteImport
- ._addFileChildren(rootRouteChildren)
- ._addFileTypes()
diff --git a/benchmarks/client-nav/scenarios/link-churn/vue/src/routes/__root.tsx b/benchmarks/client-nav/scenarios/link-churn/vue/src/routes/__root.tsx
deleted file mode 100644
index a4f7985c5a..0000000000
--- a/benchmarks/client-nav/scenarios/link-churn/vue/src/routes/__root.tsx
+++ /dev/null
@@ -1,46 +0,0 @@
-import * as Vue from 'vue'
-import { Link, Outlet, createRootRoute } from '@tanstack/vue-router'
-import { sortedSearch } from '../../../shared'
-
-const RootComponent = Vue.defineComponent({
- setup() {
- return () => (
- <>
-
-
- List
-
-
- List sorted
-
-
- Detail 1
-
-
- Detail 2
-
-
- Other
-
-
-
- >
- )
- },
-})
-
-export const Route = createRootRoute({
- component: RootComponent,
-})
diff --git a/benchmarks/client-nav/scenarios/link-churn/vue/src/routes/hub.detail.$id.tsx b/benchmarks/client-nav/scenarios/link-churn/vue/src/routes/hub.detail.$id.tsx
deleted file mode 100644
index 4701ab44eb..0000000000
--- a/benchmarks/client-nav/scenarios/link-churn/vue/src/routes/hub.detail.$id.tsx
+++ /dev/null
@@ -1,27 +0,0 @@
-import * as Vue from 'vue'
-import { Link, createFileRoute } from '@tanstack/vue-router'
-import { detailMarker } from '../../../shared'
-
-const DetailPage = Vue.defineComponent({
- setup() {
- const params = Route.useParams()
-
- return () => (
-
- {detailMarker(params.value.id)}
- Back to list
-
- Next
-
- Elsewhere
-
- )
- },
-})
-
-export const Route = createFileRoute('/hub/detail/$id')({
- component: DetailPage,
-})
diff --git a/benchmarks/client-nav/scenarios/link-churn/vue/src/routes/hub.list.tsx b/benchmarks/client-nav/scenarios/link-churn/vue/src/routes/hub.list.tsx
deleted file mode 100644
index 02abd6db1b..0000000000
--- a/benchmarks/client-nav/scenarios/link-churn/vue/src/routes/hub.list.tsx
+++ /dev/null
@@ -1,74 +0,0 @@
-import * as Vue from 'vue'
-import { Link, createFileRoute } from '@tanstack/vue-router'
-import {
- listItemIds,
- listMarker,
- listRelativeTestId,
- listSortedMarker,
-} from '../../../shared'
-
-const ascSearch = { sort: 'asc' } as const
-
-// List Links depart whenever the list leaf is left.
-const ListLinks = Vue.defineComponent({
- setup() {
- return () => (
-
- {listItemIds.map((id) => {
- const page = Number(id)
- return (
-
-
- {`Item ${id}`}
-
-
- {`Item ${id} asc`}
-
-
- {`Item ${id} exact`}
-
- ({ ...prev, page })}>
- {`Page ${id}`}
-
- ({
- ...prev,
- page,
- sort: 'asc' as const,
- })}
- data-testid={id === '1' ? listRelativeTestId : undefined}
- >
- {`Page ${id} asc`}
-
-
- )
- })}
-
- )
- },
-})
-
-const ListPage = Vue.defineComponent({
- setup() {
- const sort = Route.useSearch({ select: (search) => search.sort })
-
- return () => (
-
-
- {sort.value === 'desc' ? listSortedMarker : listMarker}
-
-
-
- )
- },
-})
-
-export const Route = createFileRoute('/hub/list')({
- component: ListPage,
-})
diff --git a/benchmarks/client-nav/scenarios/link-churn/vue/src/routes/hub.tsx b/benchmarks/client-nav/scenarios/link-churn/vue/src/routes/hub.tsx
deleted file mode 100644
index 5be17f3350..0000000000
--- a/benchmarks/client-nav/scenarios/link-churn/vue/src/routes/hub.tsx
+++ /dev/null
@@ -1,69 +0,0 @@
-import * as Vue from 'vue'
-import { Link, Outlet, createFileRoute } from '@tanstack/vue-router'
-import {
- hubItemIds,
- hubRelativeTestId,
- validateHubSearch,
-} from '../../../shared'
-
-// Layout Links stay mounted while the hub leaves change.
-const HubLinks = Vue.defineComponent({
- setup() {
- return () => (
-
- {hubItemIds.map((id) => {
- const page = Number(id)
- return (
-
-
- {`Detail ${id}`}
-
-
- {`Detail ${id} exact`}
-
-
- {`List page ${id}`}
-
- ({ ...prev, page })}>
- {`List keep ${id}`}
-
- ({ ...prev, page })}
- data-testid={id === '1' ? hubRelativeTestId : undefined}
- >
- {`Here page ${id}`}
-
-
- )
- })}
-
- )
- },
-})
-
-const HubLayout = Vue.defineComponent({
- setup() {
- return () => (
-
- )
- },
-})
-
-export const Route = createFileRoute('/hub')({
- validateSearch: validateHubSearch,
- component: HubLayout,
-})
diff --git a/benchmarks/client-nav/scenarios/link-churn/vue/src/routes/other.tsx b/benchmarks/client-nav/scenarios/link-churn/vue/src/routes/other.tsx
deleted file mode 100644
index 08dec586fa..0000000000
--- a/benchmarks/client-nav/scenarios/link-churn/vue/src/routes/other.tsx
+++ /dev/null
@@ -1,17 +0,0 @@
-import * as Vue from 'vue'
-import { createFileRoute } from '@tanstack/vue-router'
-import { otherMarker } from '../../../shared'
-
-const OtherPage = Vue.defineComponent({
- setup() {
- return () => (
-
- {otherMarker}
-
- )
- },
-})
-
-export const Route = createFileRoute('/other')({
- component: OtherPage,
-})
diff --git a/benchmarks/client-nav/scenarios/link-churn/vue/tsconfig.json b/benchmarks/client-nav/scenarios/link-churn/vue/tsconfig.json
deleted file mode 100644
index 7786fc3da9..0000000000
--- a/benchmarks/client-nav/scenarios/link-churn/vue/tsconfig.json
+++ /dev/null
@@ -1,21 +0,0 @@
-{
- "extends": "../../../../../tsconfig.json",
- "compilerOptions": {
- "jsx": "preserve",
- "jsxImportSource": "vue",
- "allowImportingTsExtensions": true,
- "types": ["node", "vite/client", "vitest/globals"]
- },
- "include": [
- "speed.bench.ts",
- "speed.flame.ts",
- "setup.ts",
- "vite.config.ts",
- "../shared.ts",
- "../../harness.ts",
- "../../../setup-helpers.ts",
- "../../../jsdom.ts",
- "../../../vitest.setup.ts",
- "./src/**/*"
- ]
-}
diff --git a/benchmarks/client-nav/scenarios/link-churn/vue/vite.config.ts b/benchmarks/client-nav/scenarios/link-churn/vue/vite.config.ts
deleted file mode 100644
index 8f56734e04..0000000000
--- a/benchmarks/client-nav/scenarios/link-churn/vue/vite.config.ts
+++ /dev/null
@@ -1,44 +0,0 @@
-import { fileURLToPath } from 'node:url'
-import { defineConfig } from 'vitest/config'
-import vue from '@vitejs/plugin-vue'
-import vueJsx from '@vitejs/plugin-vue-jsx'
-import codspeedPlugin from '@codspeed/vitest-plugin'
-import { tanstackRouter } from '@tanstack/router-plugin/vite'
-import { cpuSimulationExecArgv } from '../../../../cpu-simulation'
-
-const rootDir = fileURLToPath(new URL('.', import.meta.url))
-
-export default defineConfig({
- root: rootDir,
- define: {
- 'process.env.NODE_ENV': JSON.stringify('production'),
- },
- plugins: [
- !!(process.env.VITEST && process.env.WITH_INSTRUMENTATION) &&
- codspeedPlugin(),
- tanstackRouter({
- target: 'vue',
- routesDirectory: `${rootDir}src/routes`,
- generatedRouteTree: `${rootDir}src/routeTree.gen.ts`,
- }),
- vue(),
- vueJsx(),
- ],
- build: {
- outDir: './dist',
- emptyOutDir: true,
- minify: false,
- lib: {
- entry: './src/main.tsx',
- formats: ['es'],
- fileName: 'app',
- },
- },
- test: {
- execArgv: cpuSimulationExecArgv(),
- name: '@benchmarks/client-nav link-churn (vue)',
- watch: false,
- environment: 'jsdom',
- setupFiles: ['../../../vitest.setup.ts'],
- },
-})
diff --git a/benchmarks/client-nav/scenarios/links/react/speed.bench.ts b/benchmarks/client-nav/scenarios/links/react/speed.bench.ts
index 75f5f725d4..0892308901 100644
--- a/benchmarks/client-nav/scenarios/links/react/speed.bench.ts
+++ b/benchmarks/client-nav/scenarios/links/react/speed.bench.ts
@@ -1,19 +1,32 @@
-import { test } from 'vitest'
-import { benchLifecycle } from '../../../../cpu-simulation'
+import { afterEach, beforeEach, bench, describe } from 'vitest'
import { benchOptions, ticksPerIteration } from '../shared'
import { setup } from './setup'
-test('client-links', async ({ bench }) => {
- const scenario = setup()
+describe('client-links', () => {
+ const test = setup()
- await bench(
+ /**
+ * Running `vitest bench` ignores suite hooks, so Tinybench uses the `setup`
+ * and `teardown` options below. CodSpeed bypasses those options but supports
+ * `beforeEach` and `afterEach`. Only one lifecycle path runs in either
+ * environment, and every measured invocation receives fresh application state.
+ */
+
+ beforeEach(test.before)
+ afterEach(test.after)
+
+ bench(
'client-links navigation loop (react)',
- benchLifecycle(scenario),
async () => {
for (let i = 0; i < ticksPerIteration; i++) {
- await scenario.tick()
+ await test.tick()
}
- await scenario.finishBatch()
+ await test.finishBatch()
},
- ).run(benchOptions)
+ {
+ ...benchOptions,
+ setup: test.before,
+ teardown: test.after,
+ },
+ )
})
diff --git a/benchmarks/client-nav/scenarios/links/react/vite.config.ts b/benchmarks/client-nav/scenarios/links/react/vite.config.ts
index 69de10b5b7..9e9cd48895 100644
--- a/benchmarks/client-nav/scenarios/links/react/vite.config.ts
+++ b/benchmarks/client-nav/scenarios/links/react/vite.config.ts
@@ -3,7 +3,6 @@ import { defineConfig } from 'vitest/config'
import react from '@vitejs/plugin-react'
import codspeedPlugin from '@codspeed/vitest-plugin'
import { tanstackRouter } from '@tanstack/router-plugin/vite'
-import { cpuSimulationExecArgv } from '../../../../cpu-simulation'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -33,7 +32,6 @@ export default defineConfig({
},
},
test: {
- execArgv: cpuSimulationExecArgv(),
name: '@benchmarks/client-nav links (react)',
watch: false,
environment: 'jsdom',
diff --git a/benchmarks/client-nav/scenarios/links/solid/speed.bench.ts b/benchmarks/client-nav/scenarios/links/solid/speed.bench.ts
index fc7f3e71e7..a3d690b423 100644
--- a/benchmarks/client-nav/scenarios/links/solid/speed.bench.ts
+++ b/benchmarks/client-nav/scenarios/links/solid/speed.bench.ts
@@ -1,19 +1,32 @@
-import { test } from 'vitest'
-import { benchLifecycle } from '../../../../cpu-simulation'
+import { afterEach, beforeEach, bench, describe } from 'vitest'
import { benchOptions, ticksPerIteration } from '../shared'
import { setup } from './setup'
-test('client-links', async ({ bench }) => {
- const scenario = setup()
+describe('client-links', () => {
+ const test = setup()
- await bench(
+ /**
+ * Running `vitest bench` ignores suite hooks, so Tinybench uses the `setup`
+ * and `teardown` options below. CodSpeed bypasses those options but supports
+ * `beforeEach` and `afterEach`. Only one lifecycle path runs in either
+ * environment, and every measured invocation receives fresh application state.
+ */
+
+ beforeEach(test.before)
+ afterEach(test.after)
+
+ bench(
'client-links navigation loop (solid)',
- benchLifecycle(scenario),
async () => {
for (let i = 0; i < ticksPerIteration; i++) {
- await scenario.tick()
+ await test.tick()
}
- await scenario.finishBatch()
+ await test.finishBatch()
},
- ).run(benchOptions)
+ {
+ ...benchOptions,
+ setup: test.before,
+ teardown: test.after,
+ },
+ )
})
diff --git a/benchmarks/client-nav/scenarios/links/solid/src/main.tsx b/benchmarks/client-nav/scenarios/links/solid/src/main.tsx
index fa9d239418..f7148011f5 100644
--- a/benchmarks/client-nav/scenarios/links/solid/src/main.tsx
+++ b/benchmarks/client-nav/scenarios/links/solid/src/main.tsx
@@ -1,5 +1,5 @@
import type { RouterHistory } from '@tanstack/history'
-import { render } from 'solid-js/web'
+import { render } from '@solidjs/web'
import { RouterProvider, createRouter } from '@tanstack/solid-router'
import { routeTree } from './routeTree.gen'
diff --git a/benchmarks/client-nav/scenarios/links/solid/src/routeTree.gen.ts b/benchmarks/client-nav/scenarios/links/solid/src/routeTree.gen.ts
index 0da70513e8..b61431e40d 100644
--- a/benchmarks/client-nav/scenarios/links/solid/src/routeTree.gen.ts
+++ b/benchmarks/client-nav/scenarios/links/solid/src/routeTree.gen.ts
@@ -9,20 +9,20 @@
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
import { Route as rootRouteImport } from './routes/__root'
-import { Route as IndexRouteImport } from './routes/index'
import { Route as AboutRouteImport } from './routes/about'
+import { Route as IndexRouteImport } from './routes/index'
import { Route as ItemsIdRouteImport } from './routes/items.$id'
-const IndexRoute = IndexRouteImport.update({
- id: '/',
- path: '/',
- getParentRoute: () => rootRouteImport,
-} as any)
const AboutRoute = AboutRouteImport.update({
id: '/about',
path: '/about',
getParentRoute: () => rootRouteImport,
} as any)
+const IndexRoute = IndexRouteImport.update({
+ id: '/',
+ path: '/',
+ getParentRoute: () => rootRouteImport,
+} as any)
const ItemsIdRoute = ItemsIdRouteImport.update({
id: '/items/$id',
path: '/items/$id',
@@ -61,13 +61,6 @@ export interface RootRouteChildren {
declare module '@tanstack/solid-router' {
interface FileRoutesByPath {
- '/': {
- id: '/'
- path: '/'
- fullPath: '/'
- preLoaderRoute: typeof IndexRouteImport
- parentRoute: typeof rootRouteImport
- }
'/about': {
id: '/about'
path: '/about'
@@ -75,6 +68,13 @@ declare module '@tanstack/solid-router' {
preLoaderRoute: typeof AboutRouteImport
parentRoute: typeof rootRouteImport
}
+ '/': {
+ id: '/'
+ path: '/'
+ fullPath: '/'
+ preLoaderRoute: typeof IndexRouteImport
+ parentRoute: typeof rootRouteImport
+ }
'/items/$id': {
id: '/items/$id'
path: '/items/$id'
diff --git a/benchmarks/client-nav/scenarios/links/solid/tsconfig.json b/benchmarks/client-nav/scenarios/links/solid/tsconfig.json
index 98d76ad6b8..8c57ff876a 100644
--- a/benchmarks/client-nav/scenarios/links/solid/tsconfig.json
+++ b/benchmarks/client-nav/scenarios/links/solid/tsconfig.json
@@ -2,7 +2,7 @@
"extends": "../../../../../tsconfig.json",
"compilerOptions": {
"jsx": "preserve",
- "jsxImportSource": "solid-js",
+ "jsxImportSource": "@solidjs/web",
"allowImportingTsExtensions": true,
"types": ["node", "vite/client", "vitest/globals"]
},
diff --git a/benchmarks/client-nav/scenarios/links/solid/vite.config.ts b/benchmarks/client-nav/scenarios/links/solid/vite.config.ts
index e37342ffc3..7a0bb18aee 100644
--- a/benchmarks/client-nav/scenarios/links/solid/vite.config.ts
+++ b/benchmarks/client-nav/scenarios/links/solid/vite.config.ts
@@ -1,9 +1,8 @@
import { fileURLToPath } from 'node:url'
import { defineConfig } from 'vitest/config'
-import solid from 'vite-plugin-solid'
+import solid from '@solidjs/vite-plugin'
import codspeedPlugin from '@codspeed/vitest-plugin'
import { tanstackRouter } from '@tanstack/router-plugin/vite'
-import { cpuSimulationExecArgv } from '../../../../cpu-simulation'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -20,7 +19,7 @@ export default defineConfig({
routesDirectory: `${rootDir}src/routes`,
generatedRouteTree: `${rootDir}src/routeTree.gen.ts`,
}),
- solid({ hot: false, dev: false }),
+ solid({ refresh: false, dev: false }),
],
build: {
outDir: './dist',
@@ -36,7 +35,6 @@ export default defineConfig({
conditions: ['solid', 'browser'],
},
test: {
- execArgv: cpuSimulationExecArgv(),
name: '@benchmarks/client-nav links (solid)',
watch: false,
environment: 'jsdom',
diff --git a/benchmarks/client-nav/scenarios/links/vue/speed.bench.ts b/benchmarks/client-nav/scenarios/links/vue/speed.bench.ts
index 2ace7a8409..e2d3f7c47a 100644
--- a/benchmarks/client-nav/scenarios/links/vue/speed.bench.ts
+++ b/benchmarks/client-nav/scenarios/links/vue/speed.bench.ts
@@ -1,19 +1,32 @@
-import { test } from 'vitest'
-import { benchLifecycle } from '../../../../cpu-simulation'
+import { afterEach, beforeEach, bench, describe } from 'vitest'
import { benchOptions, ticksPerIteration } from '../shared'
import { setup } from './setup'
-test('client-links', async ({ bench }) => {
- const scenario = setup()
+describe('client-links', () => {
+ const test = setup()
- await bench(
+ /**
+ * Running `vitest bench` ignores suite hooks, so Tinybench uses the `setup`
+ * and `teardown` options below. CodSpeed bypasses those options but supports
+ * `beforeEach` and `afterEach`. Only one lifecycle path runs in either
+ * environment, and every measured invocation receives fresh application state.
+ */
+
+ beforeEach(test.before)
+ afterEach(test.after)
+
+ bench(
'client-links navigation loop (vue)',
- benchLifecycle(scenario),
async () => {
for (let i = 0; i < ticksPerIteration; i++) {
- await scenario.tick()
+ await test.tick()
}
- await scenario.finishBatch()
+ await test.finishBatch()
},
- ).run(benchOptions)
+ {
+ ...benchOptions,
+ setup: test.before,
+ teardown: test.after,
+ },
+ )
})
diff --git a/benchmarks/client-nav/scenarios/links/vue/src/routeTree.gen.ts b/benchmarks/client-nav/scenarios/links/vue/src/routeTree.gen.ts
index 7d2b1e9bbb..cee64be43c 100644
--- a/benchmarks/client-nav/scenarios/links/vue/src/routeTree.gen.ts
+++ b/benchmarks/client-nav/scenarios/links/vue/src/routeTree.gen.ts
@@ -9,20 +9,20 @@
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
import { Route as rootRouteImport } from './routes/__root'
-import { Route as IndexRouteImport } from './routes/index'
import { Route as AboutRouteImport } from './routes/about'
+import { Route as IndexRouteImport } from './routes/index'
import { Route as ItemsIdRouteImport } from './routes/items.$id'
-const IndexRoute = IndexRouteImport.update({
- id: '/',
- path: '/',
- getParentRoute: () => rootRouteImport,
-} as any)
const AboutRoute = AboutRouteImport.update({
id: '/about',
path: '/about',
getParentRoute: () => rootRouteImport,
} as any)
+const IndexRoute = IndexRouteImport.update({
+ id: '/',
+ path: '/',
+ getParentRoute: () => rootRouteImport,
+} as any)
const ItemsIdRoute = ItemsIdRouteImport.update({
id: '/items/$id',
path: '/items/$id',
@@ -61,13 +61,6 @@ export interface RootRouteChildren {
declare module '@tanstack/vue-router' {
interface FileRoutesByPath {
- '/': {
- id: '/'
- path: '/'
- fullPath: '/'
- preLoaderRoute: typeof IndexRouteImport
- parentRoute: typeof rootRouteImport
- }
'/about': {
id: '/about'
path: '/about'
@@ -75,6 +68,13 @@ declare module '@tanstack/vue-router' {
preLoaderRoute: typeof AboutRouteImport
parentRoute: typeof rootRouteImport
}
+ '/': {
+ id: '/'
+ path: '/'
+ fullPath: '/'
+ preLoaderRoute: typeof IndexRouteImport
+ parentRoute: typeof rootRouteImport
+ }
'/items/$id': {
id: '/items/$id'
path: '/items/$id'
diff --git a/benchmarks/client-nav/scenarios/links/vue/vite.config.ts b/benchmarks/client-nav/scenarios/links/vue/vite.config.ts
index ad89a49d70..d1cf9f561d 100644
--- a/benchmarks/client-nav/scenarios/links/vue/vite.config.ts
+++ b/benchmarks/client-nav/scenarios/links/vue/vite.config.ts
@@ -4,7 +4,6 @@ import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import codspeedPlugin from '@codspeed/vitest-plugin'
import { tanstackRouter } from '@tanstack/router-plugin/vite'
-import { cpuSimulationExecArgv } from '../../../../cpu-simulation'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -35,7 +34,6 @@ export default defineConfig({
},
},
test: {
- execArgv: cpuSimulationExecArgv(),
name: '@benchmarks/client-nav links (vue)',
watch: false,
environment: 'jsdom',
diff --git a/benchmarks/client-nav/scenarios/loaders/react/speed.bench.ts b/benchmarks/client-nav/scenarios/loaders/react/speed.bench.ts
index 8bcc53b88e..f5a51b29be 100644
--- a/benchmarks/client-nav/scenarios/loaders/react/speed.bench.ts
+++ b/benchmarks/client-nav/scenarios/loaders/react/speed.bench.ts
@@ -1,19 +1,32 @@
-import { test } from 'vitest'
-import { benchLifecycle } from '../../../../cpu-simulation'
+import { afterEach, beforeEach, bench, describe } from 'vitest'
import { benchOptions, ticksPerIteration } from '../shared'
import { setup } from './setup'
-test('client-loaders', async ({ bench }) => {
- const scenario = setup()
+describe('client-loaders', () => {
+ const test = setup()
- await bench(
+ /**
+ * Running `vitest bench` ignores suite hooks, so Tinybench uses the `setup`
+ * and `teardown` options below. CodSpeed bypasses those options but supports
+ * `beforeEach` and `afterEach`. Only one lifecycle path runs in either
+ * environment, and every measured invocation receives fresh application state.
+ */
+
+ beforeEach(test.before)
+ afterEach(test.after)
+
+ bench(
'client-loaders navigation loop (react)',
- benchLifecycle(scenario),
async () => {
for (let i = 0; i < ticksPerIteration; i++) {
- await scenario.tick()
+ await test.tick()
}
- await scenario.finishBatch()
+ await test.finishBatch()
},
- ).run(benchOptions)
+ {
+ ...benchOptions,
+ setup: test.before,
+ teardown: test.after,
+ },
+ )
})
diff --git a/benchmarks/client-nav/scenarios/loaders/react/vite.config.ts b/benchmarks/client-nav/scenarios/loaders/react/vite.config.ts
index 818b224130..6fa28bcd35 100644
--- a/benchmarks/client-nav/scenarios/loaders/react/vite.config.ts
+++ b/benchmarks/client-nav/scenarios/loaders/react/vite.config.ts
@@ -3,7 +3,6 @@ import { defineConfig } from 'vitest/config'
import react from '@vitejs/plugin-react'
import codspeedPlugin from '@codspeed/vitest-plugin'
import { tanstackRouter } from '@tanstack/router-plugin/vite'
-import { cpuSimulationExecArgv } from '../../../../cpu-simulation'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -33,7 +32,6 @@ export default defineConfig({
},
},
test: {
- execArgv: cpuSimulationExecArgv(),
name: '@benchmarks/client-nav loaders (react)',
watch: false,
environment: 'jsdom',
diff --git a/benchmarks/client-nav/scenarios/loaders/solid/speed.bench.ts b/benchmarks/client-nav/scenarios/loaders/solid/speed.bench.ts
index 953a17b31a..9f3bd397db 100644
--- a/benchmarks/client-nav/scenarios/loaders/solid/speed.bench.ts
+++ b/benchmarks/client-nav/scenarios/loaders/solid/speed.bench.ts
@@ -1,19 +1,32 @@
-import { test } from 'vitest'
-import { benchLifecycle } from '../../../../cpu-simulation'
+import { afterEach, beforeEach, bench, describe } from 'vitest'
import { benchOptions, ticksPerIteration } from '../shared'
import { setup } from './setup'
-test('client-loaders', async ({ bench }) => {
- const scenario = setup()
+describe('client-loaders', () => {
+ const test = setup()
- await bench(
+ /**
+ * Running `vitest bench` ignores suite hooks, so Tinybench uses the `setup`
+ * and `teardown` options below. CodSpeed bypasses those options but supports
+ * `beforeEach` and `afterEach`. Only one lifecycle path runs in either
+ * environment, and every measured invocation receives fresh application state.
+ */
+
+ beforeEach(test.before)
+ afterEach(test.after)
+
+ bench(
'client-loaders navigation loop (solid)',
- benchLifecycle(scenario),
async () => {
for (let i = 0; i < ticksPerIteration; i++) {
- await scenario.tick()
+ await test.tick()
}
- await scenario.finishBatch()
+ await test.finishBatch()
},
- ).run(benchOptions)
+ {
+ ...benchOptions,
+ setup: test.before,
+ teardown: test.after,
+ },
+ )
})
diff --git a/benchmarks/client-nav/scenarios/loaders/solid/src/main.tsx b/benchmarks/client-nav/scenarios/loaders/solid/src/main.tsx
index fa9d239418..f7148011f5 100644
--- a/benchmarks/client-nav/scenarios/loaders/solid/src/main.tsx
+++ b/benchmarks/client-nav/scenarios/loaders/solid/src/main.tsx
@@ -1,5 +1,5 @@
import type { RouterHistory } from '@tanstack/history'
-import { render } from 'solid-js/web'
+import { render } from '@solidjs/web'
import { RouterProvider, createRouter } from '@tanstack/solid-router'
import { routeTree } from './routeTree.gen'
diff --git a/benchmarks/client-nav/scenarios/loaders/solid/src/routeTree.gen.ts b/benchmarks/client-nav/scenarios/loaders/solid/src/routeTree.gen.ts
index fa5d032141..bdec400237 100644
--- a/benchmarks/client-nav/scenarios/loaders/solid/src/routeTree.gen.ts
+++ b/benchmarks/client-nav/scenarios/loaders/solid/src/routeTree.gen.ts
@@ -9,24 +9,19 @@
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
import { Route as rootRouteImport } from './routes/__root'
-import { Route as IndexRouteImport } from './routes/index'
import { Route as DepsRouteImport } from './routes/deps'
-import { Route as CachedIdRouteImport } from './routes/cached.$id'
+import { Route as IndexRouteImport } from './routes/index'
import { Route as FreshIdRouteImport } from './routes/fresh.$id'
+import { Route as CachedIdRouteImport } from './routes/cached.$id'
-const IndexRoute = IndexRouteImport.update({
- id: '/',
- path: '/',
- getParentRoute: () => rootRouteImport,
-} as any)
const DepsRoute = DepsRouteImport.update({
id: '/deps',
path: '/deps',
getParentRoute: () => rootRouteImport,
} as any)
-const CachedIdRoute = CachedIdRouteImport.update({
- id: '/cached/$id',
- path: '/cached/$id',
+const IndexRoute = IndexRouteImport.update({
+ id: '/',
+ path: '/',
getParentRoute: () => rootRouteImport,
} as any)
const FreshIdRoute = FreshIdRouteImport.update({
@@ -34,6 +29,11 @@ const FreshIdRoute = FreshIdRouteImport.update({
path: '/fresh/$id',
getParentRoute: () => rootRouteImport,
} as any)
+const CachedIdRoute = CachedIdRouteImport.update({
+ id: '/cached/$id',
+ path: '/cached/$id',
+ getParentRoute: () => rootRouteImport,
+} as any)
export interface FileRoutesByFullPath {
'/': typeof IndexRoute
@@ -71,13 +71,6 @@ export interface RootRouteChildren {
declare module '@tanstack/solid-router' {
interface FileRoutesByPath {
- '/': {
- id: '/'
- path: '/'
- fullPath: '/'
- preLoaderRoute: typeof IndexRouteImport
- parentRoute: typeof rootRouteImport
- }
'/deps': {
id: '/deps'
path: '/deps'
@@ -85,11 +78,11 @@ declare module '@tanstack/solid-router' {
preLoaderRoute: typeof DepsRouteImport
parentRoute: typeof rootRouteImport
}
- '/cached/$id': {
- id: '/cached/$id'
- path: '/cached/$id'
- fullPath: '/cached/$id'
- preLoaderRoute: typeof CachedIdRouteImport
+ '/': {
+ id: '/'
+ path: '/'
+ fullPath: '/'
+ preLoaderRoute: typeof IndexRouteImport
parentRoute: typeof rootRouteImport
}
'/fresh/$id': {
@@ -99,6 +92,13 @@ declare module '@tanstack/solid-router' {
preLoaderRoute: typeof FreshIdRouteImport
parentRoute: typeof rootRouteImport
}
+ '/cached/$id': {
+ id: '/cached/$id'
+ path: '/cached/$id'
+ fullPath: '/cached/$id'
+ preLoaderRoute: typeof CachedIdRouteImport
+ parentRoute: typeof rootRouteImport
+ }
}
}
diff --git a/benchmarks/client-nav/scenarios/loaders/solid/src/routes/cached.$id.tsx b/benchmarks/client-nav/scenarios/loaders/solid/src/routes/cached.$id.tsx
index aab6be74dc..4838141b22 100644
--- a/benchmarks/client-nav/scenarios/loaders/solid/src/routes/cached.$id.tsx
+++ b/benchmarks/client-nav/scenarios/loaders/solid/src/routes/cached.$id.tsx
@@ -15,9 +15,12 @@ export const Route = createFileRoute('/cached/$id')({
const subscriberIndexes = Array.from({ length: 2 }, (_, index) => index)
function PerfValue(props: { value: () => number }) {
- createRenderEffect(() => {
- void props.value()
- })
+ createRenderEffect(
+ () => {
+ void props.value()
+ },
+ () => {},
+ )
return null
}
diff --git a/benchmarks/client-nav/scenarios/loaders/solid/src/routes/deps.tsx b/benchmarks/client-nav/scenarios/loaders/solid/src/routes/deps.tsx
index 2f23f2d3da..258c7bc23b 100644
--- a/benchmarks/client-nav/scenarios/loaders/solid/src/routes/deps.tsx
+++ b/benchmarks/client-nav/scenarios/loaders/solid/src/routes/deps.tsx
@@ -25,9 +25,12 @@ export const Route = createFileRoute('/deps')({
const subscriberIndexes = Array.from({ length: 2 }, (_, index) => index)
function PerfValue(props: { value: () => number }) {
- createRenderEffect(() => {
- void props.value()
- })
+ createRenderEffect(
+ () => {
+ void props.value()
+ },
+ () => {},
+ )
return null
}
diff --git a/benchmarks/client-nav/scenarios/loaders/solid/src/routes/fresh.$id.tsx b/benchmarks/client-nav/scenarios/loaders/solid/src/routes/fresh.$id.tsx
index acd6a9aa27..29bc35a650 100644
--- a/benchmarks/client-nav/scenarios/loaders/solid/src/routes/fresh.$id.tsx
+++ b/benchmarks/client-nav/scenarios/loaders/solid/src/routes/fresh.$id.tsx
@@ -15,9 +15,12 @@ export const Route = createFileRoute('/fresh/$id')({
const subscriberIndexes = Array.from({ length: 2 }, (_, index) => index)
function PerfValue(props: { value: () => number }) {
- createRenderEffect(() => {
- void props.value()
- })
+ createRenderEffect(
+ () => {
+ void props.value()
+ },
+ () => {},
+ )
return null
}
diff --git a/benchmarks/client-nav/scenarios/loaders/solid/tsconfig.json b/benchmarks/client-nav/scenarios/loaders/solid/tsconfig.json
index 98d76ad6b8..8c57ff876a 100644
--- a/benchmarks/client-nav/scenarios/loaders/solid/tsconfig.json
+++ b/benchmarks/client-nav/scenarios/loaders/solid/tsconfig.json
@@ -2,7 +2,7 @@
"extends": "../../../../../tsconfig.json",
"compilerOptions": {
"jsx": "preserve",
- "jsxImportSource": "solid-js",
+ "jsxImportSource": "@solidjs/web",
"allowImportingTsExtensions": true,
"types": ["node", "vite/client", "vitest/globals"]
},
diff --git a/benchmarks/client-nav/scenarios/loaders/solid/vite.config.ts b/benchmarks/client-nav/scenarios/loaders/solid/vite.config.ts
index 90584d3b7e..723e95e181 100644
--- a/benchmarks/client-nav/scenarios/loaders/solid/vite.config.ts
+++ b/benchmarks/client-nav/scenarios/loaders/solid/vite.config.ts
@@ -1,9 +1,8 @@
import { fileURLToPath } from 'node:url'
import { defineConfig } from 'vitest/config'
-import solid from 'vite-plugin-solid'
+import solid from '@solidjs/vite-plugin'
import codspeedPlugin from '@codspeed/vitest-plugin'
import { tanstackRouter } from '@tanstack/router-plugin/vite'
-import { cpuSimulationExecArgv } from '../../../../cpu-simulation'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -20,7 +19,7 @@ export default defineConfig({
routesDirectory: `${rootDir}src/routes`,
generatedRouteTree: `${rootDir}src/routeTree.gen.ts`,
}),
- solid({ hot: false, dev: false }),
+ solid({ refresh: false, dev: false }),
],
build: {
outDir: './dist',
@@ -36,7 +35,6 @@ export default defineConfig({
conditions: ['solid', 'browser'],
},
test: {
- execArgv: cpuSimulationExecArgv(),
name: '@benchmarks/client-nav loaders (solid)',
watch: false,
environment: 'jsdom',
diff --git a/benchmarks/client-nav/scenarios/loaders/vue/speed.bench.ts b/benchmarks/client-nav/scenarios/loaders/vue/speed.bench.ts
index 1ae2f89a56..819fe020b0 100644
--- a/benchmarks/client-nav/scenarios/loaders/vue/speed.bench.ts
+++ b/benchmarks/client-nav/scenarios/loaders/vue/speed.bench.ts
@@ -1,19 +1,32 @@
-import { test } from 'vitest'
-import { benchLifecycle } from '../../../../cpu-simulation'
+import { afterEach, beforeEach, bench, describe } from 'vitest'
import { benchOptions, ticksPerIteration } from '../shared'
import { setup } from './setup'
-test('client-loaders', async ({ bench }) => {
- const scenario = setup()
+describe('client-loaders', () => {
+ const test = setup()
- await bench(
+ /**
+ * Running `vitest bench` ignores suite hooks, so Tinybench uses the `setup`
+ * and `teardown` options below. CodSpeed bypasses those options but supports
+ * `beforeEach` and `afterEach`. Only one lifecycle path runs in either
+ * environment, and every measured invocation receives fresh application state.
+ */
+
+ beforeEach(test.before)
+ afterEach(test.after)
+
+ bench(
'client-loaders navigation loop (vue)',
- benchLifecycle(scenario),
async () => {
for (let i = 0; i < ticksPerIteration; i++) {
- await scenario.tick()
+ await test.tick()
}
- await scenario.finishBatch()
+ await test.finishBatch()
},
- ).run(benchOptions)
+ {
+ ...benchOptions,
+ setup: test.before,
+ teardown: test.after,
+ },
+ )
})
diff --git a/benchmarks/client-nav/scenarios/loaders/vue/src/routeTree.gen.ts b/benchmarks/client-nav/scenarios/loaders/vue/src/routeTree.gen.ts
index 10cb8f2aca..25a82df477 100644
--- a/benchmarks/client-nav/scenarios/loaders/vue/src/routeTree.gen.ts
+++ b/benchmarks/client-nav/scenarios/loaders/vue/src/routeTree.gen.ts
@@ -9,24 +9,19 @@
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
import { Route as rootRouteImport } from './routes/__root'
-import { Route as IndexRouteImport } from './routes/index'
import { Route as DepsRouteImport } from './routes/deps'
-import { Route as CachedIdRouteImport } from './routes/cached.$id'
+import { Route as IndexRouteImport } from './routes/index'
import { Route as FreshIdRouteImport } from './routes/fresh.$id'
+import { Route as CachedIdRouteImport } from './routes/cached.$id'
-const IndexRoute = IndexRouteImport.update({
- id: '/',
- path: '/',
- getParentRoute: () => rootRouteImport,
-} as any)
const DepsRoute = DepsRouteImport.update({
id: '/deps',
path: '/deps',
getParentRoute: () => rootRouteImport,
} as any)
-const CachedIdRoute = CachedIdRouteImport.update({
- id: '/cached/$id',
- path: '/cached/$id',
+const IndexRoute = IndexRouteImport.update({
+ id: '/',
+ path: '/',
getParentRoute: () => rootRouteImport,
} as any)
const FreshIdRoute = FreshIdRouteImport.update({
@@ -34,6 +29,11 @@ const FreshIdRoute = FreshIdRouteImport.update({
path: '/fresh/$id',
getParentRoute: () => rootRouteImport,
} as any)
+const CachedIdRoute = CachedIdRouteImport.update({
+ id: '/cached/$id',
+ path: '/cached/$id',
+ getParentRoute: () => rootRouteImport,
+} as any)
export interface FileRoutesByFullPath {
'/': typeof IndexRoute
@@ -71,13 +71,6 @@ export interface RootRouteChildren {
declare module '@tanstack/vue-router' {
interface FileRoutesByPath {
- '/': {
- id: '/'
- path: '/'
- fullPath: '/'
- preLoaderRoute: typeof IndexRouteImport
- parentRoute: typeof rootRouteImport
- }
'/deps': {
id: '/deps'
path: '/deps'
@@ -85,11 +78,11 @@ declare module '@tanstack/vue-router' {
preLoaderRoute: typeof DepsRouteImport
parentRoute: typeof rootRouteImport
}
- '/cached/$id': {
- id: '/cached/$id'
- path: '/cached/$id'
- fullPath: '/cached/$id'
- preLoaderRoute: typeof CachedIdRouteImport
+ '/': {
+ id: '/'
+ path: '/'
+ fullPath: '/'
+ preLoaderRoute: typeof IndexRouteImport
parentRoute: typeof rootRouteImport
}
'/fresh/$id': {
@@ -99,6 +92,13 @@ declare module '@tanstack/vue-router' {
preLoaderRoute: typeof FreshIdRouteImport
parentRoute: typeof rootRouteImport
}
+ '/cached/$id': {
+ id: '/cached/$id'
+ path: '/cached/$id'
+ fullPath: '/cached/$id'
+ preLoaderRoute: typeof CachedIdRouteImport
+ parentRoute: typeof rootRouteImport
+ }
}
}
diff --git a/benchmarks/client-nav/scenarios/loaders/vue/vite.config.ts b/benchmarks/client-nav/scenarios/loaders/vue/vite.config.ts
index ecf4cce139..350fadf387 100644
--- a/benchmarks/client-nav/scenarios/loaders/vue/vite.config.ts
+++ b/benchmarks/client-nav/scenarios/loaders/vue/vite.config.ts
@@ -4,7 +4,6 @@ import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import codspeedPlugin from '@codspeed/vitest-plugin'
import { tanstackRouter } from '@tanstack/router-plugin/vite'
-import { cpuSimulationExecArgv } from '../../../../cpu-simulation'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -35,7 +34,6 @@ export default defineConfig({
},
},
test: {
- execArgv: cpuSimulationExecArgv(),
name: '@benchmarks/client-nav loaders (vue)',
watch: false,
environment: 'jsdom',
diff --git a/benchmarks/client-nav/scenarios/mount/react/speed.bench.ts b/benchmarks/client-nav/scenarios/mount/react/speed.bench.ts
index 6c3a64b026..2d675ff259 100644
--- a/benchmarks/client-nav/scenarios/mount/react/speed.bench.ts
+++ b/benchmarks/client-nav/scenarios/mount/react/speed.bench.ts
@@ -1,19 +1,32 @@
-import { test } from 'vitest'
-import { benchLifecycle } from '../../../../cpu-simulation'
+import { afterEach, beforeEach, bench, describe } from 'vitest'
import { benchOptions, ticksPerIteration } from '../shared'
import { setup } from './setup'
-test('client-mount', async ({ bench }) => {
- const scenario = setup()
+describe('client-mount', () => {
+ const test = setup()
- await bench(
+ /**
+ * Running `vitest bench` ignores suite hooks, so Tinybench uses the `setup`
+ * and `teardown` options below. CodSpeed bypasses those options but supports
+ * `beforeEach` and `afterEach`. Only one lifecycle path runs in either
+ * environment, and every measured invocation receives fresh application state.
+ */
+
+ beforeEach(test.before)
+ afterEach(test.after)
+
+ bench(
'client-mount loop (react)',
- benchLifecycle(scenario),
async () => {
for (let i = 0; i < ticksPerIteration; i++) {
- await scenario.tick()
+ await test.tick()
}
- await scenario.finishBatch()
+ await test.finishBatch()
},
- ).run(benchOptions)
+ {
+ ...benchOptions,
+ setup: test.before,
+ teardown: test.after,
+ },
+ )
})
diff --git a/benchmarks/client-nav/scenarios/mount/react/vite.config.ts b/benchmarks/client-nav/scenarios/mount/react/vite.config.ts
index e197d33a9e..68ee46738a 100644
--- a/benchmarks/client-nav/scenarios/mount/react/vite.config.ts
+++ b/benchmarks/client-nav/scenarios/mount/react/vite.config.ts
@@ -3,7 +3,6 @@ import { defineConfig } from 'vitest/config'
import react from '@vitejs/plugin-react'
import codspeedPlugin from '@codspeed/vitest-plugin'
import { tanstackRouter } from '@tanstack/router-plugin/vite'
-import { cpuSimulationExecArgv } from '../../../../cpu-simulation'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -33,7 +32,6 @@ export default defineConfig({
},
},
test: {
- execArgv: cpuSimulationExecArgv(),
name: '@benchmarks/client-nav mount (react)',
watch: false,
environment: 'jsdom',
diff --git a/benchmarks/client-nav/scenarios/mount/solid/speed.bench.ts b/benchmarks/client-nav/scenarios/mount/solid/speed.bench.ts
index 236f875f57..eaf7f1ed34 100644
--- a/benchmarks/client-nav/scenarios/mount/solid/speed.bench.ts
+++ b/benchmarks/client-nav/scenarios/mount/solid/speed.bench.ts
@@ -1,19 +1,32 @@
-import { test } from 'vitest'
-import { benchLifecycle } from '../../../../cpu-simulation'
+import { afterEach, beforeEach, bench, describe } from 'vitest'
import { benchOptions, ticksPerIteration } from '../shared'
import { setup } from './setup'
-test('client-mount', async ({ bench }) => {
- const scenario = setup()
+describe('client-mount', () => {
+ const test = setup()
- await bench(
+ /**
+ * Running `vitest bench` ignores suite hooks, so Tinybench uses the `setup`
+ * and `teardown` options below. CodSpeed bypasses those options but supports
+ * `beforeEach` and `afterEach`. Only one lifecycle path runs in either
+ * environment, and every measured invocation receives fresh application state.
+ */
+
+ beforeEach(test.before)
+ afterEach(test.after)
+
+ bench(
'client-mount loop (solid)',
- benchLifecycle(scenario),
async () => {
for (let i = 0; i < ticksPerIteration; i++) {
- await scenario.tick()
+ await test.tick()
}
- await scenario.finishBatch()
+ await test.finishBatch()
},
- ).run(benchOptions)
+ {
+ ...benchOptions,
+ setup: test.before,
+ teardown: test.after,
+ },
+ )
})
diff --git a/benchmarks/client-nav/scenarios/mount/solid/src/main.tsx b/benchmarks/client-nav/scenarios/mount/solid/src/main.tsx
index 2586872f5c..bd29324154 100644
--- a/benchmarks/client-nav/scenarios/mount/solid/src/main.tsx
+++ b/benchmarks/client-nav/scenarios/mount/solid/src/main.tsx
@@ -1,4 +1,4 @@
-import { render } from 'solid-js/web'
+import { render } from '@solidjs/web'
import { RouterProvider, createRouter } from '@tanstack/solid-router'
import { routeTree } from './routeTree.gen'
import type { RouterHistory } from '@tanstack/history'
diff --git a/benchmarks/client-nav/scenarios/mount/solid/src/routeTree.gen.ts b/benchmarks/client-nav/scenarios/mount/solid/src/routeTree.gen.ts
index 30247636dd..dc0acc183d 100644
--- a/benchmarks/client-nav/scenarios/mount/solid/src/routeTree.gen.ts
+++ b/benchmarks/client-nav/scenarios/mount/solid/src/routeTree.gen.ts
@@ -9,35 +9,20 @@
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
import { Route as rootRouteImport } from './routes/__root'
-import { Route as IndexRouteImport } from './routes/index'
-import { Route as AboutRouteImport } from './routes/about'
-import { Route as BlogRouteImport } from './routes/blog'
-import { Route as SearchRouteImport } from './routes/search'
-import { Route as SettingsRouteImport } from './routes/settings'
import { Route as ShopRouteImport } from './routes/shop'
-import { Route as BlogIndexRouteImport } from './routes/blog.index'
-import { Route as BlogSlugRouteImport } from './routes/blog.$slug'
+import { Route as SettingsRouteImport } from './routes/settings'
+import { Route as SearchRouteImport } from './routes/search'
+import { Route as BlogRouteImport } from './routes/blog'
+import { Route as AboutRouteImport } from './routes/about'
+import { Route as IndexRouteImport } from './routes/index'
import { Route as ShopIndexRouteImport } from './routes/shop.index'
+import { Route as BlogIndexRouteImport } from './routes/blog.index'
import { Route as ShopProductIdRouteImport } from './routes/shop.$productId'
+import { Route as BlogSlugRouteImport } from './routes/blog.$slug'
-const IndexRoute = IndexRouteImport.update({
- id: '/',
- path: '/',
- getParentRoute: () => rootRouteImport,
-} as any)
-const AboutRoute = AboutRouteImport.update({
- id: '/about',
- path: '/about',
- getParentRoute: () => rootRouteImport,
-} as any)
-const BlogRoute = BlogRouteImport.update({
- id: '/blog',
- path: '/blog',
- getParentRoute: () => rootRouteImport,
-} as any)
-const SearchRoute = SearchRouteImport.update({
- id: '/search',
- path: '/search',
+const ShopRoute = ShopRouteImport.update({
+ id: '/shop',
+ path: '/shop',
getParentRoute: () => rootRouteImport,
} as any)
const SettingsRoute = SettingsRouteImport.update({
@@ -45,31 +30,46 @@ const SettingsRoute = SettingsRouteImport.update({
path: '/settings',
getParentRoute: () => rootRouteImport,
} as any)
-const ShopRoute = ShopRouteImport.update({
- id: '/shop',
- path: '/shop',
+const SearchRoute = SearchRouteImport.update({
+ id: '/search',
+ path: '/search',
getParentRoute: () => rootRouteImport,
} as any)
-const BlogIndexRoute = BlogIndexRouteImport.update({
+const BlogRoute = BlogRouteImport.update({
+ id: '/blog',
+ path: '/blog',
+ getParentRoute: () => rootRouteImport,
+} as any)
+const AboutRoute = AboutRouteImport.update({
+ id: '/about',
+ path: '/about',
+ getParentRoute: () => rootRouteImport,
+} as any)
+const IndexRoute = IndexRouteImport.update({
id: '/',
path: '/',
- getParentRoute: () => BlogRoute,
-} as any)
-const BlogSlugRoute = BlogSlugRouteImport.update({
- id: '/$slug',
- path: '/$slug',
- getParentRoute: () => BlogRoute,
+ getParentRoute: () => rootRouteImport,
} as any)
const ShopIndexRoute = ShopIndexRouteImport.update({
id: '/',
path: '/',
getParentRoute: () => ShopRoute,
} as any)
+const BlogIndexRoute = BlogIndexRouteImport.update({
+ id: '/',
+ path: '/',
+ getParentRoute: () => BlogRoute,
+} as any)
const ShopProductIdRoute = ShopProductIdRouteImport.update({
id: '/$productId',
path: '/$productId',
getParentRoute: () => ShopRoute,
} as any)
+const BlogSlugRoute = BlogSlugRouteImport.update({
+ id: '/$slug',
+ path: '/$slug',
+ getParentRoute: () => BlogRoute,
+} as any)
export interface FileRoutesByFullPath {
'/': typeof IndexRoute
@@ -154,32 +154,11 @@ export interface RootRouteChildren {
declare module '@tanstack/solid-router' {
interface FileRoutesByPath {
- '/': {
- id: '/'
- path: '/'
- fullPath: '/'
- preLoaderRoute: typeof IndexRouteImport
- parentRoute: typeof rootRouteImport
- }
- '/about': {
- id: '/about'
- path: '/about'
- fullPath: '/about'
- preLoaderRoute: typeof AboutRouteImport
- parentRoute: typeof rootRouteImport
- }
- '/blog': {
- id: '/blog'
- path: '/blog'
- fullPath: '/blog'
- preLoaderRoute: typeof BlogRouteImport
- parentRoute: typeof rootRouteImport
- }
- '/search': {
- id: '/search'
- path: '/search'
- fullPath: '/search'
- preLoaderRoute: typeof SearchRouteImport
+ '/shop': {
+ id: '/shop'
+ path: '/shop'
+ fullPath: '/shop'
+ preLoaderRoute: typeof ShopRouteImport
parentRoute: typeof rootRouteImport
}
'/settings': {
@@ -189,26 +168,33 @@ declare module '@tanstack/solid-router' {
preLoaderRoute: typeof SettingsRouteImport
parentRoute: typeof rootRouteImport
}
- '/shop': {
- id: '/shop'
- path: '/shop'
- fullPath: '/shop'
- preLoaderRoute: typeof ShopRouteImport
+ '/search': {
+ id: '/search'
+ path: '/search'
+ fullPath: '/search'
+ preLoaderRoute: typeof SearchRouteImport
parentRoute: typeof rootRouteImport
}
- '/blog/': {
- id: '/blog/'
- path: '/'
- fullPath: '/blog/'
- preLoaderRoute: typeof BlogIndexRouteImport
- parentRoute: typeof BlogRoute
+ '/blog': {
+ id: '/blog'
+ path: '/blog'
+ fullPath: '/blog'
+ preLoaderRoute: typeof BlogRouteImport
+ parentRoute: typeof rootRouteImport
}
- '/blog/$slug': {
- id: '/blog/$slug'
- path: '/$slug'
- fullPath: '/blog/$slug'
- preLoaderRoute: typeof BlogSlugRouteImport
- parentRoute: typeof BlogRoute
+ '/about': {
+ id: '/about'
+ path: '/about'
+ fullPath: '/about'
+ preLoaderRoute: typeof AboutRouteImport
+ parentRoute: typeof rootRouteImport
+ }
+ '/': {
+ id: '/'
+ path: '/'
+ fullPath: '/'
+ preLoaderRoute: typeof IndexRouteImport
+ parentRoute: typeof rootRouteImport
}
'/shop/': {
id: '/shop/'
@@ -217,6 +203,13 @@ declare module '@tanstack/solid-router' {
preLoaderRoute: typeof ShopIndexRouteImport
parentRoute: typeof ShopRoute
}
+ '/blog/': {
+ id: '/blog/'
+ path: '/'
+ fullPath: '/blog/'
+ preLoaderRoute: typeof BlogIndexRouteImport
+ parentRoute: typeof BlogRoute
+ }
'/shop/$productId': {
id: '/shop/$productId'
path: '/$productId'
@@ -224,6 +217,13 @@ declare module '@tanstack/solid-router' {
preLoaderRoute: typeof ShopProductIdRouteImport
parentRoute: typeof ShopRoute
}
+ '/blog/$slug': {
+ id: '/blog/$slug'
+ path: '/$slug'
+ fullPath: '/blog/$slug'
+ preLoaderRoute: typeof BlogSlugRouteImport
+ parentRoute: typeof BlogRoute
+ }
}
}
diff --git a/benchmarks/client-nav/scenarios/mount/solid/tsconfig.json b/benchmarks/client-nav/scenarios/mount/solid/tsconfig.json
index 98d76ad6b8..8c57ff876a 100644
--- a/benchmarks/client-nav/scenarios/mount/solid/tsconfig.json
+++ b/benchmarks/client-nav/scenarios/mount/solid/tsconfig.json
@@ -2,7 +2,7 @@
"extends": "../../../../../tsconfig.json",
"compilerOptions": {
"jsx": "preserve",
- "jsxImportSource": "solid-js",
+ "jsxImportSource": "@solidjs/web",
"allowImportingTsExtensions": true,
"types": ["node", "vite/client", "vitest/globals"]
},
diff --git a/benchmarks/client-nav/scenarios/mount/solid/vite.config.ts b/benchmarks/client-nav/scenarios/mount/solid/vite.config.ts
index 5b586dd128..0669a8052d 100644
--- a/benchmarks/client-nav/scenarios/mount/solid/vite.config.ts
+++ b/benchmarks/client-nav/scenarios/mount/solid/vite.config.ts
@@ -1,9 +1,8 @@
import { fileURLToPath } from 'node:url'
import { defineConfig } from 'vitest/config'
-import solid from 'vite-plugin-solid'
+import solid from '@solidjs/vite-plugin'
import codspeedPlugin from '@codspeed/vitest-plugin'
import { tanstackRouter } from '@tanstack/router-plugin/vite'
-import { cpuSimulationExecArgv } from '../../../../cpu-simulation'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -20,7 +19,7 @@ export default defineConfig({
routesDirectory: `${rootDir}src/routes`,
generatedRouteTree: `${rootDir}src/routeTree.gen.ts`,
}),
- solid({ hot: false, dev: false }),
+ solid({ refresh: false, dev: false }),
],
build: {
outDir: './dist',
@@ -36,7 +35,6 @@ export default defineConfig({
conditions: ['solid', 'browser'],
},
test: {
- execArgv: cpuSimulationExecArgv(),
name: '@benchmarks/client-nav mount (solid)',
watch: false,
environment: 'jsdom',
diff --git a/benchmarks/client-nav/scenarios/mount/vue/speed.bench.ts b/benchmarks/client-nav/scenarios/mount/vue/speed.bench.ts
index d9268ba91b..f5538dd49c 100644
--- a/benchmarks/client-nav/scenarios/mount/vue/speed.bench.ts
+++ b/benchmarks/client-nav/scenarios/mount/vue/speed.bench.ts
@@ -1,15 +1,32 @@
-import { test } from 'vitest'
-import { benchLifecycle } from '../../../../cpu-simulation'
+import { afterEach, beforeEach, bench, describe } from 'vitest'
import { benchOptions, ticksPerIteration } from '../shared'
import { setup } from './setup'
-test('client-mount', async ({ bench }) => {
- const scenario = setup()
+describe('client-mount', () => {
+ const test = setup()
- await bench('client-mount loop (vue)', benchLifecycle(scenario), async () => {
- for (let i = 0; i < ticksPerIteration; i++) {
- await scenario.tick()
- }
- await scenario.finishBatch()
- }).run(benchOptions)
+ /**
+ * Running `vitest bench` ignores suite hooks, so Tinybench uses the `setup`
+ * and `teardown` options below. CodSpeed bypasses those options but supports
+ * `beforeEach` and `afterEach`. Only one lifecycle path runs in either
+ * environment, and every measured invocation receives fresh application state.
+ */
+
+ beforeEach(test.before)
+ afterEach(test.after)
+
+ bench(
+ 'client-mount loop (vue)',
+ async () => {
+ for (let i = 0; i < ticksPerIteration; i++) {
+ await test.tick()
+ }
+ await test.finishBatch()
+ },
+ {
+ ...benchOptions,
+ setup: test.before,
+ teardown: test.after,
+ },
+ )
})
diff --git a/benchmarks/client-nav/scenarios/mount/vue/src/routeTree.gen.ts b/benchmarks/client-nav/scenarios/mount/vue/src/routeTree.gen.ts
index cd27c917e1..98643d63c9 100644
--- a/benchmarks/client-nav/scenarios/mount/vue/src/routeTree.gen.ts
+++ b/benchmarks/client-nav/scenarios/mount/vue/src/routeTree.gen.ts
@@ -9,35 +9,20 @@
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
import { Route as rootRouteImport } from './routes/__root'
-import { Route as IndexRouteImport } from './routes/index'
-import { Route as AboutRouteImport } from './routes/about'
-import { Route as BlogRouteImport } from './routes/blog'
-import { Route as SearchRouteImport } from './routes/search'
-import { Route as SettingsRouteImport } from './routes/settings'
import { Route as ShopRouteImport } from './routes/shop'
-import { Route as BlogIndexRouteImport } from './routes/blog.index'
-import { Route as BlogSlugRouteImport } from './routes/blog.$slug'
+import { Route as SettingsRouteImport } from './routes/settings'
+import { Route as SearchRouteImport } from './routes/search'
+import { Route as BlogRouteImport } from './routes/blog'
+import { Route as AboutRouteImport } from './routes/about'
+import { Route as IndexRouteImport } from './routes/index'
import { Route as ShopIndexRouteImport } from './routes/shop.index'
+import { Route as BlogIndexRouteImport } from './routes/blog.index'
import { Route as ShopProductIdRouteImport } from './routes/shop.$productId'
+import { Route as BlogSlugRouteImport } from './routes/blog.$slug'
-const IndexRoute = IndexRouteImport.update({
- id: '/',
- path: '/',
- getParentRoute: () => rootRouteImport,
-} as any)
-const AboutRoute = AboutRouteImport.update({
- id: '/about',
- path: '/about',
- getParentRoute: () => rootRouteImport,
-} as any)
-const BlogRoute = BlogRouteImport.update({
- id: '/blog',
- path: '/blog',
- getParentRoute: () => rootRouteImport,
-} as any)
-const SearchRoute = SearchRouteImport.update({
- id: '/search',
- path: '/search',
+const ShopRoute = ShopRouteImport.update({
+ id: '/shop',
+ path: '/shop',
getParentRoute: () => rootRouteImport,
} as any)
const SettingsRoute = SettingsRouteImport.update({
@@ -45,31 +30,46 @@ const SettingsRoute = SettingsRouteImport.update({
path: '/settings',
getParentRoute: () => rootRouteImport,
} as any)
-const ShopRoute = ShopRouteImport.update({
- id: '/shop',
- path: '/shop',
+const SearchRoute = SearchRouteImport.update({
+ id: '/search',
+ path: '/search',
getParentRoute: () => rootRouteImport,
} as any)
-const BlogIndexRoute = BlogIndexRouteImport.update({
+const BlogRoute = BlogRouteImport.update({
+ id: '/blog',
+ path: '/blog',
+ getParentRoute: () => rootRouteImport,
+} as any)
+const AboutRoute = AboutRouteImport.update({
+ id: '/about',
+ path: '/about',
+ getParentRoute: () => rootRouteImport,
+} as any)
+const IndexRoute = IndexRouteImport.update({
id: '/',
path: '/',
- getParentRoute: () => BlogRoute,
-} as any)
-const BlogSlugRoute = BlogSlugRouteImport.update({
- id: '/$slug',
- path: '/$slug',
- getParentRoute: () => BlogRoute,
+ getParentRoute: () => rootRouteImport,
} as any)
const ShopIndexRoute = ShopIndexRouteImport.update({
id: '/',
path: '/',
getParentRoute: () => ShopRoute,
} as any)
+const BlogIndexRoute = BlogIndexRouteImport.update({
+ id: '/',
+ path: '/',
+ getParentRoute: () => BlogRoute,
+} as any)
const ShopProductIdRoute = ShopProductIdRouteImport.update({
id: '/$productId',
path: '/$productId',
getParentRoute: () => ShopRoute,
} as any)
+const BlogSlugRoute = BlogSlugRouteImport.update({
+ id: '/$slug',
+ path: '/$slug',
+ getParentRoute: () => BlogRoute,
+} as any)
export interface FileRoutesByFullPath {
'/': typeof IndexRoute
@@ -154,32 +154,11 @@ export interface RootRouteChildren {
declare module '@tanstack/vue-router' {
interface FileRoutesByPath {
- '/': {
- id: '/'
- path: '/'
- fullPath: '/'
- preLoaderRoute: typeof IndexRouteImport
- parentRoute: typeof rootRouteImport
- }
- '/about': {
- id: '/about'
- path: '/about'
- fullPath: '/about'
- preLoaderRoute: typeof AboutRouteImport
- parentRoute: typeof rootRouteImport
- }
- '/blog': {
- id: '/blog'
- path: '/blog'
- fullPath: '/blog'
- preLoaderRoute: typeof BlogRouteImport
- parentRoute: typeof rootRouteImport
- }
- '/search': {
- id: '/search'
- path: '/search'
- fullPath: '/search'
- preLoaderRoute: typeof SearchRouteImport
+ '/shop': {
+ id: '/shop'
+ path: '/shop'
+ fullPath: '/shop'
+ preLoaderRoute: typeof ShopRouteImport
parentRoute: typeof rootRouteImport
}
'/settings': {
@@ -189,26 +168,33 @@ declare module '@tanstack/vue-router' {
preLoaderRoute: typeof SettingsRouteImport
parentRoute: typeof rootRouteImport
}
- '/shop': {
- id: '/shop'
- path: '/shop'
- fullPath: '/shop'
- preLoaderRoute: typeof ShopRouteImport
+ '/search': {
+ id: '/search'
+ path: '/search'
+ fullPath: '/search'
+ preLoaderRoute: typeof SearchRouteImport
parentRoute: typeof rootRouteImport
}
- '/blog/': {
- id: '/blog/'
- path: '/'
- fullPath: '/blog/'
- preLoaderRoute: typeof BlogIndexRouteImport
- parentRoute: typeof BlogRoute
+ '/blog': {
+ id: '/blog'
+ path: '/blog'
+ fullPath: '/blog'
+ preLoaderRoute: typeof BlogRouteImport
+ parentRoute: typeof rootRouteImport
}
- '/blog/$slug': {
- id: '/blog/$slug'
- path: '/$slug'
- fullPath: '/blog/$slug'
- preLoaderRoute: typeof BlogSlugRouteImport
- parentRoute: typeof BlogRoute
+ '/about': {
+ id: '/about'
+ path: '/about'
+ fullPath: '/about'
+ preLoaderRoute: typeof AboutRouteImport
+ parentRoute: typeof rootRouteImport
+ }
+ '/': {
+ id: '/'
+ path: '/'
+ fullPath: '/'
+ preLoaderRoute: typeof IndexRouteImport
+ parentRoute: typeof rootRouteImport
}
'/shop/': {
id: '/shop/'
@@ -217,6 +203,13 @@ declare module '@tanstack/vue-router' {
preLoaderRoute: typeof ShopIndexRouteImport
parentRoute: typeof ShopRoute
}
+ '/blog/': {
+ id: '/blog/'
+ path: '/'
+ fullPath: '/blog/'
+ preLoaderRoute: typeof BlogIndexRouteImport
+ parentRoute: typeof BlogRoute
+ }
'/shop/$productId': {
id: '/shop/$productId'
path: '/$productId'
@@ -224,6 +217,13 @@ declare module '@tanstack/vue-router' {
preLoaderRoute: typeof ShopProductIdRouteImport
parentRoute: typeof ShopRoute
}
+ '/blog/$slug': {
+ id: '/blog/$slug'
+ path: '/$slug'
+ fullPath: '/blog/$slug'
+ preLoaderRoute: typeof BlogSlugRouteImport
+ parentRoute: typeof BlogRoute
+ }
}
}
diff --git a/benchmarks/client-nav/scenarios/mount/vue/vite.config.ts b/benchmarks/client-nav/scenarios/mount/vue/vite.config.ts
index 8d4005f339..107e1037b6 100644
--- a/benchmarks/client-nav/scenarios/mount/vue/vite.config.ts
+++ b/benchmarks/client-nav/scenarios/mount/vue/vite.config.ts
@@ -4,7 +4,6 @@ import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import codspeedPlugin from '@codspeed/vitest-plugin'
import { tanstackRouter } from '@tanstack/router-plugin/vite'
-import { cpuSimulationExecArgv } from '../../../../cpu-simulation'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -35,7 +34,6 @@ export default defineConfig({
},
},
test: {
- execArgv: cpuSimulationExecArgv(),
name: '@benchmarks/client-nav mount (vue)',
watch: false,
environment: 'jsdom',
diff --git a/benchmarks/client-nav/scenarios/nested-params/react/speed.bench.ts b/benchmarks/client-nav/scenarios/nested-params/react/speed.bench.ts
index fa5809c1fd..3dfe93c117 100644
--- a/benchmarks/client-nav/scenarios/nested-params/react/speed.bench.ts
+++ b/benchmarks/client-nav/scenarios/nested-params/react/speed.bench.ts
@@ -1,19 +1,32 @@
-import { test } from 'vitest'
-import { benchLifecycle } from '../../../../cpu-simulation'
+import { afterEach, beforeEach, bench, describe } from 'vitest'
import { benchOptions, ticksPerIteration } from '../shared'
import { setup } from './setup'
-test('client-nested-params', async ({ bench }) => {
- const scenario = setup()
+describe('client-nested-params', () => {
+ const test = setup()
- await bench(
+ /**
+ * Running `vitest bench` ignores suite hooks, so Tinybench uses the `setup`
+ * and `teardown` options below. CodSpeed bypasses those options but supports
+ * `beforeEach` and `afterEach`. Only one lifecycle path runs in either
+ * environment, and every measured invocation receives fresh application state.
+ */
+
+ beforeEach(test.before)
+ afterEach(test.after)
+
+ bench(
'client-nested-params navigation loop (react)',
- benchLifecycle(scenario),
async () => {
for (let i = 0; i < ticksPerIteration; i++) {
- await scenario.tick()
+ await test.tick()
}
- await scenario.finishBatch()
+ await test.finishBatch()
},
- ).run(benchOptions)
+ {
+ ...benchOptions,
+ setup: test.before,
+ teardown: test.after,
+ },
+ )
})
diff --git a/benchmarks/client-nav/scenarios/nested-params/react/vite.config.ts b/benchmarks/client-nav/scenarios/nested-params/react/vite.config.ts
index a99060bf1c..672b1850ff 100644
--- a/benchmarks/client-nav/scenarios/nested-params/react/vite.config.ts
+++ b/benchmarks/client-nav/scenarios/nested-params/react/vite.config.ts
@@ -3,7 +3,6 @@ import { defineConfig } from 'vitest/config'
import react from '@vitejs/plugin-react'
import codspeedPlugin from '@codspeed/vitest-plugin'
import { tanstackRouter } from '@tanstack/router-plugin/vite'
-import { cpuSimulationExecArgv } from '../../../../cpu-simulation'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -33,7 +32,6 @@ export default defineConfig({
},
},
test: {
- execArgv: cpuSimulationExecArgv(),
name: '@benchmarks/client-nav nested-params (react)',
watch: false,
environment: 'jsdom',
diff --git a/benchmarks/client-nav/scenarios/nested-params/solid/speed.bench.ts b/benchmarks/client-nav/scenarios/nested-params/solid/speed.bench.ts
index 2c64d9a221..dc7ec11f6b 100644
--- a/benchmarks/client-nav/scenarios/nested-params/solid/speed.bench.ts
+++ b/benchmarks/client-nav/scenarios/nested-params/solid/speed.bench.ts
@@ -1,19 +1,32 @@
-import { test } from 'vitest'
-import { benchLifecycle } from '../../../../cpu-simulation'
+import { afterEach, beforeEach, bench, describe } from 'vitest'
import { benchOptions, ticksPerIteration } from '../shared'
import { setup } from './setup'
-test('client-nested-params', async ({ bench }) => {
- const scenario = setup()
+describe('client-nested-params', () => {
+ const test = setup()
- await bench(
+ /**
+ * Running `vitest bench` ignores suite hooks, so Tinybench uses the `setup`
+ * and `teardown` options below. CodSpeed bypasses those options but supports
+ * `beforeEach` and `afterEach`. Only one lifecycle path runs in either
+ * environment, and every measured invocation receives fresh application state.
+ */
+
+ beforeEach(test.before)
+ afterEach(test.after)
+
+ bench(
'client-nested-params navigation loop (solid)',
- benchLifecycle(scenario),
async () => {
for (let i = 0; i < ticksPerIteration; i++) {
- await scenario.tick()
+ await test.tick()
}
- await scenario.finishBatch()
+ await test.finishBatch()
},
- ).run(benchOptions)
+ {
+ ...benchOptions,
+ setup: test.before,
+ teardown: test.after,
+ },
+ )
})
diff --git a/benchmarks/client-nav/scenarios/nested-params/solid/src/main.tsx b/benchmarks/client-nav/scenarios/nested-params/solid/src/main.tsx
index fa9d239418..f7148011f5 100644
--- a/benchmarks/client-nav/scenarios/nested-params/solid/src/main.tsx
+++ b/benchmarks/client-nav/scenarios/nested-params/solid/src/main.tsx
@@ -1,5 +1,5 @@
import type { RouterHistory } from '@tanstack/history'
-import { render } from 'solid-js/web'
+import { render } from '@solidjs/web'
import { RouterProvider, createRouter } from '@tanstack/solid-router'
import { routeTree } from './routeTree.gen'
diff --git a/benchmarks/client-nav/scenarios/nested-params/solid/src/routes/l.$a.$b.$c.$d.$e.$f.$g.$h.tsx b/benchmarks/client-nav/scenarios/nested-params/solid/src/routes/l.$a.$b.$c.$d.$e.$f.$g.$h.tsx
index 7dc55db0e4..fccc6ca7bb 100644
--- a/benchmarks/client-nav/scenarios/nested-params/solid/src/routes/l.$a.$b.$c.$d.$e.$f.$g.$h.tsx
+++ b/benchmarks/client-nav/scenarios/nested-params/solid/src/routes/l.$a.$b.$c.$d.$e.$f.$g.$h.tsx
@@ -13,9 +13,12 @@ export const Route = createFileRoute('/l/$a/$b/$c/$d/$e/$f/$g/$h')({
function ParamsSubscriberOne() {
const value = Route.useParams({ select: (params) => smallHash(params.h) })
- createRenderEffect(() => {
- void value()
- })
+ createRenderEffect(
+ () => {
+ void value()
+ },
+ () => {},
+ )
return null
}
@@ -23,17 +26,23 @@ function ParamsSubscriberTwo() {
const value = Route.useParams({
select: (params) => smallHash(`${params.h}:2`),
})
- createRenderEffect(() => {
- void value()
- })
+ createRenderEffect(
+ () => {
+ void value()
+ },
+ () => {},
+ )
return null
}
function ContextSubscriberOne() {
const value = Route.useRouteContext({ select: (context) => context.ctxH })
- createRenderEffect(() => {
- void value()
- })
+ createRenderEffect(
+ () => {
+ void value()
+ },
+ () => {},
+ )
return null
}
@@ -41,9 +50,12 @@ function ContextSubscriberTwo() {
const value = Route.useRouteContext({
select: (context) => (context.ctxH * 31 + 7) >>> 0,
})
- createRenderEffect(() => {
- void value()
- })
+ createRenderEffect(
+ () => {
+ void value()
+ },
+ () => {},
+ )
return null
}
diff --git a/benchmarks/client-nav/scenarios/nested-params/solid/src/routes/l.$a.$b.$c.$d.$e.$f.$g.tsx b/benchmarks/client-nav/scenarios/nested-params/solid/src/routes/l.$a.$b.$c.$d.$e.$f.$g.tsx
index d9c6c9429b..7274a19aac 100644
--- a/benchmarks/client-nav/scenarios/nested-params/solid/src/routes/l.$a.$b.$c.$d.$e.$f.$g.tsx
+++ b/benchmarks/client-nav/scenarios/nested-params/solid/src/routes/l.$a.$b.$c.$d.$e.$f.$g.tsx
@@ -13,9 +13,12 @@ export const Route = createFileRoute('/l/$a/$b/$c/$d/$e/$f/$g')({
function ParamsSubscriberOne() {
const value = Route.useParams({ select: (params) => smallHash(params.g) })
- createRenderEffect(() => {
- void value()
- })
+ createRenderEffect(
+ () => {
+ void value()
+ },
+ () => {},
+ )
return null
}
@@ -23,17 +26,23 @@ function ParamsSubscriberTwo() {
const value = Route.useParams({
select: (params) => smallHash(`${params.g}:2`),
})
- createRenderEffect(() => {
- void value()
- })
+ createRenderEffect(
+ () => {
+ void value()
+ },
+ () => {},
+ )
return null
}
function ContextSubscriberOne() {
const value = Route.useRouteContext({ select: (context) => context.ctxG })
- createRenderEffect(() => {
- void value()
- })
+ createRenderEffect(
+ () => {
+ void value()
+ },
+ () => {},
+ )
return null
}
@@ -41,9 +50,12 @@ function ContextSubscriberTwo() {
const value = Route.useRouteContext({
select: (context) => (context.ctxG * 31 + 7) >>> 0,
})
- createRenderEffect(() => {
- void value()
- })
+ createRenderEffect(
+ () => {
+ void value()
+ },
+ () => {},
+ )
return null
}
diff --git a/benchmarks/client-nav/scenarios/nested-params/solid/src/routes/l.$a.$b.$c.$d.$e.$f.tsx b/benchmarks/client-nav/scenarios/nested-params/solid/src/routes/l.$a.$b.$c.$d.$e.$f.tsx
index 010f89bc4d..a7ec5597f7 100644
--- a/benchmarks/client-nav/scenarios/nested-params/solid/src/routes/l.$a.$b.$c.$d.$e.$f.tsx
+++ b/benchmarks/client-nav/scenarios/nested-params/solid/src/routes/l.$a.$b.$c.$d.$e.$f.tsx
@@ -13,9 +13,12 @@ export const Route = createFileRoute('/l/$a/$b/$c/$d/$e/$f')({
function ParamsSubscriberOne() {
const value = Route.useParams({ select: (params) => smallHash(params.f) })
- createRenderEffect(() => {
- void value()
- })
+ createRenderEffect(
+ () => {
+ void value()
+ },
+ () => {},
+ )
return null
}
@@ -23,17 +26,23 @@ function ParamsSubscriberTwo() {
const value = Route.useParams({
select: (params) => smallHash(`${params.f}:2`),
})
- createRenderEffect(() => {
- void value()
- })
+ createRenderEffect(
+ () => {
+ void value()
+ },
+ () => {},
+ )
return null
}
function ContextSubscriberOne() {
const value = Route.useRouteContext({ select: (context) => context.ctxF })
- createRenderEffect(() => {
- void value()
- })
+ createRenderEffect(
+ () => {
+ void value()
+ },
+ () => {},
+ )
return null
}
@@ -41,9 +50,12 @@ function ContextSubscriberTwo() {
const value = Route.useRouteContext({
select: (context) => (context.ctxF * 31 + 7) >>> 0,
})
- createRenderEffect(() => {
- void value()
- })
+ createRenderEffect(
+ () => {
+ void value()
+ },
+ () => {},
+ )
return null
}
diff --git a/benchmarks/client-nav/scenarios/nested-params/solid/src/routes/l.$a.$b.$c.$d.$e.tsx b/benchmarks/client-nav/scenarios/nested-params/solid/src/routes/l.$a.$b.$c.$d.$e.tsx
index 08c107f0c6..79c6b118e0 100644
--- a/benchmarks/client-nav/scenarios/nested-params/solid/src/routes/l.$a.$b.$c.$d.$e.tsx
+++ b/benchmarks/client-nav/scenarios/nested-params/solid/src/routes/l.$a.$b.$c.$d.$e.tsx
@@ -13,9 +13,12 @@ export const Route = createFileRoute('/l/$a/$b/$c/$d/$e')({
function ParamsSubscriberOne() {
const value = Route.useParams({ select: (params) => smallHash(params.e) })
- createRenderEffect(() => {
- void value()
- })
+ createRenderEffect(
+ () => {
+ void value()
+ },
+ () => {},
+ )
return null
}
@@ -23,17 +26,23 @@ function ParamsSubscriberTwo() {
const value = Route.useParams({
select: (params) => smallHash(`${params.e}:2`),
})
- createRenderEffect(() => {
- void value()
- })
+ createRenderEffect(
+ () => {
+ void value()
+ },
+ () => {},
+ )
return null
}
function ContextSubscriberOne() {
const value = Route.useRouteContext({ select: (context) => context.ctxE })
- createRenderEffect(() => {
- void value()
- })
+ createRenderEffect(
+ () => {
+ void value()
+ },
+ () => {},
+ )
return null
}
@@ -41,9 +50,12 @@ function ContextSubscriberTwo() {
const value = Route.useRouteContext({
select: (context) => (context.ctxE * 31 + 7) >>> 0,
})
- createRenderEffect(() => {
- void value()
- })
+ createRenderEffect(
+ () => {
+ void value()
+ },
+ () => {},
+ )
return null
}
diff --git a/benchmarks/client-nav/scenarios/nested-params/solid/src/routes/l.$a.$b.$c.$d.tsx b/benchmarks/client-nav/scenarios/nested-params/solid/src/routes/l.$a.$b.$c.$d.tsx
index 1b64edd58b..e0dc4c10d2 100644
--- a/benchmarks/client-nav/scenarios/nested-params/solid/src/routes/l.$a.$b.$c.$d.tsx
+++ b/benchmarks/client-nav/scenarios/nested-params/solid/src/routes/l.$a.$b.$c.$d.tsx
@@ -13,9 +13,12 @@ export const Route = createFileRoute('/l/$a/$b/$c/$d')({
function ParamsSubscriberOne() {
const value = Route.useParams({ select: (params) => smallHash(params.d) })
- createRenderEffect(() => {
- void value()
- })
+ createRenderEffect(
+ () => {
+ void value()
+ },
+ () => {},
+ )
return null
}
@@ -23,17 +26,23 @@ function ParamsSubscriberTwo() {
const value = Route.useParams({
select: (params) => smallHash(`${params.d}:2`),
})
- createRenderEffect(() => {
- void value()
- })
+ createRenderEffect(
+ () => {
+ void value()
+ },
+ () => {},
+ )
return null
}
function ContextSubscriberOne() {
const value = Route.useRouteContext({ select: (context) => context.ctxD })
- createRenderEffect(() => {
- void value()
- })
+ createRenderEffect(
+ () => {
+ void value()
+ },
+ () => {},
+ )
return null
}
@@ -41,9 +50,12 @@ function ContextSubscriberTwo() {
const value = Route.useRouteContext({
select: (context) => (context.ctxD * 31 + 7) >>> 0,
})
- createRenderEffect(() => {
- void value()
- })
+ createRenderEffect(
+ () => {
+ void value()
+ },
+ () => {},
+ )
return null
}
diff --git a/benchmarks/client-nav/scenarios/nested-params/solid/src/routes/l.$a.$b.$c.tsx b/benchmarks/client-nav/scenarios/nested-params/solid/src/routes/l.$a.$b.$c.tsx
index e509ea82c6..3a0df7eb71 100644
--- a/benchmarks/client-nav/scenarios/nested-params/solid/src/routes/l.$a.$b.$c.tsx
+++ b/benchmarks/client-nav/scenarios/nested-params/solid/src/routes/l.$a.$b.$c.tsx
@@ -13,9 +13,12 @@ export const Route = createFileRoute('/l/$a/$b/$c')({
function ParamsSubscriberOne() {
const value = Route.useParams({ select: (params) => smallHash(params.c) })
- createRenderEffect(() => {
- void value()
- })
+ createRenderEffect(
+ () => {
+ void value()
+ },
+ () => {},
+ )
return null
}
@@ -23,17 +26,23 @@ function ParamsSubscriberTwo() {
const value = Route.useParams({
select: (params) => smallHash(`${params.c}:2`),
})
- createRenderEffect(() => {
- void value()
- })
+ createRenderEffect(
+ () => {
+ void value()
+ },
+ () => {},
+ )
return null
}
function ContextSubscriberOne() {
const value = Route.useRouteContext({ select: (context) => context.ctxC })
- createRenderEffect(() => {
- void value()
- })
+ createRenderEffect(
+ () => {
+ void value()
+ },
+ () => {},
+ )
return null
}
@@ -41,9 +50,12 @@ function ContextSubscriberTwo() {
const value = Route.useRouteContext({
select: (context) => (context.ctxC * 31 + 7) >>> 0,
})
- createRenderEffect(() => {
- void value()
- })
+ createRenderEffect(
+ () => {
+ void value()
+ },
+ () => {},
+ )
return null
}
diff --git a/benchmarks/client-nav/scenarios/nested-params/solid/src/routes/l.$a.$b.tsx b/benchmarks/client-nav/scenarios/nested-params/solid/src/routes/l.$a.$b.tsx
index ada853b845..6133e72b48 100644
--- a/benchmarks/client-nav/scenarios/nested-params/solid/src/routes/l.$a.$b.tsx
+++ b/benchmarks/client-nav/scenarios/nested-params/solid/src/routes/l.$a.$b.tsx
@@ -13,9 +13,12 @@ export const Route = createFileRoute('/l/$a/$b')({
function ParamsSubscriberOne() {
const value = Route.useParams({ select: (params) => smallHash(params.b) })
- createRenderEffect(() => {
- void value()
- })
+ createRenderEffect(
+ () => {
+ void value()
+ },
+ () => {},
+ )
return null
}
@@ -23,17 +26,23 @@ function ParamsSubscriberTwo() {
const value = Route.useParams({
select: (params) => smallHash(`${params.b}:2`),
})
- createRenderEffect(() => {
- void value()
- })
+ createRenderEffect(
+ () => {
+ void value()
+ },
+ () => {},
+ )
return null
}
function ContextSubscriberOne() {
const value = Route.useRouteContext({ select: (context) => context.ctxB })
- createRenderEffect(() => {
- void value()
- })
+ createRenderEffect(
+ () => {
+ void value()
+ },
+ () => {},
+ )
return null
}
@@ -41,9 +50,12 @@ function ContextSubscriberTwo() {
const value = Route.useRouteContext({
select: (context) => (context.ctxB * 31 + 7) >>> 0,
})
- createRenderEffect(() => {
- void value()
- })
+ createRenderEffect(
+ () => {
+ void value()
+ },
+ () => {},
+ )
return null
}
diff --git a/benchmarks/client-nav/scenarios/nested-params/solid/src/routes/l.$a.tsx b/benchmarks/client-nav/scenarios/nested-params/solid/src/routes/l.$a.tsx
index 5ecf004fae..7bd378431b 100644
--- a/benchmarks/client-nav/scenarios/nested-params/solid/src/routes/l.$a.tsx
+++ b/benchmarks/client-nav/scenarios/nested-params/solid/src/routes/l.$a.tsx
@@ -13,9 +13,12 @@ export const Route = createFileRoute('/l/$a')({
function ParamsSubscriberOne() {
const value = Route.useParams({ select: (params) => smallHash(params.a) })
- createRenderEffect(() => {
- void value()
- })
+ createRenderEffect(
+ () => {
+ void value()
+ },
+ () => {},
+ )
return null
}
@@ -23,17 +26,23 @@ function ParamsSubscriberTwo() {
const value = Route.useParams({
select: (params) => smallHash(`${params.a}:2`),
})
- createRenderEffect(() => {
- void value()
- })
+ createRenderEffect(
+ () => {
+ void value()
+ },
+ () => {},
+ )
return null
}
function ContextSubscriberOne() {
const value = Route.useRouteContext({ select: (context) => context.ctxA })
- createRenderEffect(() => {
- void value()
- })
+ createRenderEffect(
+ () => {
+ void value()
+ },
+ () => {},
+ )
return null
}
@@ -41,9 +50,12 @@ function ContextSubscriberTwo() {
const value = Route.useRouteContext({
select: (context) => (context.ctxA * 31 + 7) >>> 0,
})
- createRenderEffect(() => {
- void value()
- })
+ createRenderEffect(
+ () => {
+ void value()
+ },
+ () => {},
+ )
return null
}
diff --git a/benchmarks/client-nav/scenarios/nested-params/solid/tsconfig.json b/benchmarks/client-nav/scenarios/nested-params/solid/tsconfig.json
index 98d76ad6b8..8c57ff876a 100644
--- a/benchmarks/client-nav/scenarios/nested-params/solid/tsconfig.json
+++ b/benchmarks/client-nav/scenarios/nested-params/solid/tsconfig.json
@@ -2,7 +2,7 @@
"extends": "../../../../../tsconfig.json",
"compilerOptions": {
"jsx": "preserve",
- "jsxImportSource": "solid-js",
+ "jsxImportSource": "@solidjs/web",
"allowImportingTsExtensions": true,
"types": ["node", "vite/client", "vitest/globals"]
},
diff --git a/benchmarks/client-nav/scenarios/nested-params/solid/vite.config.ts b/benchmarks/client-nav/scenarios/nested-params/solid/vite.config.ts
index 9897e2c199..12ce6954aa 100644
--- a/benchmarks/client-nav/scenarios/nested-params/solid/vite.config.ts
+++ b/benchmarks/client-nav/scenarios/nested-params/solid/vite.config.ts
@@ -1,9 +1,8 @@
import { fileURLToPath } from 'node:url'
import { defineConfig } from 'vitest/config'
-import solid from 'vite-plugin-solid'
+import solid from '@solidjs/vite-plugin'
import codspeedPlugin from '@codspeed/vitest-plugin'
import { tanstackRouter } from '@tanstack/router-plugin/vite'
-import { cpuSimulationExecArgv } from '../../../../cpu-simulation'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -20,7 +19,7 @@ export default defineConfig({
routesDirectory: `${rootDir}src/routes`,
generatedRouteTree: `${rootDir}src/routeTree.gen.ts`,
}),
- solid({ hot: false, dev: false }),
+ solid({ refresh: false, dev: false }),
],
build: {
outDir: './dist',
@@ -36,7 +35,6 @@ export default defineConfig({
conditions: ['solid', 'browser'],
},
test: {
- execArgv: cpuSimulationExecArgv(),
name: '@benchmarks/client-nav nested-params (solid)',
watch: false,
environment: 'jsdom',
diff --git a/benchmarks/client-nav/scenarios/nested-params/vue/speed.bench.ts b/benchmarks/client-nav/scenarios/nested-params/vue/speed.bench.ts
index bd3e82e070..fcb336d1db 100644
--- a/benchmarks/client-nav/scenarios/nested-params/vue/speed.bench.ts
+++ b/benchmarks/client-nav/scenarios/nested-params/vue/speed.bench.ts
@@ -1,19 +1,32 @@
-import { test } from 'vitest'
-import { benchLifecycle } from '../../../../cpu-simulation'
+import { afterEach, beforeEach, bench, describe } from 'vitest'
import { benchOptions, ticksPerIteration } from '../shared'
import { setup } from './setup'
-test('client-nested-params', async ({ bench }) => {
- const scenario = setup()
+describe('client-nested-params', () => {
+ const test = setup()
- await bench(
+ /**
+ * Running `vitest bench` ignores suite hooks, so Tinybench uses the `setup`
+ * and `teardown` options below. CodSpeed bypasses those options but supports
+ * `beforeEach` and `afterEach`. Only one lifecycle path runs in either
+ * environment, and every measured invocation receives fresh application state.
+ */
+
+ beforeEach(test.before)
+ afterEach(test.after)
+
+ bench(
'client-nested-params navigation loop (vue)',
- benchLifecycle(scenario),
async () => {
for (let i = 0; i < ticksPerIteration; i++) {
- await scenario.tick()
+ await test.tick()
}
- await scenario.finishBatch()
+ await test.finishBatch()
},
- ).run(benchOptions)
+ {
+ ...benchOptions,
+ setup: test.before,
+ teardown: test.after,
+ },
+ )
})
diff --git a/benchmarks/client-nav/scenarios/nested-params/vue/vite.config.ts b/benchmarks/client-nav/scenarios/nested-params/vue/vite.config.ts
index 0d74eb7a7c..59a4af48ef 100644
--- a/benchmarks/client-nav/scenarios/nested-params/vue/vite.config.ts
+++ b/benchmarks/client-nav/scenarios/nested-params/vue/vite.config.ts
@@ -4,7 +4,6 @@ import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import codspeedPlugin from '@codspeed/vitest-plugin'
import { tanstackRouter } from '@tanstack/router-plugin/vite'
-import { cpuSimulationExecArgv } from '../../../../cpu-simulation'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -35,7 +34,6 @@ export default defineConfig({
},
},
test: {
- execArgv: cpuSimulationExecArgv(),
name: '@benchmarks/client-nav nested-params (vue)',
watch: false,
environment: 'jsdom',
diff --git a/benchmarks/client-nav/scenarios/preload/react/speed.bench.ts b/benchmarks/client-nav/scenarios/preload/react/speed.bench.ts
index 5c210b2fd7..5b188a0a0b 100644
--- a/benchmarks/client-nav/scenarios/preload/react/speed.bench.ts
+++ b/benchmarks/client-nav/scenarios/preload/react/speed.bench.ts
@@ -1,19 +1,32 @@
-import { test } from 'vitest'
-import { benchLifecycle } from '../../../../cpu-simulation'
+import { afterEach, beforeEach, bench, describe } from 'vitest'
import { benchOptions, ticksPerIteration } from '../shared'
import { setup } from './setup'
-test('client-preload', async ({ bench }) => {
- const scenario = setup()
+describe('client-preload', () => {
+ const test = setup()
- await bench(
+ /**
+ * Running `vitest bench` ignores suite hooks, so Tinybench uses the `setup`
+ * and `teardown` options below. CodSpeed bypasses those options but supports
+ * `beforeEach` and `afterEach`. Only one lifecycle path runs in either
+ * environment, and every measured invocation receives fresh application state.
+ */
+
+ beforeEach(test.before)
+ afterEach(test.after)
+
+ bench(
'client-preload interaction loop (react)',
- benchLifecycle(scenario),
async () => {
for (let i = 0; i < ticksPerIteration; i++) {
- await scenario.tick()
+ await test.tick()
}
- await scenario.finishBatch()
+ await test.finishBatch()
},
- ).run(benchOptions)
+ {
+ ...benchOptions,
+ setup: test.before,
+ teardown: test.after,
+ },
+ )
})
diff --git a/benchmarks/client-nav/scenarios/preload/react/vite.config.ts b/benchmarks/client-nav/scenarios/preload/react/vite.config.ts
index 8a41fc8707..ff51686959 100644
--- a/benchmarks/client-nav/scenarios/preload/react/vite.config.ts
+++ b/benchmarks/client-nav/scenarios/preload/react/vite.config.ts
@@ -3,7 +3,6 @@ import { defineConfig } from 'vitest/config'
import react from '@vitejs/plugin-react'
import codspeedPlugin from '@codspeed/vitest-plugin'
import { tanstackRouter } from '@tanstack/router-plugin/vite'
-import { cpuSimulationExecArgv } from '../../../../cpu-simulation'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -33,7 +32,6 @@ export default defineConfig({
},
},
test: {
- execArgv: cpuSimulationExecArgv(),
name: '@benchmarks/client-nav preload (react)',
watch: false,
environment: 'jsdom',
diff --git a/benchmarks/client-nav/scenarios/preload/solid/speed.bench.ts b/benchmarks/client-nav/scenarios/preload/solid/speed.bench.ts
index f835b4a7b9..267c9fd41d 100644
--- a/benchmarks/client-nav/scenarios/preload/solid/speed.bench.ts
+++ b/benchmarks/client-nav/scenarios/preload/solid/speed.bench.ts
@@ -1,19 +1,32 @@
-import { test } from 'vitest'
-import { benchLifecycle } from '../../../../cpu-simulation'
+import { afterEach, beforeEach, bench, describe } from 'vitest'
import { benchOptions, ticksPerIteration } from '../shared'
import { setup } from './setup'
-test('client-preload', async ({ bench }) => {
- const scenario = setup()
+describe('client-preload', () => {
+ const test = setup()
- await bench(
+ /**
+ * Running `vitest bench` ignores suite hooks, so Tinybench uses the `setup`
+ * and `teardown` options below. CodSpeed bypasses those options but supports
+ * `beforeEach` and `afterEach`. Only one lifecycle path runs in either
+ * environment, and every measured invocation receives fresh application state.
+ */
+
+ beforeEach(test.before)
+ afterEach(test.after)
+
+ bench(
'client-preload interaction loop (solid)',
- benchLifecycle(scenario),
async () => {
for (let i = 0; i < ticksPerIteration; i++) {
- await scenario.tick()
+ await test.tick()
}
- await scenario.finishBatch()
+ await test.finishBatch()
},
- ).run(benchOptions)
+ {
+ ...benchOptions,
+ setup: test.before,
+ teardown: test.after,
+ },
+ )
})
diff --git a/benchmarks/client-nav/scenarios/preload/solid/src/main.tsx b/benchmarks/client-nav/scenarios/preload/solid/src/main.tsx
index 3791156c64..ad7e065f2e 100644
--- a/benchmarks/client-nav/scenarios/preload/solid/src/main.tsx
+++ b/benchmarks/client-nav/scenarios/preload/solid/src/main.tsx
@@ -1,5 +1,5 @@
import type { RouterHistory } from '@tanstack/history'
-import { render } from 'solid-js/web'
+import { render } from '@solidjs/web'
import { RouterProvider, createRouter } from '@tanstack/solid-router'
import { routeTree } from './routeTree.gen'
diff --git a/benchmarks/client-nav/scenarios/preload/solid/src/routeTree.gen.ts b/benchmarks/client-nav/scenarios/preload/solid/src/routeTree.gen.ts
index 97e215b6da..645d925238 100644
--- a/benchmarks/client-nav/scenarios/preload/solid/src/routeTree.gen.ts
+++ b/benchmarks/client-nav/scenarios/preload/solid/src/routeTree.gen.ts
@@ -9,20 +9,20 @@
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
import { Route as rootRouteImport } from './routes/__root'
-import { Route as IndexRouteImport } from './routes/index'
import { Route as DocsRouteImport } from './routes/docs'
+import { Route as IndexRouteImport } from './routes/index'
import { Route as SectionsSectionRouteImport } from './routes/sections.$section'
-const IndexRoute = IndexRouteImport.update({
- id: '/',
- path: '/',
- getParentRoute: () => rootRouteImport,
-} as any)
const DocsRoute = DocsRouteImport.update({
id: '/docs',
path: '/docs',
getParentRoute: () => rootRouteImport,
} as any)
+const IndexRoute = IndexRouteImport.update({
+ id: '/',
+ path: '/',
+ getParentRoute: () => rootRouteImport,
+} as any)
const SectionsSectionRoute = SectionsSectionRouteImport.update({
id: '/sections/$section',
path: '/sections/$section',
@@ -61,13 +61,6 @@ export interface RootRouteChildren {
declare module '@tanstack/solid-router' {
interface FileRoutesByPath {
- '/': {
- id: '/'
- path: '/'
- fullPath: '/'
- preLoaderRoute: typeof IndexRouteImport
- parentRoute: typeof rootRouteImport
- }
'/docs': {
id: '/docs'
path: '/docs'
@@ -75,6 +68,13 @@ declare module '@tanstack/solid-router' {
preLoaderRoute: typeof DocsRouteImport
parentRoute: typeof rootRouteImport
}
+ '/': {
+ id: '/'
+ path: '/'
+ fullPath: '/'
+ preLoaderRoute: typeof IndexRouteImport
+ parentRoute: typeof rootRouteImport
+ }
'/sections/$section': {
id: '/sections/$section'
path: '/sections/$section'
diff --git a/benchmarks/client-nav/scenarios/preload/solid/tsconfig.json b/benchmarks/client-nav/scenarios/preload/solid/tsconfig.json
index 98d76ad6b8..8c57ff876a 100644
--- a/benchmarks/client-nav/scenarios/preload/solid/tsconfig.json
+++ b/benchmarks/client-nav/scenarios/preload/solid/tsconfig.json
@@ -2,7 +2,7 @@
"extends": "../../../../../tsconfig.json",
"compilerOptions": {
"jsx": "preserve",
- "jsxImportSource": "solid-js",
+ "jsxImportSource": "@solidjs/web",
"allowImportingTsExtensions": true,
"types": ["node", "vite/client", "vitest/globals"]
},
diff --git a/benchmarks/client-nav/scenarios/preload/solid/vite.config.ts b/benchmarks/client-nav/scenarios/preload/solid/vite.config.ts
index 07014e6124..99f5b9fad5 100644
--- a/benchmarks/client-nav/scenarios/preload/solid/vite.config.ts
+++ b/benchmarks/client-nav/scenarios/preload/solid/vite.config.ts
@@ -1,9 +1,8 @@
import { fileURLToPath } from 'node:url'
import { defineConfig } from 'vitest/config'
-import solid from 'vite-plugin-solid'
+import solid from '@solidjs/vite-plugin'
import codspeedPlugin from '@codspeed/vitest-plugin'
import { tanstackRouter } from '@tanstack/router-plugin/vite'
-import { cpuSimulationExecArgv } from '../../../../cpu-simulation'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -20,7 +19,7 @@ export default defineConfig({
routesDirectory: `${rootDir}src/routes`,
generatedRouteTree: `${rootDir}src/routeTree.gen.ts`,
}),
- solid({ hot: false, dev: false }),
+ solid({ refresh: false, dev: false }),
],
build: {
outDir: './dist',
@@ -36,7 +35,6 @@ export default defineConfig({
conditions: ['solid', 'browser'],
},
test: {
- execArgv: cpuSimulationExecArgv(),
name: '@benchmarks/client-nav preload (solid)',
watch: false,
environment: 'jsdom',
diff --git a/benchmarks/client-nav/scenarios/preload/vue/speed.bench.ts b/benchmarks/client-nav/scenarios/preload/vue/speed.bench.ts
index e0ec83619b..38a2e9e664 100644
--- a/benchmarks/client-nav/scenarios/preload/vue/speed.bench.ts
+++ b/benchmarks/client-nav/scenarios/preload/vue/speed.bench.ts
@@ -1,19 +1,32 @@
-import { test } from 'vitest'
-import { benchLifecycle } from '../../../../cpu-simulation'
+import { afterEach, beforeEach, bench, describe } from 'vitest'
import { benchOptions, ticksPerIteration } from '../shared'
import { setup } from './setup'
-test('client-preload', async ({ bench }) => {
- const scenario = setup()
+describe('client-preload', () => {
+ const test = setup()
- await bench(
+ /**
+ * Running `vitest bench` ignores suite hooks, so Tinybench uses the `setup`
+ * and `teardown` options below. CodSpeed bypasses those options but supports
+ * `beforeEach` and `afterEach`. Only one lifecycle path runs in either
+ * environment, and every measured invocation receives fresh application state.
+ */
+
+ beforeEach(test.before)
+ afterEach(test.after)
+
+ bench(
'client-preload interaction loop (vue)',
- benchLifecycle(scenario),
async () => {
for (let i = 0; i < ticksPerIteration; i++) {
- await scenario.tick()
+ await test.tick()
}
- await scenario.finishBatch()
+ await test.finishBatch()
},
- ).run(benchOptions)
+ {
+ ...benchOptions,
+ setup: test.before,
+ teardown: test.after,
+ },
+ )
})
diff --git a/benchmarks/client-nav/scenarios/preload/vue/src/routeTree.gen.ts b/benchmarks/client-nav/scenarios/preload/vue/src/routeTree.gen.ts
index 5f95d09da0..05a751060b 100644
--- a/benchmarks/client-nav/scenarios/preload/vue/src/routeTree.gen.ts
+++ b/benchmarks/client-nav/scenarios/preload/vue/src/routeTree.gen.ts
@@ -9,20 +9,20 @@
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
import { Route as rootRouteImport } from './routes/__root'
-import { Route as IndexRouteImport } from './routes/index'
import { Route as DocsRouteImport } from './routes/docs'
+import { Route as IndexRouteImport } from './routes/index'
import { Route as SectionsSectionRouteImport } from './routes/sections.$section'
-const IndexRoute = IndexRouteImport.update({
- id: '/',
- path: '/',
- getParentRoute: () => rootRouteImport,
-} as any)
const DocsRoute = DocsRouteImport.update({
id: '/docs',
path: '/docs',
getParentRoute: () => rootRouteImport,
} as any)
+const IndexRoute = IndexRouteImport.update({
+ id: '/',
+ path: '/',
+ getParentRoute: () => rootRouteImport,
+} as any)
const SectionsSectionRoute = SectionsSectionRouteImport.update({
id: '/sections/$section',
path: '/sections/$section',
@@ -61,13 +61,6 @@ export interface RootRouteChildren {
declare module '@tanstack/vue-router' {
interface FileRoutesByPath {
- '/': {
- id: '/'
- path: '/'
- fullPath: '/'
- preLoaderRoute: typeof IndexRouteImport
- parentRoute: typeof rootRouteImport
- }
'/docs': {
id: '/docs'
path: '/docs'
@@ -75,6 +68,13 @@ declare module '@tanstack/vue-router' {
preLoaderRoute: typeof DocsRouteImport
parentRoute: typeof rootRouteImport
}
+ '/': {
+ id: '/'
+ path: '/'
+ fullPath: '/'
+ preLoaderRoute: typeof IndexRouteImport
+ parentRoute: typeof rootRouteImport
+ }
'/sections/$section': {
id: '/sections/$section'
path: '/sections/$section'
diff --git a/benchmarks/client-nav/scenarios/preload/vue/vite.config.ts b/benchmarks/client-nav/scenarios/preload/vue/vite.config.ts
index 8d00e66378..25e64b5bef 100644
--- a/benchmarks/client-nav/scenarios/preload/vue/vite.config.ts
+++ b/benchmarks/client-nav/scenarios/preload/vue/vite.config.ts
@@ -4,7 +4,6 @@ import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import codspeedPlugin from '@codspeed/vitest-plugin'
import { tanstackRouter } from '@tanstack/router-plugin/vite'
-import { cpuSimulationExecArgv } from '../../../../cpu-simulation'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -35,7 +34,6 @@ export default defineConfig({
},
},
test: {
- execArgv: cpuSimulationExecArgv(),
name: '@benchmarks/client-nav preload (vue)',
watch: false,
environment: 'jsdom',
diff --git a/benchmarks/client-nav/scenarios/rewrites/react/speed.bench.ts b/benchmarks/client-nav/scenarios/rewrites/react/speed.bench.ts
index dd1b6f3686..8e79c6db7e 100644
--- a/benchmarks/client-nav/scenarios/rewrites/react/speed.bench.ts
+++ b/benchmarks/client-nav/scenarios/rewrites/react/speed.bench.ts
@@ -1,19 +1,32 @@
-import { test } from 'vitest'
-import { benchLifecycle } from '../../../../cpu-simulation'
+import { afterEach, beforeEach, bench, describe } from 'vitest'
import { benchOptions, ticksPerIteration } from '../shared'
import { setup } from './setup'
-test('client-rewrites', async ({ bench }) => {
- const scenario = setup()
+describe('client-rewrites', () => {
+ const test = setup()
- await bench(
+ /**
+ * Running `vitest bench` ignores suite hooks, so Tinybench uses the `setup`
+ * and `teardown` options below. CodSpeed bypasses those options but supports
+ * `beforeEach` and `afterEach`. Only one lifecycle path runs in either
+ * environment, and every measured invocation receives fresh application state.
+ */
+
+ beforeEach(test.before)
+ afterEach(test.after)
+
+ bench(
'client-rewrites navigation loop (react)',
- benchLifecycle(scenario),
async () => {
for (let i = 0; i < ticksPerIteration; i++) {
- await scenario.tick()
+ await test.tick()
}
- await scenario.finishBatch()
+ await test.finishBatch()
},
- ).run(benchOptions)
+ {
+ ...benchOptions,
+ setup: test.before,
+ teardown: test.after,
+ },
+ )
})
diff --git a/benchmarks/client-nav/scenarios/rewrites/react/vite.config.ts b/benchmarks/client-nav/scenarios/rewrites/react/vite.config.ts
index e79e8522e9..8c07cff4fb 100644
--- a/benchmarks/client-nav/scenarios/rewrites/react/vite.config.ts
+++ b/benchmarks/client-nav/scenarios/rewrites/react/vite.config.ts
@@ -3,7 +3,6 @@ import { defineConfig } from 'vitest/config'
import react from '@vitejs/plugin-react'
import codspeedPlugin from '@codspeed/vitest-plugin'
import { tanstackRouter } from '@tanstack/router-plugin/vite'
-import { cpuSimulationExecArgv } from '../../../../cpu-simulation'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -33,7 +32,6 @@ export default defineConfig({
},
},
test: {
- execArgv: cpuSimulationExecArgv(),
name: '@benchmarks/client-nav rewrites (react)',
watch: false,
environment: 'jsdom',
diff --git a/benchmarks/client-nav/scenarios/rewrites/solid/speed.bench.ts b/benchmarks/client-nav/scenarios/rewrites/solid/speed.bench.ts
index 9c4313e2ff..cf70bcaa40 100644
--- a/benchmarks/client-nav/scenarios/rewrites/solid/speed.bench.ts
+++ b/benchmarks/client-nav/scenarios/rewrites/solid/speed.bench.ts
@@ -1,19 +1,32 @@
-import { test } from 'vitest'
-import { benchLifecycle } from '../../../../cpu-simulation'
+import { afterEach, beforeEach, bench, describe } from 'vitest'
import { benchOptions, ticksPerIteration } from '../shared'
import { setup } from './setup'
-test('client-rewrites', async ({ bench }) => {
- const scenario = setup()
+describe('client-rewrites', () => {
+ const test = setup()
- await bench(
+ /**
+ * Running `vitest bench` ignores suite hooks, so Tinybench uses the `setup`
+ * and `teardown` options below. CodSpeed bypasses those options but supports
+ * `beforeEach` and `afterEach`. Only one lifecycle path runs in either
+ * environment, and every measured invocation receives fresh application state.
+ */
+
+ beforeEach(test.before)
+ afterEach(test.after)
+
+ bench(
'client-rewrites navigation loop (solid)',
- benchLifecycle(scenario),
async () => {
for (let i = 0; i < ticksPerIteration; i++) {
- await scenario.tick()
+ await test.tick()
}
- await scenario.finishBatch()
+ await test.finishBatch()
},
- ).run(benchOptions)
+ {
+ ...benchOptions,
+ setup: test.before,
+ teardown: test.after,
+ },
+ )
})
diff --git a/benchmarks/client-nav/scenarios/rewrites/solid/src/main.tsx b/benchmarks/client-nav/scenarios/rewrites/solid/src/main.tsx
index 31f1d07650..9f34e66a66 100644
--- a/benchmarks/client-nav/scenarios/rewrites/solid/src/main.tsx
+++ b/benchmarks/client-nav/scenarios/rewrites/solid/src/main.tsx
@@ -1,5 +1,5 @@
import type { RouterHistory } from '@tanstack/history'
-import { render } from 'solid-js/web'
+import { render } from '@solidjs/web'
import { RouterProvider, createRouter } from '@tanstack/solid-router'
import { routeTree } from './routeTree.gen'
import { basepath, localeRewrite } from '../../shared'
diff --git a/benchmarks/client-nav/scenarios/rewrites/solid/tsconfig.json b/benchmarks/client-nav/scenarios/rewrites/solid/tsconfig.json
index 98d76ad6b8..8c57ff876a 100644
--- a/benchmarks/client-nav/scenarios/rewrites/solid/tsconfig.json
+++ b/benchmarks/client-nav/scenarios/rewrites/solid/tsconfig.json
@@ -2,7 +2,7 @@
"extends": "../../../../../tsconfig.json",
"compilerOptions": {
"jsx": "preserve",
- "jsxImportSource": "solid-js",
+ "jsxImportSource": "@solidjs/web",
"allowImportingTsExtensions": true,
"types": ["node", "vite/client", "vitest/globals"]
},
diff --git a/benchmarks/client-nav/scenarios/rewrites/solid/vite.config.ts b/benchmarks/client-nav/scenarios/rewrites/solid/vite.config.ts
index c9e99b7d60..c499a0a89b 100644
--- a/benchmarks/client-nav/scenarios/rewrites/solid/vite.config.ts
+++ b/benchmarks/client-nav/scenarios/rewrites/solid/vite.config.ts
@@ -1,9 +1,8 @@
import { fileURLToPath } from 'node:url'
import { defineConfig } from 'vitest/config'
-import solid from 'vite-plugin-solid'
+import solid from '@solidjs/vite-plugin'
import codspeedPlugin from '@codspeed/vitest-plugin'
import { tanstackRouter } from '@tanstack/router-plugin/vite'
-import { cpuSimulationExecArgv } from '../../../../cpu-simulation'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -20,7 +19,7 @@ export default defineConfig({
routesDirectory: `${rootDir}src/routes`,
generatedRouteTree: `${rootDir}src/routeTree.gen.ts`,
}),
- solid({ hot: false, dev: false }),
+ solid({ refresh: false, dev: false }),
],
build: {
outDir: './dist',
@@ -36,7 +35,6 @@ export default defineConfig({
conditions: ['solid', 'browser'],
},
test: {
- execArgv: cpuSimulationExecArgv(),
name: '@benchmarks/client-nav rewrites (solid)',
watch: false,
environment: 'jsdom',
diff --git a/benchmarks/client-nav/scenarios/rewrites/vue/speed.bench.ts b/benchmarks/client-nav/scenarios/rewrites/vue/speed.bench.ts
index e96aff39eb..2dc9eb2679 100644
--- a/benchmarks/client-nav/scenarios/rewrites/vue/speed.bench.ts
+++ b/benchmarks/client-nav/scenarios/rewrites/vue/speed.bench.ts
@@ -1,19 +1,32 @@
-import { test } from 'vitest'
-import { benchLifecycle } from '../../../../cpu-simulation'
+import { afterEach, beforeEach, bench, describe } from 'vitest'
import { benchOptions, ticksPerIteration } from '../shared'
import { setup } from './setup'
-test('client-rewrites', async ({ bench }) => {
- const scenario = setup()
+describe('client-rewrites', () => {
+ const test = setup()
- await bench(
+ /**
+ * Running `vitest bench` ignores suite hooks, so Tinybench uses the `setup`
+ * and `teardown` options below. CodSpeed bypasses those options but supports
+ * `beforeEach` and `afterEach`. Only one lifecycle path runs in either
+ * environment, and every measured invocation receives fresh application state.
+ */
+
+ beforeEach(test.before)
+ afterEach(test.after)
+
+ bench(
'client-rewrites navigation loop (vue)',
- benchLifecycle(scenario),
async () => {
for (let i = 0; i < ticksPerIteration; i++) {
- await scenario.tick()
+ await test.tick()
}
- await scenario.finishBatch()
+ await test.finishBatch()
},
- ).run(benchOptions)
+ {
+ ...benchOptions,
+ setup: test.before,
+ teardown: test.after,
+ },
+ )
})
diff --git a/benchmarks/client-nav/scenarios/rewrites/vue/vite.config.ts b/benchmarks/client-nav/scenarios/rewrites/vue/vite.config.ts
index 1a795a4e1d..39e22b6c3e 100644
--- a/benchmarks/client-nav/scenarios/rewrites/vue/vite.config.ts
+++ b/benchmarks/client-nav/scenarios/rewrites/vue/vite.config.ts
@@ -4,7 +4,6 @@ import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import codspeedPlugin from '@codspeed/vitest-plugin'
import { tanstackRouter } from '@tanstack/router-plugin/vite'
-import { cpuSimulationExecArgv } from '../../../../cpu-simulation'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -35,7 +34,6 @@ export default defineConfig({
},
},
test: {
- execArgv: cpuSimulationExecArgv(),
name: '@benchmarks/client-nav rewrites (vue)',
watch: false,
environment: 'jsdom',
diff --git a/benchmarks/client-nav/scenarios/route-tree-scale/react/speed.bench.ts b/benchmarks/client-nav/scenarios/route-tree-scale/react/speed.bench.ts
index 6f4b448775..337ba35b73 100644
--- a/benchmarks/client-nav/scenarios/route-tree-scale/react/speed.bench.ts
+++ b/benchmarks/client-nav/scenarios/route-tree-scale/react/speed.bench.ts
@@ -1,19 +1,32 @@
-import { test } from 'vitest'
-import { benchLifecycle } from '../../../../cpu-simulation'
+import { afterEach, beforeEach, bench, describe } from 'vitest'
import { benchOptions, ticksPerIteration } from '../shared'
import { setup } from './setup'
-test('client-route-tree-scale', async ({ bench }) => {
- const scenario = setup()
+describe('client-route-tree-scale', () => {
+ const test = setup()
- await bench(
+ /**
+ * Running `vitest bench` ignores suite hooks, so Tinybench uses the `setup`
+ * and `teardown` options below. CodSpeed bypasses those options but supports
+ * `beforeEach` and `afterEach`. Only one lifecycle path runs in either
+ * environment, and every measured invocation receives fresh application state.
+ */
+
+ beforeEach(test.before)
+ afterEach(test.after)
+
+ bench(
'client-route-tree-scale navigation loop (react)',
- benchLifecycle(scenario),
async () => {
for (let i = 0; i < ticksPerIteration; i++) {
- await scenario.tick()
+ await test.tick()
}
- await scenario.finishBatch()
+ await test.finishBatch()
},
- ).run(benchOptions)
+ {
+ ...benchOptions,
+ setup: test.before,
+ teardown: test.after,
+ },
+ )
})
diff --git a/benchmarks/client-nav/scenarios/route-tree-scale/react/vite.config.ts b/benchmarks/client-nav/scenarios/route-tree-scale/react/vite.config.ts
index 0f588fda53..686907a506 100644
--- a/benchmarks/client-nav/scenarios/route-tree-scale/react/vite.config.ts
+++ b/benchmarks/client-nav/scenarios/route-tree-scale/react/vite.config.ts
@@ -3,7 +3,6 @@ import { defineConfig } from 'vitest/config'
import react from '@vitejs/plugin-react'
import codspeedPlugin from '@codspeed/vitest-plugin'
import { tanstackRouter } from '@tanstack/router-plugin/vite'
-import { cpuSimulationExecArgv } from '../../../../cpu-simulation'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -36,7 +35,6 @@ export default defineConfig({
},
},
test: {
- execArgv: cpuSimulationExecArgv(),
name: '@benchmarks/client-nav route-tree-scale (react)',
watch: false,
environment: 'jsdom',
diff --git a/benchmarks/client-nav/scenarios/route-tree-scale/solid/speed.bench.ts b/benchmarks/client-nav/scenarios/route-tree-scale/solid/speed.bench.ts
index 9244ef1350..545b501617 100644
--- a/benchmarks/client-nav/scenarios/route-tree-scale/solid/speed.bench.ts
+++ b/benchmarks/client-nav/scenarios/route-tree-scale/solid/speed.bench.ts
@@ -1,19 +1,32 @@
-import { test } from 'vitest'
-import { benchLifecycle } from '../../../../cpu-simulation'
+import { afterEach, beforeEach, bench, describe } from 'vitest'
import { benchOptions, ticksPerIteration } from '../shared'
import { setup } from './setup'
-test('client-route-tree-scale', async ({ bench }) => {
- const scenario = setup()
+describe('client-route-tree-scale', () => {
+ const test = setup()
- await bench(
+ /**
+ * Running `vitest bench` ignores suite hooks, so Tinybench uses the `setup`
+ * and `teardown` options below. CodSpeed bypasses those options but supports
+ * `beforeEach` and `afterEach`. Only one lifecycle path runs in either
+ * environment, and every measured invocation receives fresh application state.
+ */
+
+ beforeEach(test.before)
+ afterEach(test.after)
+
+ bench(
'client-route-tree-scale navigation loop (solid)',
- benchLifecycle(scenario),
async () => {
for (let i = 0; i < ticksPerIteration; i++) {
- await scenario.tick()
+ await test.tick()
}
- await scenario.finishBatch()
+ await test.finishBatch()
},
- ).run(benchOptions)
+ {
+ ...benchOptions,
+ setup: test.before,
+ teardown: test.after,
+ },
+ )
})
diff --git a/benchmarks/client-nav/scenarios/route-tree-scale/solid/src/main.tsx b/benchmarks/client-nav/scenarios/route-tree-scale/solid/src/main.tsx
index fa9d239418..f7148011f5 100644
--- a/benchmarks/client-nav/scenarios/route-tree-scale/solid/src/main.tsx
+++ b/benchmarks/client-nav/scenarios/route-tree-scale/solid/src/main.tsx
@@ -1,5 +1,5 @@
import type { RouterHistory } from '@tanstack/history'
-import { render } from 'solid-js/web'
+import { render } from '@solidjs/web'
import { RouterProvider, createRouter } from '@tanstack/solid-router'
import { routeTree } from './routeTree.gen'
diff --git a/benchmarks/client-nav/scenarios/route-tree-scale/solid/src/routeTree.gen.ts b/benchmarks/client-nav/scenarios/route-tree-scale/solid/src/routeTree.gen.ts
index e6f3596562..20b4af6146 100644
--- a/benchmarks/client-nav/scenarios/route-tree-scale/solid/src/routeTree.gen.ts
+++ b/benchmarks/client-nav/scenarios/route-tree-scale/solid/src/routeTree.gen.ts
@@ -9,72 +9,48 @@
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
import { Route as rootRouteImport } from './routes/__root'
-import { Route as IndexRouteImport } from './routes/index'
-import { Route as LayoutRouteImport } from './routes/_layout'
-import { Route as SecARouteImport } from './routes/sec-a'
-import { Route as SecBRouteImport } from './routes/sec-b'
-import { Route as SecCRouteImport } from './routes/sec-c'
-import { Route as SecDRouteImport } from './routes/sec-d'
-import { Route as SecERouteImport } from './routes/sec-e'
import { Route as SecFRouteImport } from './routes/sec-f'
-import { Route as marketingPricingRouteImport } from './routes/(marketing)/pricing'
-import { Route as marketingPromoRouteImport } from './routes/(marketing)/promo'
-import { Route as LayoutAlphaRouteImport } from './routes/_layout.alpha'
-import { Route as LayoutBetaRouteImport } from './routes/_layout.beta'
-import { Route as FilesSplatRouteImport } from './routes/files.$'
-import { Route as ReleaseVChar123versionChar125RouteImport } from './routes/release.v{$version}'
-import { Route as SecAIndexRouteImport } from './routes/sec-a.index'
-import { Route as SecAIdRouteImport } from './routes/sec-a.$id'
-import { Route as SecAAboutRouteImport } from './routes/sec-a.about'
-import { Route as SecASettingsRouteImport } from './routes/sec-a.settings'
-import { Route as SecBIndexRouteImport } from './routes/sec-b.index'
-import { Route as SecBIdRouteImport } from './routes/sec-b.$id'
-import { Route as SecBAboutRouteImport } from './routes/sec-b.about'
-import { Route as SecBSettingsRouteImport } from './routes/sec-b.settings'
-import { Route as SecCIndexRouteImport } from './routes/sec-c.index'
-import { Route as SecCIdRouteImport } from './routes/sec-c.$id'
-import { Route as SecCAboutRouteImport } from './routes/sec-c.about'
-import { Route as SecCSettingsRouteImport } from './routes/sec-c.settings'
-import { Route as SecDIndexRouteImport } from './routes/sec-d.index'
-import { Route as SecDIdRouteImport } from './routes/sec-d.$id'
-import { Route as SecDAboutRouteImport } from './routes/sec-d.about'
-import { Route as SecDSettingsRouteImport } from './routes/sec-d.settings'
-import { Route as SecEIndexRouteImport } from './routes/sec-e.index'
-import { Route as SecEIdRouteImport } from './routes/sec-e.$id'
-import { Route as SecEAboutRouteImport } from './routes/sec-e.about'
-import { Route as SecESettingsRouteImport } from './routes/sec-e.settings'
+import { Route as SecERouteImport } from './routes/sec-e'
+import { Route as SecDRouteImport } from './routes/sec-d'
+import { Route as SecCRouteImport } from './routes/sec-c'
+import { Route as SecBRouteImport } from './routes/sec-b'
+import { Route as SecARouteImport } from './routes/sec-a'
+import { Route as LayoutRouteImport } from './routes/_layout'
+import { Route as IndexRouteImport } from './routes/index'
import { Route as SecFIndexRouteImport } from './routes/sec-f.index'
-import { Route as SecFIdRouteImport } from './routes/sec-f.$id'
-import { Route as SecFAboutRouteImport } from './routes/sec-f.about'
+import { Route as SecEIndexRouteImport } from './routes/sec-e.index'
+import { Route as SecDIndexRouteImport } from './routes/sec-d.index'
+import { Route as SecCIndexRouteImport } from './routes/sec-c.index'
+import { Route as SecBIndexRouteImport } from './routes/sec-b.index'
+import { Route as SecAIndexRouteImport } from './routes/sec-a.index'
import { Route as SecFSettingsRouteImport } from './routes/sec-f.settings'
+import { Route as SecFAboutRouteImport } from './routes/sec-f.about'
+import { Route as SecFIdRouteImport } from './routes/sec-f.$id'
+import { Route as SecESettingsRouteImport } from './routes/sec-e.settings'
+import { Route as SecEAboutRouteImport } from './routes/sec-e.about'
+import { Route as SecEIdRouteImport } from './routes/sec-e.$id'
+import { Route as SecDSettingsRouteImport } from './routes/sec-d.settings'
+import { Route as SecDAboutRouteImport } from './routes/sec-d.about'
+import { Route as SecDIdRouteImport } from './routes/sec-d.$id'
+import { Route as SecCSettingsRouteImport } from './routes/sec-c.settings'
+import { Route as SecCAboutRouteImport } from './routes/sec-c.about'
+import { Route as SecCIdRouteImport } from './routes/sec-c.$id'
+import { Route as SecBSettingsRouteImport } from './routes/sec-b.settings'
+import { Route as SecBAboutRouteImport } from './routes/sec-b.about'
+import { Route as SecBIdRouteImport } from './routes/sec-b.$id'
+import { Route as SecASettingsRouteImport } from './routes/sec-a.settings'
+import { Route as SecAAboutRouteImport } from './routes/sec-a.about'
+import { Route as SecAIdRouteImport } from './routes/sec-a.$id'
+import { Route as ReleaseVChar123versionChar125RouteImport } from './routes/release.v{$version}'
+import { Route as FilesSplatRouteImport } from './routes/files.$'
+import { Route as LayoutBetaRouteImport } from './routes/_layout.beta'
+import { Route as LayoutAlphaRouteImport } from './routes/_layout.alpha'
+import { Route as marketingPromoRouteImport } from './routes/(marketing)/promo'
+import { Route as marketingPricingRouteImport } from './routes/(marketing)/pricing'
-const IndexRoute = IndexRouteImport.update({
- id: '/',
- path: '/',
- getParentRoute: () => rootRouteImport,
-} as any)
-const LayoutRoute = LayoutRouteImport.update({
- id: '/_layout',
- getParentRoute: () => rootRouteImport,
-} as any)
-const SecARoute = SecARouteImport.update({
- id: '/sec-a',
- path: '/sec-a',
- getParentRoute: () => rootRouteImport,
-} as any)
-const SecBRoute = SecBRouteImport.update({
- id: '/sec-b',
- path: '/sec-b',
- getParentRoute: () => rootRouteImport,
-} as any)
-const SecCRoute = SecCRouteImport.update({
- id: '/sec-c',
- path: '/sec-c',
- getParentRoute: () => rootRouteImport,
-} as any)
-const SecDRoute = SecDRouteImport.update({
- id: '/sec-d',
- path: '/sec-d',
+const SecFRoute = SecFRouteImport.update({
+ id: '/sec-f',
+ path: '/sec-f',
getParentRoute: () => rootRouteImport,
} as any)
const SecERoute = SecERouteImport.update({
@@ -82,150 +58,68 @@ const SecERoute = SecERouteImport.update({
path: '/sec-e',
getParentRoute: () => rootRouteImport,
} as any)
-const SecFRoute = SecFRouteImport.update({
- id: '/sec-f',
- path: '/sec-f',
+const SecDRoute = SecDRouteImport.update({
+ id: '/sec-d',
+ path: '/sec-d',
getParentRoute: () => rootRouteImport,
} as any)
-const marketingPricingRoute = marketingPricingRouteImport.update({
- id: '/(marketing)/pricing',
- path: '/pricing',
+const SecCRoute = SecCRouteImport.update({
+ id: '/sec-c',
+ path: '/sec-c',
getParentRoute: () => rootRouteImport,
} as any)
-const marketingPromoRoute = marketingPromoRouteImport.update({
- id: '/(marketing)/promo',
- path: '/promo',
+const SecBRoute = SecBRouteImport.update({
+ id: '/sec-b',
+ path: '/sec-b',
getParentRoute: () => rootRouteImport,
} as any)
-const LayoutAlphaRoute = LayoutAlphaRouteImport.update({
- id: '/alpha',
- path: '/alpha',
- getParentRoute: () => LayoutRoute,
-} as any)
-const LayoutBetaRoute = LayoutBetaRouteImport.update({
- id: '/beta',
- path: '/beta',
- getParentRoute: () => LayoutRoute,
-} as any)
-const FilesSplatRoute = FilesSplatRouteImport.update({
- id: '/files/$',
- path: '/files/$',
+const SecARoute = SecARouteImport.update({
+ id: '/sec-a',
+ path: '/sec-a',
getParentRoute: () => rootRouteImport,
} as any)
-const ReleaseVChar123versionChar125Route =
- ReleaseVChar123versionChar125RouteImport.update({
- id: '/release/v{$version}',
- path: '/release/v{$version}',
- getParentRoute: () => rootRouteImport,
- } as any)
-const SecAIndexRoute = SecAIndexRouteImport.update({
+const LayoutRoute = LayoutRouteImport.update({
+ id: '/_layout',
+ getParentRoute: () => rootRouteImport,
+} as any)
+const IndexRoute = IndexRouteImport.update({
id: '/',
path: '/',
- getParentRoute: () => SecARoute,
-} as any)
-const SecAIdRoute = SecAIdRouteImport.update({
- id: '/$id',
- path: '/$id',
- getParentRoute: () => SecARoute,
-} as any)
-const SecAAboutRoute = SecAAboutRouteImport.update({
- id: '/about',
- path: '/about',
- getParentRoute: () => SecARoute,
-} as any)
-const SecASettingsRoute = SecASettingsRouteImport.update({
- id: '/settings',
- path: '/settings',
- getParentRoute: () => SecARoute,
-} as any)
-const SecBIndexRoute = SecBIndexRouteImport.update({
- id: '/',
- path: '/',
- getParentRoute: () => SecBRoute,
-} as any)
-const SecBIdRoute = SecBIdRouteImport.update({
- id: '/$id',
- path: '/$id',
- getParentRoute: () => SecBRoute,
-} as any)
-const SecBAboutRoute = SecBAboutRouteImport.update({
- id: '/about',
- path: '/about',
- getParentRoute: () => SecBRoute,
-} as any)
-const SecBSettingsRoute = SecBSettingsRouteImport.update({
- id: '/settings',
- path: '/settings',
- getParentRoute: () => SecBRoute,
-} as any)
-const SecCIndexRoute = SecCIndexRouteImport.update({
- id: '/',
- path: '/',
- getParentRoute: () => SecCRoute,
-} as any)
-const SecCIdRoute = SecCIdRouteImport.update({
- id: '/$id',
- path: '/$id',
- getParentRoute: () => SecCRoute,
-} as any)
-const SecCAboutRoute = SecCAboutRouteImport.update({
- id: '/about',
- path: '/about',
- getParentRoute: () => SecCRoute,
-} as any)
-const SecCSettingsRoute = SecCSettingsRouteImport.update({
- id: '/settings',
- path: '/settings',
- getParentRoute: () => SecCRoute,
-} as any)
-const SecDIndexRoute = SecDIndexRouteImport.update({
- id: '/',
- path: '/',
- getParentRoute: () => SecDRoute,
-} as any)
-const SecDIdRoute = SecDIdRouteImport.update({
- id: '/$id',
- path: '/$id',
- getParentRoute: () => SecDRoute,
-} as any)
-const SecDAboutRoute = SecDAboutRouteImport.update({
- id: '/about',
- path: '/about',
- getParentRoute: () => SecDRoute,
-} as any)
-const SecDSettingsRoute = SecDSettingsRouteImport.update({
- id: '/settings',
- path: '/settings',
- getParentRoute: () => SecDRoute,
-} as any)
-const SecEIndexRoute = SecEIndexRouteImport.update({
- id: '/',
- path: '/',
- getParentRoute: () => SecERoute,
-} as any)
-const SecEIdRoute = SecEIdRouteImport.update({
- id: '/$id',
- path: '/$id',
- getParentRoute: () => SecERoute,
-} as any)
-const SecEAboutRoute = SecEAboutRouteImport.update({
- id: '/about',
- path: '/about',
- getParentRoute: () => SecERoute,
-} as any)
-const SecESettingsRoute = SecESettingsRouteImport.update({
- id: '/settings',
- path: '/settings',
- getParentRoute: () => SecERoute,
+ getParentRoute: () => rootRouteImport,
} as any)
const SecFIndexRoute = SecFIndexRouteImport.update({
id: '/',
path: '/',
getParentRoute: () => SecFRoute,
} as any)
-const SecFIdRoute = SecFIdRouteImport.update({
- id: '/$id',
- path: '/$id',
+const SecEIndexRoute = SecEIndexRouteImport.update({
+ id: '/',
+ path: '/',
+ getParentRoute: () => SecERoute,
+} as any)
+const SecDIndexRoute = SecDIndexRouteImport.update({
+ id: '/',
+ path: '/',
+ getParentRoute: () => SecDRoute,
+} as any)
+const SecCIndexRoute = SecCIndexRouteImport.update({
+ id: '/',
+ path: '/',
+ getParentRoute: () => SecCRoute,
+} as any)
+const SecBIndexRoute = SecBIndexRouteImport.update({
+ id: '/',
+ path: '/',
+ getParentRoute: () => SecBRoute,
+} as any)
+const SecAIndexRoute = SecAIndexRouteImport.update({
+ id: '/',
+ path: '/',
+ getParentRoute: () => SecARoute,
+} as any)
+const SecFSettingsRoute = SecFSettingsRouteImport.update({
+ id: '/settings',
+ path: '/settings',
getParentRoute: () => SecFRoute,
} as any)
const SecFAboutRoute = SecFAboutRouteImport.update({
@@ -233,10 +127,116 @@ const SecFAboutRoute = SecFAboutRouteImport.update({
path: '/about',
getParentRoute: () => SecFRoute,
} as any)
-const SecFSettingsRoute = SecFSettingsRouteImport.update({
+const SecFIdRoute = SecFIdRouteImport.update({
+ id: '/$id',
+ path: '/$id',
+ getParentRoute: () => SecFRoute,
+} as any)
+const SecESettingsRoute = SecESettingsRouteImport.update({
id: '/settings',
path: '/settings',
- getParentRoute: () => SecFRoute,
+ getParentRoute: () => SecERoute,
+} as any)
+const SecEAboutRoute = SecEAboutRouteImport.update({
+ id: '/about',
+ path: '/about',
+ getParentRoute: () => SecERoute,
+} as any)
+const SecEIdRoute = SecEIdRouteImport.update({
+ id: '/$id',
+ path: '/$id',
+ getParentRoute: () => SecERoute,
+} as any)
+const SecDSettingsRoute = SecDSettingsRouteImport.update({
+ id: '/settings',
+ path: '/settings',
+ getParentRoute: () => SecDRoute,
+} as any)
+const SecDAboutRoute = SecDAboutRouteImport.update({
+ id: '/about',
+ path: '/about',
+ getParentRoute: () => SecDRoute,
+} as any)
+const SecDIdRoute = SecDIdRouteImport.update({
+ id: '/$id',
+ path: '/$id',
+ getParentRoute: () => SecDRoute,
+} as any)
+const SecCSettingsRoute = SecCSettingsRouteImport.update({
+ id: '/settings',
+ path: '/settings',
+ getParentRoute: () => SecCRoute,
+} as any)
+const SecCAboutRoute = SecCAboutRouteImport.update({
+ id: '/about',
+ path: '/about',
+ getParentRoute: () => SecCRoute,
+} as any)
+const SecCIdRoute = SecCIdRouteImport.update({
+ id: '/$id',
+ path: '/$id',
+ getParentRoute: () => SecCRoute,
+} as any)
+const SecBSettingsRoute = SecBSettingsRouteImport.update({
+ id: '/settings',
+ path: '/settings',
+ getParentRoute: () => SecBRoute,
+} as any)
+const SecBAboutRoute = SecBAboutRouteImport.update({
+ id: '/about',
+ path: '/about',
+ getParentRoute: () => SecBRoute,
+} as any)
+const SecBIdRoute = SecBIdRouteImport.update({
+ id: '/$id',
+ path: '/$id',
+ getParentRoute: () => SecBRoute,
+} as any)
+const SecASettingsRoute = SecASettingsRouteImport.update({
+ id: '/settings',
+ path: '/settings',
+ getParentRoute: () => SecARoute,
+} as any)
+const SecAAboutRoute = SecAAboutRouteImport.update({
+ id: '/about',
+ path: '/about',
+ getParentRoute: () => SecARoute,
+} as any)
+const SecAIdRoute = SecAIdRouteImport.update({
+ id: '/$id',
+ path: '/$id',
+ getParentRoute: () => SecARoute,
+} as any)
+const ReleaseVChar123versionChar125Route =
+ ReleaseVChar123versionChar125RouteImport.update({
+ id: '/release/v{$version}',
+ path: '/release/v{$version}',
+ getParentRoute: () => rootRouteImport,
+ } as any)
+const FilesSplatRoute = FilesSplatRouteImport.update({
+ id: '/files/$',
+ path: '/files/$',
+ getParentRoute: () => rootRouteImport,
+} as any)
+const LayoutBetaRoute = LayoutBetaRouteImport.update({
+ id: '/beta',
+ path: '/beta',
+ getParentRoute: () => LayoutRoute,
+} as any)
+const LayoutAlphaRoute = LayoutAlphaRouteImport.update({
+ id: '/alpha',
+ path: '/alpha',
+ getParentRoute: () => LayoutRoute,
+} as any)
+const marketingPromoRoute = marketingPromoRouteImport.update({
+ id: '/(marketing)/promo',
+ path: '/promo',
+ getParentRoute: () => rootRouteImport,
+} as any)
+const marketingPricingRoute = marketingPricingRouteImport.update({
+ id: '/(marketing)/pricing',
+ path: '/pricing',
+ getParentRoute: () => rootRouteImport,
} as any)
export interface FileRoutesByFullPath {
@@ -484,46 +484,11 @@ export interface RootRouteChildren {
declare module '@tanstack/solid-router' {
interface FileRoutesByPath {
- '/': {
- id: '/'
- path: '/'
- fullPath: '/'
- preLoaderRoute: typeof IndexRouteImport
- parentRoute: typeof rootRouteImport
- }
- '/_layout': {
- id: '/_layout'
- path: ''
- fullPath: '/'
- preLoaderRoute: typeof LayoutRouteImport
- parentRoute: typeof rootRouteImport
- }
- '/sec-a': {
- id: '/sec-a'
- path: '/sec-a'
- fullPath: '/sec-a'
- preLoaderRoute: typeof SecARouteImport
- parentRoute: typeof rootRouteImport
- }
- '/sec-b': {
- id: '/sec-b'
- path: '/sec-b'
- fullPath: '/sec-b'
- preLoaderRoute: typeof SecBRouteImport
- parentRoute: typeof rootRouteImport
- }
- '/sec-c': {
- id: '/sec-c'
- path: '/sec-c'
- fullPath: '/sec-c'
- preLoaderRoute: typeof SecCRouteImport
- parentRoute: typeof rootRouteImport
- }
- '/sec-d': {
- id: '/sec-d'
- path: '/sec-d'
- fullPath: '/sec-d'
- preLoaderRoute: typeof SecDRouteImport
+ '/sec-f': {
+ id: '/sec-f'
+ path: '/sec-f'
+ fullPath: '/sec-f'
+ preLoaderRoute: typeof SecFRouteImport
parentRoute: typeof rootRouteImport
}
'/sec-e': {
@@ -533,194 +498,47 @@ declare module '@tanstack/solid-router' {
preLoaderRoute: typeof SecERouteImport
parentRoute: typeof rootRouteImport
}
- '/sec-f': {
- id: '/sec-f'
- path: '/sec-f'
- fullPath: '/sec-f'
- preLoaderRoute: typeof SecFRouteImport
+ '/sec-d': {
+ id: '/sec-d'
+ path: '/sec-d'
+ fullPath: '/sec-d'
+ preLoaderRoute: typeof SecDRouteImport
parentRoute: typeof rootRouteImport
}
- '/(marketing)/pricing': {
- id: '/(marketing)/pricing'
- path: '/pricing'
- fullPath: '/pricing'
- preLoaderRoute: typeof marketingPricingRouteImport
+ '/sec-c': {
+ id: '/sec-c'
+ path: '/sec-c'
+ fullPath: '/sec-c'
+ preLoaderRoute: typeof SecCRouteImport
parentRoute: typeof rootRouteImport
}
- '/(marketing)/promo': {
- id: '/(marketing)/promo'
- path: '/promo'
- fullPath: '/promo'
- preLoaderRoute: typeof marketingPromoRouteImport
+ '/sec-b': {
+ id: '/sec-b'
+ path: '/sec-b'
+ fullPath: '/sec-b'
+ preLoaderRoute: typeof SecBRouteImport
parentRoute: typeof rootRouteImport
}
- '/_layout/alpha': {
- id: '/_layout/alpha'
- path: '/alpha'
- fullPath: '/alpha'
- preLoaderRoute: typeof LayoutAlphaRouteImport
- parentRoute: typeof LayoutRoute
- }
- '/_layout/beta': {
- id: '/_layout/beta'
- path: '/beta'
- fullPath: '/beta'
- preLoaderRoute: typeof LayoutBetaRouteImport
- parentRoute: typeof LayoutRoute
- }
- '/files/$': {
- id: '/files/$'
- path: '/files/$'
- fullPath: '/files/$'
- preLoaderRoute: typeof FilesSplatRouteImport
+ '/sec-a': {
+ id: '/sec-a'
+ path: '/sec-a'
+ fullPath: '/sec-a'
+ preLoaderRoute: typeof SecARouteImport
parentRoute: typeof rootRouteImport
}
- '/release/v{$version}': {
- id: '/release/v{$version}'
- path: '/release/v{$version}'
- fullPath: '/release/v{$version}'
- preLoaderRoute: typeof ReleaseVChar123versionChar125RouteImport
+ '/_layout': {
+ id: '/_layout'
+ path: ''
+ fullPath: '/'
+ preLoaderRoute: typeof LayoutRouteImport
parentRoute: typeof rootRouteImport
}
- '/sec-a/': {
- id: '/sec-a/'
+ '/': {
+ id: '/'
path: '/'
- fullPath: '/sec-a/'
- preLoaderRoute: typeof SecAIndexRouteImport
- parentRoute: typeof SecARoute
- }
- '/sec-a/$id': {
- id: '/sec-a/$id'
- path: '/$id'
- fullPath: '/sec-a/$id'
- preLoaderRoute: typeof SecAIdRouteImport
- parentRoute: typeof SecARoute
- }
- '/sec-a/about': {
- id: '/sec-a/about'
- path: '/about'
- fullPath: '/sec-a/about'
- preLoaderRoute: typeof SecAAboutRouteImport
- parentRoute: typeof SecARoute
- }
- '/sec-a/settings': {
- id: '/sec-a/settings'
- path: '/settings'
- fullPath: '/sec-a/settings'
- preLoaderRoute: typeof SecASettingsRouteImport
- parentRoute: typeof SecARoute
- }
- '/sec-b/': {
- id: '/sec-b/'
- path: '/'
- fullPath: '/sec-b/'
- preLoaderRoute: typeof SecBIndexRouteImport
- parentRoute: typeof SecBRoute
- }
- '/sec-b/$id': {
- id: '/sec-b/$id'
- path: '/$id'
- fullPath: '/sec-b/$id'
- preLoaderRoute: typeof SecBIdRouteImport
- parentRoute: typeof SecBRoute
- }
- '/sec-b/about': {
- id: '/sec-b/about'
- path: '/about'
- fullPath: '/sec-b/about'
- preLoaderRoute: typeof SecBAboutRouteImport
- parentRoute: typeof SecBRoute
- }
- '/sec-b/settings': {
- id: '/sec-b/settings'
- path: '/settings'
- fullPath: '/sec-b/settings'
- preLoaderRoute: typeof SecBSettingsRouteImport
- parentRoute: typeof SecBRoute
- }
- '/sec-c/': {
- id: '/sec-c/'
- path: '/'
- fullPath: '/sec-c/'
- preLoaderRoute: typeof SecCIndexRouteImport
- parentRoute: typeof SecCRoute
- }
- '/sec-c/$id': {
- id: '/sec-c/$id'
- path: '/$id'
- fullPath: '/sec-c/$id'
- preLoaderRoute: typeof SecCIdRouteImport
- parentRoute: typeof SecCRoute
- }
- '/sec-c/about': {
- id: '/sec-c/about'
- path: '/about'
- fullPath: '/sec-c/about'
- preLoaderRoute: typeof SecCAboutRouteImport
- parentRoute: typeof SecCRoute
- }
- '/sec-c/settings': {
- id: '/sec-c/settings'
- path: '/settings'
- fullPath: '/sec-c/settings'
- preLoaderRoute: typeof SecCSettingsRouteImport
- parentRoute: typeof SecCRoute
- }
- '/sec-d/': {
- id: '/sec-d/'
- path: '/'
- fullPath: '/sec-d/'
- preLoaderRoute: typeof SecDIndexRouteImport
- parentRoute: typeof SecDRoute
- }
- '/sec-d/$id': {
- id: '/sec-d/$id'
- path: '/$id'
- fullPath: '/sec-d/$id'
- preLoaderRoute: typeof SecDIdRouteImport
- parentRoute: typeof SecDRoute
- }
- '/sec-d/about': {
- id: '/sec-d/about'
- path: '/about'
- fullPath: '/sec-d/about'
- preLoaderRoute: typeof SecDAboutRouteImport
- parentRoute: typeof SecDRoute
- }
- '/sec-d/settings': {
- id: '/sec-d/settings'
- path: '/settings'
- fullPath: '/sec-d/settings'
- preLoaderRoute: typeof SecDSettingsRouteImport
- parentRoute: typeof SecDRoute
- }
- '/sec-e/': {
- id: '/sec-e/'
- path: '/'
- fullPath: '/sec-e/'
- preLoaderRoute: typeof SecEIndexRouteImport
- parentRoute: typeof SecERoute
- }
- '/sec-e/$id': {
- id: '/sec-e/$id'
- path: '/$id'
- fullPath: '/sec-e/$id'
- preLoaderRoute: typeof SecEIdRouteImport
- parentRoute: typeof SecERoute
- }
- '/sec-e/about': {
- id: '/sec-e/about'
- path: '/about'
- fullPath: '/sec-e/about'
- preLoaderRoute: typeof SecEAboutRouteImport
- parentRoute: typeof SecERoute
- }
- '/sec-e/settings': {
- id: '/sec-e/settings'
- path: '/settings'
- fullPath: '/sec-e/settings'
- preLoaderRoute: typeof SecESettingsRouteImport
- parentRoute: typeof SecERoute
+ fullPath: '/'
+ preLoaderRoute: typeof IndexRouteImport
+ parentRoute: typeof rootRouteImport
}
'/sec-f/': {
id: '/sec-f/'
@@ -729,11 +547,46 @@ declare module '@tanstack/solid-router' {
preLoaderRoute: typeof SecFIndexRouteImport
parentRoute: typeof SecFRoute
}
- '/sec-f/$id': {
- id: '/sec-f/$id'
- path: '/$id'
- fullPath: '/sec-f/$id'
- preLoaderRoute: typeof SecFIdRouteImport
+ '/sec-e/': {
+ id: '/sec-e/'
+ path: '/'
+ fullPath: '/sec-e/'
+ preLoaderRoute: typeof SecEIndexRouteImport
+ parentRoute: typeof SecERoute
+ }
+ '/sec-d/': {
+ id: '/sec-d/'
+ path: '/'
+ fullPath: '/sec-d/'
+ preLoaderRoute: typeof SecDIndexRouteImport
+ parentRoute: typeof SecDRoute
+ }
+ '/sec-c/': {
+ id: '/sec-c/'
+ path: '/'
+ fullPath: '/sec-c/'
+ preLoaderRoute: typeof SecCIndexRouteImport
+ parentRoute: typeof SecCRoute
+ }
+ '/sec-b/': {
+ id: '/sec-b/'
+ path: '/'
+ fullPath: '/sec-b/'
+ preLoaderRoute: typeof SecBIndexRouteImport
+ parentRoute: typeof SecBRoute
+ }
+ '/sec-a/': {
+ id: '/sec-a/'
+ path: '/'
+ fullPath: '/sec-a/'
+ preLoaderRoute: typeof SecAIndexRouteImport
+ parentRoute: typeof SecARoute
+ }
+ '/sec-f/settings': {
+ id: '/sec-f/settings'
+ path: '/settings'
+ fullPath: '/sec-f/settings'
+ preLoaderRoute: typeof SecFSettingsRouteImport
parentRoute: typeof SecFRoute
}
'/sec-f/about': {
@@ -743,13 +596,160 @@ declare module '@tanstack/solid-router' {
preLoaderRoute: typeof SecFAboutRouteImport
parentRoute: typeof SecFRoute
}
- '/sec-f/settings': {
- id: '/sec-f/settings'
- path: '/settings'
- fullPath: '/sec-f/settings'
- preLoaderRoute: typeof SecFSettingsRouteImport
+ '/sec-f/$id': {
+ id: '/sec-f/$id'
+ path: '/$id'
+ fullPath: '/sec-f/$id'
+ preLoaderRoute: typeof SecFIdRouteImport
parentRoute: typeof SecFRoute
}
+ '/sec-e/settings': {
+ id: '/sec-e/settings'
+ path: '/settings'
+ fullPath: '/sec-e/settings'
+ preLoaderRoute: typeof SecESettingsRouteImport
+ parentRoute: typeof SecERoute
+ }
+ '/sec-e/about': {
+ id: '/sec-e/about'
+ path: '/about'
+ fullPath: '/sec-e/about'
+ preLoaderRoute: typeof SecEAboutRouteImport
+ parentRoute: typeof SecERoute
+ }
+ '/sec-e/$id': {
+ id: '/sec-e/$id'
+ path: '/$id'
+ fullPath: '/sec-e/$id'
+ preLoaderRoute: typeof SecEIdRouteImport
+ parentRoute: typeof SecERoute
+ }
+ '/sec-d/settings': {
+ id: '/sec-d/settings'
+ path: '/settings'
+ fullPath: '/sec-d/settings'
+ preLoaderRoute: typeof SecDSettingsRouteImport
+ parentRoute: typeof SecDRoute
+ }
+ '/sec-d/about': {
+ id: '/sec-d/about'
+ path: '/about'
+ fullPath: '/sec-d/about'
+ preLoaderRoute: typeof SecDAboutRouteImport
+ parentRoute: typeof SecDRoute
+ }
+ '/sec-d/$id': {
+ id: '/sec-d/$id'
+ path: '/$id'
+ fullPath: '/sec-d/$id'
+ preLoaderRoute: typeof SecDIdRouteImport
+ parentRoute: typeof SecDRoute
+ }
+ '/sec-c/settings': {
+ id: '/sec-c/settings'
+ path: '/settings'
+ fullPath: '/sec-c/settings'
+ preLoaderRoute: typeof SecCSettingsRouteImport
+ parentRoute: typeof SecCRoute
+ }
+ '/sec-c/about': {
+ id: '/sec-c/about'
+ path: '/about'
+ fullPath: '/sec-c/about'
+ preLoaderRoute: typeof SecCAboutRouteImport
+ parentRoute: typeof SecCRoute
+ }
+ '/sec-c/$id': {
+ id: '/sec-c/$id'
+ path: '/$id'
+ fullPath: '/sec-c/$id'
+ preLoaderRoute: typeof SecCIdRouteImport
+ parentRoute: typeof SecCRoute
+ }
+ '/sec-b/settings': {
+ id: '/sec-b/settings'
+ path: '/settings'
+ fullPath: '/sec-b/settings'
+ preLoaderRoute: typeof SecBSettingsRouteImport
+ parentRoute: typeof SecBRoute
+ }
+ '/sec-b/about': {
+ id: '/sec-b/about'
+ path: '/about'
+ fullPath: '/sec-b/about'
+ preLoaderRoute: typeof SecBAboutRouteImport
+ parentRoute: typeof SecBRoute
+ }
+ '/sec-b/$id': {
+ id: '/sec-b/$id'
+ path: '/$id'
+ fullPath: '/sec-b/$id'
+ preLoaderRoute: typeof SecBIdRouteImport
+ parentRoute: typeof SecBRoute
+ }
+ '/sec-a/settings': {
+ id: '/sec-a/settings'
+ path: '/settings'
+ fullPath: '/sec-a/settings'
+ preLoaderRoute: typeof SecASettingsRouteImport
+ parentRoute: typeof SecARoute
+ }
+ '/sec-a/about': {
+ id: '/sec-a/about'
+ path: '/about'
+ fullPath: '/sec-a/about'
+ preLoaderRoute: typeof SecAAboutRouteImport
+ parentRoute: typeof SecARoute
+ }
+ '/sec-a/$id': {
+ id: '/sec-a/$id'
+ path: '/$id'
+ fullPath: '/sec-a/$id'
+ preLoaderRoute: typeof SecAIdRouteImport
+ parentRoute: typeof SecARoute
+ }
+ '/release/v{$version}': {
+ id: '/release/v{$version}'
+ path: '/release/v{$version}'
+ fullPath: '/release/v{$version}'
+ preLoaderRoute: typeof ReleaseVChar123versionChar125RouteImport
+ parentRoute: typeof rootRouteImport
+ }
+ '/files/$': {
+ id: '/files/$'
+ path: '/files/$'
+ fullPath: '/files/$'
+ preLoaderRoute: typeof FilesSplatRouteImport
+ parentRoute: typeof rootRouteImport
+ }
+ '/_layout/beta': {
+ id: '/_layout/beta'
+ path: '/beta'
+ fullPath: '/beta'
+ preLoaderRoute: typeof LayoutBetaRouteImport
+ parentRoute: typeof LayoutRoute
+ }
+ '/_layout/alpha': {
+ id: '/_layout/alpha'
+ path: '/alpha'
+ fullPath: '/alpha'
+ preLoaderRoute: typeof LayoutAlphaRouteImport
+ parentRoute: typeof LayoutRoute
+ }
+ '/(marketing)/promo': {
+ id: '/(marketing)/promo'
+ path: '/promo'
+ fullPath: '/promo'
+ preLoaderRoute: typeof marketingPromoRouteImport
+ parentRoute: typeof rootRouteImport
+ }
+ '/(marketing)/pricing': {
+ id: '/(marketing)/pricing'
+ path: '/pricing'
+ fullPath: '/pricing'
+ preLoaderRoute: typeof marketingPricingRouteImport
+ parentRoute: typeof rootRouteImport
+ }
}
}
diff --git a/benchmarks/client-nav/scenarios/route-tree-scale/solid/tsconfig.json b/benchmarks/client-nav/scenarios/route-tree-scale/solid/tsconfig.json
index 98d76ad6b8..8c57ff876a 100644
--- a/benchmarks/client-nav/scenarios/route-tree-scale/solid/tsconfig.json
+++ b/benchmarks/client-nav/scenarios/route-tree-scale/solid/tsconfig.json
@@ -2,7 +2,7 @@
"extends": "../../../../../tsconfig.json",
"compilerOptions": {
"jsx": "preserve",
- "jsxImportSource": "solid-js",
+ "jsxImportSource": "@solidjs/web",
"allowImportingTsExtensions": true,
"types": ["node", "vite/client", "vitest/globals"]
},
diff --git a/benchmarks/client-nav/scenarios/route-tree-scale/solid/vite.config.ts b/benchmarks/client-nav/scenarios/route-tree-scale/solid/vite.config.ts
index 542ede131b..3c870e9c21 100644
--- a/benchmarks/client-nav/scenarios/route-tree-scale/solid/vite.config.ts
+++ b/benchmarks/client-nav/scenarios/route-tree-scale/solid/vite.config.ts
@@ -1,9 +1,8 @@
import { fileURLToPath } from 'node:url'
import { defineConfig } from 'vitest/config'
-import solid from 'vite-plugin-solid'
+import solid from '@solidjs/vite-plugin'
import codspeedPlugin from '@codspeed/vitest-plugin'
import { tanstackRouter } from '@tanstack/router-plugin/vite'
-import { cpuSimulationExecArgv } from '../../../../cpu-simulation'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -23,7 +22,7 @@ export default defineConfig({
routesDirectory: `${rootDir}src/routes`,
generatedRouteTree: `${rootDir}src/routeTree.gen.ts`,
}),
- solid({ hot: false, dev: false }),
+ solid({ refresh: false, dev: false }),
],
build: {
outDir: './dist',
@@ -39,7 +38,6 @@ export default defineConfig({
conditions: ['solid', 'browser'],
},
test: {
- execArgv: cpuSimulationExecArgv(),
name: '@benchmarks/client-nav route-tree-scale (solid)',
watch: false,
environment: 'jsdom',
diff --git a/benchmarks/client-nav/scenarios/route-tree-scale/vue/speed.bench.ts b/benchmarks/client-nav/scenarios/route-tree-scale/vue/speed.bench.ts
index 331e8e008f..9365231579 100644
--- a/benchmarks/client-nav/scenarios/route-tree-scale/vue/speed.bench.ts
+++ b/benchmarks/client-nav/scenarios/route-tree-scale/vue/speed.bench.ts
@@ -1,19 +1,32 @@
-import { test } from 'vitest'
-import { benchLifecycle } from '../../../../cpu-simulation'
+import { afterEach, beforeEach, bench, describe } from 'vitest'
import { benchOptions, ticksPerIteration } from '../shared'
import { setup } from './setup'
-test('client-route-tree-scale', async ({ bench }) => {
- const scenario = setup()
+describe('client-route-tree-scale', () => {
+ const test = setup()
- await bench(
+ /**
+ * Running `vitest bench` ignores suite hooks, so Tinybench uses the `setup`
+ * and `teardown` options below. CodSpeed bypasses those options but supports
+ * `beforeEach` and `afterEach`. Only one lifecycle path runs in either
+ * environment, and every measured invocation receives fresh application state.
+ */
+
+ beforeEach(test.before)
+ afterEach(test.after)
+
+ bench(
'client-route-tree-scale navigation loop (vue)',
- benchLifecycle(scenario),
async () => {
for (let i = 0; i < ticksPerIteration; i++) {
- await scenario.tick()
+ await test.tick()
}
- await scenario.finishBatch()
+ await test.finishBatch()
},
- ).run(benchOptions)
+ {
+ ...benchOptions,
+ setup: test.before,
+ teardown: test.after,
+ },
+ )
})
diff --git a/benchmarks/client-nav/scenarios/route-tree-scale/vue/src/routeTree.gen.ts b/benchmarks/client-nav/scenarios/route-tree-scale/vue/src/routeTree.gen.ts
index a12f981bb4..a03c051a79 100644
--- a/benchmarks/client-nav/scenarios/route-tree-scale/vue/src/routeTree.gen.ts
+++ b/benchmarks/client-nav/scenarios/route-tree-scale/vue/src/routeTree.gen.ts
@@ -9,72 +9,48 @@
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
import { Route as rootRouteImport } from './routes/__root'
-import { Route as IndexRouteImport } from './routes/index'
-import { Route as LayoutRouteImport } from './routes/_layout'
-import { Route as SecARouteImport } from './routes/sec-a'
-import { Route as SecBRouteImport } from './routes/sec-b'
-import { Route as SecCRouteImport } from './routes/sec-c'
-import { Route as SecDRouteImport } from './routes/sec-d'
-import { Route as SecERouteImport } from './routes/sec-e'
import { Route as SecFRouteImport } from './routes/sec-f'
-import { Route as marketingPricingRouteImport } from './routes/(marketing)/pricing'
-import { Route as marketingPromoRouteImport } from './routes/(marketing)/promo'
-import { Route as LayoutAlphaRouteImport } from './routes/_layout.alpha'
-import { Route as LayoutBetaRouteImport } from './routes/_layout.beta'
-import { Route as FilesSplatRouteImport } from './routes/files.$'
-import { Route as ReleaseVChar123versionChar125RouteImport } from './routes/release.v{$version}'
-import { Route as SecAIndexRouteImport } from './routes/sec-a.index'
-import { Route as SecAIdRouteImport } from './routes/sec-a.$id'
-import { Route as SecAAboutRouteImport } from './routes/sec-a.about'
-import { Route as SecASettingsRouteImport } from './routes/sec-a.settings'
-import { Route as SecBIndexRouteImport } from './routes/sec-b.index'
-import { Route as SecBIdRouteImport } from './routes/sec-b.$id'
-import { Route as SecBAboutRouteImport } from './routes/sec-b.about'
-import { Route as SecBSettingsRouteImport } from './routes/sec-b.settings'
-import { Route as SecCIndexRouteImport } from './routes/sec-c.index'
-import { Route as SecCIdRouteImport } from './routes/sec-c.$id'
-import { Route as SecCAboutRouteImport } from './routes/sec-c.about'
-import { Route as SecCSettingsRouteImport } from './routes/sec-c.settings'
-import { Route as SecDIndexRouteImport } from './routes/sec-d.index'
-import { Route as SecDIdRouteImport } from './routes/sec-d.$id'
-import { Route as SecDAboutRouteImport } from './routes/sec-d.about'
-import { Route as SecDSettingsRouteImport } from './routes/sec-d.settings'
-import { Route as SecEIndexRouteImport } from './routes/sec-e.index'
-import { Route as SecEIdRouteImport } from './routes/sec-e.$id'
-import { Route as SecEAboutRouteImport } from './routes/sec-e.about'
-import { Route as SecESettingsRouteImport } from './routes/sec-e.settings'
+import { Route as SecERouteImport } from './routes/sec-e'
+import { Route as SecDRouteImport } from './routes/sec-d'
+import { Route as SecCRouteImport } from './routes/sec-c'
+import { Route as SecBRouteImport } from './routes/sec-b'
+import { Route as SecARouteImport } from './routes/sec-a'
+import { Route as LayoutRouteImport } from './routes/_layout'
+import { Route as IndexRouteImport } from './routes/index'
import { Route as SecFIndexRouteImport } from './routes/sec-f.index'
-import { Route as SecFIdRouteImport } from './routes/sec-f.$id'
-import { Route as SecFAboutRouteImport } from './routes/sec-f.about'
+import { Route as SecEIndexRouteImport } from './routes/sec-e.index'
+import { Route as SecDIndexRouteImport } from './routes/sec-d.index'
+import { Route as SecCIndexRouteImport } from './routes/sec-c.index'
+import { Route as SecBIndexRouteImport } from './routes/sec-b.index'
+import { Route as SecAIndexRouteImport } from './routes/sec-a.index'
import { Route as SecFSettingsRouteImport } from './routes/sec-f.settings'
+import { Route as SecFAboutRouteImport } from './routes/sec-f.about'
+import { Route as SecFIdRouteImport } from './routes/sec-f.$id'
+import { Route as SecESettingsRouteImport } from './routes/sec-e.settings'
+import { Route as SecEAboutRouteImport } from './routes/sec-e.about'
+import { Route as SecEIdRouteImport } from './routes/sec-e.$id'
+import { Route as SecDSettingsRouteImport } from './routes/sec-d.settings'
+import { Route as SecDAboutRouteImport } from './routes/sec-d.about'
+import { Route as SecDIdRouteImport } from './routes/sec-d.$id'
+import { Route as SecCSettingsRouteImport } from './routes/sec-c.settings'
+import { Route as SecCAboutRouteImport } from './routes/sec-c.about'
+import { Route as SecCIdRouteImport } from './routes/sec-c.$id'
+import { Route as SecBSettingsRouteImport } from './routes/sec-b.settings'
+import { Route as SecBAboutRouteImport } from './routes/sec-b.about'
+import { Route as SecBIdRouteImport } from './routes/sec-b.$id'
+import { Route as SecASettingsRouteImport } from './routes/sec-a.settings'
+import { Route as SecAAboutRouteImport } from './routes/sec-a.about'
+import { Route as SecAIdRouteImport } from './routes/sec-a.$id'
+import { Route as ReleaseVChar123versionChar125RouteImport } from './routes/release.v{$version}'
+import { Route as FilesSplatRouteImport } from './routes/files.$'
+import { Route as LayoutBetaRouteImport } from './routes/_layout.beta'
+import { Route as LayoutAlphaRouteImport } from './routes/_layout.alpha'
+import { Route as marketingPromoRouteImport } from './routes/(marketing)/promo'
+import { Route as marketingPricingRouteImport } from './routes/(marketing)/pricing'
-const IndexRoute = IndexRouteImport.update({
- id: '/',
- path: '/',
- getParentRoute: () => rootRouteImport,
-} as any)
-const LayoutRoute = LayoutRouteImport.update({
- id: '/_layout',
- getParentRoute: () => rootRouteImport,
-} as any)
-const SecARoute = SecARouteImport.update({
- id: '/sec-a',
- path: '/sec-a',
- getParentRoute: () => rootRouteImport,
-} as any)
-const SecBRoute = SecBRouteImport.update({
- id: '/sec-b',
- path: '/sec-b',
- getParentRoute: () => rootRouteImport,
-} as any)
-const SecCRoute = SecCRouteImport.update({
- id: '/sec-c',
- path: '/sec-c',
- getParentRoute: () => rootRouteImport,
-} as any)
-const SecDRoute = SecDRouteImport.update({
- id: '/sec-d',
- path: '/sec-d',
+const SecFRoute = SecFRouteImport.update({
+ id: '/sec-f',
+ path: '/sec-f',
getParentRoute: () => rootRouteImport,
} as any)
const SecERoute = SecERouteImport.update({
@@ -82,150 +58,68 @@ const SecERoute = SecERouteImport.update({
path: '/sec-e',
getParentRoute: () => rootRouteImport,
} as any)
-const SecFRoute = SecFRouteImport.update({
- id: '/sec-f',
- path: '/sec-f',
+const SecDRoute = SecDRouteImport.update({
+ id: '/sec-d',
+ path: '/sec-d',
getParentRoute: () => rootRouteImport,
} as any)
-const marketingPricingRoute = marketingPricingRouteImport.update({
- id: '/(marketing)/pricing',
- path: '/pricing',
+const SecCRoute = SecCRouteImport.update({
+ id: '/sec-c',
+ path: '/sec-c',
getParentRoute: () => rootRouteImport,
} as any)
-const marketingPromoRoute = marketingPromoRouteImport.update({
- id: '/(marketing)/promo',
- path: '/promo',
+const SecBRoute = SecBRouteImport.update({
+ id: '/sec-b',
+ path: '/sec-b',
getParentRoute: () => rootRouteImport,
} as any)
-const LayoutAlphaRoute = LayoutAlphaRouteImport.update({
- id: '/alpha',
- path: '/alpha',
- getParentRoute: () => LayoutRoute,
-} as any)
-const LayoutBetaRoute = LayoutBetaRouteImport.update({
- id: '/beta',
- path: '/beta',
- getParentRoute: () => LayoutRoute,
-} as any)
-const FilesSplatRoute = FilesSplatRouteImport.update({
- id: '/files/$',
- path: '/files/$',
+const SecARoute = SecARouteImport.update({
+ id: '/sec-a',
+ path: '/sec-a',
getParentRoute: () => rootRouteImport,
} as any)
-const ReleaseVChar123versionChar125Route =
- ReleaseVChar123versionChar125RouteImport.update({
- id: '/release/v{$version}',
- path: '/release/v{$version}',
- getParentRoute: () => rootRouteImport,
- } as any)
-const SecAIndexRoute = SecAIndexRouteImport.update({
+const LayoutRoute = LayoutRouteImport.update({
+ id: '/_layout',
+ getParentRoute: () => rootRouteImport,
+} as any)
+const IndexRoute = IndexRouteImport.update({
id: '/',
path: '/',
- getParentRoute: () => SecARoute,
-} as any)
-const SecAIdRoute = SecAIdRouteImport.update({
- id: '/$id',
- path: '/$id',
- getParentRoute: () => SecARoute,
-} as any)
-const SecAAboutRoute = SecAAboutRouteImport.update({
- id: '/about',
- path: '/about',
- getParentRoute: () => SecARoute,
-} as any)
-const SecASettingsRoute = SecASettingsRouteImport.update({
- id: '/settings',
- path: '/settings',
- getParentRoute: () => SecARoute,
-} as any)
-const SecBIndexRoute = SecBIndexRouteImport.update({
- id: '/',
- path: '/',
- getParentRoute: () => SecBRoute,
-} as any)
-const SecBIdRoute = SecBIdRouteImport.update({
- id: '/$id',
- path: '/$id',
- getParentRoute: () => SecBRoute,
-} as any)
-const SecBAboutRoute = SecBAboutRouteImport.update({
- id: '/about',
- path: '/about',
- getParentRoute: () => SecBRoute,
-} as any)
-const SecBSettingsRoute = SecBSettingsRouteImport.update({
- id: '/settings',
- path: '/settings',
- getParentRoute: () => SecBRoute,
-} as any)
-const SecCIndexRoute = SecCIndexRouteImport.update({
- id: '/',
- path: '/',
- getParentRoute: () => SecCRoute,
-} as any)
-const SecCIdRoute = SecCIdRouteImport.update({
- id: '/$id',
- path: '/$id',
- getParentRoute: () => SecCRoute,
-} as any)
-const SecCAboutRoute = SecCAboutRouteImport.update({
- id: '/about',
- path: '/about',
- getParentRoute: () => SecCRoute,
-} as any)
-const SecCSettingsRoute = SecCSettingsRouteImport.update({
- id: '/settings',
- path: '/settings',
- getParentRoute: () => SecCRoute,
-} as any)
-const SecDIndexRoute = SecDIndexRouteImport.update({
- id: '/',
- path: '/',
- getParentRoute: () => SecDRoute,
-} as any)
-const SecDIdRoute = SecDIdRouteImport.update({
- id: '/$id',
- path: '/$id',
- getParentRoute: () => SecDRoute,
-} as any)
-const SecDAboutRoute = SecDAboutRouteImport.update({
- id: '/about',
- path: '/about',
- getParentRoute: () => SecDRoute,
-} as any)
-const SecDSettingsRoute = SecDSettingsRouteImport.update({
- id: '/settings',
- path: '/settings',
- getParentRoute: () => SecDRoute,
-} as any)
-const SecEIndexRoute = SecEIndexRouteImport.update({
- id: '/',
- path: '/',
- getParentRoute: () => SecERoute,
-} as any)
-const SecEIdRoute = SecEIdRouteImport.update({
- id: '/$id',
- path: '/$id',
- getParentRoute: () => SecERoute,
-} as any)
-const SecEAboutRoute = SecEAboutRouteImport.update({
- id: '/about',
- path: '/about',
- getParentRoute: () => SecERoute,
-} as any)
-const SecESettingsRoute = SecESettingsRouteImport.update({
- id: '/settings',
- path: '/settings',
- getParentRoute: () => SecERoute,
+ getParentRoute: () => rootRouteImport,
} as any)
const SecFIndexRoute = SecFIndexRouteImport.update({
id: '/',
path: '/',
getParentRoute: () => SecFRoute,
} as any)
-const SecFIdRoute = SecFIdRouteImport.update({
- id: '/$id',
- path: '/$id',
+const SecEIndexRoute = SecEIndexRouteImport.update({
+ id: '/',
+ path: '/',
+ getParentRoute: () => SecERoute,
+} as any)
+const SecDIndexRoute = SecDIndexRouteImport.update({
+ id: '/',
+ path: '/',
+ getParentRoute: () => SecDRoute,
+} as any)
+const SecCIndexRoute = SecCIndexRouteImport.update({
+ id: '/',
+ path: '/',
+ getParentRoute: () => SecCRoute,
+} as any)
+const SecBIndexRoute = SecBIndexRouteImport.update({
+ id: '/',
+ path: '/',
+ getParentRoute: () => SecBRoute,
+} as any)
+const SecAIndexRoute = SecAIndexRouteImport.update({
+ id: '/',
+ path: '/',
+ getParentRoute: () => SecARoute,
+} as any)
+const SecFSettingsRoute = SecFSettingsRouteImport.update({
+ id: '/settings',
+ path: '/settings',
getParentRoute: () => SecFRoute,
} as any)
const SecFAboutRoute = SecFAboutRouteImport.update({
@@ -233,10 +127,116 @@ const SecFAboutRoute = SecFAboutRouteImport.update({
path: '/about',
getParentRoute: () => SecFRoute,
} as any)
-const SecFSettingsRoute = SecFSettingsRouteImport.update({
+const SecFIdRoute = SecFIdRouteImport.update({
+ id: '/$id',
+ path: '/$id',
+ getParentRoute: () => SecFRoute,
+} as any)
+const SecESettingsRoute = SecESettingsRouteImport.update({
id: '/settings',
path: '/settings',
- getParentRoute: () => SecFRoute,
+ getParentRoute: () => SecERoute,
+} as any)
+const SecEAboutRoute = SecEAboutRouteImport.update({
+ id: '/about',
+ path: '/about',
+ getParentRoute: () => SecERoute,
+} as any)
+const SecEIdRoute = SecEIdRouteImport.update({
+ id: '/$id',
+ path: '/$id',
+ getParentRoute: () => SecERoute,
+} as any)
+const SecDSettingsRoute = SecDSettingsRouteImport.update({
+ id: '/settings',
+ path: '/settings',
+ getParentRoute: () => SecDRoute,
+} as any)
+const SecDAboutRoute = SecDAboutRouteImport.update({
+ id: '/about',
+ path: '/about',
+ getParentRoute: () => SecDRoute,
+} as any)
+const SecDIdRoute = SecDIdRouteImport.update({
+ id: '/$id',
+ path: '/$id',
+ getParentRoute: () => SecDRoute,
+} as any)
+const SecCSettingsRoute = SecCSettingsRouteImport.update({
+ id: '/settings',
+ path: '/settings',
+ getParentRoute: () => SecCRoute,
+} as any)
+const SecCAboutRoute = SecCAboutRouteImport.update({
+ id: '/about',
+ path: '/about',
+ getParentRoute: () => SecCRoute,
+} as any)
+const SecCIdRoute = SecCIdRouteImport.update({
+ id: '/$id',
+ path: '/$id',
+ getParentRoute: () => SecCRoute,
+} as any)
+const SecBSettingsRoute = SecBSettingsRouteImport.update({
+ id: '/settings',
+ path: '/settings',
+ getParentRoute: () => SecBRoute,
+} as any)
+const SecBAboutRoute = SecBAboutRouteImport.update({
+ id: '/about',
+ path: '/about',
+ getParentRoute: () => SecBRoute,
+} as any)
+const SecBIdRoute = SecBIdRouteImport.update({
+ id: '/$id',
+ path: '/$id',
+ getParentRoute: () => SecBRoute,
+} as any)
+const SecASettingsRoute = SecASettingsRouteImport.update({
+ id: '/settings',
+ path: '/settings',
+ getParentRoute: () => SecARoute,
+} as any)
+const SecAAboutRoute = SecAAboutRouteImport.update({
+ id: '/about',
+ path: '/about',
+ getParentRoute: () => SecARoute,
+} as any)
+const SecAIdRoute = SecAIdRouteImport.update({
+ id: '/$id',
+ path: '/$id',
+ getParentRoute: () => SecARoute,
+} as any)
+const ReleaseVChar123versionChar125Route =
+ ReleaseVChar123versionChar125RouteImport.update({
+ id: '/release/v{$version}',
+ path: '/release/v{$version}',
+ getParentRoute: () => rootRouteImport,
+ } as any)
+const FilesSplatRoute = FilesSplatRouteImport.update({
+ id: '/files/$',
+ path: '/files/$',
+ getParentRoute: () => rootRouteImport,
+} as any)
+const LayoutBetaRoute = LayoutBetaRouteImport.update({
+ id: '/beta',
+ path: '/beta',
+ getParentRoute: () => LayoutRoute,
+} as any)
+const LayoutAlphaRoute = LayoutAlphaRouteImport.update({
+ id: '/alpha',
+ path: '/alpha',
+ getParentRoute: () => LayoutRoute,
+} as any)
+const marketingPromoRoute = marketingPromoRouteImport.update({
+ id: '/(marketing)/promo',
+ path: '/promo',
+ getParentRoute: () => rootRouteImport,
+} as any)
+const marketingPricingRoute = marketingPricingRouteImport.update({
+ id: '/(marketing)/pricing',
+ path: '/pricing',
+ getParentRoute: () => rootRouteImport,
} as any)
export interface FileRoutesByFullPath {
@@ -484,46 +484,11 @@ export interface RootRouteChildren {
declare module '@tanstack/vue-router' {
interface FileRoutesByPath {
- '/': {
- id: '/'
- path: '/'
- fullPath: '/'
- preLoaderRoute: typeof IndexRouteImport
- parentRoute: typeof rootRouteImport
- }
- '/_layout': {
- id: '/_layout'
- path: ''
- fullPath: '/'
- preLoaderRoute: typeof LayoutRouteImport
- parentRoute: typeof rootRouteImport
- }
- '/sec-a': {
- id: '/sec-a'
- path: '/sec-a'
- fullPath: '/sec-a'
- preLoaderRoute: typeof SecARouteImport
- parentRoute: typeof rootRouteImport
- }
- '/sec-b': {
- id: '/sec-b'
- path: '/sec-b'
- fullPath: '/sec-b'
- preLoaderRoute: typeof SecBRouteImport
- parentRoute: typeof rootRouteImport
- }
- '/sec-c': {
- id: '/sec-c'
- path: '/sec-c'
- fullPath: '/sec-c'
- preLoaderRoute: typeof SecCRouteImport
- parentRoute: typeof rootRouteImport
- }
- '/sec-d': {
- id: '/sec-d'
- path: '/sec-d'
- fullPath: '/sec-d'
- preLoaderRoute: typeof SecDRouteImport
+ '/sec-f': {
+ id: '/sec-f'
+ path: '/sec-f'
+ fullPath: '/sec-f'
+ preLoaderRoute: typeof SecFRouteImport
parentRoute: typeof rootRouteImport
}
'/sec-e': {
@@ -533,194 +498,47 @@ declare module '@tanstack/vue-router' {
preLoaderRoute: typeof SecERouteImport
parentRoute: typeof rootRouteImport
}
- '/sec-f': {
- id: '/sec-f'
- path: '/sec-f'
- fullPath: '/sec-f'
- preLoaderRoute: typeof SecFRouteImport
+ '/sec-d': {
+ id: '/sec-d'
+ path: '/sec-d'
+ fullPath: '/sec-d'
+ preLoaderRoute: typeof SecDRouteImport
parentRoute: typeof rootRouteImport
}
- '/(marketing)/pricing': {
- id: '/(marketing)/pricing'
- path: '/pricing'
- fullPath: '/pricing'
- preLoaderRoute: typeof marketingPricingRouteImport
+ '/sec-c': {
+ id: '/sec-c'
+ path: '/sec-c'
+ fullPath: '/sec-c'
+ preLoaderRoute: typeof SecCRouteImport
parentRoute: typeof rootRouteImport
}
- '/(marketing)/promo': {
- id: '/(marketing)/promo'
- path: '/promo'
- fullPath: '/promo'
- preLoaderRoute: typeof marketingPromoRouteImport
+ '/sec-b': {
+ id: '/sec-b'
+ path: '/sec-b'
+ fullPath: '/sec-b'
+ preLoaderRoute: typeof SecBRouteImport
parentRoute: typeof rootRouteImport
}
- '/_layout/alpha': {
- id: '/_layout/alpha'
- path: '/alpha'
- fullPath: '/alpha'
- preLoaderRoute: typeof LayoutAlphaRouteImport
- parentRoute: typeof LayoutRoute
- }
- '/_layout/beta': {
- id: '/_layout/beta'
- path: '/beta'
- fullPath: '/beta'
- preLoaderRoute: typeof LayoutBetaRouteImport
- parentRoute: typeof LayoutRoute
- }
- '/files/$': {
- id: '/files/$'
- path: '/files/$'
- fullPath: '/files/$'
- preLoaderRoute: typeof FilesSplatRouteImport
+ '/sec-a': {
+ id: '/sec-a'
+ path: '/sec-a'
+ fullPath: '/sec-a'
+ preLoaderRoute: typeof SecARouteImport
parentRoute: typeof rootRouteImport
}
- '/release/v{$version}': {
- id: '/release/v{$version}'
- path: '/release/v{$version}'
- fullPath: '/release/v{$version}'
- preLoaderRoute: typeof ReleaseVChar123versionChar125RouteImport
+ '/_layout': {
+ id: '/_layout'
+ path: ''
+ fullPath: '/'
+ preLoaderRoute: typeof LayoutRouteImport
parentRoute: typeof rootRouteImport
}
- '/sec-a/': {
- id: '/sec-a/'
+ '/': {
+ id: '/'
path: '/'
- fullPath: '/sec-a/'
- preLoaderRoute: typeof SecAIndexRouteImport
- parentRoute: typeof SecARoute
- }
- '/sec-a/$id': {
- id: '/sec-a/$id'
- path: '/$id'
- fullPath: '/sec-a/$id'
- preLoaderRoute: typeof SecAIdRouteImport
- parentRoute: typeof SecARoute
- }
- '/sec-a/about': {
- id: '/sec-a/about'
- path: '/about'
- fullPath: '/sec-a/about'
- preLoaderRoute: typeof SecAAboutRouteImport
- parentRoute: typeof SecARoute
- }
- '/sec-a/settings': {
- id: '/sec-a/settings'
- path: '/settings'
- fullPath: '/sec-a/settings'
- preLoaderRoute: typeof SecASettingsRouteImport
- parentRoute: typeof SecARoute
- }
- '/sec-b/': {
- id: '/sec-b/'
- path: '/'
- fullPath: '/sec-b/'
- preLoaderRoute: typeof SecBIndexRouteImport
- parentRoute: typeof SecBRoute
- }
- '/sec-b/$id': {
- id: '/sec-b/$id'
- path: '/$id'
- fullPath: '/sec-b/$id'
- preLoaderRoute: typeof SecBIdRouteImport
- parentRoute: typeof SecBRoute
- }
- '/sec-b/about': {
- id: '/sec-b/about'
- path: '/about'
- fullPath: '/sec-b/about'
- preLoaderRoute: typeof SecBAboutRouteImport
- parentRoute: typeof SecBRoute
- }
- '/sec-b/settings': {
- id: '/sec-b/settings'
- path: '/settings'
- fullPath: '/sec-b/settings'
- preLoaderRoute: typeof SecBSettingsRouteImport
- parentRoute: typeof SecBRoute
- }
- '/sec-c/': {
- id: '/sec-c/'
- path: '/'
- fullPath: '/sec-c/'
- preLoaderRoute: typeof SecCIndexRouteImport
- parentRoute: typeof SecCRoute
- }
- '/sec-c/$id': {
- id: '/sec-c/$id'
- path: '/$id'
- fullPath: '/sec-c/$id'
- preLoaderRoute: typeof SecCIdRouteImport
- parentRoute: typeof SecCRoute
- }
- '/sec-c/about': {
- id: '/sec-c/about'
- path: '/about'
- fullPath: '/sec-c/about'
- preLoaderRoute: typeof SecCAboutRouteImport
- parentRoute: typeof SecCRoute
- }
- '/sec-c/settings': {
- id: '/sec-c/settings'
- path: '/settings'
- fullPath: '/sec-c/settings'
- preLoaderRoute: typeof SecCSettingsRouteImport
- parentRoute: typeof SecCRoute
- }
- '/sec-d/': {
- id: '/sec-d/'
- path: '/'
- fullPath: '/sec-d/'
- preLoaderRoute: typeof SecDIndexRouteImport
- parentRoute: typeof SecDRoute
- }
- '/sec-d/$id': {
- id: '/sec-d/$id'
- path: '/$id'
- fullPath: '/sec-d/$id'
- preLoaderRoute: typeof SecDIdRouteImport
- parentRoute: typeof SecDRoute
- }
- '/sec-d/about': {
- id: '/sec-d/about'
- path: '/about'
- fullPath: '/sec-d/about'
- preLoaderRoute: typeof SecDAboutRouteImport
- parentRoute: typeof SecDRoute
- }
- '/sec-d/settings': {
- id: '/sec-d/settings'
- path: '/settings'
- fullPath: '/sec-d/settings'
- preLoaderRoute: typeof SecDSettingsRouteImport
- parentRoute: typeof SecDRoute
- }
- '/sec-e/': {
- id: '/sec-e/'
- path: '/'
- fullPath: '/sec-e/'
- preLoaderRoute: typeof SecEIndexRouteImport
- parentRoute: typeof SecERoute
- }
- '/sec-e/$id': {
- id: '/sec-e/$id'
- path: '/$id'
- fullPath: '/sec-e/$id'
- preLoaderRoute: typeof SecEIdRouteImport
- parentRoute: typeof SecERoute
- }
- '/sec-e/about': {
- id: '/sec-e/about'
- path: '/about'
- fullPath: '/sec-e/about'
- preLoaderRoute: typeof SecEAboutRouteImport
- parentRoute: typeof SecERoute
- }
- '/sec-e/settings': {
- id: '/sec-e/settings'
- path: '/settings'
- fullPath: '/sec-e/settings'
- preLoaderRoute: typeof SecESettingsRouteImport
- parentRoute: typeof SecERoute
+ fullPath: '/'
+ preLoaderRoute: typeof IndexRouteImport
+ parentRoute: typeof rootRouteImport
}
'/sec-f/': {
id: '/sec-f/'
@@ -729,11 +547,46 @@ declare module '@tanstack/vue-router' {
preLoaderRoute: typeof SecFIndexRouteImport
parentRoute: typeof SecFRoute
}
- '/sec-f/$id': {
- id: '/sec-f/$id'
- path: '/$id'
- fullPath: '/sec-f/$id'
- preLoaderRoute: typeof SecFIdRouteImport
+ '/sec-e/': {
+ id: '/sec-e/'
+ path: '/'
+ fullPath: '/sec-e/'
+ preLoaderRoute: typeof SecEIndexRouteImport
+ parentRoute: typeof SecERoute
+ }
+ '/sec-d/': {
+ id: '/sec-d/'
+ path: '/'
+ fullPath: '/sec-d/'
+ preLoaderRoute: typeof SecDIndexRouteImport
+ parentRoute: typeof SecDRoute
+ }
+ '/sec-c/': {
+ id: '/sec-c/'
+ path: '/'
+ fullPath: '/sec-c/'
+ preLoaderRoute: typeof SecCIndexRouteImport
+ parentRoute: typeof SecCRoute
+ }
+ '/sec-b/': {
+ id: '/sec-b/'
+ path: '/'
+ fullPath: '/sec-b/'
+ preLoaderRoute: typeof SecBIndexRouteImport
+ parentRoute: typeof SecBRoute
+ }
+ '/sec-a/': {
+ id: '/sec-a/'
+ path: '/'
+ fullPath: '/sec-a/'
+ preLoaderRoute: typeof SecAIndexRouteImport
+ parentRoute: typeof SecARoute
+ }
+ '/sec-f/settings': {
+ id: '/sec-f/settings'
+ path: '/settings'
+ fullPath: '/sec-f/settings'
+ preLoaderRoute: typeof SecFSettingsRouteImport
parentRoute: typeof SecFRoute
}
'/sec-f/about': {
@@ -743,13 +596,160 @@ declare module '@tanstack/vue-router' {
preLoaderRoute: typeof SecFAboutRouteImport
parentRoute: typeof SecFRoute
}
- '/sec-f/settings': {
- id: '/sec-f/settings'
- path: '/settings'
- fullPath: '/sec-f/settings'
- preLoaderRoute: typeof SecFSettingsRouteImport
+ '/sec-f/$id': {
+ id: '/sec-f/$id'
+ path: '/$id'
+ fullPath: '/sec-f/$id'
+ preLoaderRoute: typeof SecFIdRouteImport
parentRoute: typeof SecFRoute
}
+ '/sec-e/settings': {
+ id: '/sec-e/settings'
+ path: '/settings'
+ fullPath: '/sec-e/settings'
+ preLoaderRoute: typeof SecESettingsRouteImport
+ parentRoute: typeof SecERoute
+ }
+ '/sec-e/about': {
+ id: '/sec-e/about'
+ path: '/about'
+ fullPath: '/sec-e/about'
+ preLoaderRoute: typeof SecEAboutRouteImport
+ parentRoute: typeof SecERoute
+ }
+ '/sec-e/$id': {
+ id: '/sec-e/$id'
+ path: '/$id'
+ fullPath: '/sec-e/$id'
+ preLoaderRoute: typeof SecEIdRouteImport
+ parentRoute: typeof SecERoute
+ }
+ '/sec-d/settings': {
+ id: '/sec-d/settings'
+ path: '/settings'
+ fullPath: '/sec-d/settings'
+ preLoaderRoute: typeof SecDSettingsRouteImport
+ parentRoute: typeof SecDRoute
+ }
+ '/sec-d/about': {
+ id: '/sec-d/about'
+ path: '/about'
+ fullPath: '/sec-d/about'
+ preLoaderRoute: typeof SecDAboutRouteImport
+ parentRoute: typeof SecDRoute
+ }
+ '/sec-d/$id': {
+ id: '/sec-d/$id'
+ path: '/$id'
+ fullPath: '/sec-d/$id'
+ preLoaderRoute: typeof SecDIdRouteImport
+ parentRoute: typeof SecDRoute
+ }
+ '/sec-c/settings': {
+ id: '/sec-c/settings'
+ path: '/settings'
+ fullPath: '/sec-c/settings'
+ preLoaderRoute: typeof SecCSettingsRouteImport
+ parentRoute: typeof SecCRoute
+ }
+ '/sec-c/about': {
+ id: '/sec-c/about'
+ path: '/about'
+ fullPath: '/sec-c/about'
+ preLoaderRoute: typeof SecCAboutRouteImport
+ parentRoute: typeof SecCRoute
+ }
+ '/sec-c/$id': {
+ id: '/sec-c/$id'
+ path: '/$id'
+ fullPath: '/sec-c/$id'
+ preLoaderRoute: typeof SecCIdRouteImport
+ parentRoute: typeof SecCRoute
+ }
+ '/sec-b/settings': {
+ id: '/sec-b/settings'
+ path: '/settings'
+ fullPath: '/sec-b/settings'
+ preLoaderRoute: typeof SecBSettingsRouteImport
+ parentRoute: typeof SecBRoute
+ }
+ '/sec-b/about': {
+ id: '/sec-b/about'
+ path: '/about'
+ fullPath: '/sec-b/about'
+ preLoaderRoute: typeof SecBAboutRouteImport
+ parentRoute: typeof SecBRoute
+ }
+ '/sec-b/$id': {
+ id: '/sec-b/$id'
+ path: '/$id'
+ fullPath: '/sec-b/$id'
+ preLoaderRoute: typeof SecBIdRouteImport
+ parentRoute: typeof SecBRoute
+ }
+ '/sec-a/settings': {
+ id: '/sec-a/settings'
+ path: '/settings'
+ fullPath: '/sec-a/settings'
+ preLoaderRoute: typeof SecASettingsRouteImport
+ parentRoute: typeof SecARoute
+ }
+ '/sec-a/about': {
+ id: '/sec-a/about'
+ path: '/about'
+ fullPath: '/sec-a/about'
+ preLoaderRoute: typeof SecAAboutRouteImport
+ parentRoute: typeof SecARoute
+ }
+ '/sec-a/$id': {
+ id: '/sec-a/$id'
+ path: '/$id'
+ fullPath: '/sec-a/$id'
+ preLoaderRoute: typeof SecAIdRouteImport
+ parentRoute: typeof SecARoute
+ }
+ '/release/v{$version}': {
+ id: '/release/v{$version}'
+ path: '/release/v{$version}'
+ fullPath: '/release/v{$version}'
+ preLoaderRoute: typeof ReleaseVChar123versionChar125RouteImport
+ parentRoute: typeof rootRouteImport
+ }
+ '/files/$': {
+ id: '/files/$'
+ path: '/files/$'
+ fullPath: '/files/$'
+ preLoaderRoute: typeof FilesSplatRouteImport
+ parentRoute: typeof rootRouteImport
+ }
+ '/_layout/beta': {
+ id: '/_layout/beta'
+ path: '/beta'
+ fullPath: '/beta'
+ preLoaderRoute: typeof LayoutBetaRouteImport
+ parentRoute: typeof LayoutRoute
+ }
+ '/_layout/alpha': {
+ id: '/_layout/alpha'
+ path: '/alpha'
+ fullPath: '/alpha'
+ preLoaderRoute: typeof LayoutAlphaRouteImport
+ parentRoute: typeof LayoutRoute
+ }
+ '/(marketing)/promo': {
+ id: '/(marketing)/promo'
+ path: '/promo'
+ fullPath: '/promo'
+ preLoaderRoute: typeof marketingPromoRouteImport
+ parentRoute: typeof rootRouteImport
+ }
+ '/(marketing)/pricing': {
+ id: '/(marketing)/pricing'
+ path: '/pricing'
+ fullPath: '/pricing'
+ preLoaderRoute: typeof marketingPricingRouteImport
+ parentRoute: typeof rootRouteImport
+ }
}
}
diff --git a/benchmarks/client-nav/scenarios/route-tree-scale/vue/vite.config.ts b/benchmarks/client-nav/scenarios/route-tree-scale/vue/vite.config.ts
index 189ba1de99..a547406198 100644
--- a/benchmarks/client-nav/scenarios/route-tree-scale/vue/vite.config.ts
+++ b/benchmarks/client-nav/scenarios/route-tree-scale/vue/vite.config.ts
@@ -4,7 +4,6 @@ import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import codspeedPlugin from '@codspeed/vitest-plugin'
import { tanstackRouter } from '@tanstack/router-plugin/vite'
-import { cpuSimulationExecArgv } from '../../../../cpu-simulation'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -38,7 +37,6 @@ export default defineConfig({
},
},
test: {
- execArgv: cpuSimulationExecArgv(),
name: '@benchmarks/client-nav route-tree-scale (vue)',
watch: false,
environment: 'jsdom',
diff --git a/benchmarks/client-nav/scenarios/search-params/react/speed.bench.ts b/benchmarks/client-nav/scenarios/search-params/react/speed.bench.ts
index 0b38f7bddb..5bdd994e32 100644
--- a/benchmarks/client-nav/scenarios/search-params/react/speed.bench.ts
+++ b/benchmarks/client-nav/scenarios/search-params/react/speed.bench.ts
@@ -1,19 +1,32 @@
-import { test } from 'vitest'
-import { benchLifecycle } from '../../../../cpu-simulation'
+import { afterEach, beforeEach, bench, describe } from 'vitest'
import { benchOptions, ticksPerIteration } from '../shared'
import { setup } from './setup'
-test('client-search-params', async ({ bench }) => {
- const scenario = setup()
+describe('client-search-params', () => {
+ const test = setup()
- await bench(
+ /**
+ * Running `vitest bench` ignores suite hooks, so Tinybench uses the `setup`
+ * and `teardown` options below. CodSpeed bypasses those options but supports
+ * `beforeEach` and `afterEach`. Only one lifecycle path runs in either
+ * environment, and every measured invocation receives fresh application state.
+ */
+
+ beforeEach(test.before)
+ afterEach(test.after)
+
+ bench(
'client-search-params navigation loop (react)',
- benchLifecycle(scenario),
async () => {
for (let i = 0; i < ticksPerIteration; i++) {
- await scenario.tick()
+ await test.tick()
}
- await scenario.finishBatch()
+ await test.finishBatch()
},
- ).run(benchOptions)
+ {
+ ...benchOptions,
+ setup: test.before,
+ teardown: test.after,
+ },
+ )
})
diff --git a/benchmarks/client-nav/scenarios/search-params/react/vite.config.ts b/benchmarks/client-nav/scenarios/search-params/react/vite.config.ts
index 0318a10815..b220ae7d0d 100644
--- a/benchmarks/client-nav/scenarios/search-params/react/vite.config.ts
+++ b/benchmarks/client-nav/scenarios/search-params/react/vite.config.ts
@@ -3,7 +3,6 @@ import { defineConfig } from 'vitest/config'
import react from '@vitejs/plugin-react'
import codspeedPlugin from '@codspeed/vitest-plugin'
import { tanstackRouter } from '@tanstack/router-plugin/vite'
-import { cpuSimulationExecArgv } from '../../../../cpu-simulation'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -33,7 +32,6 @@ export default defineConfig({
},
},
test: {
- execArgv: cpuSimulationExecArgv(),
name: '@benchmarks/client-nav search-params (react)',
watch: false,
environment: 'jsdom',
diff --git a/benchmarks/client-nav/scenarios/search-params/solid/speed.bench.ts b/benchmarks/client-nav/scenarios/search-params/solid/speed.bench.ts
index caa626c596..ea0baa1098 100644
--- a/benchmarks/client-nav/scenarios/search-params/solid/speed.bench.ts
+++ b/benchmarks/client-nav/scenarios/search-params/solid/speed.bench.ts
@@ -1,19 +1,32 @@
-import { test } from 'vitest'
-import { benchLifecycle } from '../../../../cpu-simulation'
+import { afterEach, beforeEach, bench, describe } from 'vitest'
import { benchOptions, ticksPerIteration } from '../shared'
import { setup } from './setup'
-test('client-search-params', async ({ bench }) => {
- const scenario = setup()
+describe('client-search-params', () => {
+ const test = setup()
- await bench(
+ /**
+ * Running `vitest bench` ignores suite hooks, so Tinybench uses the `setup`
+ * and `teardown` options below. CodSpeed bypasses those options but supports
+ * `beforeEach` and `afterEach`. Only one lifecycle path runs in either
+ * environment, and every measured invocation receives fresh application state.
+ */
+
+ beforeEach(test.before)
+ afterEach(test.after)
+
+ bench(
'client-search-params navigation loop (solid)',
- benchLifecycle(scenario),
async () => {
for (let i = 0; i < ticksPerIteration; i++) {
- await scenario.tick()
+ await test.tick()
}
- await scenario.finishBatch()
+ await test.finishBatch()
},
- ).run(benchOptions)
+ {
+ ...benchOptions,
+ setup: test.before,
+ teardown: test.after,
+ },
+ )
})
diff --git a/benchmarks/client-nav/scenarios/search-params/solid/src/main.tsx b/benchmarks/client-nav/scenarios/search-params/solid/src/main.tsx
index 25071f7979..714d5a0098 100644
--- a/benchmarks/client-nav/scenarios/search-params/solid/src/main.tsx
+++ b/benchmarks/client-nav/scenarios/search-params/solid/src/main.tsx
@@ -1,5 +1,5 @@
import type { RouterHistory } from '@tanstack/history'
-import { render } from 'solid-js/web'
+import { render } from '@solidjs/web'
import { RouterProvider, createRouter } from '@tanstack/solid-router'
import { routeTree } from './routeTree.gen'
diff --git a/benchmarks/client-nav/scenarios/search-params/solid/src/routeTree.gen.ts b/benchmarks/client-nav/scenarios/search-params/solid/src/routeTree.gen.ts
index b15beed09b..96d211d64c 100644
--- a/benchmarks/client-nav/scenarios/search-params/solid/src/routeTree.gen.ts
+++ b/benchmarks/client-nav/scenarios/search-params/solid/src/routeTree.gen.ts
@@ -9,13 +9,13 @@
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
import { Route as rootRouteImport } from './routes/__root'
-import { Route as IndexRouteImport } from './routes/index'
-import { Route as CatalogRouteImport } from './routes/catalog'
import { Route as ProductsRouteImport } from './routes/products'
+import { Route as CatalogRouteImport } from './routes/catalog'
+import { Route as IndexRouteImport } from './routes/index'
-const IndexRoute = IndexRouteImport.update({
- id: '/',
- path: '/',
+const ProductsRoute = ProductsRouteImport.update({
+ id: '/products',
+ path: '/products',
getParentRoute: () => rootRouteImport,
} as any)
const CatalogRoute = CatalogRouteImport.update({
@@ -23,9 +23,9 @@ const CatalogRoute = CatalogRouteImport.update({
path: '/catalog',
getParentRoute: () => rootRouteImport,
} as any)
-const ProductsRoute = ProductsRouteImport.update({
- id: '/products',
- path: '/products',
+const IndexRoute = IndexRouteImport.update({
+ id: '/',
+ path: '/',
getParentRoute: () => rootRouteImport,
} as any)
@@ -61,11 +61,11 @@ export interface RootRouteChildren {
declare module '@tanstack/solid-router' {
interface FileRoutesByPath {
- '/': {
- id: '/'
- path: '/'
- fullPath: '/'
- preLoaderRoute: typeof IndexRouteImport
+ '/products': {
+ id: '/products'
+ path: '/products'
+ fullPath: '/products'
+ preLoaderRoute: typeof ProductsRouteImport
parentRoute: typeof rootRouteImport
}
'/catalog': {
@@ -75,11 +75,11 @@ declare module '@tanstack/solid-router' {
preLoaderRoute: typeof CatalogRouteImport
parentRoute: typeof rootRouteImport
}
- '/products': {
- id: '/products'
- path: '/products'
- fullPath: '/products'
- preLoaderRoute: typeof ProductsRouteImport
+ '/': {
+ id: '/'
+ path: '/'
+ fullPath: '/'
+ preLoaderRoute: typeof IndexRouteImport
parentRoute: typeof rootRouteImport
}
}
diff --git a/benchmarks/client-nav/scenarios/search-params/solid/src/routes/__root.tsx b/benchmarks/client-nav/scenarios/search-params/solid/src/routes/__root.tsx
index 30c042f9c5..e6f9592e07 100644
--- a/benchmarks/client-nav/scenarios/search-params/solid/src/routes/__root.tsx
+++ b/benchmarks/client-nav/scenarios/search-params/solid/src/routes/__root.tsx
@@ -18,9 +18,12 @@ export const Route = createRootRoute({
const rootSubscribers = Array.from({ length: 4 }, (_, index) => index)
function PerfValue(props: { value: () => number }) {
- createRenderEffect(() => {
- void props.value()
- })
+ createRenderEffect(
+ () => {
+ void props.value()
+ },
+ () => {},
+ )
return null
}
diff --git a/benchmarks/client-nav/scenarios/search-params/solid/src/routes/catalog.tsx b/benchmarks/client-nav/scenarios/search-params/solid/src/routes/catalog.tsx
index 60cf8e7896..7f3fcf7078 100644
--- a/benchmarks/client-nav/scenarios/search-params/solid/src/routes/catalog.tsx
+++ b/benchmarks/client-nav/scenarios/search-params/solid/src/routes/catalog.tsx
@@ -19,9 +19,12 @@ export const Route = createFileRoute('/catalog')({
const subscriberIndexes = Array.from({ length: 2 }, (_, index) => index)
function PerfValue(props: { value: () => number }) {
- createRenderEffect(() => {
- void props.value()
- })
+ createRenderEffect(
+ () => {
+ void props.value()
+ },
+ () => {},
+ )
return null
}
diff --git a/benchmarks/client-nav/scenarios/search-params/solid/src/routes/products.tsx b/benchmarks/client-nav/scenarios/search-params/solid/src/routes/products.tsx
index 8b2a252155..1319aabae3 100644
--- a/benchmarks/client-nav/scenarios/search-params/solid/src/routes/products.tsx
+++ b/benchmarks/client-nav/scenarios/search-params/solid/src/routes/products.tsx
@@ -37,9 +37,12 @@ export const Route = createFileRoute('/products')({
const subscriberIndexes = Array.from({ length: 2 }, (_, index) => index)
function PerfValue(props: { value: () => number }) {
- createRenderEffect(() => {
- void props.value()
- })
+ createRenderEffect(
+ () => {
+ void props.value()
+ },
+ () => {},
+ )
return null
}
diff --git a/benchmarks/client-nav/scenarios/search-params/solid/tsconfig.json b/benchmarks/client-nav/scenarios/search-params/solid/tsconfig.json
index 98d76ad6b8..8c57ff876a 100644
--- a/benchmarks/client-nav/scenarios/search-params/solid/tsconfig.json
+++ b/benchmarks/client-nav/scenarios/search-params/solid/tsconfig.json
@@ -2,7 +2,7 @@
"extends": "../../../../../tsconfig.json",
"compilerOptions": {
"jsx": "preserve",
- "jsxImportSource": "solid-js",
+ "jsxImportSource": "@solidjs/web",
"allowImportingTsExtensions": true,
"types": ["node", "vite/client", "vitest/globals"]
},
diff --git a/benchmarks/client-nav/scenarios/search-params/solid/vite.config.ts b/benchmarks/client-nav/scenarios/search-params/solid/vite.config.ts
index 511fd49466..e404b55b51 100644
--- a/benchmarks/client-nav/scenarios/search-params/solid/vite.config.ts
+++ b/benchmarks/client-nav/scenarios/search-params/solid/vite.config.ts
@@ -1,9 +1,8 @@
import { fileURLToPath } from 'node:url'
import { defineConfig } from 'vitest/config'
-import solid from 'vite-plugin-solid'
+import solid from '@solidjs/vite-plugin'
import codspeedPlugin from '@codspeed/vitest-plugin'
import { tanstackRouter } from '@tanstack/router-plugin/vite'
-import { cpuSimulationExecArgv } from '../../../../cpu-simulation'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -20,7 +19,7 @@ export default defineConfig({
routesDirectory: `${rootDir}src/routes`,
generatedRouteTree: `${rootDir}src/routeTree.gen.ts`,
}),
- solid({ hot: false, dev: false }),
+ solid({ refresh: false, dev: false }),
],
build: {
outDir: './dist',
@@ -36,7 +35,6 @@ export default defineConfig({
conditions: ['solid', 'browser'],
},
test: {
- execArgv: cpuSimulationExecArgv(),
name: '@benchmarks/client-nav search-params (solid)',
watch: false,
environment: 'jsdom',
diff --git a/benchmarks/client-nav/scenarios/search-params/vue/speed.bench.ts b/benchmarks/client-nav/scenarios/search-params/vue/speed.bench.ts
index 728d2779e8..c82efd49c9 100644
--- a/benchmarks/client-nav/scenarios/search-params/vue/speed.bench.ts
+++ b/benchmarks/client-nav/scenarios/search-params/vue/speed.bench.ts
@@ -1,19 +1,32 @@
-import { test } from 'vitest'
-import { benchLifecycle } from '../../../../cpu-simulation'
+import { afterEach, beforeEach, bench, describe } from 'vitest'
import { benchOptions, ticksPerIteration } from '../shared'
import { setup } from './setup'
-test('client-search-params', async ({ bench }) => {
- const scenario = setup()
+describe('client-search-params', () => {
+ const test = setup()
- await bench(
+ /**
+ * Running `vitest bench` ignores suite hooks, so Tinybench uses the `setup`
+ * and `teardown` options below. CodSpeed bypasses those options but supports
+ * `beforeEach` and `afterEach`. Only one lifecycle path runs in either
+ * environment, and every measured invocation receives fresh application state.
+ */
+
+ beforeEach(test.before)
+ afterEach(test.after)
+
+ bench(
'client-search-params navigation loop (vue)',
- benchLifecycle(scenario),
async () => {
for (let i = 0; i < ticksPerIteration; i++) {
- await scenario.tick()
+ await test.tick()
}
- await scenario.finishBatch()
+ await test.finishBatch()
},
- ).run(benchOptions)
+ {
+ ...benchOptions,
+ setup: test.before,
+ teardown: test.after,
+ },
+ )
})
diff --git a/benchmarks/client-nav/scenarios/search-params/vue/src/routeTree.gen.ts b/benchmarks/client-nav/scenarios/search-params/vue/src/routeTree.gen.ts
index f73b84ebe7..b95b667803 100644
--- a/benchmarks/client-nav/scenarios/search-params/vue/src/routeTree.gen.ts
+++ b/benchmarks/client-nav/scenarios/search-params/vue/src/routeTree.gen.ts
@@ -9,13 +9,13 @@
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
import { Route as rootRouteImport } from './routes/__root'
-import { Route as IndexRouteImport } from './routes/index'
-import { Route as CatalogRouteImport } from './routes/catalog'
import { Route as ProductsRouteImport } from './routes/products'
+import { Route as CatalogRouteImport } from './routes/catalog'
+import { Route as IndexRouteImport } from './routes/index'
-const IndexRoute = IndexRouteImport.update({
- id: '/',
- path: '/',
+const ProductsRoute = ProductsRouteImport.update({
+ id: '/products',
+ path: '/products',
getParentRoute: () => rootRouteImport,
} as any)
const CatalogRoute = CatalogRouteImport.update({
@@ -23,9 +23,9 @@ const CatalogRoute = CatalogRouteImport.update({
path: '/catalog',
getParentRoute: () => rootRouteImport,
} as any)
-const ProductsRoute = ProductsRouteImport.update({
- id: '/products',
- path: '/products',
+const IndexRoute = IndexRouteImport.update({
+ id: '/',
+ path: '/',
getParentRoute: () => rootRouteImport,
} as any)
@@ -61,11 +61,11 @@ export interface RootRouteChildren {
declare module '@tanstack/vue-router' {
interface FileRoutesByPath {
- '/': {
- id: '/'
- path: '/'
- fullPath: '/'
- preLoaderRoute: typeof IndexRouteImport
+ '/products': {
+ id: '/products'
+ path: '/products'
+ fullPath: '/products'
+ preLoaderRoute: typeof ProductsRouteImport
parentRoute: typeof rootRouteImport
}
'/catalog': {
@@ -75,11 +75,11 @@ declare module '@tanstack/vue-router' {
preLoaderRoute: typeof CatalogRouteImport
parentRoute: typeof rootRouteImport
}
- '/products': {
- id: '/products'
- path: '/products'
- fullPath: '/products'
- preLoaderRoute: typeof ProductsRouteImport
+ '/': {
+ id: '/'
+ path: '/'
+ fullPath: '/'
+ preLoaderRoute: typeof IndexRouteImport
parentRoute: typeof rootRouteImport
}
}
diff --git a/benchmarks/client-nav/scenarios/search-params/vue/vite.config.ts b/benchmarks/client-nav/scenarios/search-params/vue/vite.config.ts
index 27490b276a..9a3b82d066 100644
--- a/benchmarks/client-nav/scenarios/search-params/vue/vite.config.ts
+++ b/benchmarks/client-nav/scenarios/search-params/vue/vite.config.ts
@@ -4,7 +4,6 @@ import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import codspeedPlugin from '@codspeed/vitest-plugin'
import { tanstackRouter } from '@tanstack/router-plugin/vite'
-import { cpuSimulationExecArgv } from '../../../../cpu-simulation'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -35,7 +34,6 @@ export default defineConfig({
},
},
test: {
- execArgv: cpuSimulationExecArgv(),
name: '@benchmarks/client-nav search-params (vue)',
watch: false,
environment: 'jsdom',
diff --git a/benchmarks/client-nav/solid/app.tsx b/benchmarks/client-nav/solid/app.tsx
index ef90130f5e..4779054bec 100644
--- a/benchmarks/client-nav/solid/app.tsx
+++ b/benchmarks/client-nav/solid/app.tsx
@@ -1,5 +1,5 @@
import { For, createRenderEffect } from 'solid-js'
-import { render } from 'solid-js/web'
+import { render } from '@solidjs/web'
import {
Link,
Outlet,
@@ -37,9 +37,10 @@ const routeSelectors = Array.from({ length: 6 }, (_, index) => index)
const linkGroups = Array.from({ length: 4 }, (_, index) => index)
function PerfValue(props: { value: () => number }) {
- createRenderEffect(() => {
- void props.value()
- })
+ createRenderEffect(
+ () => props.value(),
+ () => {},
+ )
return null
}
@@ -66,7 +67,8 @@ function LinkPanel() {
return (
<>
- {(groupIndex) => {
+ {(groupIndexAccessor) => {
+ const groupIndex = groupIndexAccessor
const itemsId = groupIndex === 0 ? 1 : groupIndex + 2
const ctxId = groupIndex + 1
diff --git a/benchmarks/client-nav/solid/speed.bench.ts b/benchmarks/client-nav/solid/speed.bench.ts
index d629da17a8..34791180ce 100644
--- a/benchmarks/client-nav/solid/speed.bench.ts
+++ b/benchmarks/client-nav/solid/speed.bench.ts
@@ -1,19 +1,34 @@
-import { test } from 'vitest'
+import { afterAll, beforeAll, bench, describe } from 'vitest'
import { setup } from './setup'
-test('client-nav', async ({ bench }) => {
- const scenario = setup()
+describe('client-nav', () => {
+ const test = setup()
- await bench(
+ /**
+ * Running `vitest bench` ignores "suite hooks" like `beforeAll` and `afterAll`,
+ * so we use tinybench's `setup` and `teardown` options to run our setup and teardown logic.
+ *
+ * But CodSpeed calls the benchmarked function directly, bypassing `setup` and `teardown`,
+ * but it does support `beforeAll` and `afterAll`.
+ *
+ * So it looks like we're setting up in duplicate, but in reality, it's only running once per environment, as intended.
+ */
+
+ beforeAll(test.before)
+ afterAll(test.after)
+
+ bench(
'client-side navigation loop (solid)',
- { beforeAll: scenario.before, afterAll: scenario.after },
async () => {
for (let i = 0; i < 10; i++) {
- await scenario.tick()
+ await test.tick()
}
},
- ).run({
- warmupIterations: 100,
- time: 10_000,
- })
+ {
+ warmupIterations: 100,
+ time: 10_000,
+ setup: test.before,
+ teardown: test.after,
+ },
+ )
})
diff --git a/benchmarks/client-nav/solid/tsconfig.json b/benchmarks/client-nav/solid/tsconfig.json
index 4c500d0793..aa3cfb2444 100644
--- a/benchmarks/client-nav/solid/tsconfig.json
+++ b/benchmarks/client-nav/solid/tsconfig.json
@@ -3,7 +3,7 @@
"compilerOptions": {
"jsx": "preserve",
"allowImportingTsExtensions": true,
- "jsxImportSource": "solid-js",
+ "jsxImportSource": "@solidjs/web",
"types": ["node", "vite/client", "vitest/globals"]
},
"include": [
diff --git a/benchmarks/client-nav/solid/vite.config.ts b/benchmarks/client-nav/solid/vite.config.ts
index 0c26b32f5f..57c23312a5 100644
--- a/benchmarks/client-nav/solid/vite.config.ts
+++ b/benchmarks/client-nav/solid/vite.config.ts
@@ -1,8 +1,7 @@
import { fileURLToPath } from 'node:url'
import { defineConfig } from 'vitest/config'
-import solid from 'vite-plugin-solid'
+import solid from '@solidjs/vite-plugin'
import codspeedPlugin from '@codspeed/vitest-plugin'
-import { cpuSimulationExecArgv } from '../../cpu-simulation'
// Anchor the project root to the package directory so this config resolves
// identically when run directly and as part of an aggregate `projects` config.
@@ -16,7 +15,7 @@ export default defineConfig({
plugins: [
!!(process.env.VITEST && process.env.WITH_INSTRUMENTATION) &&
codspeedPlugin(),
- solid({ hot: false, dev: false }),
+ solid({ refresh: false, dev: false }),
],
build: {
outDir: './solid/dist',
@@ -32,12 +31,10 @@ export default defineConfig({
conditions: ['solid', 'browser'],
},
test: {
- execArgv: cpuSimulationExecArgv(),
name: '@benchmarks/client-nav (solid)',
watch: false,
environment: 'jsdom',
setupFiles: [`${rootDir}vitest.setup.ts`],
- benchmark: { include: ['solid/speed.bench.ts'] },
server: {
deps: {
inline: [/@solidjs/, /@tanstack\/solid-store/],
diff --git a/benchmarks/client-nav/vue/speed.bench.ts b/benchmarks/client-nav/vue/speed.bench.ts
index 503e91e7b7..f9e532f5ba 100644
--- a/benchmarks/client-nav/vue/speed.bench.ts
+++ b/benchmarks/client-nav/vue/speed.bench.ts
@@ -1,19 +1,34 @@
-import { test } from 'vitest'
+import { afterAll, beforeAll, bench, describe } from 'vitest'
import { setup } from './setup'
-test('client-nav', async ({ bench }) => {
- const scenario = setup()
+describe('client-nav', () => {
+ const test = setup()
- await bench(
+ /**
+ * Running `vitest bench` ignores "suite hooks" like `beforeAll` and `afterAll`,
+ * so we use tinybench's `setup` and `teardown` options to run our setup and teardown logic.
+ *
+ * But CodSpeed calls the benchmarked function directly, bypassing `setup` and `teardown`,
+ * but it does support `beforeAll` and `afterAll`.
+ *
+ * So it looks like we're setting up in duplicate, but in reality, it's only running once per environment, as intended.
+ */
+
+ beforeAll(test.before)
+ afterAll(test.after)
+
+ bench(
'client-side navigation loop (vue)',
- { beforeAll: scenario.before, afterAll: scenario.after },
async () => {
for (let i = 0; i < 10; i++) {
- await scenario.tick()
+ await test.tick()
}
},
- ).run({
- warmupIterations: 100,
- time: 10_000,
- })
+ {
+ warmupIterations: 100,
+ time: 10_000,
+ setup: test.before,
+ teardown: test.after,
+ },
+ )
})
diff --git a/benchmarks/client-nav/vue/vite.config.ts b/benchmarks/client-nav/vue/vite.config.ts
index 78d8ae5638..4c44c09fdd 100644
--- a/benchmarks/client-nav/vue/vite.config.ts
+++ b/benchmarks/client-nav/vue/vite.config.ts
@@ -3,7 +3,6 @@ import { defineConfig } from 'vitest/config'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import codspeedPlugin from '@codspeed/vitest-plugin'
-import { cpuSimulationExecArgv } from '../../cpu-simulation'
// Anchor the project root to the package directory so this config resolves
// identically when run directly and as part of an aggregate `projects` config.
@@ -31,11 +30,9 @@ export default defineConfig({
},
},
test: {
- execArgv: cpuSimulationExecArgv(),
name: '@benchmarks/client-nav (vue)',
watch: false,
environment: 'jsdom',
setupFiles: [`${rootDir}vitest.setup.ts`],
- benchmark: { include: ['vue/speed.bench.ts'] },
},
})
diff --git a/benchmarks/cpu-simulation.ts b/benchmarks/cpu-simulation.ts
deleted file mode 100644
index 9b8859f74d..0000000000
--- a/benchmarks/cpu-simulation.ts
+++ /dev/null
@@ -1,53 +0,0 @@
-function codspeedRunnerMode() {
- return process.env.CODSPEED_ENV === undefined
- ? undefined
- : process.env.CODSPEED_RUNNER_MODE
-}
-
-/**
- * Whether CodSpeed's simulation or memory instrument drives the run. Both
- * measure one invocation after a few warmup calls instead of sampling.
- */
-export function isCodSpeedAnalysis() {
- const mode = codspeedRunnerMode()
- return (
- mode === 'simulation' || mode === 'instrumentation' || mode === 'memory'
- )
-}
-
-/** Extra worker flags for CodSpeed CPU simulation, not walltime benchmarks. */
-export function cpuSimulationExecArgv() {
- const mode = codspeedRunnerMode()
- if (mode === 'simulation' || mode === 'instrumentation') {
- // CodSpeed supplies --no-opt, which only disables TurboFan on Node 24.
- // Maglev can still compile and inline hot functions between measured runs.
- // Compile baseline code on first use, so warmup does not leave functions
- // near Sparkplug's later tier-up/batch-compilation thresholds.
- // V8 renamed --scavenge-task in Node 20; CodSpeed's old flag is omitted.
- // Keep minor GC tied to allocations instead of scheduled foreground tasks.
- // Fix the initial/minimum old-generation allocation budget. This can skip
- // automatic full collections below the budget; minor GC remains enabled.
- return [
- '--no-maglev',
- '--always-sparkplug',
- '--no-minor-gc-task',
- '--initial-old-space-size=512',
- ]
- }
- return []
-}
-
-/**
- * Per-bench lifecycle for apps that a bench prepares and disposes outside
- * timing. CodSpeed measures one invocation, so each invocation gets fresh
- * state. Tinybench samples thousands of iterations and keeps one instance per
- * warmup/run phase instead of preparing it for every iteration.
- */
-export function benchLifecycle(hooks: {
- before: () => Promise | void
- after: () => Promise | void
-}) {
- return isCodSpeedAnalysis()
- ? { beforeEach: hooks.before, afterEach: hooks.after }
- : { beforeAll: hooks.before, afterAll: hooks.after }
-}
diff --git a/benchmarks/memory/README.md b/benchmarks/memory/README.md
index 18b68768f9..cf871f3439 100644
--- a/benchmarks/memory/README.md
+++ b/benchmarks/memory/README.md
@@ -2,7 +2,7 @@
Dedicated memory benchmarks for TanStack Router / Start, measured with the
CodSpeed **memory instrument** (`mode: memory` in
-`.github/workflows/benchmarks.yml`). The workflow runs on every
+`.github/workflows/client-nav-benchmarks.yml`). The workflow runs on every
push to `main` except docs/examples/e2e-only pushes: CodSpeed compares a PR
against the run on its merge-base commit, and a main commit without a run makes
CodSpeed silently fall back to an older base — a single outlier base run then
@@ -34,8 +34,8 @@ benchmarks/memory//
One app per scenario; apps and bench names are stable once landed (CodSpeed
continuity). Never grow an existing scenario for a new case — add a scenario.
`setup.ts` imports the built app and exports the concrete workload;
-`memory.bench.ts` registers it with Vitest's `bench` test fixture, and
-`memory.flame.ts` runs the same workload through the Flame profiler.
+`memory.bench.ts` registers `bench(...)` directly, and `memory.flame.ts` runs the
+same workload through the Flame profiler.
## How the memory instrument executes a bench
@@ -43,98 +43,40 @@ continuity). Never grow an existing scenario for a new case — add a scenario.
after a forced GC. Under plain `vitest bench` the suites only smoke-test:
timing output is meaningless; real numbers come from CodSpeed.
- Under CodSpeed the bench fn runs several warmup invocations plus the
- measured one. The bench's `beforeEach`/`afterEach` hooks
- (`memoryBenchHooks`) run around every invocation, outside the measurement
- window: client workloads mount a fresh app before each invocation and tear
- it down afterward. This prevents warmup navigation history and caches from
- changing the starting state. Plain `vitest bench` runs the same hooks around
- its warmup and measured iteration. Module-level counters/LCGs keep generated
- URLs unique across invocations.
-- Workload `run` functions must be `async` functions. CodSpeed's Vitest 5
- provider awaits only `AsyncFunction`s; a plain function that returns a
- promise would be measured only up to its first suspension.
-- Worker flags live in `runtime.ts` and apply only to the CodSpeed memory
- instrument. They supplement the integration's predictable execution flags;
- the retained overrides are described below.
-- Before each CodSpeed invocation, the `beforeEach` hook yields to the event
- loop, outside the measurement marker and before CodSpeed forces GC. Promise-only
- warmup chains can keep WeakRef targets alive through a collection in the same
- job. Client app setup also runs before the forced GC.
-- Do not force GC inside a measured request loop or poll `heapUsed` to choose
- how much work to do. Both introduce allocator activity from the harness into
- the measurement. Footprint scenarios run exactly one large request per
- invocation; churn scenarios retain their fixed sequential request counts.
-- Error-path cases use separate isolated workers so one case's module and
- allocator history cannot contaminate the next case.
+ measured one **on the same mount**, so bench fns must be idempotent and
+ module-level counters/LCGs are used where ids must never repeat across
+ invocations.
+- Plain `vitest bench` never runs suite hooks (`beforeAll`/`afterAll`) and
+ only honors tinybench's `setup`/`teardown` options; the CodSpeed runner
+ does the exact opposite. Client benches therefore register **both** — in
+ any given mode exactly one pair runs.
+- The process runs with V8 determinism flags (predictable GC schedule,
+ `--no-opt`). Never call `global.gc()` manually in **churn** scenarios —
+ their signal is accumulation across iterations, which a forced collection
+ masks. **Peak** scenarios do the opposite: they set
+ `pinGcBetweenIterations` on the request loop so a collection runs between
+ iterations. Their signal is the footprint of a single request, and without
+ pinned GC points the measured peak flips by a whole payload depending on
+ whether iteration i's garbage is collected before iteration i+1 allocates.
+ Because of `--no-opt`, allocation counts overstate production; numbers are
+ for regression tracking, not absolute claims.
- Keep each bench under **~1.5M allocations** (instrument overhead grows past
2M); this is the main constraint when tuning iteration counts.
-## Worker settings
-
-All scenarios use [`memoryConfig`](./runtime.ts). It adds these flags only in
-memory mode:
-
-- `--no-maglev`
-- `--no-flush-bytecode`
-- `--no-minor-gc-task`
-- `--no-incremental-marking`
-- `--initial-old-space-size=512`
-
-`--jitless` was removed after repeated CI comparisons. Ten unchanged-commit
-repetitions with the last four flags kept all 48 peak-memory results within 1%
-(worst spread: 0.834%). With JIT enabled, all 16 subsets of the four flags were
-tested. Removing bytecode, minor-GC-task, incremental-marking, or heap-budget
-overrides from this profile produced worst client peak spreads of 6.616%, 2.714%,
-2.109%, and 10.669%, respectively. Smaller combinations also exceeded 1% in at
-least one tracked metric. This supports retaining the four-flag profile; it does
-not establish that every override is required in every individual scenario.
-
-A server-only heap-budget profile initially passed five repetitions, but further
-confirmation produced a 24.46% server peak outlier. That configuration was
-rejected. Allocated bytes and allocation counts remain imperfectly repeatable:
-a client confirmation with the retained four flags showed a 6.77% allocated-byte
-spread and a 5.91% allocation-count spread. Client peaks remained within 0.834%
-across all 15 observations with the retained profile. Experiment details and CI runs are recorded in
-[PR #8260](https://github.com/TanStack/router/pull/8260).
-
-These settings trade production GC behavior for repeatable regression signals.
-They suppress bytecode reclamation and change collection scheduling. The 512 MiB
-initial/minimum old-generation allocation budget can postpone automatic full
-collections. This does not preallocate 512 MiB, and the smallest sufficient budget
-was not determined. Results describe this controlled worker profile, not a
-production application's absolute memory footprint.
-
-CodSpeed's `--no-opt` only disables TurboFan on Node 24 (V8 13); Maglev still
-compiles. Under CodSpeed's `--predictable` there is no background compilation,
-so Maglev compiles run synchronously inside whichever request triggers them, and
-the forced GC before the measured call can discard optimized code so recompiles
-land inside the measured window. Maglev's malloc'd Zone scratch (32 KiB
-segments) then dominates allocation metrics, and its size depends on
-per-process feedback state. `--no-maglev` was added for this: the bimodal
-+32,792 B / +1 allocation in `mem server error-paths unmatched (react)` was one
-Maglev Zone segment allocated while compiling React Fizz's per-request stream
-`write` closure, and compiler scratch made up ~97% of that bench's allocated
-bytes. Retained-object measurements are unaffected because Zone memory is freed
-after each compile. The repeatability figures above predate this flag.
-
## Bench shapes and signals
-- **Churn:** a fixed number of sequential operations, measuring native
- allocation activity and peak outstanding native allocations.
-- **Peak (footprint):** one large operation, measuring its native footprint.
-
-CodSpeed reports native allocator activity, not individual JavaScript object
-allocations or retained JS heap size. V8 can reuse heap pages without a visible
-native allocation. These benchmarks can detect native buffering and allocator
-regressions, but a flat graph does not establish that route data or JS objects
-are collectable. Absolute numbers include Node/framework/jsdom activity under
-benchmark-specific V8 settings; compare identical harness versions.
+- **Churn (leak detector):** N sequential iterations at steady state. If one
+ iteration leaks L bytes, peak grows by ~N·L; healthy builds show a flat
+ timeline floor independent of N. Tuning check: doubling N must leave peak
+ roughly unchanged.
+- **Peak (footprint):** one (or very few) large operations; peak memory
+ scaling with the workload is the signal.
## Scenarios
### Server
-| Scenario | Shape | Exercises |
+| Scenario | Shape | Guards against |
| ----------------------- | ----- | --------------------------------------------------------- |
| `request-churn` | churn | cross-request retention in document SSR (unique URLs) |
| `server-fn-churn` | churn | retention in the server-function RPC path |
@@ -146,7 +88,7 @@ benchmark-specific V8 settings; compare identical harness versions.
### Client
-| Scenario | Shape | Exercises |
+| Scenario | Shape | Guards against |
| ------------------------- | ----- | -------------------------------------------------------- |
| `navigation-churn` | churn | per-navigation retention at steady state |
| `unique-location-churn` | churn | unbounded href/search-keyed caches (never-repeated URLs) |
@@ -161,10 +103,14 @@ benchmark-specific V8 settings; compare identical harness versions.
server response is fully consumed before the next request. Pairing a single
navigation with its render signal via `Promise.all([navigate, rendered])`
is fine — never overlap distinct work items.
-- Randomness only via the seeded LCG in `bench-utils.ts`. Deferred streaming
- uses counted zero-delay timer hops to stage work. Timers still depend on the
- event loop, so validate repeatability on CI instead of assuming deterministic
- ordering from a zero delay alone.
+- Randomness only via the seeded LCG in `bench-utils.ts`; no `Math.random`,
+ `Date.now`, or timers with a nonzero delay — anywhere async ordering must be
+ staged (`streaming-peak`'s deferred sections, `aborted-requests`' deferred
+ loader data and post-abort drain), chain **0ms `setTimeout` hops** and count
+ event-loop turns instead. A wall-clock delay races renderer work differently
+ depending on runner load and instrumentation overhead, which makes the
+ single measured run non-reproducible; 0ms hops fire in registration order in
+ the timers phase, so the interleaving is a pure function of the schedule.
- Sanity assertions run once at module load and throw on wrong
status/markers, so a bench can never silently measure the wrong thing.
- Server requests follow `benchmarks/ssr` conventions: document GETs send
@@ -238,7 +184,7 @@ pnpm --filter @benchmarks/memory-client clean:profiles
```
Client memory benches are useful for regression tracking of router/React/jsdom
-integration behavior and native allocation activity. They are not pure
+integration behavior, especially retained route/cache data. They are not pure
browser-memory measurements, and local Flame attribution can include jsdom,
React DOM, and profiler shutdown frames.
@@ -254,20 +200,3 @@ WITH_INSTRUMENTATION=1 codspeed run --mode memory -- pnpm nx run @benchmarks/mem
WITH_INSTRUMENTATION=1 codspeed run --mode memory -- pnpm nx run @benchmarks/memory-client:test:perf:solid
WITH_INSTRUMENTATION=1 codspeed run --mode memory -- pnpm nx run @benchmarks/memory-client:test:perf:vue
```
-
-Run the benchmark workflow on an experiment branch:
-
-```bash
-gh workflow run benchmarks.yml --ref
-```
-
-Repeat at the same commit, using distinct branch names if runs should overlap
-(the workflow serializes runs on the same ref). Compare all 48 fresh memory
-results: 18 client and 30 server. Exclude CPU simulation results, inherited
-CodSpeed results, and failed or incomplete repetitions. For each workload, calculate
-`100 * (max / min - 1)` across runs for peak bytes, allocated bytes, and
-allocation counts; aggregate averages hide unstable cases.
-
-Observed spreads below 1% establish repeatability in the tested sample, not a
-bound on future runs. Changes to worker flags or workload lifecycles establish
-new measurement baselines.
diff --git a/benchmarks/memory/client/bench-utils.ts b/benchmarks/memory/client/bench-utils.ts
index 785e8fac7f..0cbaedbd71 100644
--- a/benchmarks/memory/client/bench-utils.ts
+++ b/benchmarks/memory/client/bench-utils.ts
@@ -1,5 +1,3 @@
-export { memoryBenchHooks } from '../turn'
-
export const memoryBenchOptions = {
iterations: 1,
warmupIterations: 1,
diff --git a/benchmarks/memory/client/benchmark.ts b/benchmarks/memory/client/benchmark.ts
index 463047f4d9..8b877b0740 100644
--- a/benchmarks/memory/client/benchmark.ts
+++ b/benchmarks/memory/client/benchmark.ts
@@ -1,10 +1,6 @@
export interface ClientMemoryWorkload {
name: string
before?: () => Promise | void
- /**
- * Must be an `async` function: CodSpeed's Vitest 5 provider awaits only
- * `AsyncFunction`s and otherwise measures just the synchronous part.
- */
run: () => Promise | void
sanity: () => Promise | void
after?: () => Promise | void
diff --git a/benchmarks/memory/client/package.json b/benchmarks/memory/client/package.json
index 4dc6246183..5c67b9118a 100644
--- a/benchmarks/memory/client/package.json
+++ b/benchmarks/memory/client/package.json
@@ -12,32 +12,31 @@
"#memory-client/lifecycle": "./lifecycle.ts"
},
"dependencies": {
+ "@solidjs/web": "^2.0.0-rc.20",
"@tanstack/react-router": "workspace:*",
"@tanstack/router-core": "workspace:*",
"@tanstack/solid-router": "workspace:*",
"@tanstack/vue-router": "workspace:*",
"react": "^19.0.0",
"react-dom": "^19.0.0",
- "solid-js": "^1.9.10",
+ "solid-js": "^2.0.0-rc.20",
"vue": "^3.5.16"
},
"devDependencies": {
- "@codspeed/vitest-plugin": "^6.0.1",
+ "@codspeed/vitest-plugin": "^5.5.0",
"@datadog/pprof": "^5.13.2",
"@platformatic/flame": "^1.6.0",
+ "@solidjs/vite-plugin": "^3.0.0-next.54",
"@testing-library/react": "^16.2.0",
"@vitejs/plugin-react": "^6.0.1",
"@vitejs/plugin-vue": "^6.0.5",
"@vitejs/plugin-vue-jsx": "^5.1.5",
"@types/jsdom": "28.0.0",
- "@types/react": "catalog:",
- "@types/react-dom": "catalog:",
"jsdom": "29.1.1",
"@typescript/native": "npm:typescript@^7.0.2",
"typescript": "npm:@typescript/typescript6@^6.0.2",
"vite": "^8.0.14",
- "vite-plugin-solid": "^2.11.11",
- "vitest": "catalog:"
+ "vitest": "^4.1.4"
},
"nx": {
"targets": {
@@ -202,7 +201,7 @@
"build:react"
],
"options": {
- "command": "NODE_ENV=production vitest bench --mode benchmark --config ./vitest.react.config.ts",
+ "command": "NODE_ENV=production vitest bench --config ./vitest.react.config.ts",
"cwd": "benchmarks/memory/client"
}
},
@@ -214,7 +213,7 @@
"build:solid"
],
"options": {
- "command": "NODE_ENV=production vitest bench --mode benchmark --config ./vitest.solid.config.ts",
+ "command": "NODE_ENV=production vitest bench --config ./vitest.solid.config.ts",
"cwd": "benchmarks/memory/client"
}
},
@@ -226,12 +225,12 @@
"build:vue"
],
"options": {
- "command": "NODE_ENV=production vitest bench --mode benchmark --config ./vitest.vue.config.ts",
+ "command": "NODE_ENV=production vitest bench --config ./vitest.vue.config.ts",
"cwd": "benchmarks/memory/client"
}
},
"test:types": {
- "executor": "nx:run-commands",
+ "executor": "nx:noop",
"dependsOn": [
{
"projects": [
@@ -256,17 +255,6 @@
],
"target": "test:types:client"
}
- ],
- "options": {
- "command": "tsc -p ./tsconfig.json --noEmit",
- "cwd": "benchmarks/memory/client"
- },
- "inputs": [
- "default",
- "^production",
- "{workspaceRoot}/eslint.config.js",
- "dependentTaskOutputs",
- "{workspaceRoot}/benchmarks/memory/*.ts"
]
}
}
diff --git a/benchmarks/memory/client/scenarios/interrupted-navigations/react/memory.bench.ts b/benchmarks/memory/client/scenarios/interrupted-navigations/react/memory.bench.ts
index 43ab822de3..e645ab38f1 100644
--- a/benchmarks/memory/client/scenarios/interrupted-navigations/react/memory.bench.ts
+++ b/benchmarks/memory/client/scenarios/interrupted-navigations/react/memory.bench.ts
@@ -1,14 +1,21 @@
-import { test } from 'vitest'
-import {
- memoryBenchHooks,
- memoryBenchOptions,
-} from '#memory-client/bench-utils'
+import { afterAll, beforeAll, bench, describe } from 'vitest'
+import { memoryBenchOptions } from '#memory-client/bench-utils'
import { workload } from './setup'
await workload.sanity()
-test('memory', async ({ bench }) => {
- await bench(workload.name, memoryBenchHooks(workload), workload.run).run(
- memoryBenchOptions,
- )
+describe('memory', () => {
+ if (workload.before && workload.after) {
+ beforeAll(workload.before)
+ afterAll(workload.after)
+
+ bench(workload.name, workload.run, {
+ ...memoryBenchOptions,
+ setup: workload.before,
+ teardown: workload.after,
+ })
+ return
+ }
+
+ bench(workload.name, workload.run, memoryBenchOptions)
})
diff --git a/benchmarks/memory/client/scenarios/interrupted-navigations/react/vite.config.ts b/benchmarks/memory/client/scenarios/interrupted-navigations/react/vite.config.ts
index 0f05cedf40..048a9cc833 100644
--- a/benchmarks/memory/client/scenarios/interrupted-navigations/react/vite.config.ts
+++ b/benchmarks/memory/client/scenarios/interrupted-navigations/react/vite.config.ts
@@ -2,7 +2,6 @@ import { fileURLToPath } from 'node:url'
import { defineConfig } from 'vitest/config'
import codspeedPlugin from '@codspeed/vitest-plugin'
import react from '@vitejs/plugin-react'
-import { memoryConfig } from '../../../../runtime'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -27,9 +26,9 @@ export default defineConfig({
},
},
test: {
- ...memoryConfig('client'),
name: '@benchmarks/memory-client interrupted-navigations (react)',
watch: false,
environment: 'jsdom',
+ setupFiles: ['../../../vitest.setup.ts'],
},
})
diff --git a/benchmarks/memory/client/scenarios/interrupted-navigations/solid/memory.bench.ts b/benchmarks/memory/client/scenarios/interrupted-navigations/solid/memory.bench.ts
index 43ab822de3..e645ab38f1 100644
--- a/benchmarks/memory/client/scenarios/interrupted-navigations/solid/memory.bench.ts
+++ b/benchmarks/memory/client/scenarios/interrupted-navigations/solid/memory.bench.ts
@@ -1,14 +1,21 @@
-import { test } from 'vitest'
-import {
- memoryBenchHooks,
- memoryBenchOptions,
-} from '#memory-client/bench-utils'
+import { afterAll, beforeAll, bench, describe } from 'vitest'
+import { memoryBenchOptions } from '#memory-client/bench-utils'
import { workload } from './setup'
await workload.sanity()
-test('memory', async ({ bench }) => {
- await bench(workload.name, memoryBenchHooks(workload), workload.run).run(
- memoryBenchOptions,
- )
+describe('memory', () => {
+ if (workload.before && workload.after) {
+ beforeAll(workload.before)
+ afterAll(workload.after)
+
+ bench(workload.name, workload.run, {
+ ...memoryBenchOptions,
+ setup: workload.before,
+ teardown: workload.after,
+ })
+ return
+ }
+
+ bench(workload.name, workload.run, memoryBenchOptions)
})
diff --git a/benchmarks/memory/client/scenarios/interrupted-navigations/solid/src/app.tsx b/benchmarks/memory/client/scenarios/interrupted-navigations/solid/src/app.tsx
index 6288b5fab1..9264e1cc51 100644
--- a/benchmarks/memory/client/scenarios/interrupted-navigations/solid/src/app.tsx
+++ b/benchmarks/memory/client/scenarios/interrupted-navigations/solid/src/app.tsx
@@ -1,5 +1,5 @@
import { RouterProvider } from '@tanstack/solid-router'
-import { render } from 'solid-js/web'
+import { render } from '@solidjs/web'
import { getRouter } from './router'
export {
diff --git a/benchmarks/memory/client/scenarios/interrupted-navigations/solid/tsconfig.json b/benchmarks/memory/client/scenarios/interrupted-navigations/solid/tsconfig.json
index b12dcb7ade..9558353c88 100644
--- a/benchmarks/memory/client/scenarios/interrupted-navigations/solid/tsconfig.json
+++ b/benchmarks/memory/client/scenarios/interrupted-navigations/solid/tsconfig.json
@@ -3,7 +3,7 @@
"compilerOptions": {
"jsx": "preserve",
"allowImportingTsExtensions": true,
- "jsxImportSource": "solid-js",
+ "jsxImportSource": "@solidjs/web",
"types": ["node", "vite/client", "vitest/globals"]
},
"include": [
diff --git a/benchmarks/memory/client/scenarios/interrupted-navigations/solid/vite.config.ts b/benchmarks/memory/client/scenarios/interrupted-navigations/solid/vite.config.ts
index 26ff0b5c8c..d7c4a8d9d2 100644
--- a/benchmarks/memory/client/scenarios/interrupted-navigations/solid/vite.config.ts
+++ b/benchmarks/memory/client/scenarios/interrupted-navigations/solid/vite.config.ts
@@ -1,8 +1,7 @@
import { fileURLToPath } from 'node:url'
import { defineConfig } from 'vitest/config'
import codspeedPlugin from '@codspeed/vitest-plugin'
-import solid from 'vite-plugin-solid'
-import { memoryConfig } from '../../../../runtime'
+import solid from '@solidjs/vite-plugin'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -14,7 +13,7 @@ export default defineConfig({
plugins: [
!!(process.env.VITEST && process.env.WITH_INSTRUMENTATION) &&
codspeedPlugin(),
- solid({ hot: false, dev: false }),
+ solid({ refresh: false, dev: false }),
],
build: {
outDir: './dist',
@@ -27,9 +26,9 @@ export default defineConfig({
},
},
test: {
- ...memoryConfig('client'),
name: '@benchmarks/memory-client interrupted-navigations (solid)',
watch: false,
environment: 'jsdom',
+ setupFiles: ['../../../vitest.setup.ts'],
},
})
diff --git a/benchmarks/memory/client/scenarios/interrupted-navigations/vue/memory.bench.ts b/benchmarks/memory/client/scenarios/interrupted-navigations/vue/memory.bench.ts
index 43ab822de3..e645ab38f1 100644
--- a/benchmarks/memory/client/scenarios/interrupted-navigations/vue/memory.bench.ts
+++ b/benchmarks/memory/client/scenarios/interrupted-navigations/vue/memory.bench.ts
@@ -1,14 +1,21 @@
-import { test } from 'vitest'
-import {
- memoryBenchHooks,
- memoryBenchOptions,
-} from '#memory-client/bench-utils'
+import { afterAll, beforeAll, bench, describe } from 'vitest'
+import { memoryBenchOptions } from '#memory-client/bench-utils'
import { workload } from './setup'
await workload.sanity()
-test('memory', async ({ bench }) => {
- await bench(workload.name, memoryBenchHooks(workload), workload.run).run(
- memoryBenchOptions,
- )
+describe('memory', () => {
+ if (workload.before && workload.after) {
+ beforeAll(workload.before)
+ afterAll(workload.after)
+
+ bench(workload.name, workload.run, {
+ ...memoryBenchOptions,
+ setup: workload.before,
+ teardown: workload.after,
+ })
+ return
+ }
+
+ bench(workload.name, workload.run, memoryBenchOptions)
})
diff --git a/benchmarks/memory/client/scenarios/interrupted-navigations/vue/src/routes/fast.$id.tsx b/benchmarks/memory/client/scenarios/interrupted-navigations/vue/src/routes/fast.$id.tsx
index f6dc9ac3bd..3bd820bd07 100644
--- a/benchmarks/memory/client/scenarios/interrupted-navigations/vue/src/routes/fast.$id.tsx
+++ b/benchmarks/memory/client/scenarios/interrupted-navigations/vue/src/routes/fast.$id.tsx
@@ -1,19 +1,6 @@
-import { defineComponent } from 'vue'
import { createFileRoute } from '@tanstack/vue-router'
import { fixedTimestamp } from '../../../slow-loaders'
-const FastComponent = defineComponent({
- setup() {
- const data = Route.useLoaderData()
-
- return () => (
-
- {`${data.value.kind}:${data.value.id}:${data.value.ts}`}
-
- )
- },
-})
-
export const Route = createFileRoute('/fast/$id')({
loader: ({ params }: { params: { id: string } }) => ({
id: params.id,
@@ -22,3 +9,13 @@ export const Route = createFileRoute('/fast/$id')({
}),
component: FastComponent,
})
+
+function FastComponent() {
+ const data = Route.useLoaderData()
+
+ return (
+
+ {`${data.value.kind}:${data.value.id}:${data.value.ts}`}
+
+ )
+}
diff --git a/benchmarks/memory/client/scenarios/interrupted-navigations/vue/src/routes/slow.$id.tsx b/benchmarks/memory/client/scenarios/interrupted-navigations/vue/src/routes/slow.$id.tsx
index 3b5bb75ede..68885fb918 100644
--- a/benchmarks/memory/client/scenarios/interrupted-navigations/vue/src/routes/slow.$id.tsx
+++ b/benchmarks/memory/client/scenarios/interrupted-navigations/vue/src/routes/slow.$id.tsx
@@ -1,19 +1,6 @@
-import { defineComponent } from 'vue'
import { createFileRoute } from '@tanstack/vue-router'
import { getSlowLoaderDeferred } from '../../../slow-loaders'
-const SlowComponent = defineComponent({
- setup() {
- const data = Route.useLoaderData()
-
- return () => (
-
- {`${data.value.kind}:${data.value.id}:${data.value.ts}`}
-
- )
- },
-})
-
export const Route = createFileRoute('/slow/$id')({
loader: async ({ params }: { params: { id: string } }) => {
const deferred = getSlowLoaderDeferred(params.id)
@@ -22,3 +9,13 @@ export const Route = createFileRoute('/slow/$id')({
},
component: SlowComponent,
})
+
+function SlowComponent() {
+ const data = Route.useLoaderData()
+
+ return (
+
+ {`${data.value.kind}:${data.value.id}:${data.value.ts}`}
+
+ )
+}
diff --git a/benchmarks/memory/client/scenarios/interrupted-navigations/vue/vite.config.ts b/benchmarks/memory/client/scenarios/interrupted-navigations/vue/vite.config.ts
index 02574908d2..b2912ce9d1 100644
--- a/benchmarks/memory/client/scenarios/interrupted-navigations/vue/vite.config.ts
+++ b/benchmarks/memory/client/scenarios/interrupted-navigations/vue/vite.config.ts
@@ -3,7 +3,6 @@ import { defineConfig } from 'vitest/config'
import codspeedPlugin from '@codspeed/vitest-plugin'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
-import { memoryConfig } from '../../../../runtime'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -29,9 +28,9 @@ export default defineConfig({
},
},
test: {
- ...memoryConfig('client'),
name: '@benchmarks/memory-client interrupted-navigations (vue)',
watch: false,
environment: 'jsdom',
+ setupFiles: ['../../../vitest.setup.ts'],
},
})
diff --git a/benchmarks/memory/client/scenarios/loader-data-retention/react/memory.bench.ts b/benchmarks/memory/client/scenarios/loader-data-retention/react/memory.bench.ts
index 43ab822de3..e645ab38f1 100644
--- a/benchmarks/memory/client/scenarios/loader-data-retention/react/memory.bench.ts
+++ b/benchmarks/memory/client/scenarios/loader-data-retention/react/memory.bench.ts
@@ -1,14 +1,21 @@
-import { test } from 'vitest'
-import {
- memoryBenchHooks,
- memoryBenchOptions,
-} from '#memory-client/bench-utils'
+import { afterAll, beforeAll, bench, describe } from 'vitest'
+import { memoryBenchOptions } from '#memory-client/bench-utils'
import { workload } from './setup'
await workload.sanity()
-test('memory', async ({ bench }) => {
- await bench(workload.name, memoryBenchHooks(workload), workload.run).run(
- memoryBenchOptions,
- )
+describe('memory', () => {
+ if (workload.before && workload.after) {
+ beforeAll(workload.before)
+ afterAll(workload.after)
+
+ bench(workload.name, workload.run, {
+ ...memoryBenchOptions,
+ setup: workload.before,
+ teardown: workload.after,
+ })
+ return
+ }
+
+ bench(workload.name, workload.run, memoryBenchOptions)
})
diff --git a/benchmarks/memory/client/scenarios/loader-data-retention/react/vite.config.ts b/benchmarks/memory/client/scenarios/loader-data-retention/react/vite.config.ts
index 8630417936..555e5f5612 100644
--- a/benchmarks/memory/client/scenarios/loader-data-retention/react/vite.config.ts
+++ b/benchmarks/memory/client/scenarios/loader-data-retention/react/vite.config.ts
@@ -2,7 +2,6 @@ import { fileURLToPath } from 'node:url'
import { defineConfig } from 'vitest/config'
import codspeedPlugin from '@codspeed/vitest-plugin'
import react from '@vitejs/plugin-react'
-import { memoryConfig } from '../../../../runtime'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -27,9 +26,9 @@ export default defineConfig({
},
},
test: {
- ...memoryConfig('client'),
name: '@benchmarks/memory-client loader-data-retention (react)',
watch: false,
environment: 'jsdom',
+ setupFiles: ['../../../vitest.setup.ts'],
},
})
diff --git a/benchmarks/memory/client/scenarios/loader-data-retention/solid/memory.bench.ts b/benchmarks/memory/client/scenarios/loader-data-retention/solid/memory.bench.ts
index 43ab822de3..e645ab38f1 100644
--- a/benchmarks/memory/client/scenarios/loader-data-retention/solid/memory.bench.ts
+++ b/benchmarks/memory/client/scenarios/loader-data-retention/solid/memory.bench.ts
@@ -1,14 +1,21 @@
-import { test } from 'vitest'
-import {
- memoryBenchHooks,
- memoryBenchOptions,
-} from '#memory-client/bench-utils'
+import { afterAll, beforeAll, bench, describe } from 'vitest'
+import { memoryBenchOptions } from '#memory-client/bench-utils'
import { workload } from './setup'
await workload.sanity()
-test('memory', async ({ bench }) => {
- await bench(workload.name, memoryBenchHooks(workload), workload.run).run(
- memoryBenchOptions,
- )
+describe('memory', () => {
+ if (workload.before && workload.after) {
+ beforeAll(workload.before)
+ afterAll(workload.after)
+
+ bench(workload.name, workload.run, {
+ ...memoryBenchOptions,
+ setup: workload.before,
+ teardown: workload.after,
+ })
+ return
+ }
+
+ bench(workload.name, workload.run, memoryBenchOptions)
})
diff --git a/benchmarks/memory/client/scenarios/loader-data-retention/solid/src/app.tsx b/benchmarks/memory/client/scenarios/loader-data-retention/solid/src/app.tsx
index 4315a4b15c..1b47cda1f9 100644
--- a/benchmarks/memory/client/scenarios/loader-data-retention/solid/src/app.tsx
+++ b/benchmarks/memory/client/scenarios/loader-data-retention/solid/src/app.tsx
@@ -1,5 +1,5 @@
import { RouterProvider } from '@tanstack/solid-router'
-import { render } from 'solid-js/web'
+import { render } from '@solidjs/web'
import { getRouter } from './router'
export { loaderPayloadRecordCount } from '../../loader-data'
diff --git a/benchmarks/memory/client/scenarios/loader-data-retention/solid/tsconfig.json b/benchmarks/memory/client/scenarios/loader-data-retention/solid/tsconfig.json
index b12dcb7ade..9558353c88 100644
--- a/benchmarks/memory/client/scenarios/loader-data-retention/solid/tsconfig.json
+++ b/benchmarks/memory/client/scenarios/loader-data-retention/solid/tsconfig.json
@@ -3,7 +3,7 @@
"compilerOptions": {
"jsx": "preserve",
"allowImportingTsExtensions": true,
- "jsxImportSource": "solid-js",
+ "jsxImportSource": "@solidjs/web",
"types": ["node", "vite/client", "vitest/globals"]
},
"include": [
diff --git a/benchmarks/memory/client/scenarios/loader-data-retention/solid/vite.config.ts b/benchmarks/memory/client/scenarios/loader-data-retention/solid/vite.config.ts
index 5dfd5b53fe..b2bcdee643 100644
--- a/benchmarks/memory/client/scenarios/loader-data-retention/solid/vite.config.ts
+++ b/benchmarks/memory/client/scenarios/loader-data-retention/solid/vite.config.ts
@@ -1,8 +1,7 @@
import { fileURLToPath } from 'node:url'
import { defineConfig } from 'vitest/config'
import codspeedPlugin from '@codspeed/vitest-plugin'
-import solid from 'vite-plugin-solid'
-import { memoryConfig } from '../../../../runtime'
+import solid from '@solidjs/vite-plugin'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -14,7 +13,7 @@ export default defineConfig({
plugins: [
!!(process.env.VITEST && process.env.WITH_INSTRUMENTATION) &&
codspeedPlugin(),
- solid({ hot: false, dev: false }),
+ solid({ refresh: false, dev: false }),
],
build: {
outDir: './dist',
@@ -27,9 +26,9 @@ export default defineConfig({
},
},
test: {
- ...memoryConfig('client'),
name: '@benchmarks/memory-client loader-data-retention (solid)',
watch: false,
environment: 'jsdom',
+ setupFiles: ['../../../vitest.setup.ts'],
},
})
diff --git a/benchmarks/memory/client/scenarios/loader-data-retention/vue/memory.bench.ts b/benchmarks/memory/client/scenarios/loader-data-retention/vue/memory.bench.ts
index 43ab822de3..e645ab38f1 100644
--- a/benchmarks/memory/client/scenarios/loader-data-retention/vue/memory.bench.ts
+++ b/benchmarks/memory/client/scenarios/loader-data-retention/vue/memory.bench.ts
@@ -1,14 +1,21 @@
-import { test } from 'vitest'
-import {
- memoryBenchHooks,
- memoryBenchOptions,
-} from '#memory-client/bench-utils'
+import { afterAll, beforeAll, bench, describe } from 'vitest'
+import { memoryBenchOptions } from '#memory-client/bench-utils'
import { workload } from './setup'
await workload.sanity()
-test('memory', async ({ bench }) => {
- await bench(workload.name, memoryBenchHooks(workload), workload.run).run(
- memoryBenchOptions,
- )
+describe('memory', () => {
+ if (workload.before && workload.after) {
+ beforeAll(workload.before)
+ afterAll(workload.after)
+
+ bench(workload.name, workload.run, {
+ ...memoryBenchOptions,
+ setup: workload.before,
+ teardown: workload.after,
+ })
+ return
+ }
+
+ bench(workload.name, workload.run, memoryBenchOptions)
})
diff --git a/benchmarks/memory/client/scenarios/loader-data-retention/vue/src/routes/page.$id.tsx b/benchmarks/memory/client/scenarios/loader-data-retention/vue/src/routes/page.$id.tsx
index 38f1d2614c..9f4b3c4470 100644
--- a/benchmarks/memory/client/scenarios/loader-data-retention/vue/src/routes/page.$id.tsx
+++ b/benchmarks/memory/client/scenarios/loader-data-retention/vue/src/routes/page.$id.tsx
@@ -1,25 +1,22 @@
-import { defineComponent } from 'vue'
import { createFileRoute } from '@tanstack/vue-router'
import { createLoaderData } from '../../../loader-data'
-const PageComponent = defineComponent({
- setup() {
- const data = Route.useLoaderData()
-
- return () => (
-
- {`${data.value.id}:${data.value.records.length}`}
-
- )
- },
-})
-
export const Route = createFileRoute('/page/$id')({
loader: ({ params }: { params: { id: string } }) =>
createLoaderData(params.id),
component: PageComponent,
})
+
+function PageComponent() {
+ const data = Route.useLoaderData()
+
+ return (
+
+ {`${data.value.id}:${data.value.records.length}`}
+
+ )
+}
diff --git a/benchmarks/memory/client/scenarios/loader-data-retention/vue/vite.config.ts b/benchmarks/memory/client/scenarios/loader-data-retention/vue/vite.config.ts
index 006636eaa0..bbf2fd02d8 100644
--- a/benchmarks/memory/client/scenarios/loader-data-retention/vue/vite.config.ts
+++ b/benchmarks/memory/client/scenarios/loader-data-retention/vue/vite.config.ts
@@ -3,7 +3,6 @@ import { defineConfig } from 'vitest/config'
import codspeedPlugin from '@codspeed/vitest-plugin'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
-import { memoryConfig } from '../../../../runtime'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -29,9 +28,9 @@ export default defineConfig({
},
},
test: {
- ...memoryConfig('client'),
name: '@benchmarks/memory-client loader-data-retention (vue)',
watch: false,
environment: 'jsdom',
+ setupFiles: ['../../../vitest.setup.ts'],
},
})
diff --git a/benchmarks/memory/client/scenarios/mount-unmount/react/memory.bench.ts b/benchmarks/memory/client/scenarios/mount-unmount/react/memory.bench.ts
index 43ab822de3..e645ab38f1 100644
--- a/benchmarks/memory/client/scenarios/mount-unmount/react/memory.bench.ts
+++ b/benchmarks/memory/client/scenarios/mount-unmount/react/memory.bench.ts
@@ -1,14 +1,21 @@
-import { test } from 'vitest'
-import {
- memoryBenchHooks,
- memoryBenchOptions,
-} from '#memory-client/bench-utils'
+import { afterAll, beforeAll, bench, describe } from 'vitest'
+import { memoryBenchOptions } from '#memory-client/bench-utils'
import { workload } from './setup'
await workload.sanity()
-test('memory', async ({ bench }) => {
- await bench(workload.name, memoryBenchHooks(workload), workload.run).run(
- memoryBenchOptions,
- )
+describe('memory', () => {
+ if (workload.before && workload.after) {
+ beforeAll(workload.before)
+ afterAll(workload.after)
+
+ bench(workload.name, workload.run, {
+ ...memoryBenchOptions,
+ setup: workload.before,
+ teardown: workload.after,
+ })
+ return
+ }
+
+ bench(workload.name, workload.run, memoryBenchOptions)
})
diff --git a/benchmarks/memory/client/scenarios/mount-unmount/react/vite.config.ts b/benchmarks/memory/client/scenarios/mount-unmount/react/vite.config.ts
index a08352a837..bb0f3c2e0a 100644
--- a/benchmarks/memory/client/scenarios/mount-unmount/react/vite.config.ts
+++ b/benchmarks/memory/client/scenarios/mount-unmount/react/vite.config.ts
@@ -2,7 +2,6 @@ import { fileURLToPath } from 'node:url'
import { defineConfig } from 'vitest/config'
import codspeedPlugin from '@codspeed/vitest-plugin'
import react from '@vitejs/plugin-react'
-import { memoryConfig } from '../../../../runtime'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -27,9 +26,9 @@ export default defineConfig({
},
},
test: {
- ...memoryConfig('client'),
name: '@benchmarks/memory-client mount-unmount (react)',
watch: false,
environment: 'jsdom',
+ setupFiles: ['../../../vitest.setup.ts'],
},
})
diff --git a/benchmarks/memory/client/scenarios/mount-unmount/solid/memory.bench.ts b/benchmarks/memory/client/scenarios/mount-unmount/solid/memory.bench.ts
index 43ab822de3..e645ab38f1 100644
--- a/benchmarks/memory/client/scenarios/mount-unmount/solid/memory.bench.ts
+++ b/benchmarks/memory/client/scenarios/mount-unmount/solid/memory.bench.ts
@@ -1,14 +1,21 @@
-import { test } from 'vitest'
-import {
- memoryBenchHooks,
- memoryBenchOptions,
-} from '#memory-client/bench-utils'
+import { afterAll, beforeAll, bench, describe } from 'vitest'
+import { memoryBenchOptions } from '#memory-client/bench-utils'
import { workload } from './setup'
await workload.sanity()
-test('memory', async ({ bench }) => {
- await bench(workload.name, memoryBenchHooks(workload), workload.run).run(
- memoryBenchOptions,
- )
+describe('memory', () => {
+ if (workload.before && workload.after) {
+ beforeAll(workload.before)
+ afterAll(workload.after)
+
+ bench(workload.name, workload.run, {
+ ...memoryBenchOptions,
+ setup: workload.before,
+ teardown: workload.after,
+ })
+ return
+ }
+
+ bench(workload.name, workload.run, memoryBenchOptions)
})
diff --git a/benchmarks/memory/client/scenarios/mount-unmount/solid/src/app.tsx b/benchmarks/memory/client/scenarios/mount-unmount/solid/src/app.tsx
index b23bc126d5..e82e21bd97 100644
--- a/benchmarks/memory/client/scenarios/mount-unmount/solid/src/app.tsx
+++ b/benchmarks/memory/client/scenarios/mount-unmount/solid/src/app.tsx
@@ -1,5 +1,5 @@
import { RouterProvider } from '@tanstack/solid-router'
-import { render } from 'solid-js/web'
+import { render } from '@solidjs/web'
import { getRouter } from './router'
export function mountTestApp(container: Element) {
diff --git a/benchmarks/memory/client/scenarios/mount-unmount/solid/tsconfig.json b/benchmarks/memory/client/scenarios/mount-unmount/solid/tsconfig.json
index b12dcb7ade..9558353c88 100644
--- a/benchmarks/memory/client/scenarios/mount-unmount/solid/tsconfig.json
+++ b/benchmarks/memory/client/scenarios/mount-unmount/solid/tsconfig.json
@@ -3,7 +3,7 @@
"compilerOptions": {
"jsx": "preserve",
"allowImportingTsExtensions": true,
- "jsxImportSource": "solid-js",
+ "jsxImportSource": "@solidjs/web",
"types": ["node", "vite/client", "vitest/globals"]
},
"include": [
diff --git a/benchmarks/memory/client/scenarios/mount-unmount/solid/vite.config.ts b/benchmarks/memory/client/scenarios/mount-unmount/solid/vite.config.ts
index 33699639de..d5727728e6 100644
--- a/benchmarks/memory/client/scenarios/mount-unmount/solid/vite.config.ts
+++ b/benchmarks/memory/client/scenarios/mount-unmount/solid/vite.config.ts
@@ -1,8 +1,7 @@
import { fileURLToPath } from 'node:url'
import { defineConfig } from 'vitest/config'
import codspeedPlugin from '@codspeed/vitest-plugin'
-import solid from 'vite-plugin-solid'
-import { memoryConfig } from '../../../../runtime'
+import solid from '@solidjs/vite-plugin'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -14,7 +13,7 @@ export default defineConfig({
plugins: [
!!(process.env.VITEST && process.env.WITH_INSTRUMENTATION) &&
codspeedPlugin(),
- solid({ hot: false, dev: false }),
+ solid({ refresh: false, dev: false }),
],
build: {
outDir: './dist',
@@ -27,9 +26,9 @@ export default defineConfig({
},
},
test: {
- ...memoryConfig('client'),
name: '@benchmarks/memory-client mount-unmount (solid)',
watch: false,
environment: 'jsdom',
+ setupFiles: ['../../../vitest.setup.ts'],
},
})
diff --git a/benchmarks/memory/client/scenarios/mount-unmount/vue/memory.bench.ts b/benchmarks/memory/client/scenarios/mount-unmount/vue/memory.bench.ts
index 43ab822de3..e645ab38f1 100644
--- a/benchmarks/memory/client/scenarios/mount-unmount/vue/memory.bench.ts
+++ b/benchmarks/memory/client/scenarios/mount-unmount/vue/memory.bench.ts
@@ -1,14 +1,21 @@
-import { test } from 'vitest'
-import {
- memoryBenchHooks,
- memoryBenchOptions,
-} from '#memory-client/bench-utils'
+import { afterAll, beforeAll, bench, describe } from 'vitest'
+import { memoryBenchOptions } from '#memory-client/bench-utils'
import { workload } from './setup'
await workload.sanity()
-test('memory', async ({ bench }) => {
- await bench(workload.name, memoryBenchHooks(workload), workload.run).run(
- memoryBenchOptions,
- )
+describe('memory', () => {
+ if (workload.before && workload.after) {
+ beforeAll(workload.before)
+ afterAll(workload.after)
+
+ bench(workload.name, workload.run, {
+ ...memoryBenchOptions,
+ setup: workload.before,
+ teardown: workload.after,
+ })
+ return
+ }
+
+ bench(workload.name, workload.run, memoryBenchOptions)
})
diff --git a/benchmarks/memory/client/scenarios/mount-unmount/vue/src/routes/a.tsx b/benchmarks/memory/client/scenarios/mount-unmount/vue/src/routes/a.tsx
index 0dd650e1dd..cbcd543ce5 100644
--- a/benchmarks/memory/client/scenarios/mount-unmount/vue/src/routes/a.tsx
+++ b/benchmarks/memory/client/scenarios/mount-unmount/vue/src/routes/a.tsx
@@ -1,15 +1,12 @@
-import { defineComponent } from 'vue'
import { createFileRoute } from '@tanstack/vue-router'
-const AComponent = defineComponent({
- setup() {
- const data = Route.useLoaderData()
-
- return () => {data.value.id}
- },
-})
-
export const Route = createFileRoute('/a')({
loader: () => ({ id: 'a' }),
component: AComponent,
})
+
+function AComponent() {
+ const data = Route.useLoaderData()
+
+ return {data.value.id}
+}
diff --git a/benchmarks/memory/client/scenarios/mount-unmount/vue/vite.config.ts b/benchmarks/memory/client/scenarios/mount-unmount/vue/vite.config.ts
index a3f0eeaa8c..0f7573a408 100644
--- a/benchmarks/memory/client/scenarios/mount-unmount/vue/vite.config.ts
+++ b/benchmarks/memory/client/scenarios/mount-unmount/vue/vite.config.ts
@@ -3,7 +3,6 @@ import { defineConfig } from 'vitest/config'
import codspeedPlugin from '@codspeed/vitest-plugin'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
-import { memoryConfig } from '../../../../runtime'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -29,9 +28,9 @@ export default defineConfig({
},
},
test: {
- ...memoryConfig('client'),
name: '@benchmarks/memory-client mount-unmount (vue)',
watch: false,
environment: 'jsdom',
+ setupFiles: ['../../../vitest.setup.ts'],
},
})
diff --git a/benchmarks/memory/client/scenarios/navigation-churn/react/memory.bench.ts b/benchmarks/memory/client/scenarios/navigation-churn/react/memory.bench.ts
index 43ab822de3..e645ab38f1 100644
--- a/benchmarks/memory/client/scenarios/navigation-churn/react/memory.bench.ts
+++ b/benchmarks/memory/client/scenarios/navigation-churn/react/memory.bench.ts
@@ -1,14 +1,21 @@
-import { test } from 'vitest'
-import {
- memoryBenchHooks,
- memoryBenchOptions,
-} from '#memory-client/bench-utils'
+import { afterAll, beforeAll, bench, describe } from 'vitest'
+import { memoryBenchOptions } from '#memory-client/bench-utils'
import { workload } from './setup'
await workload.sanity()
-test('memory', async ({ bench }) => {
- await bench(workload.name, memoryBenchHooks(workload), workload.run).run(
- memoryBenchOptions,
- )
+describe('memory', () => {
+ if (workload.before && workload.after) {
+ beforeAll(workload.before)
+ afterAll(workload.after)
+
+ bench(workload.name, workload.run, {
+ ...memoryBenchOptions,
+ setup: workload.before,
+ teardown: workload.after,
+ })
+ return
+ }
+
+ bench(workload.name, workload.run, memoryBenchOptions)
})
diff --git a/benchmarks/memory/client/scenarios/navigation-churn/react/vite.config.ts b/benchmarks/memory/client/scenarios/navigation-churn/react/vite.config.ts
index eef60a658e..b05b999297 100644
--- a/benchmarks/memory/client/scenarios/navigation-churn/react/vite.config.ts
+++ b/benchmarks/memory/client/scenarios/navigation-churn/react/vite.config.ts
@@ -2,7 +2,6 @@ import { fileURLToPath } from 'node:url'
import { defineConfig } from 'vitest/config'
import codspeedPlugin from '@codspeed/vitest-plugin'
import react from '@vitejs/plugin-react'
-import { memoryConfig } from '../../../../runtime'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -27,9 +26,9 @@ export default defineConfig({
},
},
test: {
- ...memoryConfig('client'),
name: '@benchmarks/memory-client navigation-churn (react)',
watch: false,
environment: 'jsdom',
+ setupFiles: ['../../../vitest.setup.ts'],
},
})
diff --git a/benchmarks/memory/client/scenarios/navigation-churn/solid/memory.bench.ts b/benchmarks/memory/client/scenarios/navigation-churn/solid/memory.bench.ts
index 43ab822de3..e645ab38f1 100644
--- a/benchmarks/memory/client/scenarios/navigation-churn/solid/memory.bench.ts
+++ b/benchmarks/memory/client/scenarios/navigation-churn/solid/memory.bench.ts
@@ -1,14 +1,21 @@
-import { test } from 'vitest'
-import {
- memoryBenchHooks,
- memoryBenchOptions,
-} from '#memory-client/bench-utils'
+import { afterAll, beforeAll, bench, describe } from 'vitest'
+import { memoryBenchOptions } from '#memory-client/bench-utils'
import { workload } from './setup'
await workload.sanity()
-test('memory', async ({ bench }) => {
- await bench(workload.name, memoryBenchHooks(workload), workload.run).run(
- memoryBenchOptions,
- )
+describe('memory', () => {
+ if (workload.before && workload.after) {
+ beforeAll(workload.before)
+ afterAll(workload.after)
+
+ bench(workload.name, workload.run, {
+ ...memoryBenchOptions,
+ setup: workload.before,
+ teardown: workload.after,
+ })
+ return
+ }
+
+ bench(workload.name, workload.run, memoryBenchOptions)
})
diff --git a/benchmarks/memory/client/scenarios/navigation-churn/solid/src/app.tsx b/benchmarks/memory/client/scenarios/navigation-churn/solid/src/app.tsx
index 16000c90a1..5917ef0191 100644
--- a/benchmarks/memory/client/scenarios/navigation-churn/solid/src/app.tsx
+++ b/benchmarks/memory/client/scenarios/navigation-churn/solid/src/app.tsx
@@ -1,5 +1,5 @@
import { RouterProvider } from '@tanstack/solid-router'
-import { render } from 'solid-js/web'
+import { render } from '@solidjs/web'
import { getRouter } from './router'
export function mountTestApp(container: Element) {
diff --git a/benchmarks/memory/client/scenarios/navigation-churn/solid/tsconfig.json b/benchmarks/memory/client/scenarios/navigation-churn/solid/tsconfig.json
index b12dcb7ade..9558353c88 100644
--- a/benchmarks/memory/client/scenarios/navigation-churn/solid/tsconfig.json
+++ b/benchmarks/memory/client/scenarios/navigation-churn/solid/tsconfig.json
@@ -3,7 +3,7 @@
"compilerOptions": {
"jsx": "preserve",
"allowImportingTsExtensions": true,
- "jsxImportSource": "solid-js",
+ "jsxImportSource": "@solidjs/web",
"types": ["node", "vite/client", "vitest/globals"]
},
"include": [
diff --git a/benchmarks/memory/client/scenarios/navigation-churn/solid/vite.config.ts b/benchmarks/memory/client/scenarios/navigation-churn/solid/vite.config.ts
index 7dfb186b2e..c885d5edcb 100644
--- a/benchmarks/memory/client/scenarios/navigation-churn/solid/vite.config.ts
+++ b/benchmarks/memory/client/scenarios/navigation-churn/solid/vite.config.ts
@@ -1,8 +1,7 @@
import { fileURLToPath } from 'node:url'
import { defineConfig } from 'vitest/config'
import codspeedPlugin from '@codspeed/vitest-plugin'
-import solid from 'vite-plugin-solid'
-import { memoryConfig } from '../../../../runtime'
+import solid from '@solidjs/vite-plugin'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -14,7 +13,7 @@ export default defineConfig({
plugins: [
!!(process.env.VITEST && process.env.WITH_INSTRUMENTATION) &&
codspeedPlugin(),
- solid({ hot: false, dev: false }),
+ solid({ refresh: false, dev: false }),
],
build: {
outDir: './dist',
@@ -27,9 +26,9 @@ export default defineConfig({
},
},
test: {
- ...memoryConfig('client'),
name: '@benchmarks/memory-client navigation-churn (solid)',
watch: false,
environment: 'jsdom',
+ setupFiles: ['../../../vitest.setup.ts'],
},
})
diff --git a/benchmarks/memory/client/scenarios/navigation-churn/vue/memory.bench.ts b/benchmarks/memory/client/scenarios/navigation-churn/vue/memory.bench.ts
index 43ab822de3..e645ab38f1 100644
--- a/benchmarks/memory/client/scenarios/navigation-churn/vue/memory.bench.ts
+++ b/benchmarks/memory/client/scenarios/navigation-churn/vue/memory.bench.ts
@@ -1,14 +1,21 @@
-import { test } from 'vitest'
-import {
- memoryBenchHooks,
- memoryBenchOptions,
-} from '#memory-client/bench-utils'
+import { afterAll, beforeAll, bench, describe } from 'vitest'
+import { memoryBenchOptions } from '#memory-client/bench-utils'
import { workload } from './setup'
await workload.sanity()
-test('memory', async ({ bench }) => {
- await bench(workload.name, memoryBenchHooks(workload), workload.run).run(
- memoryBenchOptions,
- )
+describe('memory', () => {
+ if (workload.before && workload.after) {
+ beforeAll(workload.before)
+ afterAll(workload.after)
+
+ bench(workload.name, workload.run, {
+ ...memoryBenchOptions,
+ setup: workload.before,
+ teardown: workload.after,
+ })
+ return
+ }
+
+ bench(workload.name, workload.run, memoryBenchOptions)
})
diff --git a/benchmarks/memory/client/scenarios/navigation-churn/vue/src/routes/a.tsx b/benchmarks/memory/client/scenarios/navigation-churn/vue/src/routes/a.tsx
index c1a9cfb244..183228e748 100644
--- a/benchmarks/memory/client/scenarios/navigation-churn/vue/src/routes/a.tsx
+++ b/benchmarks/memory/client/scenarios/navigation-churn/vue/src/routes/a.tsx
@@ -1,19 +1,16 @@
-import { defineComponent } from 'vue'
import { createFileRoute } from '@tanstack/vue-router'
const fixedTimestamp = 1_700_000_000_000
-const AComponent = defineComponent({
- setup() {
- const data = Route.useLoaderData()
-
- return () => (
- {`${data.value.name}:${data.value.ts}`}
- )
- },
-})
-
export const Route = createFileRoute('/a')({
loader: () => ({ name: 'a', ts: fixedTimestamp }),
component: AComponent,
})
+
+function AComponent() {
+ const data = Route.useLoaderData()
+
+ return (
+ {`${data.value.name}:${data.value.ts}`}
+ )
+}
diff --git a/benchmarks/memory/client/scenarios/navigation-churn/vue/src/routes/b.tsx b/benchmarks/memory/client/scenarios/navigation-churn/vue/src/routes/b.tsx
index 3a20799f3b..3a18ec97a9 100644
--- a/benchmarks/memory/client/scenarios/navigation-churn/vue/src/routes/b.tsx
+++ b/benchmarks/memory/client/scenarios/navigation-churn/vue/src/routes/b.tsx
@@ -1,19 +1,16 @@
-import { defineComponent } from 'vue'
import { createFileRoute } from '@tanstack/vue-router'
const fixedTimestamp = 1_700_000_000_000
-const BComponent = defineComponent({
- setup() {
- const data = Route.useLoaderData()
-
- return () => (
- {`${data.value.name}:${data.value.ts}`}
- )
- },
-})
-
export const Route = createFileRoute('/b')({
loader: () => ({ name: 'b', ts: fixedTimestamp }),
component: BComponent,
})
+
+function BComponent() {
+ const data = Route.useLoaderData()
+
+ return (
+ {`${data.value.name}:${data.value.ts}`}
+ )
+}
diff --git a/benchmarks/memory/client/scenarios/navigation-churn/vue/vite.config.ts b/benchmarks/memory/client/scenarios/navigation-churn/vue/vite.config.ts
index b3bdd39dd2..d26ce23d07 100644
--- a/benchmarks/memory/client/scenarios/navigation-churn/vue/vite.config.ts
+++ b/benchmarks/memory/client/scenarios/navigation-churn/vue/vite.config.ts
@@ -3,7 +3,6 @@ import { defineConfig } from 'vitest/config'
import codspeedPlugin from '@codspeed/vitest-plugin'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
-import { memoryConfig } from '../../../../runtime'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -29,9 +28,9 @@ export default defineConfig({
},
},
test: {
- ...memoryConfig('client'),
name: '@benchmarks/memory-client navigation-churn (vue)',
watch: false,
environment: 'jsdom',
+ setupFiles: ['../../../vitest.setup.ts'],
},
})
diff --git a/benchmarks/memory/client/scenarios/preload-churn/react/memory.bench.ts b/benchmarks/memory/client/scenarios/preload-churn/react/memory.bench.ts
index 43ab822de3..e645ab38f1 100644
--- a/benchmarks/memory/client/scenarios/preload-churn/react/memory.bench.ts
+++ b/benchmarks/memory/client/scenarios/preload-churn/react/memory.bench.ts
@@ -1,14 +1,21 @@
-import { test } from 'vitest'
-import {
- memoryBenchHooks,
- memoryBenchOptions,
-} from '#memory-client/bench-utils'
+import { afterAll, beforeAll, bench, describe } from 'vitest'
+import { memoryBenchOptions } from '#memory-client/bench-utils'
import { workload } from './setup'
await workload.sanity()
-test('memory', async ({ bench }) => {
- await bench(workload.name, memoryBenchHooks(workload), workload.run).run(
- memoryBenchOptions,
- )
+describe('memory', () => {
+ if (workload.before && workload.after) {
+ beforeAll(workload.before)
+ afterAll(workload.after)
+
+ bench(workload.name, workload.run, {
+ ...memoryBenchOptions,
+ setup: workload.before,
+ teardown: workload.after,
+ })
+ return
+ }
+
+ bench(workload.name, workload.run, memoryBenchOptions)
})
diff --git a/benchmarks/memory/client/scenarios/preload-churn/react/vite.config.ts b/benchmarks/memory/client/scenarios/preload-churn/react/vite.config.ts
index c12995f68e..f9c426656b 100644
--- a/benchmarks/memory/client/scenarios/preload-churn/react/vite.config.ts
+++ b/benchmarks/memory/client/scenarios/preload-churn/react/vite.config.ts
@@ -2,7 +2,6 @@ import { fileURLToPath } from 'node:url'
import { defineConfig } from 'vitest/config'
import codspeedPlugin from '@codspeed/vitest-plugin'
import react from '@vitejs/plugin-react'
-import { memoryConfig } from '../../../../runtime'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -27,9 +26,9 @@ export default defineConfig({
},
},
test: {
- ...memoryConfig('client'),
name: '@benchmarks/memory-client preload-churn (react)',
watch: false,
environment: 'jsdom',
+ setupFiles: ['../../../vitest.setup.ts'],
},
})
diff --git a/benchmarks/memory/client/scenarios/preload-churn/shared.ts b/benchmarks/memory/client/scenarios/preload-churn/shared.ts
index 68fdfedd3f..8cea4aca81 100644
--- a/benchmarks/memory/client/scenarios/preload-churn/shared.ts
+++ b/benchmarks/memory/client/scenarios/preload-churn/shared.ts
@@ -35,14 +35,18 @@ type PreloadRouter = {
subscribe: (event: 'onRendered', listener: () => void) => () => void
}
-// Reuse one navigation target while evicting the distinct preloaded routes.
+// Fixed id for the eviction navigations interleaved into the bench loop; its
+// payload is a constant-size steady-state resident, never part of the signal.
const evictionItemId = 'nav-evict'
const preloadChurnIterations = 200
// A navigation commit is what triggers the router's clearExpiredCache --
// preloaded matches (defaultPreloadGcTime: 0) are only evicted then, never
-// during a preload-only loop. Interleave navigation to exercise eviction.
+// during a preload-only loop. Interleaving a navigation every few preloads is
+// what makes the flat floor assert "eviction releases preloaded payloads".
const preloadsPerEvictionNavigation = 10
-// Keep generated URLs unique across warmup and measured invocations.
+// Module-level so ids stay unique across runner invocations on one mount; a
+// per-invocation LCG would replay identical ids, and every preload after the
+// first invocation would dedupe against cachedMatches instead of doing work.
const benchmarkRandom = createDeterministicRandom(0x706c6f61)
let preloadCounter = 0
diff --git a/benchmarks/memory/client/scenarios/preload-churn/solid/memory.bench.ts b/benchmarks/memory/client/scenarios/preload-churn/solid/memory.bench.ts
index 43ab822de3..e645ab38f1 100644
--- a/benchmarks/memory/client/scenarios/preload-churn/solid/memory.bench.ts
+++ b/benchmarks/memory/client/scenarios/preload-churn/solid/memory.bench.ts
@@ -1,14 +1,21 @@
-import { test } from 'vitest'
-import {
- memoryBenchHooks,
- memoryBenchOptions,
-} from '#memory-client/bench-utils'
+import { afterAll, beforeAll, bench, describe } from 'vitest'
+import { memoryBenchOptions } from '#memory-client/bench-utils'
import { workload } from './setup'
await workload.sanity()
-test('memory', async ({ bench }) => {
- await bench(workload.name, memoryBenchHooks(workload), workload.run).run(
- memoryBenchOptions,
- )
+describe('memory', () => {
+ if (workload.before && workload.after) {
+ beforeAll(workload.before)
+ afterAll(workload.after)
+
+ bench(workload.name, workload.run, {
+ ...memoryBenchOptions,
+ setup: workload.before,
+ teardown: workload.after,
+ })
+ return
+ }
+
+ bench(workload.name, workload.run, memoryBenchOptions)
})
diff --git a/benchmarks/memory/client/scenarios/preload-churn/solid/src/app.tsx b/benchmarks/memory/client/scenarios/preload-churn/solid/src/app.tsx
index 18ad5b97e4..b5b0a1d555 100644
--- a/benchmarks/memory/client/scenarios/preload-churn/solid/src/app.tsx
+++ b/benchmarks/memory/client/scenarios/preload-churn/solid/src/app.tsx
@@ -1,5 +1,5 @@
import { RouterProvider } from '@tanstack/solid-router'
-import { render } from 'solid-js/web'
+import { render } from '@solidjs/web'
import { getRouter } from './router'
export { getTrackedItemLoaderCount } from '../../item-payload'
diff --git a/benchmarks/memory/client/scenarios/preload-churn/solid/tsconfig.json b/benchmarks/memory/client/scenarios/preload-churn/solid/tsconfig.json
index b12dcb7ade..9558353c88 100644
--- a/benchmarks/memory/client/scenarios/preload-churn/solid/tsconfig.json
+++ b/benchmarks/memory/client/scenarios/preload-churn/solid/tsconfig.json
@@ -3,7 +3,7 @@
"compilerOptions": {
"jsx": "preserve",
"allowImportingTsExtensions": true,
- "jsxImportSource": "solid-js",
+ "jsxImportSource": "@solidjs/web",
"types": ["node", "vite/client", "vitest/globals"]
},
"include": [
diff --git a/benchmarks/memory/client/scenarios/preload-churn/solid/vite.config.ts b/benchmarks/memory/client/scenarios/preload-churn/solid/vite.config.ts
index efc75d2b93..6fc5fa6c4e 100644
--- a/benchmarks/memory/client/scenarios/preload-churn/solid/vite.config.ts
+++ b/benchmarks/memory/client/scenarios/preload-churn/solid/vite.config.ts
@@ -1,8 +1,7 @@
import { fileURLToPath } from 'node:url'
import { defineConfig } from 'vitest/config'
import codspeedPlugin from '@codspeed/vitest-plugin'
-import solid from 'vite-plugin-solid'
-import { memoryConfig } from '../../../../runtime'
+import solid from '@solidjs/vite-plugin'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -14,7 +13,7 @@ export default defineConfig({
plugins: [
!!(process.env.VITEST && process.env.WITH_INSTRUMENTATION) &&
codspeedPlugin(),
- solid({ hot: false, dev: false }),
+ solid({ refresh: false, dev: false }),
],
build: {
outDir: './dist',
@@ -27,9 +26,9 @@ export default defineConfig({
},
},
test: {
- ...memoryConfig('client'),
name: '@benchmarks/memory-client preload-churn (solid)',
watch: false,
environment: 'jsdom',
+ setupFiles: ['../../../vitest.setup.ts'],
},
})
diff --git a/benchmarks/memory/client/scenarios/preload-churn/vue/memory.bench.ts b/benchmarks/memory/client/scenarios/preload-churn/vue/memory.bench.ts
index 43ab822de3..e645ab38f1 100644
--- a/benchmarks/memory/client/scenarios/preload-churn/vue/memory.bench.ts
+++ b/benchmarks/memory/client/scenarios/preload-churn/vue/memory.bench.ts
@@ -1,14 +1,21 @@
-import { test } from 'vitest'
-import {
- memoryBenchHooks,
- memoryBenchOptions,
-} from '#memory-client/bench-utils'
+import { afterAll, beforeAll, bench, describe } from 'vitest'
+import { memoryBenchOptions } from '#memory-client/bench-utils'
import { workload } from './setup'
await workload.sanity()
-test('memory', async ({ bench }) => {
- await bench(workload.name, memoryBenchHooks(workload), workload.run).run(
- memoryBenchOptions,
- )
+describe('memory', () => {
+ if (workload.before && workload.after) {
+ beforeAll(workload.before)
+ afterAll(workload.after)
+
+ bench(workload.name, workload.run, {
+ ...memoryBenchOptions,
+ setup: workload.before,
+ teardown: workload.after,
+ })
+ return
+ }
+
+ bench(workload.name, workload.run, memoryBenchOptions)
})
diff --git a/benchmarks/memory/client/scenarios/preload-churn/vue/src/routes/items.$id.tsx b/benchmarks/memory/client/scenarios/preload-churn/vue/src/routes/items.$id.tsx
index 08254e173e..2a29245926 100644
--- a/benchmarks/memory/client/scenarios/preload-churn/vue/src/routes/items.$id.tsx
+++ b/benchmarks/memory/client/scenarios/preload-churn/vue/src/routes/items.$id.tsx
@@ -1,19 +1,6 @@
-import { defineComponent } from 'vue'
import { createFileRoute } from '@tanstack/vue-router'
import { createItemPayload, trackItemLoaderCall } from '../../../item-payload'
-const ItemComponent = defineComponent({
- setup() {
- const data = Route.useLoaderData()
-
- return () => (
-
- {`${data.value.id}:${data.value.byteLength}`}
-
- )
- },
-})
-
export const Route = createFileRoute('/items/$id')({
loader: ({ params }: { params: { id: string } }) => {
trackItemLoaderCall(params.id)
@@ -21,3 +8,13 @@ export const Route = createFileRoute('/items/$id')({
},
component: ItemComponent,
})
+
+function ItemComponent() {
+ const data = Route.useLoaderData()
+
+ return (
+
+ {`${data.value.id}:${data.value.byteLength}`}
+
+ )
+}
diff --git a/benchmarks/memory/client/scenarios/preload-churn/vue/vite.config.ts b/benchmarks/memory/client/scenarios/preload-churn/vue/vite.config.ts
index 3d56089ba7..ea7ed7b695 100644
--- a/benchmarks/memory/client/scenarios/preload-churn/vue/vite.config.ts
+++ b/benchmarks/memory/client/scenarios/preload-churn/vue/vite.config.ts
@@ -3,7 +3,6 @@ import { defineConfig } from 'vitest/config'
import codspeedPlugin from '@codspeed/vitest-plugin'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
-import { memoryConfig } from '../../../../runtime'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -29,9 +28,9 @@ export default defineConfig({
},
},
test: {
- ...memoryConfig('client'),
name: '@benchmarks/memory-client preload-churn (vue)',
watch: false,
environment: 'jsdom',
+ setupFiles: ['../../../vitest.setup.ts'],
},
})
diff --git a/benchmarks/memory/client/scenarios/unique-location-churn/react/memory.bench.ts b/benchmarks/memory/client/scenarios/unique-location-churn/react/memory.bench.ts
index 43ab822de3..e645ab38f1 100644
--- a/benchmarks/memory/client/scenarios/unique-location-churn/react/memory.bench.ts
+++ b/benchmarks/memory/client/scenarios/unique-location-churn/react/memory.bench.ts
@@ -1,14 +1,21 @@
-import { test } from 'vitest'
-import {
- memoryBenchHooks,
- memoryBenchOptions,
-} from '#memory-client/bench-utils'
+import { afterAll, beforeAll, bench, describe } from 'vitest'
+import { memoryBenchOptions } from '#memory-client/bench-utils'
import { workload } from './setup'
await workload.sanity()
-test('memory', async ({ bench }) => {
- await bench(workload.name, memoryBenchHooks(workload), workload.run).run(
- memoryBenchOptions,
- )
+describe('memory', () => {
+ if (workload.before && workload.after) {
+ beforeAll(workload.before)
+ afterAll(workload.after)
+
+ bench(workload.name, workload.run, {
+ ...memoryBenchOptions,
+ setup: workload.before,
+ teardown: workload.after,
+ })
+ return
+ }
+
+ bench(workload.name, workload.run, memoryBenchOptions)
})
diff --git a/benchmarks/memory/client/scenarios/unique-location-churn/react/vite.config.ts b/benchmarks/memory/client/scenarios/unique-location-churn/react/vite.config.ts
index 7ee67bfe30..f424c57cef 100644
--- a/benchmarks/memory/client/scenarios/unique-location-churn/react/vite.config.ts
+++ b/benchmarks/memory/client/scenarios/unique-location-churn/react/vite.config.ts
@@ -2,7 +2,6 @@ import { fileURLToPath } from 'node:url'
import { defineConfig } from 'vitest/config'
import codspeedPlugin from '@codspeed/vitest-plugin'
import react from '@vitejs/plugin-react'
-import { memoryConfig } from '../../../../runtime'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -27,9 +26,9 @@ export default defineConfig({
},
},
test: {
- ...memoryConfig('client'),
name: '@benchmarks/memory-client unique-location-churn (react)',
watch: false,
environment: 'jsdom',
+ setupFiles: ['../../../vitest.setup.ts'],
},
})
diff --git a/benchmarks/memory/client/scenarios/unique-location-churn/solid/memory.bench.ts b/benchmarks/memory/client/scenarios/unique-location-churn/solid/memory.bench.ts
index 43ab822de3..e645ab38f1 100644
--- a/benchmarks/memory/client/scenarios/unique-location-churn/solid/memory.bench.ts
+++ b/benchmarks/memory/client/scenarios/unique-location-churn/solid/memory.bench.ts
@@ -1,14 +1,21 @@
-import { test } from 'vitest'
-import {
- memoryBenchHooks,
- memoryBenchOptions,
-} from '#memory-client/bench-utils'
+import { afterAll, beforeAll, bench, describe } from 'vitest'
+import { memoryBenchOptions } from '#memory-client/bench-utils'
import { workload } from './setup'
await workload.sanity()
-test('memory', async ({ bench }) => {
- await bench(workload.name, memoryBenchHooks(workload), workload.run).run(
- memoryBenchOptions,
- )
+describe('memory', () => {
+ if (workload.before && workload.after) {
+ beforeAll(workload.before)
+ afterAll(workload.after)
+
+ bench(workload.name, workload.run, {
+ ...memoryBenchOptions,
+ setup: workload.before,
+ teardown: workload.after,
+ })
+ return
+ }
+
+ bench(workload.name, workload.run, memoryBenchOptions)
})
diff --git a/benchmarks/memory/client/scenarios/unique-location-churn/solid/src/app.tsx b/benchmarks/memory/client/scenarios/unique-location-churn/solid/src/app.tsx
index 16000c90a1..5917ef0191 100644
--- a/benchmarks/memory/client/scenarios/unique-location-churn/solid/src/app.tsx
+++ b/benchmarks/memory/client/scenarios/unique-location-churn/solid/src/app.tsx
@@ -1,5 +1,5 @@
import { RouterProvider } from '@tanstack/solid-router'
-import { render } from 'solid-js/web'
+import { render } from '@solidjs/web'
import { getRouter } from './router'
export function mountTestApp(container: Element) {
diff --git a/benchmarks/memory/client/scenarios/unique-location-churn/solid/tsconfig.json b/benchmarks/memory/client/scenarios/unique-location-churn/solid/tsconfig.json
index b12dcb7ade..9558353c88 100644
--- a/benchmarks/memory/client/scenarios/unique-location-churn/solid/tsconfig.json
+++ b/benchmarks/memory/client/scenarios/unique-location-churn/solid/tsconfig.json
@@ -3,7 +3,7 @@
"compilerOptions": {
"jsx": "preserve",
"allowImportingTsExtensions": true,
- "jsxImportSource": "solid-js",
+ "jsxImportSource": "@solidjs/web",
"types": ["node", "vite/client", "vitest/globals"]
},
"include": [
diff --git a/benchmarks/memory/client/scenarios/unique-location-churn/solid/vite.config.ts b/benchmarks/memory/client/scenarios/unique-location-churn/solid/vite.config.ts
index 4db90da2d2..df652ab2c4 100644
--- a/benchmarks/memory/client/scenarios/unique-location-churn/solid/vite.config.ts
+++ b/benchmarks/memory/client/scenarios/unique-location-churn/solid/vite.config.ts
@@ -1,8 +1,7 @@
import { fileURLToPath } from 'node:url'
import { defineConfig } from 'vitest/config'
import codspeedPlugin from '@codspeed/vitest-plugin'
-import solid from 'vite-plugin-solid'
-import { memoryConfig } from '../../../../runtime'
+import solid from '@solidjs/vite-plugin'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -14,7 +13,7 @@ export default defineConfig({
plugins: [
!!(process.env.VITEST && process.env.WITH_INSTRUMENTATION) &&
codspeedPlugin(),
- solid({ hot: false, dev: false }),
+ solid({ refresh: false, dev: false }),
],
build: {
outDir: './dist',
@@ -27,9 +26,9 @@ export default defineConfig({
},
},
test: {
- ...memoryConfig('client'),
name: '@benchmarks/memory-client unique-location-churn (solid)',
watch: false,
environment: 'jsdom',
+ setupFiles: ['../../../vitest.setup.ts'],
},
})
diff --git a/benchmarks/memory/client/scenarios/unique-location-churn/vue/memory.bench.ts b/benchmarks/memory/client/scenarios/unique-location-churn/vue/memory.bench.ts
index 43ab822de3..e645ab38f1 100644
--- a/benchmarks/memory/client/scenarios/unique-location-churn/vue/memory.bench.ts
+++ b/benchmarks/memory/client/scenarios/unique-location-churn/vue/memory.bench.ts
@@ -1,14 +1,21 @@
-import { test } from 'vitest'
-import {
- memoryBenchHooks,
- memoryBenchOptions,
-} from '#memory-client/bench-utils'
+import { afterAll, beforeAll, bench, describe } from 'vitest'
+import { memoryBenchOptions } from '#memory-client/bench-utils'
import { workload } from './setup'
await workload.sanity()
-test('memory', async ({ bench }) => {
- await bench(workload.name, memoryBenchHooks(workload), workload.run).run(
- memoryBenchOptions,
- )
+describe('memory', () => {
+ if (workload.before && workload.after) {
+ beforeAll(workload.before)
+ afterAll(workload.after)
+
+ bench(workload.name, workload.run, {
+ ...memoryBenchOptions,
+ setup: workload.before,
+ teardown: workload.after,
+ })
+ return
+ }
+
+ bench(workload.name, workload.run, memoryBenchOptions)
})
diff --git a/benchmarks/memory/client/scenarios/unique-location-churn/vue/src/routes/items.$id.tsx b/benchmarks/memory/client/scenarios/unique-location-churn/vue/src/routes/items.$id.tsx
index e796ee14d1..1854367142 100644
--- a/benchmarks/memory/client/scenarios/unique-location-churn/vue/src/routes/items.$id.tsx
+++ b/benchmarks/memory/client/scenarios/unique-location-churn/vue/src/routes/items.$id.tsx
@@ -1,22 +1,9 @@
-import { defineComponent } from 'vue'
import { createFileRoute } from '@tanstack/vue-router'
type ItemSearch = {
q: string
}
-const ItemComponent = defineComponent({
- setup() {
- const data = Route.useLoaderData()
-
- return () => (
- {`${data.value.id}:${data.value.q}:${data.value.checksum}`}
- )
- },
-})
-
export const Route = createFileRoute('/items/$id')({
validateSearch: (search: Record): ItemSearch => ({
q: typeof search.q === 'string' ? search.q : '',
@@ -35,3 +22,13 @@ export const Route = createFileRoute('/items/$id')({
}),
component: ItemComponent,
})
+
+function ItemComponent() {
+ const data = Route.useLoaderData()
+
+ return (
+ {`${data.value.id}:${data.value.q}:${data.value.checksum}`}
+ )
+}
diff --git a/benchmarks/memory/client/scenarios/unique-location-churn/vue/vite.config.ts b/benchmarks/memory/client/scenarios/unique-location-churn/vue/vite.config.ts
index d074d571b9..423126019b 100644
--- a/benchmarks/memory/client/scenarios/unique-location-churn/vue/vite.config.ts
+++ b/benchmarks/memory/client/scenarios/unique-location-churn/vue/vite.config.ts
@@ -3,7 +3,6 @@ import { defineConfig } from 'vitest/config'
import codspeedPlugin from '@codspeed/vitest-plugin'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
-import { memoryConfig } from '../../../../runtime'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -29,9 +28,9 @@ export default defineConfig({
},
},
test: {
- ...memoryConfig('client'),
name: '@benchmarks/memory-client unique-location-churn (vue)',
watch: false,
environment: 'jsdom',
+ setupFiles: ['../../../vitest.setup.ts'],
},
})
diff --git a/benchmarks/memory/client/tsconfig.json b/benchmarks/memory/client/tsconfig.json
index eefc5c581e..9280d5c42f 100644
--- a/benchmarks/memory/client/tsconfig.json
+++ b/benchmarks/memory/client/tsconfig.json
@@ -3,10 +3,5 @@
"compilerOptions": {
"types": ["node", "vite/client", "vitest/globals"]
},
- "include": [
- "bench-utils.ts",
- "lifecycle.ts",
- "vitest.setup.ts",
- "scenarios/*/shared.ts"
- ]
+ "include": ["bench-utils.ts", "lifecycle.ts", "vitest.setup.ts"]
}
diff --git a/benchmarks/memory/runtime.ts b/benchmarks/memory/runtime.ts
deleted file mode 100644
index 010149b4df..0000000000
--- a/benchmarks/memory/runtime.ts
+++ /dev/null
@@ -1,36 +0,0 @@
-import { fileURLToPath } from 'node:url'
-import { isMemoryInstrumented } from './turn'
-
-/** Worker settings for the CodSpeed memory instrument. */
-export function memoryExecArgv() {
- if (!isMemoryInstrumented()) {
- return []
- }
-
- // CodSpeed supplies --no-opt, which only disables TurboFan on Node 24.
- // Under --predictable, Maglev compilations run synchronously inside the
- // request that triggers them, and the forced GC before the measured call can
- // discard optimized code so recompiles land in the measured window. Their
- // malloc'd Zone scratch (32 KiB segments) then dominates allocation metrics
- // and depends on per-process feedback state.
- // Limit variation from GC scheduling and bytecode reclamation; keep a
- // fixed initial old-generation budget.
- return [
- '--no-maglev',
- '--no-flush-bytecode',
- '--no-minor-gc-task',
- '--no-incremental-marking',
- '--initial-old-space-size=512',
- ]
-}
-
-export function memoryConfig(side: 'client' | 'server') {
- const execArgv = memoryExecArgv()
- return {
- execArgv,
- setupFiles:
- side === 'client'
- ? [fileURLToPath(new URL('./client/vitest.setup.ts', import.meta.url))]
- : [],
- }
-}
diff --git a/benchmarks/memory/server/bench-utils.ts b/benchmarks/memory/server/bench-utils.ts
index 9caaf63384..b8a09fdd8e 100644
--- a/benchmarks/memory/server/bench-utils.ts
+++ b/benchmarks/memory/server/bench-utils.ts
@@ -1,5 +1,3 @@
-export { memoryBenchHooks } from '../turn'
-
export interface StartRequestHandler {
fetch: (request: Request) => Promise | Response
}
@@ -19,6 +17,24 @@ export type RunSequentialRequestLoopOptions =
iterations?: number
buildRequest: (random: () => number, index: number) => Request
validateResponse?: (response: Response, request: Request) => void
+ // Whether V8 collects iteration i's garbage before iteration i+1
+ // allocates its payload is not reproducible run to run — the measured
+ // peak flips by a whole payload depending on GC timing, which shifts
+ // with runner hardware. Forcing a collection between iterations pins
+ // the GC points so peak deterministically measures the largest
+ // single-iteration footprint plus any reachable accumulation.
+ // Accumulation signals stay visible: leaked or cached objects are
+ // still referenced, so a forced collection cannot reclaim them — it
+ // only removes floating garbage, whose collection timing is the
+ // dominant cross-run noise source.
+ pinGcBetweenIterations?: boolean
+ // For peak-shape scenarios ONLY (flat inter-iteration heap floor):
+ // verify each pinned collection actually returned the heap to the
+ // floor, extending the barrier when a runner's late teardown holds the
+ // payload past the fixed window. Churn/abort scenarios must not set
+ // this: their floor legitimately drifts, so the verification caps out
+ // chronically and the extra collections it fires destabilize the peak.
+ verifyGcFloor?: boolean
}
export const memoryBenchOptions = {
@@ -50,7 +66,7 @@ export async function drainResponse(response: Response) {
}
try {
- for (;;) {
+ while (true) {
const result = await reader.read()
if (result.done) {
@@ -66,7 +82,13 @@ export async function runSequentialRequestLoop(
handler: StartRequestHandler,
options: RunSequentialRequestLoopOptions,
) {
- const { iterations = 10, buildRequest, validateResponse } = options
+ const {
+ iterations = 10,
+ buildRequest,
+ validateResponse,
+ pinGcBetweenIterations = false,
+ verifyGcFloor = false,
+ } = options
const random =
options.seed !== undefined
? createDeterministicRandom(options.seed)
@@ -81,6 +103,8 @@ export async function runSequentialRequestLoop(
}
})
+ const gcPinState = verifyGcFloor ? createGcPinState() : undefined
+
for (let index = 0; index < iterations; index++) {
const request = buildRequest(random, index)
const response = await handler.fetch(request)
@@ -88,12 +112,89 @@ export async function runSequentialRequestLoop(
validate(response, request)
await drainResponse(response)
+
+ if (pinGcBetweenIterations) {
+ await settleAndPinGc(gcPinState)
+ }
}
}
-// Cancellation can leave deferred loaders and renderer teardown queued.
-export async function settle() {
- for (let turn = 0; turn < 16; turn++) {
+// Renderer/stream teardown spans several event-loop turns (React and Vue
+// need more than the two turns the original barrier allowed for), and a
+// too-short settle window leaks a whole payload of garbage past the
+// collection point, flipping the measured peak bimodally between runs.
+// The settle length is a fixed count on purpose: an adaptive exit (collect
+// until the post-GC heap size stops moving) makes the collection points
+// land at data-dependent turns, which re-introduces exactly the run-to-run
+// variance this barrier exists to remove — heap-size readings never fully
+// stabilize under the instrumented CI environment, so the exit point (and
+// with it every subsequent GC point) shifted between identical runs.
+const settleTurnsBeforeGc = 16
+const maxSettleTurns = 64
+// Below every scenario's payload size, above normal inter-iteration jitter.
+const settledHeapSlackBytes = 256 * 1024
+
+// Tracks the smallest post-collection heap size seen in a workload run:
+// the inter-iteration floor the heap must return to before the next
+// iteration may start.
+export interface GcPinState {
+ floorHeapUsed: number
+}
+
+export function createGcPinState(): GcPinState {
+ return { floorHeapUsed: Infinity }
+}
+
+// Settle trailing renderer/stream teardown with a fixed number of 0ms timer
+// hops (one full event-loop turn each, microtasks flushing between hops),
+// then pin a collection point. The second collection one turn later picks
+// up whatever the first collection's finalizers released. gc() is present
+// under CodSpeed (--expose-gc); in plain smoke runs there is nothing to
+// pin, so only the settle hops run.
+//
+// The collection is then verified against the inter-iteration heap floor:
+// on some runners the response teardown holds the payload past the fixed
+// settle window (released only by a later internal timer), and that one
+// still-reachable payload survives the collection and bleeds into the next
+// iteration's measured peak. When the post-collection heap has not returned
+// to the floor, keep hopping and collecting — bounded — until the payload
+// is actually released, so the barrier self-heals in exactly the case where
+// the fixed-count barrier fails. A workload that genuinely accumulates
+// reachable memory raises the floor as it goes (the floor is the minimum
+// seen), so accumulation still measures; it only pays the turn cap.
+export async function settleAndPinGc(state?: GcPinState) {
+ for (let turn = 0; turn < settleTurnsBeforeGc; turn++) {
await new Promise((resolve) => setTimeout(resolve, 0))
}
+
+ const gc = (globalThis as { gc?: () => void }).gc
+
+ if (!gc) {
+ return
+ }
+
+ gc()
+ await new Promise((resolve) => setTimeout(resolve, 0))
+ gc()
+
+ if (!state) {
+ return
+ }
+
+ let heapUsed = process.memoryUsage().heapUsed
+
+ for (
+ let turn = settleTurnsBeforeGc;
+ turn < maxSettleTurns &&
+ heapUsed > state.floorHeapUsed + settledHeapSlackBytes;
+ turn++
+ ) {
+ await new Promise((resolve) => setTimeout(resolve, 0))
+ gc()
+ heapUsed = process.memoryUsage().heapUsed
+ }
+
+ if (heapUsed < state.floorHeapUsed) {
+ state.floorHeapUsed = heapUsed
+ }
}
diff --git a/benchmarks/memory/server/benchmark.ts b/benchmarks/memory/server/benchmark.ts
index 9b8dc2c76f..301a9f956d 100644
--- a/benchmarks/memory/server/benchmark.ts
+++ b/benchmarks/memory/server/benchmark.ts
@@ -1,9 +1,5 @@
export interface ServerMemoryWorkload {
name: string
- /**
- * Must be an `async` function: CodSpeed's Vitest 5 provider awaits only
- * `AsyncFunction`s and otherwise measures just the synchronous part.
- */
run: () => Promise | void
}
diff --git a/benchmarks/memory/server/package.json b/benchmarks/memory/server/package.json
index d09343c7b6..3663b3aa1e 100644
--- a/benchmarks/memory/server/package.json
+++ b/benchmarks/memory/server/package.json
@@ -11,6 +11,7 @@
"#memory-server/flame-runner": "./flame-runner.ts"
},
"dependencies": {
+ "@solidjs/web": "^2.0.0-rc.20",
"@tanstack/react-router": "workspace:*",
"@tanstack/react-start": "workspace:*",
"@tanstack/solid-router": "workspace:*",
@@ -19,22 +20,20 @@
"@tanstack/vue-start": "workspace:*",
"react": "^19.0.0",
"react-dom": "^19.0.0",
- "solid-js": "^1.9.10",
+ "solid-js": "^2.0.0-rc.20",
"vue": "^3.5.16"
},
"devDependencies": {
- "@codspeed/vitest-plugin": "^6.0.1",
+ "@codspeed/vitest-plugin": "^5.5.0",
"@datadog/pprof": "^5.13.2",
"@platformatic/flame": "^1.6.0",
+ "@solidjs/vite-plugin": "^3.0.0-next.54",
"@vitejs/plugin-react": "^6.0.1",
"@vitejs/plugin-vue-jsx": "^5.1.5",
- "@types/react": "catalog:",
"@typescript/native": "npm:typescript@^7.0.2",
- "jsdom": "29.1.1",
"typescript": "npm:@typescript/typescript6@^6.0.2",
"vite": "^8.0.14",
- "vite-plugin-solid": "^2.11.11",
- "vitest": "catalog:"
+ "vitest": "^4.1.4"
},
"nx": {
"targets": {
@@ -208,7 +207,7 @@
"build:react"
],
"options": {
- "command": "NODE_ENV=production vitest bench --mode benchmark --config ./vitest.react.config.ts",
+ "command": "NODE_ENV=production vitest bench --config ./vitest.react.config.ts",
"cwd": "benchmarks/memory/server"
}
},
@@ -220,7 +219,7 @@
"build:solid"
],
"options": {
- "command": "NODE_ENV=production vitest bench --mode benchmark --config ./vitest.solid.config.ts",
+ "command": "NODE_ENV=production vitest bench --config ./vitest.solid.config.ts",
"cwd": "benchmarks/memory/server"
}
},
@@ -232,12 +231,12 @@
"build:vue"
],
"options": {
- "command": "NODE_ENV=production vitest bench --mode benchmark --config ./vitest.vue.config.ts",
+ "command": "NODE_ENV=production vitest bench --config ./vitest.vue.config.ts",
"cwd": "benchmarks/memory/server"
}
},
"test:types": {
- "executor": "nx:run-commands",
+ "executor": "nx:noop",
"dependsOn": [
{
"projects": [
@@ -265,17 +264,6 @@
],
"target": "test:types:ssr"
}
- ],
- "options": {
- "command": "tsc -p ./tsconfig.json --noEmit",
- "cwd": "benchmarks/memory/server"
- },
- "inputs": [
- "default",
- "^production",
- "{workspaceRoot}/eslint.config.js",
- "dependentTaskOutputs",
- "{workspaceRoot}/benchmarks/memory/*.ts"
]
}
}
diff --git a/benchmarks/memory/server/scenarios/aborted-requests/deferred-records.ts b/benchmarks/memory/server/scenarios/aborted-requests/deferred-records.ts
index 7a1cd6d254..4886e3ee80 100644
--- a/benchmarks/memory/server/scenarios/aborted-requests/deferred-records.ts
+++ b/benchmarks/memory/server/scenarios/aborted-requests/deferred-records.ts
@@ -16,42 +16,3 @@ export function makeAbortedRequestRecords(
label: `deferred-${group}-${id}-${index}`,
}))
}
-
-// Abort probes keep their deferred payload pending until the request is
-// cancelled. Timer chains can outlive cancellation and spill into the next
-// measured request; route-loader signals stop observing the request after load.
-export function makeDeferredRecords(
- id: string,
- group: RecordGroup,
- signal: AbortSignal,
-): Promise> {
- return new Promise((resolve) => {
- if (signal.aborted) {
- resolve([])
- return
- }
-
- let timeoutId: ReturnType | undefined
- const onAbort = () => {
- clearTimeout(timeoutId)
- resolve([])
- }
- signal.addEventListener('abort', onAbort, { once: true })
-
- if (id === 'sanity-mid-stream' || id.startsWith('abort-')) {
- return
- }
-
- let remaining = group === 'alpha' ? 4 : 6
- const step = () => {
- remaining -= 1
- if (remaining === 0) {
- signal.removeEventListener('abort', onAbort)
- resolve(makeAbortedRequestRecords(id, group))
- return
- }
- timeoutId = setTimeout(step, 0)
- }
- timeoutId = setTimeout(step, 0)
- })
-}
diff --git a/benchmarks/memory/server/scenarios/aborted-requests/react/memory.bench.ts b/benchmarks/memory/server/scenarios/aborted-requests/react/memory.bench.ts
index 8b5f16ad63..9a5c211fee 100644
--- a/benchmarks/memory/server/scenarios/aborted-requests/react/memory.bench.ts
+++ b/benchmarks/memory/server/scenarios/aborted-requests/react/memory.bench.ts
@@ -1,16 +1,11 @@
-import { test } from 'vitest'
-import {
- memoryBenchHooks,
- memoryBenchOptions,
-} from '#memory-server/bench-utils'
+import { bench, describe } from 'vitest'
+import { memoryBenchOptions } from '#memory-server/bench-utils'
import { workloadGroup } from './setup'
await workloadGroup.sanity()
-test('memory', async ({ bench }) => {
+describe('memory', () => {
for (const workload of workloadGroup.workloads) {
- await bench(workload.name, memoryBenchHooks(), workload.run).run(
- memoryBenchOptions,
- )
+ bench(workload.name, workload.run, memoryBenchOptions)
}
})
diff --git a/benchmarks/memory/server/scenarios/aborted-requests/react/vite.config.ts b/benchmarks/memory/server/scenarios/aborted-requests/react/vite.config.ts
index eff0d0e043..2ce925e406 100644
--- a/benchmarks/memory/server/scenarios/aborted-requests/react/vite.config.ts
+++ b/benchmarks/memory/server/scenarios/aborted-requests/react/vite.config.ts
@@ -3,7 +3,6 @@ import { defineConfig } from 'vitest/config'
import codspeedPlugin from '@codspeed/vitest-plugin'
import { tanstackStart } from '@tanstack/react-start/plugin/vite'
import react from '@vitejs/plugin-react'
-import { memoryConfig } from '../../../../runtime'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -23,7 +22,19 @@ export default defineConfig({
minify: false,
},
test: {
- ...memoryConfig('server'),
+ // Keep lazily-compiled code alive for the whole run: the pinned
+ // collections age code fast enough for V8 to flush unused bytecode,
+ // and the mid-measurement recompile injects a multi-MB allocation
+ // burst at a run-dependent time.
+ execArgv: [
+ '--no-flush-bytecode',
+ // Pre-size the V8 heap so no space has to grow mid-measurement:
+ // heap-growth events allocate several MB at a run-dependent moment,
+ // which flips the measured peak bimodally between identical runs.
+ '--initial-old-space-size=64',
+ '--min-semi-space-size=16',
+ '--max-semi-space-size=16',
+ ],
name: '@benchmarks/memory-server aborted-requests (react)',
watch: false,
environment: 'node',
diff --git a/benchmarks/memory/server/scenarios/aborted-requests/shared.ts b/benchmarks/memory/server/scenarios/aborted-requests/shared.ts
index 29eca99e00..c98f462538 100644
--- a/benchmarks/memory/server/scenarios/aborted-requests/shared.ts
+++ b/benchmarks/memory/server/scenarios/aborted-requests/shared.ts
@@ -1,4 +1,4 @@
-import { settle } from '#memory-server/bench-utils'
+import { settleAndPinGc } from '#memory-server/bench-utils'
import type { StartRequestHandler } from '#memory-server/bench-utils'
export type { StartRequestHandler }
@@ -6,6 +6,13 @@ export type { StartRequestHandler }
type Framework = 'react' | 'solid' | 'vue'
type AbortedRequestReadMode = 'first-chunk' | 'shell-before-deferred'
+type AbortedRequestCancelMode = 'plain' | 'swallow-abort-error'
+
+type AbortedRequestMode = {
+ readMode: AbortedRequestReadMode
+ cancelMode: AbortedRequestCancelMode
+}
+
const abortedRequestIterations = 40
let abortedRequestCounter = 0
const eagerMarker = 'data-bench="aborted-requests-eager"'
@@ -17,10 +24,19 @@ const betaFirstRecord = (id: string) => `deferred-beta-${id}-0`
const betaLastRecord = (id: string) => `deferred-beta-${id}-19`
const textDecoder = new TextDecoder()
-const abortedRequestModes: Record = {
- react: 'first-chunk',
- solid: 'first-chunk',
- vue: 'shell-before-deferred',
+const abortedRequestModes: Record = {
+ react: {
+ readMode: 'first-chunk',
+ cancelMode: 'swallow-abort-error',
+ },
+ solid: {
+ readMode: 'first-chunk',
+ cancelMode: 'swallow-abort-error',
+ },
+ vue: {
+ readMode: 'shell-before-deferred',
+ cancelMode: 'swallow-abort-error',
+ },
}
const documentRequestInit = {
@@ -80,7 +96,7 @@ async function readShellBeforeDeferred(
const reader = response.body.getReader()
let text = ''
- for (;;) {
+ while (true) {
const result = await reader.read()
const value = result.value
@@ -121,10 +137,10 @@ async function readShellBeforeDeferred(
async function readSanityStream(
response: Response,
request: Request,
- mode: AbortedRequestReadMode,
+ mode: AbortedRequestMode,
id: string,
) {
- if (mode === 'shell-before-deferred') {
+ if (mode.readMode === 'shell-before-deferred') {
return readShellBeforeDeferred(response, request, id)
}
@@ -149,19 +165,36 @@ function readLoopStream(
return readFirstChunk(response, request)
}
-async function cancelReader(reader: ReadableStreamDefaultReader) {
- try {
- await reader.cancel()
- } catch (error) {
- if (!(error instanceof DOMException && error.name === 'AbortError')) {
- throw error
+async function cancelReader(
+ reader: ReadableStreamDefaultReader,
+ mode: AbortedRequestCancelMode,
+) {
+ if (mode === 'swallow-abort-error') {
+ try {
+ await reader.cancel()
+ } catch (error) {
+ if (!(error instanceof DOMException && error.name === 'AbortError')) {
+ throw error
+ }
}
+
+ return
}
+
+ await reader.cancel()
+}
+
+// Post-abort settlement barrier. Settles renderer teardown across a fixed
+// number of event-loop turns, then (under CodSpeed) pins a collection point
+// after every aborted request, so the measured peak cannot drift with how
+// much floating garbage the previous iterations happened to leave behind.
+async function drainCancellation() {
+ await settleAndPinGc()
}
async function assertAbortedRequestsSanity(
handler: StartRequestHandler,
- mode: AbortedRequestReadMode,
+ mode: AbortedRequestMode,
) {
const fullId = 'sanity-full'
const fullRequest = buildStreamRequest(fullId)
@@ -194,13 +227,13 @@ async function assertAbortedRequestsSanity(
// reader.cancel() is the response-stream cancellation path if the handler
// does not observe Request.signal for this in-process request.
controller.abort()
- await cancelReader(reader)
- await settle()
+ await cancelReader(reader, mode.cancelMode)
+ await drainCancellation()
}
async function runAbortedRequestLoop(
handler: StartRequestHandler,
- mode: AbortedRequestReadMode,
+ mode: AbortedRequestMode,
) {
for (let index = 0; index < abortedRequestIterations; index++) {
const controller = new AbortController()
@@ -209,10 +242,15 @@ async function runAbortedRequestLoop(
const response = await handler.fetch(request)
validateDocumentResponse(response, request)
- const { reader } = await readLoopStream(mode, response, request, id)
+ const { reader } = await readLoopStream(
+ mode.readMode,
+ response,
+ request,
+ id,
+ )
controller.abort()
- await cancelReader(reader)
- await settle()
+ await cancelReader(reader, mode.cancelMode)
+ await drainCancellation()
}
}
@@ -221,7 +259,7 @@ export function createWorkloadGroup(
handler: StartRequestHandler,
) {
const mode = abortedRequestModes[framework]
- const run = async () => runAbortedRequestLoop(handler, mode)
+ const run = () => runAbortedRequestLoop(handler, mode)
return {
sanity: () => assertAbortedRequestsSanity(handler, mode),
diff --git a/benchmarks/memory/server/scenarios/aborted-requests/solid/memory.bench.ts b/benchmarks/memory/server/scenarios/aborted-requests/solid/memory.bench.ts
index 8b5f16ad63..9a5c211fee 100644
--- a/benchmarks/memory/server/scenarios/aborted-requests/solid/memory.bench.ts
+++ b/benchmarks/memory/server/scenarios/aborted-requests/solid/memory.bench.ts
@@ -1,16 +1,11 @@
-import { test } from 'vitest'
-import {
- memoryBenchHooks,
- memoryBenchOptions,
-} from '#memory-server/bench-utils'
+import { bench, describe } from 'vitest'
+import { memoryBenchOptions } from '#memory-server/bench-utils'
import { workloadGroup } from './setup'
await workloadGroup.sanity()
-test('memory', async ({ bench }) => {
+describe('memory', () => {
for (const workload of workloadGroup.workloads) {
- await bench(workload.name, memoryBenchHooks(), workload.run).run(
- memoryBenchOptions,
- )
+ bench(workload.name, workload.run, memoryBenchOptions)
}
})
diff --git a/benchmarks/memory/server/scenarios/aborted-requests/solid/src/routes/__root.tsx b/benchmarks/memory/server/scenarios/aborted-requests/solid/src/routes/__root.tsx
index aaf7dfdd89..6e83136ea0 100644
--- a/benchmarks/memory/server/scenarios/aborted-requests/solid/src/routes/__root.tsx
+++ b/benchmarks/memory/server/scenarios/aborted-requests/solid/src/routes/__root.tsx
@@ -4,7 +4,7 @@ import {
Scripts,
createRootRoute,
} from '@tanstack/solid-router'
-import { HydrationScript } from 'solid-js/web'
+import { HydrationScript } from '@solidjs/web'
export const Route = createRootRoute({
head: () => ({
diff --git a/benchmarks/memory/server/scenarios/aborted-requests/solid/src/routes/stream.$id.tsx b/benchmarks/memory/server/scenarios/aborted-requests/solid/src/routes/stream.$id.tsx
index bf6af17f31..0ddc6d1447 100644
--- a/benchmarks/memory/server/scenarios/aborted-requests/solid/src/routes/stream.$id.tsx
+++ b/benchmarks/memory/server/scenarios/aborted-requests/solid/src/routes/stream.$id.tsx
@@ -1,17 +1,90 @@
-import { createServerOnlyFn } from '@tanstack/solid-start'
-import { getRequest } from '@tanstack/solid-start/server'
-import { createFileRoute } from '@tanstack/solid-router'
-import { Show, Suspense, createResource } from 'solid-js'
-import { makeDeferredRecords } from '../../../deferred-records'
-import type { DeferredRecord } from '../../../deferred-records'
+import { Await, createFileRoute } from '@tanstack/solid-router'
+import { Loading } from 'solid-js'
+import {
+ makeAbortedRequestRecords,
+ type DeferredRecord,
+ type RecordGroup,
+} from '../../../deferred-records'
-const getRequestSignal = createServerOnlyFn(() => getRequest().signal)
+const alphaResolveTicks = 4
+const betaResolveTicks = 6
+const abortProbeAlphaResolveTicks = 40
+const abortProbeBetaResolveTicks = 60
+
+function isAbortProbeId(id: string) {
+ return id === 'sanity-mid-stream' || id.startsWith('abort-')
+}
+
+function getResolveTicks(id: string, group: RecordGroup) {
+ if (isAbortProbeId(id)) {
+ return group === 'alpha'
+ ? abortProbeAlphaResolveTicks
+ : abortProbeBetaResolveTicks
+ }
+
+ return group === 'alpha' ? alphaResolveTicks : betaResolveTicks
+}
+
+// One tick = one 0ms timers-phase hop. Counting event-loop turns instead of
+// milliseconds keeps the resolve/abort interleaving a pure function of the
+// event-loop schedule: a wall-clock delay races the abort differently
+// depending on runner load and instrumentation overhead, which made this
+// benchmark's single measured run swing between runs.
+function resolveAfterTicks(
+ ticks: number,
+ signal: AbortSignal,
+ value: () => T,
+ abortedValue: () => T,
+) {
+ return new Promise((resolve) => {
+ if (signal.aborted) {
+ resolve(abortedValue())
+ return
+ }
+
+ let remaining = ticks
+ let timeoutId: ReturnType
+
+ const onAbort = () => {
+ clearTimeout(timeoutId)
+ resolve(abortedValue())
+ }
+
+ const step = () => {
+ remaining -= 1
+
+ if (remaining <= 0) {
+ signal.removeEventListener('abort', onAbort)
+ resolve(value())
+ return
+ }
+
+ timeoutId = setTimeout(step, 0)
+ }
+
+ signal.addEventListener('abort', onAbort, { once: true })
+ timeoutId = setTimeout(step, 0)
+ })
+}
+
+function makeDeferredRecords(
+ id: string,
+ group: RecordGroup,
+ signal: AbortSignal,
+) {
+ return resolveAfterTicks(
+ getResolveTicks(id, group),
+ signal,
+ () => makeAbortedRequestRecords(id, group),
+ () => [],
+ )
+}
export const Route = createFileRoute('/stream/$id')({
- loader: ({ params }) => ({
+ loader: ({ params, abortController }) => ({
eager: `eager-${params.id}`,
- alpha: makeDeferredRecords(params.id, 'alpha', getRequestSignal()),
- beta: makeDeferredRecords(params.id, 'beta', getRequestSignal()),
+ alpha: makeDeferredRecords(params.id, 'alpha', abortController.signal),
+ beta: makeDeferredRecords(params.id, 'beta', abortController.signal),
}),
component: StreamComponent,
})
@@ -22,48 +95,47 @@ function StreamComponent() {
return (
{data().eager}
- loading-alpha
}
>
-
-
-
+ {(records) => (
+
+ )}
+
+
+ loading-beta
}
>
-
-
+
+ {(records) => (
+
+ )}
+
+
)
}
function DeferredRecords(props: {
- promise: Promise>
+ records: Array
dataBench: string
}) {
- const [records] = createResource(
- () => props.promise,
- (promise) => promise,
- )
-
return (
-
- {(resolvedRecords) => (
-
- {resolvedRecords().map((record) => (
- {record.label}
- ))}
-
- )}
-
+
+ {props.records.map((record) => (
+ {record.label}
+ ))}
+
)
}
diff --git a/benchmarks/memory/server/scenarios/aborted-requests/solid/tsconfig.json b/benchmarks/memory/server/scenarios/aborted-requests/solid/tsconfig.json
index 4b61264e11..cdb88448d7 100644
--- a/benchmarks/memory/server/scenarios/aborted-requests/solid/tsconfig.json
+++ b/benchmarks/memory/server/scenarios/aborted-requests/solid/tsconfig.json
@@ -3,7 +3,7 @@
"compilerOptions": {
"allowImportingTsExtensions": true,
"jsx": "preserve",
- "jsxImportSource": "solid-js",
+ "jsxImportSource": "@solidjs/web",
"types": ["node", "vite/client", "vitest/globals"]
},
"include": [
diff --git a/benchmarks/memory/server/scenarios/aborted-requests/solid/vite.config.ts b/benchmarks/memory/server/scenarios/aborted-requests/solid/vite.config.ts
index d7fd3459ee..6b39cd33c3 100644
--- a/benchmarks/memory/server/scenarios/aborted-requests/solid/vite.config.ts
+++ b/benchmarks/memory/server/scenarios/aborted-requests/solid/vite.config.ts
@@ -2,8 +2,7 @@ import { fileURLToPath } from 'node:url'
import { defineConfig } from 'vitest/config'
import codspeedPlugin from '@codspeed/vitest-plugin'
import { tanstackStart } from '@tanstack/solid-start/plugin/vite'
-import solid from 'vite-plugin-solid'
-import { memoryConfig } from '../../../../runtime'
+import solid from '@solidjs/vite-plugin'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -15,7 +14,7 @@ export default defineConfig({
tanstackStart({
srcDirectory: 'src',
}),
- solid({ ssr: true, hot: false, dev: false }),
+ solid({ ssr: true, refresh: false, dev: false }),
],
build: {
outDir: './dist',
@@ -23,7 +22,19 @@ export default defineConfig({
minify: false,
},
test: {
- ...memoryConfig('server'),
+ // Keep lazily-compiled code alive for the whole run: the pinned
+ // collections age code fast enough for V8 to flush unused bytecode,
+ // and the mid-measurement recompile injects a multi-MB allocation
+ // burst at a run-dependent time.
+ execArgv: [
+ '--no-flush-bytecode',
+ // Pre-size the V8 heap so no space has to grow mid-measurement:
+ // heap-growth events allocate several MB at a run-dependent moment,
+ // which flips the measured peak bimodally between identical runs.
+ '--initial-old-space-size=64',
+ '--min-semi-space-size=16',
+ '--max-semi-space-size=16',
+ ],
name: '@benchmarks/memory-server aborted-requests (solid)',
watch: false,
environment: 'node',
diff --git a/benchmarks/memory/server/scenarios/aborted-requests/vue/memory.bench.ts b/benchmarks/memory/server/scenarios/aborted-requests/vue/memory.bench.ts
index 8b5f16ad63..9a5c211fee 100644
--- a/benchmarks/memory/server/scenarios/aborted-requests/vue/memory.bench.ts
+++ b/benchmarks/memory/server/scenarios/aborted-requests/vue/memory.bench.ts
@@ -1,16 +1,11 @@
-import { test } from 'vitest'
-import {
- memoryBenchHooks,
- memoryBenchOptions,
-} from '#memory-server/bench-utils'
+import { bench, describe } from 'vitest'
+import { memoryBenchOptions } from '#memory-server/bench-utils'
import { workloadGroup } from './setup'
await workloadGroup.sanity()
-test('memory', async ({ bench }) => {
+describe('memory', () => {
for (const workload of workloadGroup.workloads) {
- await bench(workload.name, memoryBenchHooks(), workload.run).run(
- memoryBenchOptions,
- )
+ bench(workload.name, workload.run, memoryBenchOptions)
}
})
diff --git a/benchmarks/memory/server/scenarios/aborted-requests/vue/src/routes/stream.$id.tsx b/benchmarks/memory/server/scenarios/aborted-requests/vue/src/routes/stream.$id.tsx
index e41af03c16..b723c7f69e 100644
--- a/benchmarks/memory/server/scenarios/aborted-requests/vue/src/routes/stream.$id.tsx
+++ b/benchmarks/memory/server/scenarios/aborted-requests/vue/src/routes/stream.$id.tsx
@@ -1,65 +1,136 @@
-import { createServerOnlyFn } from '@tanstack/vue-start'
-import { getRequest } from '@tanstack/vue-start/server'
import { Await, createFileRoute } from '@tanstack/vue-router'
-import { Suspense, defineComponent } from 'vue'
-import { makeDeferredRecords } from '../../../deferred-records'
-import type { DeferredRecord } from '../../../deferred-records'
+import { Suspense } from 'vue'
+import {
+ makeAbortedRequestRecords,
+ type DeferredRecord,
+ type RecordGroup,
+} from '../../../deferred-records'
-const getRequestSignal = createServerOnlyFn(() => getRequest().signal)
+const alphaResolveTicks = 4
+const betaResolveTicks = 6
+const abortProbeAlphaResolveTicks = 40
+const abortProbeBetaResolveTicks = 60
-const StreamComponent = defineComponent({
- setup() {
- const data = Route.useLoaderData()
+function isAbortProbeId(id: string) {
+ return id === 'sanity-mid-stream' || id.startsWith('abort-')
+}
- return () => (
-
- {data.value.eager}
- loading-alpha
- loading-beta
-
- {{
- default: () => (
- ) => (
-
- {records.map((record) => (
- {record.label}
- ))}
-
- )}
- />
- ),
- fallback: () => null,
- }}
-
-
- {{
- default: () => (
- ) => (
-
- {records.map((record) => (
- {record.label}
- ))}
-
- )}
- />
- ),
- fallback: () => null,
- }}
-
-
- )
- },
-})
+function getResolveTicks(id: string, group: RecordGroup) {
+ if (isAbortProbeId(id)) {
+ return group === 'alpha'
+ ? abortProbeAlphaResolveTicks
+ : abortProbeBetaResolveTicks
+ }
+
+ return group === 'alpha' ? alphaResolveTicks : betaResolveTicks
+}
+
+// One tick = one 0ms timers-phase hop. Counting event-loop turns instead of
+// milliseconds keeps the resolve/abort interleaving a pure function of the
+// event-loop schedule: a wall-clock delay races the abort differently
+// depending on runner load and instrumentation overhead, which made this
+// benchmark's single measured run swing between runs.
+function resolveAfterTicks(
+ ticks: number,
+ signal: AbortSignal,
+ value: () => T,
+ abortedValue: () => T,
+) {
+ return new Promise((resolve) => {
+ if (signal.aborted) {
+ resolve(abortedValue())
+ return
+ }
+
+ let remaining = ticks
+ let timeoutId: ReturnType
+
+ const onAbort = () => {
+ clearTimeout(timeoutId)
+ resolve(abortedValue())
+ }
+
+ const step = () => {
+ remaining -= 1
+
+ if (remaining <= 0) {
+ signal.removeEventListener('abort', onAbort)
+ resolve(value())
+ return
+ }
+
+ timeoutId = setTimeout(step, 0)
+ }
+
+ signal.addEventListener('abort', onAbort, { once: true })
+ timeoutId = setTimeout(step, 0)
+ })
+}
+
+function makeDeferredRecords(
+ id: string,
+ group: RecordGroup,
+ signal: AbortSignal,
+) {
+ return resolveAfterTicks(
+ getResolveTicks(id, group),
+ signal,
+ () => makeAbortedRequestRecords(id, group),
+ () => [],
+ )
+}
export const Route = createFileRoute('/stream/$id')({
- loader: ({ params }) => ({
+ loader: ({ params, abortController }) => ({
eager: `eager-${params.id}`,
- alpha: makeDeferredRecords(params.id, 'alpha', getRequestSignal()),
- beta: makeDeferredRecords(params.id, 'beta', getRequestSignal()),
+ alpha: makeDeferredRecords(params.id, 'alpha', abortController.signal),
+ beta: makeDeferredRecords(params.id, 'beta', abortController.signal),
}),
component: StreamComponent,
})
+
+function StreamComponent() {
+ const data = Route.useLoaderData()
+
+ return (
+
+ {data.value.eager}
+ loading-alpha
+ loading-beta
+
+ {{
+ default: () => (
+ ) => (
+
+ {records.map((record) => (
+ {record.label}
+ ))}
+
+ )}
+ />
+ ),
+ fallback: () => null,
+ }}
+
+
+ {{
+ default: () => (
+ ) => (
+
+ {records.map((record) => (
+ {record.label}
+ ))}
+
+ )}
+ />
+ ),
+ fallback: () => null,
+ }}
+
+
+ )
+}
diff --git a/benchmarks/memory/server/scenarios/aborted-requests/vue/vite.config.ts b/benchmarks/memory/server/scenarios/aborted-requests/vue/vite.config.ts
index e4e1eb66d4..5ccc9f5d1d 100644
--- a/benchmarks/memory/server/scenarios/aborted-requests/vue/vite.config.ts
+++ b/benchmarks/memory/server/scenarios/aborted-requests/vue/vite.config.ts
@@ -3,7 +3,6 @@ import { defineConfig } from 'vitest/config'
import codspeedPlugin from '@codspeed/vitest-plugin'
import { tanstackStart } from '@tanstack/vue-start/plugin/vite'
import vueJsx from '@vitejs/plugin-vue-jsx'
-import { memoryConfig } from '../../../../runtime'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -23,7 +22,19 @@ export default defineConfig({
minify: false,
},
test: {
- ...memoryConfig('server'),
+ // Keep lazily-compiled code alive for the whole run: the pinned
+ // collections age code fast enough for V8 to flush unused bytecode,
+ // and the mid-measurement recompile injects a multi-MB allocation
+ // burst at a run-dependent time.
+ execArgv: [
+ '--no-flush-bytecode',
+ // Pre-size the V8 heap so no space has to grow mid-measurement:
+ // heap-growth events allocate several MB at a run-dependent moment,
+ // which flips the measured peak bimodally between identical runs.
+ '--initial-old-space-size=64',
+ '--min-semi-space-size=16',
+ '--max-semi-space-size=16',
+ ],
name: '@benchmarks/memory-server aborted-requests (vue)',
watch: false,
environment: 'node',
diff --git a/benchmarks/memory/server/scenarios/error-paths/react/memory.bench.ts b/benchmarks/memory/server/scenarios/error-paths/react/memory.bench.ts
index a6f07b97be..9a5c211fee 100644
--- a/benchmarks/memory/server/scenarios/error-paths/react/memory.bench.ts
+++ b/benchmarks/memory/server/scenarios/error-paths/react/memory.bench.ts
@@ -1,16 +1,11 @@
-import { test } from 'vitest'
-import {
- memoryBenchHooks,
- memoryBenchOptions,
-} from '#memory-server/bench-utils'
+import { bench, describe } from 'vitest'
+import { memoryBenchOptions } from '#memory-server/bench-utils'
import { workloadGroup } from './setup'
await workloadGroup.sanity()
-const workload = workloadGroup.workloads[0]!
-
-test('memory', async ({ bench }) => {
- await bench(workload.name, memoryBenchHooks(), workload.run).run(
- memoryBenchOptions,
- )
+describe('memory', () => {
+ for (const workload of workloadGroup.workloads) {
+ bench(workload.name, workload.run, memoryBenchOptions)
+ }
})
diff --git a/benchmarks/memory/server/scenarios/error-paths/react/memory.error.bench.ts b/benchmarks/memory/server/scenarios/error-paths/react/memory.error.bench.ts
deleted file mode 100644
index 89071137c3..0000000000
--- a/benchmarks/memory/server/scenarios/error-paths/react/memory.error.bench.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import { test } from 'vitest'
-import {
- memoryBenchHooks,
- memoryBenchOptions,
-} from '#memory-server/bench-utils'
-import { workloadGroup } from './setup'
-
-await workloadGroup.sanity()
-
-const workload = workloadGroup.workloads[2]!
-
-test('memory', async ({ bench }) => {
- await bench(workload.name, memoryBenchHooks(), workload.run).run(
- memoryBenchOptions,
- )
-})
diff --git a/benchmarks/memory/server/scenarios/error-paths/react/memory.not-found.bench.ts b/benchmarks/memory/server/scenarios/error-paths/react/memory.not-found.bench.ts
deleted file mode 100644
index fa6a6693ed..0000000000
--- a/benchmarks/memory/server/scenarios/error-paths/react/memory.not-found.bench.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import { test } from 'vitest'
-import {
- memoryBenchHooks,
- memoryBenchOptions,
-} from '#memory-server/bench-utils'
-import { workloadGroup } from './setup'
-
-await workloadGroup.sanity()
-
-const workload = workloadGroup.workloads[1]!
-
-test('memory', async ({ bench }) => {
- await bench(workload.name, memoryBenchHooks(), workload.run).run(
- memoryBenchOptions,
- )
-})
diff --git a/benchmarks/memory/server/scenarios/error-paths/react/memory.unmatched.bench.ts b/benchmarks/memory/server/scenarios/error-paths/react/memory.unmatched.bench.ts
deleted file mode 100644
index b2c3d24200..0000000000
--- a/benchmarks/memory/server/scenarios/error-paths/react/memory.unmatched.bench.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import { test } from 'vitest'
-import {
- memoryBenchHooks,
- memoryBenchOptions,
-} from '#memory-server/bench-utils'
-import { workloadGroup } from './setup'
-
-await workloadGroup.sanity()
-
-const workload = workloadGroup.workloads[3]!
-
-test('memory', async ({ bench }) => {
- await bench(workload.name, memoryBenchHooks(), workload.run).run(
- memoryBenchOptions,
- )
-})
diff --git a/benchmarks/memory/server/scenarios/error-paths/react/tsconfig.json b/benchmarks/memory/server/scenarios/error-paths/react/tsconfig.json
index 2dba47fc99..11ddcce4ea 100644
--- a/benchmarks/memory/server/scenarios/error-paths/react/tsconfig.json
+++ b/benchmarks/memory/server/scenarios/error-paths/react/tsconfig.json
@@ -7,7 +7,7 @@
"types": ["node", "vite/client", "vitest/globals"]
},
"include": [
- "memory*.bench.ts",
+ "memory.bench.ts",
"memory.flame.ts",
"setup.ts",
"vite.config.ts",
diff --git a/benchmarks/memory/server/scenarios/error-paths/react/vite.config.ts b/benchmarks/memory/server/scenarios/error-paths/react/vite.config.ts
index c00de7727a..bc67b1cfc7 100644
--- a/benchmarks/memory/server/scenarios/error-paths/react/vite.config.ts
+++ b/benchmarks/memory/server/scenarios/error-paths/react/vite.config.ts
@@ -3,7 +3,6 @@ import { defineConfig } from 'vitest/config'
import codspeedPlugin from '@codspeed/vitest-plugin'
import { tanstackStart } from '@tanstack/react-start/plugin/vite'
import react from '@vitejs/plugin-react'
-import { memoryConfig } from '../../../../runtime'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -23,8 +22,19 @@ export default defineConfig({
minify: false,
},
test: {
- isolate: true,
- ...memoryConfig('server'),
+ // Keep lazily-compiled code alive for the whole run: the pinned
+ // collections age code fast enough for V8 to flush unused bytecode,
+ // and the mid-measurement recompile injects a multi-MB allocation
+ // burst at a run-dependent time.
+ execArgv: [
+ '--no-flush-bytecode',
+ // Pre-size the V8 heap so no space has to grow mid-measurement:
+ // heap-growth events allocate several MB at a run-dependent moment,
+ // which flips the measured peak bimodally between identical runs.
+ '--initial-old-space-size=64',
+ '--min-semi-space-size=16',
+ '--max-semi-space-size=16',
+ ],
name: '@benchmarks/memory-server error-paths (react)',
watch: false,
environment: 'node',
diff --git a/benchmarks/memory/server/scenarios/error-paths/shared.ts b/benchmarks/memory/server/scenarios/error-paths/shared.ts
index 11ed293d22..57e229b7e3 100644
--- a/benchmarks/memory/server/scenarios/error-paths/shared.ts
+++ b/benchmarks/memory/server/scenarios/error-paths/shared.ts
@@ -9,6 +9,8 @@ export type { StartRequestHandler }
type Framework = 'react' | 'solid' | 'vue'
+// Sized to sit just above the 2s measured-run floor on CI (per-iteration
+// cost with the pinned collection is ~0.13-0.19s across frameworks).
const errorPathsIterations = 18
const redirectSeed = 0xdecafbad
const notFoundSeed = 0xdecafb0d
@@ -136,36 +138,40 @@ export function createWorkloadGroup(
framework: Framework,
handler: StartRequestHandler,
) {
- const runRedirect = async () =>
+ const runRedirect = () =>
runSequentialRequestLoop(handler, {
random: redirectRandom,
iterations: errorPathsIterations,
buildRequest: buildRedirectRequest,
validateResponse: validateRedirectResponse,
+ pinGcBetweenIterations: true,
})
- const runNotFound = async () =>
+ const runNotFound = () =>
runSequentialRequestLoop(handler, {
random: notFoundRandom,
iterations: errorPathsIterations,
buildRequest: buildNotFoundRequest,
validateResponse: validateNotFoundResponse,
+ pinGcBetweenIterations: true,
})
- const runError = async () =>
+ const runError = () =>
runSequentialRequestLoop(handler, {
random: errorRandom,
iterations: errorPathsIterations,
buildRequest: buildErrorRequest,
validateResponse: validateErrorResponse,
+ pinGcBetweenIterations: true,
})
- const runUnmatched = async () =>
+ const runUnmatched = () =>
runSequentialRequestLoop(handler, {
random: unmatchedRandom,
iterations: errorPathsIterations,
buildRequest: buildUnmatchedRequest,
validateResponse: validateNotFoundResponse,
+ pinGcBetweenIterations: true,
})
return {
diff --git a/benchmarks/memory/server/scenarios/error-paths/solid/memory.bench.ts b/benchmarks/memory/server/scenarios/error-paths/solid/memory.bench.ts
index a6f07b97be..9a5c211fee 100644
--- a/benchmarks/memory/server/scenarios/error-paths/solid/memory.bench.ts
+++ b/benchmarks/memory/server/scenarios/error-paths/solid/memory.bench.ts
@@ -1,16 +1,11 @@
-import { test } from 'vitest'
-import {
- memoryBenchHooks,
- memoryBenchOptions,
-} from '#memory-server/bench-utils'
+import { bench, describe } from 'vitest'
+import { memoryBenchOptions } from '#memory-server/bench-utils'
import { workloadGroup } from './setup'
await workloadGroup.sanity()
-const workload = workloadGroup.workloads[0]!
-
-test('memory', async ({ bench }) => {
- await bench(workload.name, memoryBenchHooks(), workload.run).run(
- memoryBenchOptions,
- )
+describe('memory', () => {
+ for (const workload of workloadGroup.workloads) {
+ bench(workload.name, workload.run, memoryBenchOptions)
+ }
})
diff --git a/benchmarks/memory/server/scenarios/error-paths/solid/memory.error.bench.ts b/benchmarks/memory/server/scenarios/error-paths/solid/memory.error.bench.ts
deleted file mode 100644
index 89071137c3..0000000000
--- a/benchmarks/memory/server/scenarios/error-paths/solid/memory.error.bench.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import { test } from 'vitest'
-import {
- memoryBenchHooks,
- memoryBenchOptions,
-} from '#memory-server/bench-utils'
-import { workloadGroup } from './setup'
-
-await workloadGroup.sanity()
-
-const workload = workloadGroup.workloads[2]!
-
-test('memory', async ({ bench }) => {
- await bench(workload.name, memoryBenchHooks(), workload.run).run(
- memoryBenchOptions,
- )
-})
diff --git a/benchmarks/memory/server/scenarios/error-paths/solid/memory.not-found.bench.ts b/benchmarks/memory/server/scenarios/error-paths/solid/memory.not-found.bench.ts
deleted file mode 100644
index fa6a6693ed..0000000000
--- a/benchmarks/memory/server/scenarios/error-paths/solid/memory.not-found.bench.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import { test } from 'vitest'
-import {
- memoryBenchHooks,
- memoryBenchOptions,
-} from '#memory-server/bench-utils'
-import { workloadGroup } from './setup'
-
-await workloadGroup.sanity()
-
-const workload = workloadGroup.workloads[1]!
-
-test('memory', async ({ bench }) => {
- await bench(workload.name, memoryBenchHooks(), workload.run).run(
- memoryBenchOptions,
- )
-})
diff --git a/benchmarks/memory/server/scenarios/error-paths/solid/memory.unmatched.bench.ts b/benchmarks/memory/server/scenarios/error-paths/solid/memory.unmatched.bench.ts
deleted file mode 100644
index b2c3d24200..0000000000
--- a/benchmarks/memory/server/scenarios/error-paths/solid/memory.unmatched.bench.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import { test } from 'vitest'
-import {
- memoryBenchHooks,
- memoryBenchOptions,
-} from '#memory-server/bench-utils'
-import { workloadGroup } from './setup'
-
-await workloadGroup.sanity()
-
-const workload = workloadGroup.workloads[3]!
-
-test('memory', async ({ bench }) => {
- await bench(workload.name, memoryBenchHooks(), workload.run).run(
- memoryBenchOptions,
- )
-})
diff --git a/benchmarks/memory/server/scenarios/error-paths/solid/src/routes/__root.tsx b/benchmarks/memory/server/scenarios/error-paths/solid/src/routes/__root.tsx
index aaf7dfdd89..6e83136ea0 100644
--- a/benchmarks/memory/server/scenarios/error-paths/solid/src/routes/__root.tsx
+++ b/benchmarks/memory/server/scenarios/error-paths/solid/src/routes/__root.tsx
@@ -4,7 +4,7 @@ import {
Scripts,
createRootRoute,
} from '@tanstack/solid-router'
-import { HydrationScript } from 'solid-js/web'
+import { HydrationScript } from '@solidjs/web'
export const Route = createRootRoute({
head: () => ({
diff --git a/benchmarks/memory/server/scenarios/error-paths/solid/tsconfig.json b/benchmarks/memory/server/scenarios/error-paths/solid/tsconfig.json
index 1e8103127a..cdb88448d7 100644
--- a/benchmarks/memory/server/scenarios/error-paths/solid/tsconfig.json
+++ b/benchmarks/memory/server/scenarios/error-paths/solid/tsconfig.json
@@ -3,11 +3,11 @@
"compilerOptions": {
"allowImportingTsExtensions": true,
"jsx": "preserve",
- "jsxImportSource": "solid-js",
+ "jsxImportSource": "@solidjs/web",
"types": ["node", "vite/client", "vitest/globals"]
},
"include": [
- "memory*.bench.ts",
+ "memory.bench.ts",
"memory.flame.ts",
"setup.ts",
"vite.config.ts",
diff --git a/benchmarks/memory/server/scenarios/error-paths/solid/vite.config.ts b/benchmarks/memory/server/scenarios/error-paths/solid/vite.config.ts
index d7a0bb51b0..9a3f302349 100644
--- a/benchmarks/memory/server/scenarios/error-paths/solid/vite.config.ts
+++ b/benchmarks/memory/server/scenarios/error-paths/solid/vite.config.ts
@@ -2,8 +2,7 @@ import { fileURLToPath } from 'node:url'
import { defineConfig } from 'vitest/config'
import codspeedPlugin from '@codspeed/vitest-plugin'
import { tanstackStart } from '@tanstack/solid-start/plugin/vite'
-import solid from 'vite-plugin-solid'
-import { memoryConfig } from '../../../../runtime'
+import solid from '@solidjs/vite-plugin'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -15,7 +14,7 @@ export default defineConfig({
tanstackStart({
srcDirectory: 'src',
}),
- solid({ ssr: true, hot: false, dev: false }),
+ solid({ ssr: true, refresh: false, dev: false }),
],
build: {
outDir: './dist',
@@ -23,8 +22,19 @@ export default defineConfig({
minify: false,
},
test: {
- isolate: true,
- ...memoryConfig('server'),
+ // Keep lazily-compiled code alive for the whole run: the pinned
+ // collections age code fast enough for V8 to flush unused bytecode,
+ // and the mid-measurement recompile injects a multi-MB allocation
+ // burst at a run-dependent time.
+ execArgv: [
+ '--no-flush-bytecode',
+ // Pre-size the V8 heap so no space has to grow mid-measurement:
+ // heap-growth events allocate several MB at a run-dependent moment,
+ // which flips the measured peak bimodally between identical runs.
+ '--initial-old-space-size=64',
+ '--min-semi-space-size=16',
+ '--max-semi-space-size=16',
+ ],
name: '@benchmarks/memory-server error-paths (solid)',
watch: false,
environment: 'node',
diff --git a/benchmarks/memory/server/scenarios/error-paths/vue/memory.bench.ts b/benchmarks/memory/server/scenarios/error-paths/vue/memory.bench.ts
index a6f07b97be..9a5c211fee 100644
--- a/benchmarks/memory/server/scenarios/error-paths/vue/memory.bench.ts
+++ b/benchmarks/memory/server/scenarios/error-paths/vue/memory.bench.ts
@@ -1,16 +1,11 @@
-import { test } from 'vitest'
-import {
- memoryBenchHooks,
- memoryBenchOptions,
-} from '#memory-server/bench-utils'
+import { bench, describe } from 'vitest'
+import { memoryBenchOptions } from '#memory-server/bench-utils'
import { workloadGroup } from './setup'
await workloadGroup.sanity()
-const workload = workloadGroup.workloads[0]!
-
-test('memory', async ({ bench }) => {
- await bench(workload.name, memoryBenchHooks(), workload.run).run(
- memoryBenchOptions,
- )
+describe('memory', () => {
+ for (const workload of workloadGroup.workloads) {
+ bench(workload.name, workload.run, memoryBenchOptions)
+ }
})
diff --git a/benchmarks/memory/server/scenarios/error-paths/vue/memory.error.bench.ts b/benchmarks/memory/server/scenarios/error-paths/vue/memory.error.bench.ts
deleted file mode 100644
index 89071137c3..0000000000
--- a/benchmarks/memory/server/scenarios/error-paths/vue/memory.error.bench.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import { test } from 'vitest'
-import {
- memoryBenchHooks,
- memoryBenchOptions,
-} from '#memory-server/bench-utils'
-import { workloadGroup } from './setup'
-
-await workloadGroup.sanity()
-
-const workload = workloadGroup.workloads[2]!
-
-test('memory', async ({ bench }) => {
- await bench(workload.name, memoryBenchHooks(), workload.run).run(
- memoryBenchOptions,
- )
-})
diff --git a/benchmarks/memory/server/scenarios/error-paths/vue/memory.not-found.bench.ts b/benchmarks/memory/server/scenarios/error-paths/vue/memory.not-found.bench.ts
deleted file mode 100644
index fa6a6693ed..0000000000
--- a/benchmarks/memory/server/scenarios/error-paths/vue/memory.not-found.bench.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import { test } from 'vitest'
-import {
- memoryBenchHooks,
- memoryBenchOptions,
-} from '#memory-server/bench-utils'
-import { workloadGroup } from './setup'
-
-await workloadGroup.sanity()
-
-const workload = workloadGroup.workloads[1]!
-
-test('memory', async ({ bench }) => {
- await bench(workload.name, memoryBenchHooks(), workload.run).run(
- memoryBenchOptions,
- )
-})
diff --git a/benchmarks/memory/server/scenarios/error-paths/vue/memory.unmatched.bench.ts b/benchmarks/memory/server/scenarios/error-paths/vue/memory.unmatched.bench.ts
deleted file mode 100644
index b2c3d24200..0000000000
--- a/benchmarks/memory/server/scenarios/error-paths/vue/memory.unmatched.bench.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import { test } from 'vitest'
-import {
- memoryBenchHooks,
- memoryBenchOptions,
-} from '#memory-server/bench-utils'
-import { workloadGroup } from './setup'
-
-await workloadGroup.sanity()
-
-const workload = workloadGroup.workloads[3]!
-
-test('memory', async ({ bench }) => {
- await bench(workload.name, memoryBenchHooks(), workload.run).run(
- memoryBenchOptions,
- )
-})
diff --git a/benchmarks/memory/server/scenarios/error-paths/vue/src/routes/target.$id.tsx b/benchmarks/memory/server/scenarios/error-paths/vue/src/routes/target.$id.tsx
index 0bbf4a3dc6..17ade6bf5b 100644
--- a/benchmarks/memory/server/scenarios/error-paths/vue/src/routes/target.$id.tsx
+++ b/benchmarks/memory/server/scenarios/error-paths/vue/src/routes/target.$id.tsx
@@ -1,14 +1,11 @@
-import { defineComponent } from 'vue'
import { createFileRoute } from '@tanstack/vue-router'
-const TargetComponent = defineComponent({
- setup() {
- const params = Route.useParams()
-
- return () => {`target-${params.value.id}`}
- },
-})
-
export const Route = createFileRoute('/target/$id')({
component: TargetComponent,
})
+
+function TargetComponent() {
+ const params = Route.useParams()
+
+ return {`target-${params.value.id}`}
+}
diff --git a/benchmarks/memory/server/scenarios/error-paths/vue/tsconfig.json b/benchmarks/memory/server/scenarios/error-paths/vue/tsconfig.json
index af8b83005c..9ad6481342 100644
--- a/benchmarks/memory/server/scenarios/error-paths/vue/tsconfig.json
+++ b/benchmarks/memory/server/scenarios/error-paths/vue/tsconfig.json
@@ -7,7 +7,7 @@
"types": ["node", "vite/client", "vitest/globals"]
},
"include": [
- "memory*.bench.ts",
+ "memory.bench.ts",
"memory.flame.ts",
"setup.ts",
"vite.config.ts",
diff --git a/benchmarks/memory/server/scenarios/error-paths/vue/vite.config.ts b/benchmarks/memory/server/scenarios/error-paths/vue/vite.config.ts
index 3dc0762aa0..9a0ca28a25 100644
--- a/benchmarks/memory/server/scenarios/error-paths/vue/vite.config.ts
+++ b/benchmarks/memory/server/scenarios/error-paths/vue/vite.config.ts
@@ -3,7 +3,6 @@ import { defineConfig } from 'vitest/config'
import codspeedPlugin from '@codspeed/vitest-plugin'
import { tanstackStart } from '@tanstack/vue-start/plugin/vite'
import vueJsx from '@vitejs/plugin-vue-jsx'
-import { memoryConfig } from '../../../../runtime'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -23,8 +22,19 @@ export default defineConfig({
minify: false,
},
test: {
- isolate: true,
- ...memoryConfig('server'),
+ // Keep lazily-compiled code alive for the whole run: the pinned
+ // collections age code fast enough for V8 to flush unused bytecode,
+ // and the mid-measurement recompile injects a multi-MB allocation
+ // burst at a run-dependent time.
+ execArgv: [
+ '--no-flush-bytecode',
+ // Pre-size the V8 heap so no space has to grow mid-measurement:
+ // heap-growth events allocate several MB at a run-dependent moment,
+ // which flips the measured peak bimodally between identical runs.
+ '--initial-old-space-size=64',
+ '--min-semi-space-size=16',
+ '--max-semi-space-size=16',
+ ],
name: '@benchmarks/memory-server error-paths (vue)',
watch: false,
environment: 'node',
diff --git a/benchmarks/memory/server/scenarios/peak-large-page/react/memory.bench.ts b/benchmarks/memory/server/scenarios/peak-large-page/react/memory.bench.ts
index 8b5f16ad63..9a5c211fee 100644
--- a/benchmarks/memory/server/scenarios/peak-large-page/react/memory.bench.ts
+++ b/benchmarks/memory/server/scenarios/peak-large-page/react/memory.bench.ts
@@ -1,16 +1,11 @@
-import { test } from 'vitest'
-import {
- memoryBenchHooks,
- memoryBenchOptions,
-} from '#memory-server/bench-utils'
+import { bench, describe } from 'vitest'
+import { memoryBenchOptions } from '#memory-server/bench-utils'
import { workloadGroup } from './setup'
await workloadGroup.sanity()
-test('memory', async ({ bench }) => {
+describe('memory', () => {
for (const workload of workloadGroup.workloads) {
- await bench(workload.name, memoryBenchHooks(), workload.run).run(
- memoryBenchOptions,
- )
+ bench(workload.name, workload.run, memoryBenchOptions)
}
})
diff --git a/benchmarks/memory/server/scenarios/peak-large-page/react/vite.config.ts b/benchmarks/memory/server/scenarios/peak-large-page/react/vite.config.ts
index dcfcf1f92b..adaacda86e 100644
--- a/benchmarks/memory/server/scenarios/peak-large-page/react/vite.config.ts
+++ b/benchmarks/memory/server/scenarios/peak-large-page/react/vite.config.ts
@@ -3,7 +3,6 @@ import { defineConfig } from 'vitest/config'
import codspeedPlugin from '@codspeed/vitest-plugin'
import { tanstackStart } from '@tanstack/react-start/plugin/vite'
import react from '@vitejs/plugin-react'
-import { memoryConfig } from '../../../../runtime'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -23,7 +22,19 @@ export default defineConfig({
minify: false,
},
test: {
- ...memoryConfig('server'),
+ // Keep lazily-compiled code alive for the whole run: the pinned
+ // collections age code fast enough for V8 to flush unused bytecode,
+ // and the mid-measurement recompile injects a multi-MB allocation
+ // burst at a run-dependent time.
+ execArgv: [
+ '--no-flush-bytecode',
+ // Pre-size the V8 heap so no space has to grow mid-measurement:
+ // heap-growth events allocate several MB at a run-dependent moment,
+ // which flips the measured peak bimodally between identical runs.
+ '--initial-old-space-size=64',
+ '--min-semi-space-size=16',
+ '--max-semi-space-size=16',
+ ],
name: '@benchmarks/memory-server peak-large-page (react)',
watch: false,
environment: 'node',
diff --git a/benchmarks/memory/server/scenarios/peak-large-page/shared.ts b/benchmarks/memory/server/scenarios/peak-large-page/shared.ts
index 085e576244..578fc9c5a2 100644
--- a/benchmarks/memory/server/scenarios/peak-large-page/shared.ts
+++ b/benchmarks/memory/server/scenarios/peak-large-page/shared.ts
@@ -6,7 +6,7 @@ export type { StartRequestHandler }
type Framework = 'react' | 'solid' | 'vue'
const benchmarkSeed = 0x5eed_0005
-const peakLargePageIterations = 1
+const peakLargePageIterations = 20
const peakLargePageUrl = 'http://localhost/l1/l2/l3/l4/l5/l6/l7/l8'
const levelEightMarker = 'data-bench="peak-large-page-level-8"'
@@ -48,12 +48,14 @@ export function createWorkloadGroup(
framework: Framework,
handler: StartRequestHandler,
) {
- const run = async () =>
+ const run = () =>
runSequentialRequestLoop(handler, {
seed: benchmarkSeed,
iterations: peakLargePageIterations,
buildRequest: buildPeakLargePageRequest,
validateResponse: validatePeakLargePageResponse,
+ pinGcBetweenIterations: true,
+ verifyGcFloor: true,
})
return {
diff --git a/benchmarks/memory/server/scenarios/peak-large-page/solid/memory.bench.ts b/benchmarks/memory/server/scenarios/peak-large-page/solid/memory.bench.ts
index 8b5f16ad63..9a5c211fee 100644
--- a/benchmarks/memory/server/scenarios/peak-large-page/solid/memory.bench.ts
+++ b/benchmarks/memory/server/scenarios/peak-large-page/solid/memory.bench.ts
@@ -1,16 +1,11 @@
-import { test } from 'vitest'
-import {
- memoryBenchHooks,
- memoryBenchOptions,
-} from '#memory-server/bench-utils'
+import { bench, describe } from 'vitest'
+import { memoryBenchOptions } from '#memory-server/bench-utils'
import { workloadGroup } from './setup'
await workloadGroup.sanity()
-test('memory', async ({ bench }) => {
+describe('memory', () => {
for (const workload of workloadGroup.workloads) {
- await bench(workload.name, memoryBenchHooks(), workload.run).run(
- memoryBenchOptions,
- )
+ bench(workload.name, workload.run, memoryBenchOptions)
}
})
diff --git a/benchmarks/memory/server/scenarios/peak-large-page/solid/src/routes/__root.tsx b/benchmarks/memory/server/scenarios/peak-large-page/solid/src/routes/__root.tsx
index aaf7dfdd89..6e83136ea0 100644
--- a/benchmarks/memory/server/scenarios/peak-large-page/solid/src/routes/__root.tsx
+++ b/benchmarks/memory/server/scenarios/peak-large-page/solid/src/routes/__root.tsx
@@ -4,7 +4,7 @@ import {
Scripts,
createRootRoute,
} from '@tanstack/solid-router'
-import { HydrationScript } from 'solid-js/web'
+import { HydrationScript } from '@solidjs/web'
export const Route = createRootRoute({
head: () => ({
diff --git a/benchmarks/memory/server/scenarios/peak-large-page/solid/tsconfig.json b/benchmarks/memory/server/scenarios/peak-large-page/solid/tsconfig.json
index 4b61264e11..cdb88448d7 100644
--- a/benchmarks/memory/server/scenarios/peak-large-page/solid/tsconfig.json
+++ b/benchmarks/memory/server/scenarios/peak-large-page/solid/tsconfig.json
@@ -3,7 +3,7 @@
"compilerOptions": {
"allowImportingTsExtensions": true,
"jsx": "preserve",
- "jsxImportSource": "solid-js",
+ "jsxImportSource": "@solidjs/web",
"types": ["node", "vite/client", "vitest/globals"]
},
"include": [
diff --git a/benchmarks/memory/server/scenarios/peak-large-page/solid/vite.config.ts b/benchmarks/memory/server/scenarios/peak-large-page/solid/vite.config.ts
index 15b8c3a571..5e906a464b 100644
--- a/benchmarks/memory/server/scenarios/peak-large-page/solid/vite.config.ts
+++ b/benchmarks/memory/server/scenarios/peak-large-page/solid/vite.config.ts
@@ -2,8 +2,7 @@ import { fileURLToPath } from 'node:url'
import { defineConfig } from 'vitest/config'
import codspeedPlugin from '@codspeed/vitest-plugin'
import { tanstackStart } from '@tanstack/solid-start/plugin/vite'
-import solid from 'vite-plugin-solid'
-import { memoryConfig } from '../../../../runtime'
+import solid from '@solidjs/vite-plugin'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -15,7 +14,7 @@ export default defineConfig({
tanstackStart({
srcDirectory: 'src',
}),
- solid({ ssr: true, hot: false, dev: false }),
+ solid({ ssr: true, refresh: false, dev: false }),
],
build: {
outDir: './dist',
@@ -23,7 +22,19 @@ export default defineConfig({
minify: false,
},
test: {
- ...memoryConfig('server'),
+ // Keep lazily-compiled code alive for the whole run: the pinned
+ // collections age code fast enough for V8 to flush unused bytecode,
+ // and the mid-measurement recompile injects a multi-MB allocation
+ // burst at a run-dependent time.
+ execArgv: [
+ '--no-flush-bytecode',
+ // Pre-size the V8 heap so no space has to grow mid-measurement:
+ // heap-growth events allocate several MB at a run-dependent moment,
+ // which flips the measured peak bimodally between identical runs.
+ '--initial-old-space-size=64',
+ '--min-semi-space-size=16',
+ '--max-semi-space-size=16',
+ ],
name: '@benchmarks/memory-server peak-large-page (solid)',
watch: false,
environment: 'node',
diff --git a/benchmarks/memory/server/scenarios/peak-large-page/vue/memory.bench.ts b/benchmarks/memory/server/scenarios/peak-large-page/vue/memory.bench.ts
index 8b5f16ad63..9a5c211fee 100644
--- a/benchmarks/memory/server/scenarios/peak-large-page/vue/memory.bench.ts
+++ b/benchmarks/memory/server/scenarios/peak-large-page/vue/memory.bench.ts
@@ -1,16 +1,11 @@
-import { test } from 'vitest'
-import {
- memoryBenchHooks,
- memoryBenchOptions,
-} from '#memory-server/bench-utils'
+import { bench, describe } from 'vitest'
+import { memoryBenchOptions } from '#memory-server/bench-utils'
import { workloadGroup } from './setup'
await workloadGroup.sanity()
-test('memory', async ({ bench }) => {
+describe('memory', () => {
for (const workload of workloadGroup.workloads) {
- await bench(workload.name, memoryBenchHooks(), workload.run).run(
- memoryBenchOptions,
- )
+ bench(workload.name, workload.run, memoryBenchOptions)
}
})
diff --git a/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.l3.l4.l5.l6.l7.l8.tsx b/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.l3.l4.l5.l6.l7.l8.tsx
index 7f7a42d645..bd079aa1a0 100644
--- a/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.l3.l4.l5.l6.l7.l8.tsx
+++ b/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.l3.l4.l5.l6.l7.l8.tsx
@@ -1,34 +1,28 @@
-import { defineComponent } from 'vue'
import { createFileRoute } from '@tanstack/vue-router'
import {
makeLargePageHead,
makeLargePageLevelData,
} from '../../../large-page-data'
-const LevelEightComponent = defineComponent({
- setup() {
- const data = Route.useLoaderData()
-
- return () => {
- const first = data.value.records[0]!
-
- return (
-
- {data.value.marker}
- records: {data.value.records.length}
-
- {first.name}
- {first.id}
- {first.description}
-
-
- )
- }
- },
-})
-
export const Route = createFileRoute('/l1/l2/l3/l4/l5/l6/l7/l8')({
loader: () => makeLargePageLevelData(8, 0x5eed_1008),
head: ({ loaderData }) => makeLargePageHead(loaderData),
component: LevelEightComponent,
})
+
+function LevelEightComponent() {
+ const data = Route.useLoaderData()
+ const first = data.value.records[0]!
+
+ return (
+
+ {data.value.marker}
+ records: {data.value.records.length}
+
+ {first.name}
+ {first.id}
+ {first.description}
+
+
+ )
+}
diff --git a/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.l3.l4.l5.l6.l7.tsx b/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.l3.l4.l5.l6.l7.tsx
index a99c56e529..7f69f6f438 100644
--- a/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.l3.l4.l5.l6.l7.tsx
+++ b/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.l3.l4.l5.l6.l7.tsx
@@ -1,35 +1,29 @@
-import { defineComponent } from 'vue'
import { Outlet, createFileRoute } from '@tanstack/vue-router'
import {
makeLargePageHead,
makeLargePageLevelData,
} from '../../../large-page-data'
-const LevelSevenComponent = defineComponent({
- setup() {
- const data = Route.useLoaderData()
-
- return () => {
- const first = data.value.records[0]!
-
- return (
-
- {data.value.marker}
- records: {data.value.records.length}
-
- {first.name}
- {first.id}
- {first.description}
-
-
-
- )
- }
- },
-})
-
export const Route = createFileRoute('/l1/l2/l3/l4/l5/l6/l7')({
loader: () => makeLargePageLevelData(7, 0x5eed_1007),
head: ({ loaderData }) => makeLargePageHead(loaderData),
component: LevelSevenComponent,
})
+
+function LevelSevenComponent() {
+ const data = Route.useLoaderData()
+ const first = data.value.records[0]!
+
+ return (
+
+ {data.value.marker}
+ records: {data.value.records.length}
+
+ {first.name}
+ {first.id}
+ {first.description}
+
+
+
+ )
+}
diff --git a/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.l3.l4.l5.l6.tsx b/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.l3.l4.l5.l6.tsx
index 3de3f03427..75a7c717e3 100644
--- a/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.l3.l4.l5.l6.tsx
+++ b/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.l3.l4.l5.l6.tsx
@@ -1,35 +1,29 @@
-import { defineComponent } from 'vue'
import { Outlet, createFileRoute } from '@tanstack/vue-router'
import {
makeLargePageHead,
makeLargePageLevelData,
} from '../../../large-page-data'
-const LevelSixComponent = defineComponent({
- setup() {
- const data = Route.useLoaderData()
-
- return () => {
- const first = data.value.records[0]!
-
- return (
-
- {data.value.marker}
- records: {data.value.records.length}
-
- {first.name}
- {first.id}
- {first.description}
-
-
-
- )
- }
- },
-})
-
export const Route = createFileRoute('/l1/l2/l3/l4/l5/l6')({
loader: () => makeLargePageLevelData(6, 0x5eed_1006),
head: ({ loaderData }) => makeLargePageHead(loaderData),
component: LevelSixComponent,
})
+
+function LevelSixComponent() {
+ const data = Route.useLoaderData()
+ const first = data.value.records[0]!
+
+ return (
+
+ {data.value.marker}
+ records: {data.value.records.length}
+
+ {first.name}
+ {first.id}
+ {first.description}
+
+
+
+ )
+}
diff --git a/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.l3.l4.l5.tsx b/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.l3.l4.l5.tsx
index 5d936f83b5..f390ae3db3 100644
--- a/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.l3.l4.l5.tsx
+++ b/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.l3.l4.l5.tsx
@@ -1,35 +1,29 @@
-import { defineComponent } from 'vue'
import { Outlet, createFileRoute } from '@tanstack/vue-router'
import {
makeLargePageHead,
makeLargePageLevelData,
} from '../../../large-page-data'
-const LevelFiveComponent = defineComponent({
- setup() {
- const data = Route.useLoaderData()
-
- return () => {
- const first = data.value.records[0]!
-
- return (
-
- {data.value.marker}
- records: {data.value.records.length}
-
- {first.name}
- {first.id}
- {first.description}
-
-
-
- )
- }
- },
-})
-
export const Route = createFileRoute('/l1/l2/l3/l4/l5')({
loader: () => makeLargePageLevelData(5, 0x5eed_1005),
head: ({ loaderData }) => makeLargePageHead(loaderData),
component: LevelFiveComponent,
})
+
+function LevelFiveComponent() {
+ const data = Route.useLoaderData()
+ const first = data.value.records[0]!
+
+ return (
+
+ {data.value.marker}
+ records: {data.value.records.length}
+
+ {first.name}
+ {first.id}
+ {first.description}
+
+
+
+ )
+}
diff --git a/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.l3.l4.tsx b/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.l3.l4.tsx
index 8e10331f2d..6b30bd50dc 100644
--- a/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.l3.l4.tsx
+++ b/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.l3.l4.tsx
@@ -1,35 +1,29 @@
-import { defineComponent } from 'vue'
import { Outlet, createFileRoute } from '@tanstack/vue-router'
import {
makeLargePageHead,
makeLargePageLevelData,
} from '../../../large-page-data'
-const LevelFourComponent = defineComponent({
- setup() {
- const data = Route.useLoaderData()
-
- return () => {
- const first = data.value.records[0]!
-
- return (
-
- {data.value.marker}
- records: {data.value.records.length}
-
- {first.name}
- {first.id}
- {first.description}
-
-
-
- )
- }
- },
-})
-
export const Route = createFileRoute('/l1/l2/l3/l4')({
loader: () => makeLargePageLevelData(4, 0x5eed_1004),
head: ({ loaderData }) => makeLargePageHead(loaderData),
component: LevelFourComponent,
})
+
+function LevelFourComponent() {
+ const data = Route.useLoaderData()
+ const first = data.value.records[0]!
+
+ return (
+
+ {data.value.marker}
+ records: {data.value.records.length}
+
+ {first.name}
+ {first.id}
+ {first.description}
+
+
+
+ )
+}
diff --git a/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.l3.tsx b/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.l3.tsx
index d69529c50c..6ec6f32fea 100644
--- a/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.l3.tsx
+++ b/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.l3.tsx
@@ -1,35 +1,29 @@
-import { defineComponent } from 'vue'
import { Outlet, createFileRoute } from '@tanstack/vue-router'
import {
makeLargePageHead,
makeLargePageLevelData,
} from '../../../large-page-data'
-const LevelThreeComponent = defineComponent({
- setup() {
- const data = Route.useLoaderData()
-
- return () => {
- const first = data.value.records[0]!
-
- return (
-
- {data.value.marker}
- records: {data.value.records.length}
-
- {first.name}
- {first.id}
- {first.description}
-
-
-
- )
- }
- },
-})
-
export const Route = createFileRoute('/l1/l2/l3')({
loader: () => makeLargePageLevelData(3, 0x5eed_1003),
head: ({ loaderData }) => makeLargePageHead(loaderData),
component: LevelThreeComponent,
})
+
+function LevelThreeComponent() {
+ const data = Route.useLoaderData()
+ const first = data.value.records[0]!
+
+ return (
+
+ {data.value.marker}
+ records: {data.value.records.length}
+
+ {first.name}
+ {first.id}
+ {first.description}
+
+
+
+ )
+}
diff --git a/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.tsx b/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.tsx
index d04bc7f827..e5b4cf0de1 100644
--- a/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.tsx
+++ b/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.l2.tsx
@@ -1,35 +1,29 @@
-import { defineComponent } from 'vue'
import { Outlet, createFileRoute } from '@tanstack/vue-router'
import {
makeLargePageHead,
makeLargePageLevelData,
} from '../../../large-page-data'
-const LevelTwoComponent = defineComponent({
- setup() {
- const data = Route.useLoaderData()
-
- return () => {
- const first = data.value.records[0]!
-
- return (
-
- {data.value.marker}
- records: {data.value.records.length}
-
- {first.name}
- {first.id}
- {first.description}
-
-
-
- )
- }
- },
-})
-
export const Route = createFileRoute('/l1/l2')({
loader: () => makeLargePageLevelData(2, 0x5eed_1002),
head: ({ loaderData }) => makeLargePageHead(loaderData),
component: LevelTwoComponent,
})
+
+function LevelTwoComponent() {
+ const data = Route.useLoaderData()
+ const first = data.value.records[0]!
+
+ return (
+
+ {data.value.marker}
+ records: {data.value.records.length}
+
+ {first.name}
+ {first.id}
+ {first.description}
+
+
+
+ )
+}
diff --git a/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.tsx b/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.tsx
index a95ae7f9b0..a29e465cd4 100644
--- a/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.tsx
+++ b/benchmarks/memory/server/scenarios/peak-large-page/vue/src/routes/l1.tsx
@@ -1,35 +1,29 @@
-import { defineComponent } from 'vue'
import { Outlet, createFileRoute } from '@tanstack/vue-router'
import {
makeLargePageHead,
makeLargePageLevelData,
} from '../../../large-page-data'
-const LevelOneComponent = defineComponent({
- setup() {
- const data = Route.useLoaderData()
-
- return () => {
- const first = data.value.records[0]!
-
- return (
-
- {data.value.marker}
- records: {data.value.records.length}
-
- {first.name}
- {first.id}
- {first.description}
-
-
-
- )
- }
- },
-})
-
export const Route = createFileRoute('/l1')({
loader: () => makeLargePageLevelData(1, 0x5eed_1001),
head: ({ loaderData }) => makeLargePageHead(loaderData),
component: LevelOneComponent,
})
+
+function LevelOneComponent() {
+ const data = Route.useLoaderData()
+ const first = data.value.records[0]!
+
+ return (
+
+ {data.value.marker}
+ records: {data.value.records.length}
+
+ {first.name}
+ {first.id}
+ {first.description}
+
+
+
+ )
+}
diff --git a/benchmarks/memory/server/scenarios/peak-large-page/vue/vite.config.ts b/benchmarks/memory/server/scenarios/peak-large-page/vue/vite.config.ts
index 3fab2aff9e..0f238bd7f7 100644
--- a/benchmarks/memory/server/scenarios/peak-large-page/vue/vite.config.ts
+++ b/benchmarks/memory/server/scenarios/peak-large-page/vue/vite.config.ts
@@ -3,7 +3,6 @@ import { defineConfig } from 'vitest/config'
import codspeedPlugin from '@codspeed/vitest-plugin'
import { tanstackStart } from '@tanstack/vue-start/plugin/vite'
import vueJsx from '@vitejs/plugin-vue-jsx'
-import { memoryConfig } from '../../../../runtime'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -23,7 +22,19 @@ export default defineConfig({
minify: false,
},
test: {
- ...memoryConfig('server'),
+ // Keep lazily-compiled code alive for the whole run: the pinned
+ // collections age code fast enough for V8 to flush unused bytecode,
+ // and the mid-measurement recompile injects a multi-MB allocation
+ // burst at a run-dependent time.
+ execArgv: [
+ '--no-flush-bytecode',
+ // Pre-size the V8 heap so no space has to grow mid-measurement:
+ // heap-growth events allocate several MB at a run-dependent moment,
+ // which flips the measured peak bimodally between identical runs.
+ '--initial-old-space-size=64',
+ '--min-semi-space-size=16',
+ '--max-semi-space-size=16',
+ ],
name: '@benchmarks/memory-server peak-large-page (vue)',
watch: false,
environment: 'node',
diff --git a/benchmarks/memory/server/scenarios/request-churn/react/memory.bench.ts b/benchmarks/memory/server/scenarios/request-churn/react/memory.bench.ts
index 8b5f16ad63..9a5c211fee 100644
--- a/benchmarks/memory/server/scenarios/request-churn/react/memory.bench.ts
+++ b/benchmarks/memory/server/scenarios/request-churn/react/memory.bench.ts
@@ -1,16 +1,11 @@
-import { test } from 'vitest'
-import {
- memoryBenchHooks,
- memoryBenchOptions,
-} from '#memory-server/bench-utils'
+import { bench, describe } from 'vitest'
+import { memoryBenchOptions } from '#memory-server/bench-utils'
import { workloadGroup } from './setup'
await workloadGroup.sanity()
-test('memory', async ({ bench }) => {
+describe('memory', () => {
for (const workload of workloadGroup.workloads) {
- await bench(workload.name, memoryBenchHooks(), workload.run).run(
- memoryBenchOptions,
- )
+ bench(workload.name, workload.run, memoryBenchOptions)
}
})
diff --git a/benchmarks/memory/server/scenarios/request-churn/react/vite.config.ts b/benchmarks/memory/server/scenarios/request-churn/react/vite.config.ts
index 35adf6a249..1e956958ec 100644
--- a/benchmarks/memory/server/scenarios/request-churn/react/vite.config.ts
+++ b/benchmarks/memory/server/scenarios/request-churn/react/vite.config.ts
@@ -3,7 +3,6 @@ import { defineConfig } from 'vitest/config'
import codspeedPlugin from '@codspeed/vitest-plugin'
import { tanstackStart } from '@tanstack/react-start/plugin/vite'
import react from '@vitejs/plugin-react'
-import { memoryConfig } from '../../../../runtime'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -23,7 +22,19 @@ export default defineConfig({
minify: false,
},
test: {
- ...memoryConfig('server'),
+ // Keep lazily-compiled code alive for the whole run: the pinned
+ // collections age code fast enough for V8 to flush unused bytecode,
+ // and the mid-measurement recompile injects a multi-MB allocation
+ // burst at a run-dependent time.
+ execArgv: [
+ '--no-flush-bytecode',
+ // Pre-size the V8 heap so no space has to grow mid-measurement:
+ // heap-growth events allocate several MB at a run-dependent moment,
+ // which flips the measured peak bimodally between identical runs.
+ '--initial-old-space-size=64',
+ '--min-semi-space-size=16',
+ '--max-semi-space-size=16',
+ ],
name: '@benchmarks/memory-server request-churn (react)',
watch: false,
environment: 'node',
diff --git a/benchmarks/memory/server/scenarios/request-churn/shared.ts b/benchmarks/memory/server/scenarios/request-churn/shared.ts
index b200c96ed6..a196eec8b5 100644
--- a/benchmarks/memory/server/scenarios/request-churn/shared.ts
+++ b/benchmarks/memory/server/scenarios/request-churn/shared.ts
@@ -62,12 +62,13 @@ export function createWorkloadGroup(
return new Request(`http://localhost/items/${id}?q=${q}`, requestInit)
}
- const run = async () =>
+ const run = () =>
runSequentialRequestLoop(handler, {
random: benchmarkRandom,
iterations: requestChurnIterations,
buildRequest: buildItemRequest,
validateResponse: validateItemResponse,
+ pinGcBetweenIterations: true,
})
return {
diff --git a/benchmarks/memory/server/scenarios/request-churn/solid/memory.bench.ts b/benchmarks/memory/server/scenarios/request-churn/solid/memory.bench.ts
index 8b5f16ad63..9a5c211fee 100644
--- a/benchmarks/memory/server/scenarios/request-churn/solid/memory.bench.ts
+++ b/benchmarks/memory/server/scenarios/request-churn/solid/memory.bench.ts
@@ -1,16 +1,11 @@
-import { test } from 'vitest'
-import {
- memoryBenchHooks,
- memoryBenchOptions,
-} from '#memory-server/bench-utils'
+import { bench, describe } from 'vitest'
+import { memoryBenchOptions } from '#memory-server/bench-utils'
import { workloadGroup } from './setup'
await workloadGroup.sanity()
-test('memory', async ({ bench }) => {
+describe('memory', () => {
for (const workload of workloadGroup.workloads) {
- await bench(workload.name, memoryBenchHooks(), workload.run).run(
- memoryBenchOptions,
- )
+ bench(workload.name, workload.run, memoryBenchOptions)
}
})
diff --git a/benchmarks/memory/server/scenarios/request-churn/solid/src/routes/__root.tsx b/benchmarks/memory/server/scenarios/request-churn/solid/src/routes/__root.tsx
index aaf7dfdd89..6e83136ea0 100644
--- a/benchmarks/memory/server/scenarios/request-churn/solid/src/routes/__root.tsx
+++ b/benchmarks/memory/server/scenarios/request-churn/solid/src/routes/__root.tsx
@@ -4,7 +4,7 @@ import {
Scripts,
createRootRoute,
} from '@tanstack/solid-router'
-import { HydrationScript } from 'solid-js/web'
+import { HydrationScript } from '@solidjs/web'
export const Route = createRootRoute({
head: () => ({
diff --git a/benchmarks/memory/server/scenarios/request-churn/solid/tsconfig.json b/benchmarks/memory/server/scenarios/request-churn/solid/tsconfig.json
index 4b61264e11..cdb88448d7 100644
--- a/benchmarks/memory/server/scenarios/request-churn/solid/tsconfig.json
+++ b/benchmarks/memory/server/scenarios/request-churn/solid/tsconfig.json
@@ -3,7 +3,7 @@
"compilerOptions": {
"allowImportingTsExtensions": true,
"jsx": "preserve",
- "jsxImportSource": "solid-js",
+ "jsxImportSource": "@solidjs/web",
"types": ["node", "vite/client", "vitest/globals"]
},
"include": [
diff --git a/benchmarks/memory/server/scenarios/request-churn/solid/vite.config.ts b/benchmarks/memory/server/scenarios/request-churn/solid/vite.config.ts
index 6601309a74..b9dffd9ec9 100644
--- a/benchmarks/memory/server/scenarios/request-churn/solid/vite.config.ts
+++ b/benchmarks/memory/server/scenarios/request-churn/solid/vite.config.ts
@@ -2,8 +2,7 @@ import { fileURLToPath } from 'node:url'
import { defineConfig } from 'vitest/config'
import codspeedPlugin from '@codspeed/vitest-plugin'
import { tanstackStart } from '@tanstack/solid-start/plugin/vite'
-import solid from 'vite-plugin-solid'
-import { memoryConfig } from '../../../../runtime'
+import solid from '@solidjs/vite-plugin'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -15,7 +14,7 @@ export default defineConfig({
tanstackStart({
srcDirectory: 'src',
}),
- solid({ ssr: true, hot: false, dev: false }),
+ solid({ ssr: true, refresh: false, dev: false }),
],
build: {
outDir: './dist',
@@ -23,7 +22,19 @@ export default defineConfig({
minify: false,
},
test: {
- ...memoryConfig('server'),
+ // Keep lazily-compiled code alive for the whole run: the pinned
+ // collections age code fast enough for V8 to flush unused bytecode,
+ // and the mid-measurement recompile injects a multi-MB allocation
+ // burst at a run-dependent time.
+ execArgv: [
+ '--no-flush-bytecode',
+ // Pre-size the V8 heap so no space has to grow mid-measurement:
+ // heap-growth events allocate several MB at a run-dependent moment,
+ // which flips the measured peak bimodally between identical runs.
+ '--initial-old-space-size=64',
+ '--min-semi-space-size=16',
+ '--max-semi-space-size=16',
+ ],
name: '@benchmarks/memory-server request-churn (solid)',
watch: false,
environment: 'node',
diff --git a/benchmarks/memory/server/scenarios/request-churn/vue/memory.bench.ts b/benchmarks/memory/server/scenarios/request-churn/vue/memory.bench.ts
index 8b5f16ad63..9a5c211fee 100644
--- a/benchmarks/memory/server/scenarios/request-churn/vue/memory.bench.ts
+++ b/benchmarks/memory/server/scenarios/request-churn/vue/memory.bench.ts
@@ -1,16 +1,11 @@
-import { test } from 'vitest'
-import {
- memoryBenchHooks,
- memoryBenchOptions,
-} from '#memory-server/bench-utils'
+import { bench, describe } from 'vitest'
+import { memoryBenchOptions } from '#memory-server/bench-utils'
import { workloadGroup } from './setup'
await workloadGroup.sanity()
-test('memory', async ({ bench }) => {
+describe('memory', () => {
for (const workload of workloadGroup.workloads) {
- await bench(workload.name, memoryBenchHooks(), workload.run).run(
- memoryBenchOptions,
- )
+ bench(workload.name, workload.run, memoryBenchOptions)
}
})
diff --git a/benchmarks/memory/server/scenarios/request-churn/vue/src/routes/items.$id.tsx b/benchmarks/memory/server/scenarios/request-churn/vue/src/routes/items.$id.tsx
index 570561f2a8..a98d036565 100644
--- a/benchmarks/memory/server/scenarios/request-churn/vue/src/routes/items.$id.tsx
+++ b/benchmarks/memory/server/scenarios/request-churn/vue/src/routes/items.$id.tsx
@@ -1,4 +1,3 @@
-import { defineComponent } from 'vue'
import { createFileRoute } from '@tanstack/vue-router'
const itemIndexes = Array.from({ length: 5 }, (_, index) => index)
@@ -7,24 +6,6 @@ type ItemSearch = {
q: string
}
-const ItemComponent = defineComponent({
- setup() {
- const data = Route.useLoaderData()
-
- return () => (
-
- {data.value.title}
- {data.value.q}
-
- {data.value.items.map((item) => (
- {item.label}
- ))}
-
-
- )
- },
-})
-
export const Route = createFileRoute('/items/$id')({
validateSearch: (search: Record): ItemSearch => ({
q: typeof search.q === 'string' ? search.q : '',
@@ -41,3 +22,19 @@ export const Route = createFileRoute('/items/$id')({
}),
component: ItemComponent,
})
+
+function ItemComponent() {
+ const data = Route.useLoaderData()
+
+ return (
+
+ {data.value.title}
+ {data.value.q}
+
+ {data.value.items.map((item) => (
+ {item.label}
+ ))}
+
+
+ )
+}
diff --git a/benchmarks/memory/server/scenarios/request-churn/vue/vite.config.ts b/benchmarks/memory/server/scenarios/request-churn/vue/vite.config.ts
index 7f15c5c7af..a551a96e2f 100644
--- a/benchmarks/memory/server/scenarios/request-churn/vue/vite.config.ts
+++ b/benchmarks/memory/server/scenarios/request-churn/vue/vite.config.ts
@@ -3,7 +3,6 @@ import { defineConfig } from 'vitest/config'
import codspeedPlugin from '@codspeed/vitest-plugin'
import { tanstackStart } from '@tanstack/vue-start/plugin/vite'
import vueJsx from '@vitejs/plugin-vue-jsx'
-import { memoryConfig } from '../../../../runtime'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -23,7 +22,19 @@ export default defineConfig({
minify: false,
},
test: {
- ...memoryConfig('server'),
+ // Keep lazily-compiled code alive for the whole run: the pinned
+ // collections age code fast enough for V8 to flush unused bytecode,
+ // and the mid-measurement recompile injects a multi-MB allocation
+ // burst at a run-dependent time.
+ execArgv: [
+ '--no-flush-bytecode',
+ // Pre-size the V8 heap so no space has to grow mid-measurement:
+ // heap-growth events allocate several MB at a run-dependent moment,
+ // which flips the measured peak bimodally between identical runs.
+ '--initial-old-space-size=64',
+ '--min-semi-space-size=16',
+ '--max-semi-space-size=16',
+ ],
name: '@benchmarks/memory-server request-churn (vue)',
watch: false,
environment: 'node',
diff --git a/benchmarks/memory/server/scenarios/serialization-payload/react/memory.bench.ts b/benchmarks/memory/server/scenarios/serialization-payload/react/memory.bench.ts
index 8b5f16ad63..9a5c211fee 100644
--- a/benchmarks/memory/server/scenarios/serialization-payload/react/memory.bench.ts
+++ b/benchmarks/memory/server/scenarios/serialization-payload/react/memory.bench.ts
@@ -1,16 +1,11 @@
-import { test } from 'vitest'
-import {
- memoryBenchHooks,
- memoryBenchOptions,
-} from '#memory-server/bench-utils'
+import { bench, describe } from 'vitest'
+import { memoryBenchOptions } from '#memory-server/bench-utils'
import { workloadGroup } from './setup'
await workloadGroup.sanity()
-test('memory', async ({ bench }) => {
+describe('memory', () => {
for (const workload of workloadGroup.workloads) {
- await bench(workload.name, memoryBenchHooks(), workload.run).run(
- memoryBenchOptions,
- )
+ bench(workload.name, workload.run, memoryBenchOptions)
}
})
diff --git a/benchmarks/memory/server/scenarios/serialization-payload/react/vite.config.ts b/benchmarks/memory/server/scenarios/serialization-payload/react/vite.config.ts
index 1ed3bcc335..de5549de3b 100644
--- a/benchmarks/memory/server/scenarios/serialization-payload/react/vite.config.ts
+++ b/benchmarks/memory/server/scenarios/serialization-payload/react/vite.config.ts
@@ -3,7 +3,6 @@ import { defineConfig } from 'vitest/config'
import codspeedPlugin from '@codspeed/vitest-plugin'
import { tanstackStart } from '@tanstack/react-start/plugin/vite'
import react from '@vitejs/plugin-react'
-import { memoryConfig } from '../../../../runtime'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -23,7 +22,19 @@ export default defineConfig({
minify: false,
},
test: {
- ...memoryConfig('server'),
+ // Keep lazily-compiled code alive for the whole run: the pinned
+ // collections age code fast enough for V8 to flush unused bytecode,
+ // and the mid-measurement recompile injects a multi-MB allocation
+ // burst at a run-dependent time.
+ execArgv: [
+ '--no-flush-bytecode',
+ // Pre-size the V8 heap so no space has to grow mid-measurement:
+ // heap-growth events allocate several MB at a run-dependent moment,
+ // which flips the measured peak bimodally between identical runs.
+ '--initial-old-space-size=64',
+ '--min-semi-space-size=16',
+ '--max-semi-space-size=16',
+ ],
name: '@benchmarks/memory-server serialization-payload (react)',
watch: false,
environment: 'node',
diff --git a/benchmarks/memory/server/scenarios/serialization-payload/shared.ts b/benchmarks/memory/server/scenarios/serialization-payload/shared.ts
index 14ec8f7e0a..ce095b5e10 100644
--- a/benchmarks/memory/server/scenarios/serialization-payload/shared.ts
+++ b/benchmarks/memory/server/scenarios/serialization-payload/shared.ts
@@ -9,7 +9,7 @@ export type { StartRequestHandler }
type Framework = 'react' | 'solid' | 'vue'
const benchmarkSeed = 0x51eaa11
-const serializationPayloadIterations = 1
+const serializationPayloadIterations = 12
const payloadPageMarker = 'data-bench="serialization-payload"'
const requestInit = {
@@ -55,12 +55,14 @@ export function createWorkloadGroup(
framework: Framework,
handler: StartRequestHandler,
) {
- const run = async () =>
+ const run = () =>
runSequentialRequestLoop(handler, {
seed: benchmarkSeed,
iterations: serializationPayloadIterations,
buildRequest: buildPayloadRequest,
validateResponse: validatePayloadResponse,
+ pinGcBetweenIterations: true,
+ verifyGcFloor: true,
})
return {
diff --git a/benchmarks/memory/server/scenarios/serialization-payload/solid/memory.bench.ts b/benchmarks/memory/server/scenarios/serialization-payload/solid/memory.bench.ts
index 8b5f16ad63..9a5c211fee 100644
--- a/benchmarks/memory/server/scenarios/serialization-payload/solid/memory.bench.ts
+++ b/benchmarks/memory/server/scenarios/serialization-payload/solid/memory.bench.ts
@@ -1,16 +1,11 @@
-import { test } from 'vitest'
-import {
- memoryBenchHooks,
- memoryBenchOptions,
-} from '#memory-server/bench-utils'
+import { bench, describe } from 'vitest'
+import { memoryBenchOptions } from '#memory-server/bench-utils'
import { workloadGroup } from './setup'
await workloadGroup.sanity()
-test('memory', async ({ bench }) => {
+describe('memory', () => {
for (const workload of workloadGroup.workloads) {
- await bench(workload.name, memoryBenchHooks(), workload.run).run(
- memoryBenchOptions,
- )
+ bench(workload.name, workload.run, memoryBenchOptions)
}
})
diff --git a/benchmarks/memory/server/scenarios/serialization-payload/solid/src/routes/__root.tsx b/benchmarks/memory/server/scenarios/serialization-payload/solid/src/routes/__root.tsx
index aaf7dfdd89..6e83136ea0 100644
--- a/benchmarks/memory/server/scenarios/serialization-payload/solid/src/routes/__root.tsx
+++ b/benchmarks/memory/server/scenarios/serialization-payload/solid/src/routes/__root.tsx
@@ -4,7 +4,7 @@ import {
Scripts,
createRootRoute,
} from '@tanstack/solid-router'
-import { HydrationScript } from 'solid-js/web'
+import { HydrationScript } from '@solidjs/web'
export const Route = createRootRoute({
head: () => ({
diff --git a/benchmarks/memory/server/scenarios/serialization-payload/solid/tsconfig.json b/benchmarks/memory/server/scenarios/serialization-payload/solid/tsconfig.json
index 4b61264e11..cdb88448d7 100644
--- a/benchmarks/memory/server/scenarios/serialization-payload/solid/tsconfig.json
+++ b/benchmarks/memory/server/scenarios/serialization-payload/solid/tsconfig.json
@@ -3,7 +3,7 @@
"compilerOptions": {
"allowImportingTsExtensions": true,
"jsx": "preserve",
- "jsxImportSource": "solid-js",
+ "jsxImportSource": "@solidjs/web",
"types": ["node", "vite/client", "vitest/globals"]
},
"include": [
diff --git a/benchmarks/memory/server/scenarios/serialization-payload/solid/vite.config.ts b/benchmarks/memory/server/scenarios/serialization-payload/solid/vite.config.ts
index a2d04b986c..7313699668 100644
--- a/benchmarks/memory/server/scenarios/serialization-payload/solid/vite.config.ts
+++ b/benchmarks/memory/server/scenarios/serialization-payload/solid/vite.config.ts
@@ -2,8 +2,7 @@ import { fileURLToPath } from 'node:url'
import { defineConfig } from 'vitest/config'
import codspeedPlugin from '@codspeed/vitest-plugin'
import { tanstackStart } from '@tanstack/solid-start/plugin/vite'
-import solid from 'vite-plugin-solid'
-import { memoryConfig } from '../../../../runtime'
+import solid from '@solidjs/vite-plugin'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -15,7 +14,7 @@ export default defineConfig({
tanstackStart({
srcDirectory: 'src',
}),
- solid({ ssr: true, hot: false, dev: false }),
+ solid({ ssr: true, refresh: false, dev: false }),
],
build: {
outDir: './dist',
@@ -23,7 +22,19 @@ export default defineConfig({
minify: false,
},
test: {
- ...memoryConfig('server'),
+ // Keep lazily-compiled code alive for the whole run: the pinned
+ // collections age code fast enough for V8 to flush unused bytecode,
+ // and the mid-measurement recompile injects a multi-MB allocation
+ // burst at a run-dependent time.
+ execArgv: [
+ '--no-flush-bytecode',
+ // Pre-size the V8 heap so no space has to grow mid-measurement:
+ // heap-growth events allocate several MB at a run-dependent moment,
+ // which flips the measured peak bimodally between identical runs.
+ '--initial-old-space-size=64',
+ '--min-semi-space-size=16',
+ '--max-semi-space-size=16',
+ ],
name: '@benchmarks/memory-server serialization-payload (solid)',
watch: false,
environment: 'node',
diff --git a/benchmarks/memory/server/scenarios/serialization-payload/vue/memory.bench.ts b/benchmarks/memory/server/scenarios/serialization-payload/vue/memory.bench.ts
index 8b5f16ad63..9a5c211fee 100644
--- a/benchmarks/memory/server/scenarios/serialization-payload/vue/memory.bench.ts
+++ b/benchmarks/memory/server/scenarios/serialization-payload/vue/memory.bench.ts
@@ -1,16 +1,11 @@
-import { test } from 'vitest'
-import {
- memoryBenchHooks,
- memoryBenchOptions,
-} from '#memory-server/bench-utils'
+import { bench, describe } from 'vitest'
+import { memoryBenchOptions } from '#memory-server/bench-utils'
import { workloadGroup } from './setup'
await workloadGroup.sanity()
-test('memory', async ({ bench }) => {
+describe('memory', () => {
for (const workload of workloadGroup.workloads) {
- await bench(workload.name, memoryBenchHooks(), workload.run).run(
- memoryBenchOptions,
- )
+ bench(workload.name, workload.run, memoryBenchOptions)
}
})
diff --git a/benchmarks/memory/server/scenarios/serialization-payload/vue/src/routes/data.$id.tsx b/benchmarks/memory/server/scenarios/serialization-payload/vue/src/routes/data.$id.tsx
index 37b1a590e4..e6b4cfadfb 100644
--- a/benchmarks/memory/server/scenarios/serialization-payload/vue/src/routes/data.$id.tsx
+++ b/benchmarks/memory/server/scenarios/serialization-payload/vue/src/routes/data.$id.tsx
@@ -1,20 +1,17 @@
-import { defineComponent } from 'vue'
import { createFileRoute } from '@tanstack/vue-router'
import { makeSerializationPayload } from '../../../serialization-payload'
-const DataComponent = defineComponent({
- setup() {
- const data = Route.useLoaderData()
-
- return () => (
-
- Map size: {data.value.lookup.size}
-
- )
- },
-})
-
export const Route = createFileRoute('/data/$id')({
loader: ({ params }) => makeSerializationPayload(params.id),
component: DataComponent,
})
+
+function DataComponent() {
+ const data = Route.useLoaderData()
+
+ return (
+
+ Map size: {data.value.lookup.size}
+
+ )
+}
diff --git a/benchmarks/memory/server/scenarios/serialization-payload/vue/vite.config.ts b/benchmarks/memory/server/scenarios/serialization-payload/vue/vite.config.ts
index b63a561228..41a5596adf 100644
--- a/benchmarks/memory/server/scenarios/serialization-payload/vue/vite.config.ts
+++ b/benchmarks/memory/server/scenarios/serialization-payload/vue/vite.config.ts
@@ -3,7 +3,6 @@ import { defineConfig } from 'vitest/config'
import codspeedPlugin from '@codspeed/vitest-plugin'
import { tanstackStart } from '@tanstack/vue-start/plugin/vite'
import vueJsx from '@vitejs/plugin-vue-jsx'
-import { memoryConfig } from '../../../../runtime'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -23,7 +22,19 @@ export default defineConfig({
minify: false,
},
test: {
- ...memoryConfig('server'),
+ // Keep lazily-compiled code alive for the whole run: the pinned
+ // collections age code fast enough for V8 to flush unused bytecode,
+ // and the mid-measurement recompile injects a multi-MB allocation
+ // burst at a run-dependent time.
+ execArgv: [
+ '--no-flush-bytecode',
+ // Pre-size the V8 heap so no space has to grow mid-measurement:
+ // heap-growth events allocate several MB at a run-dependent moment,
+ // which flips the measured peak bimodally between identical runs.
+ '--initial-old-space-size=64',
+ '--min-semi-space-size=16',
+ '--max-semi-space-size=16',
+ ],
name: '@benchmarks/memory-server serialization-payload (vue)',
watch: false,
environment: 'node',
diff --git a/benchmarks/memory/server/scenarios/server-fn-churn/react/memory.bench.ts b/benchmarks/memory/server/scenarios/server-fn-churn/react/memory.bench.ts
index 8b5f16ad63..9a5c211fee 100644
--- a/benchmarks/memory/server/scenarios/server-fn-churn/react/memory.bench.ts
+++ b/benchmarks/memory/server/scenarios/server-fn-churn/react/memory.bench.ts
@@ -1,16 +1,11 @@
-import { test } from 'vitest'
-import {
- memoryBenchHooks,
- memoryBenchOptions,
-} from '#memory-server/bench-utils'
+import { bench, describe } from 'vitest'
+import { memoryBenchOptions } from '#memory-server/bench-utils'
import { workloadGroup } from './setup'
await workloadGroup.sanity()
-test('memory', async ({ bench }) => {
+describe('memory', () => {
for (const workload of workloadGroup.workloads) {
- await bench(workload.name, memoryBenchHooks(), workload.run).run(
- memoryBenchOptions,
- )
+ bench(workload.name, workload.run, memoryBenchOptions)
}
})
diff --git a/benchmarks/memory/server/scenarios/server-fn-churn/react/vite.config.ts b/benchmarks/memory/server/scenarios/server-fn-churn/react/vite.config.ts
index f72cc53d6f..68d9ed839b 100644
--- a/benchmarks/memory/server/scenarios/server-fn-churn/react/vite.config.ts
+++ b/benchmarks/memory/server/scenarios/server-fn-churn/react/vite.config.ts
@@ -3,7 +3,6 @@ import { defineConfig } from 'vitest/config'
import codspeedPlugin from '@codspeed/vitest-plugin'
import { tanstackStart } from '@tanstack/react-start/plugin/vite'
import react from '@vitejs/plugin-react'
-import { memoryConfig } from '../../../../runtime'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -23,7 +22,19 @@ export default defineConfig({
minify: false,
},
test: {
- ...memoryConfig('server'),
+ // Keep lazily-compiled code alive for the whole run: the pinned
+ // collections age code fast enough for V8 to flush unused bytecode,
+ // and the mid-measurement recompile injects a multi-MB allocation
+ // burst at a run-dependent time.
+ execArgv: [
+ '--no-flush-bytecode',
+ // Pre-size the V8 heap so no space has to grow mid-measurement:
+ // heap-growth events allocate several MB at a run-dependent moment,
+ // which flips the measured peak bimodally between identical runs.
+ '--initial-old-space-size=64',
+ '--min-semi-space-size=16',
+ '--max-semi-space-size=16',
+ ],
name: '@benchmarks/memory-server server-fn-churn (react)',
watch: false,
environment: 'node',
diff --git a/benchmarks/memory/server/scenarios/server-fn-churn/shared.ts b/benchmarks/memory/server/scenarios/server-fn-churn/shared.ts
index 167b24d3b6..a385f28bf5 100644
--- a/benchmarks/memory/server/scenarios/server-fn-churn/shared.ts
+++ b/benchmarks/memory/server/scenarios/server-fn-churn/shared.ts
@@ -14,12 +14,18 @@ type FnUrls = {
post: string
}
-type PayloadFixture = {
+export type PayloadFixture = {
id: string
body: string
query: string
}
+export type ServerFnChurnAdapter = {
+ buildGetRequest: (url: string, fixture: PayloadFixture) => Request
+ buildPostRequest: (url: string, fixture: PayloadFixture) => Request
+ validateResponse: (response: Response, request: Request) => void
+}
+
type SerovalNode =
| {
t: 1
@@ -38,6 +44,8 @@ type SerovalNode =
const benchmarkSeed = 0xdecafbad
const payloadSeed = 0x51f0cafe
const fixtureCount = 16
+// Sized to sit just above the 2s measured-run floor on CI (per-iteration
+// cost with the pinned collection is ~0.08-0.11s across frameworks).
const serverFnChurnIterations = 30
const origin = 'http://localhost'
const tssContentTypeFramed = 'application/x-tss-framed'
@@ -160,6 +168,12 @@ function validateServerFnResponse(response: Response, request: Request) {
}
}
+const tanstackServerFnChurnAdapter: ServerFnChurnAdapter = {
+ buildGetRequest,
+ buildPostRequest,
+ validateResponse: validateServerFnResponse,
+}
+
function validateEchoedBody(
body: string,
request: Request,
@@ -179,49 +193,52 @@ function validateEchoedBody(
async function assertServerFnChurnSanity(
handler: StartRequestHandler,
urls: FnUrls,
+ adapter: ServerFnChurnAdapter,
) {
const getFixture = getFixtures[0]!
- const getRequest = buildGetRequest(urls.get, getFixture)
+ const getRequest = adapter.buildGetRequest(urls.get, getFixture)
const getResponse = await handler.fetch(getRequest)
const getBody = await getResponse.text()
- validateServerFnResponse(getResponse, getRequest)
+ adapter.validateResponse(getResponse, getRequest)
validateEchoedBody(getBody, getRequest, getFixture.id)
const postFixture = postFixtures[0]!
- const postRequest = buildPostRequest(urls.post, postFixture)
+ const postRequest = adapter.buildPostRequest(urls.post, postFixture)
const postResponse = await handler.fetch(postRequest)
const postBody = await postResponse.text()
- validateServerFnResponse(postResponse, postRequest)
+ adapter.validateResponse(postResponse, postRequest)
validateEchoedBody(postBody, postRequest, postFixture.id)
}
export async function createWorkloadGroup(
framework: Framework,
handler: StartRequestHandler,
+ adapter: ServerFnChurnAdapter = tanstackServerFnChurnAdapter,
) {
const urls = await discoverUrls(handler)
- const run = async () =>
+ const run = () =>
runSequentialRequestLoop(handler, {
seed: benchmarkSeed,
iterations: serverFnChurnIterations,
+ pinGcBetweenIterations: true,
buildRequest: (_random, index) => {
const fixtureIndex = Math.floor(index / 2) % fixtureCount
if (index % 2 === 0) {
const fixture = getFixtures[fixtureIndex]!
- return buildGetRequest(urls.get, fixture)
+ return adapter.buildGetRequest(urls.get, fixture)
} else {
const fixture = postFixtures[fixtureIndex]!
- return buildPostRequest(urls.post, fixture)
+ return adapter.buildPostRequest(urls.post, fixture)
}
},
- validateResponse: validateServerFnResponse,
+ validateResponse: adapter.validateResponse,
})
return {
- sanity: () => assertServerFnChurnSanity(handler, urls),
+ sanity: () => assertServerFnChurnSanity(handler, urls, adapter),
workloads: [
{
name: `mem server server-fn-churn (${framework})`,
diff --git a/benchmarks/memory/server/scenarios/server-fn-churn/solid/adapter.ts b/benchmarks/memory/server/scenarios/server-fn-churn/solid/adapter.ts
new file mode 100644
index 0000000000..f23735ce8f
--- /dev/null
+++ b/benchmarks/memory/server/scenarios/server-fn-churn/solid/adapter.ts
@@ -0,0 +1,28 @@
+import {
+ createSolidServerFunctionGetRequest,
+ createSolidServerFunctionPostRequest,
+ validateSolidServerFunctionResponse,
+} from '../../../../../solid-server-functions'
+import type { PayloadFixture, ServerFnChurnAdapter } from '../shared'
+
+function buildGetRequest(url: string, fixture: PayloadFixture) {
+ return createSolidServerFunctionGetRequest(
+ url,
+ [{ method: 'GET', data: { id: fixture.id } }],
+ `memory-get:${fixture.id}`,
+ )
+}
+
+function buildPostRequest(url: string, fixture: PayloadFixture) {
+ return createSolidServerFunctionPostRequest(
+ url,
+ [{ method: 'POST', data: { id: fixture.id } }],
+ `memory-post:${fixture.id}`,
+ )
+}
+
+export const solidServerFnChurnAdapter: ServerFnChurnAdapter = {
+ buildGetRequest,
+ buildPostRequest,
+ validateResponse: validateSolidServerFunctionResponse,
+}
diff --git a/benchmarks/memory/server/scenarios/server-fn-churn/solid/memory.bench.ts b/benchmarks/memory/server/scenarios/server-fn-churn/solid/memory.bench.ts
index 8b5f16ad63..9a5c211fee 100644
--- a/benchmarks/memory/server/scenarios/server-fn-churn/solid/memory.bench.ts
+++ b/benchmarks/memory/server/scenarios/server-fn-churn/solid/memory.bench.ts
@@ -1,16 +1,11 @@
-import { test } from 'vitest'
-import {
- memoryBenchHooks,
- memoryBenchOptions,
-} from '#memory-server/bench-utils'
+import { bench, describe } from 'vitest'
+import { memoryBenchOptions } from '#memory-server/bench-utils'
import { workloadGroup } from './setup'
await workloadGroup.sanity()
-test('memory', async ({ bench }) => {
+describe('memory', () => {
for (const workload of workloadGroup.workloads) {
- await bench(workload.name, memoryBenchHooks(), workload.run).run(
- memoryBenchOptions,
- )
+ bench(workload.name, workload.run, memoryBenchOptions)
}
})
diff --git a/benchmarks/memory/server/scenarios/server-fn-churn/solid/setup.ts b/benchmarks/memory/server/scenarios/server-fn-churn/solid/setup.ts
index 4fe85c3f00..1a732965b8 100644
--- a/benchmarks/memory/server/scenarios/server-fn-churn/solid/setup.ts
+++ b/benchmarks/memory/server/scenarios/server-fn-churn/solid/setup.ts
@@ -1,5 +1,6 @@
import type { ServerMemoryWorkloadGroup } from '#memory-server/benchmark'
import { createWorkloadGroup } from '../shared.ts'
+import { solidServerFnChurnAdapter } from './adapter'
import type { StartRequestHandler } from '../shared.ts'
const appModuleUrl = new URL('./dist/server/server.js', import.meta.url).href
@@ -11,4 +12,4 @@ const { default: handler } = (await import(
}
export const workloadGroup: ServerMemoryWorkloadGroup =
- await createWorkloadGroup('solid', handler)
+ await createWorkloadGroup('solid', handler, solidServerFnChurnAdapter)
diff --git a/benchmarks/memory/server/scenarios/server-fn-churn/solid/src/routes/__root.tsx b/benchmarks/memory/server/scenarios/server-fn-churn/solid/src/routes/__root.tsx
index aaf7dfdd89..6e83136ea0 100644
--- a/benchmarks/memory/server/scenarios/server-fn-churn/solid/src/routes/__root.tsx
+++ b/benchmarks/memory/server/scenarios/server-fn-churn/solid/src/routes/__root.tsx
@@ -4,7 +4,7 @@ import {
Scripts,
createRootRoute,
} from '@tanstack/solid-router'
-import { HydrationScript } from 'solid-js/web'
+import { HydrationScript } from '@solidjs/web'
export const Route = createRootRoute({
head: () => ({
diff --git a/benchmarks/memory/server/scenarios/server-fn-churn/solid/tsconfig.json b/benchmarks/memory/server/scenarios/server-fn-churn/solid/tsconfig.json
index 4b61264e11..cdb88448d7 100644
--- a/benchmarks/memory/server/scenarios/server-fn-churn/solid/tsconfig.json
+++ b/benchmarks/memory/server/scenarios/server-fn-churn/solid/tsconfig.json
@@ -3,7 +3,7 @@
"compilerOptions": {
"allowImportingTsExtensions": true,
"jsx": "preserve",
- "jsxImportSource": "solid-js",
+ "jsxImportSource": "@solidjs/web",
"types": ["node", "vite/client", "vitest/globals"]
},
"include": [
diff --git a/benchmarks/memory/server/scenarios/server-fn-churn/solid/vite.config.ts b/benchmarks/memory/server/scenarios/server-fn-churn/solid/vite.config.ts
index 4fba196bd2..762bb152e3 100644
--- a/benchmarks/memory/server/scenarios/server-fn-churn/solid/vite.config.ts
+++ b/benchmarks/memory/server/scenarios/server-fn-churn/solid/vite.config.ts
@@ -2,8 +2,7 @@ import { fileURLToPath } from 'node:url'
import { defineConfig } from 'vitest/config'
import codspeedPlugin from '@codspeed/vitest-plugin'
import { tanstackStart } from '@tanstack/solid-start/plugin/vite'
-import solid from 'vite-plugin-solid'
-import { memoryConfig } from '../../../../runtime'
+import solid from '@solidjs/vite-plugin'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -15,7 +14,7 @@ export default defineConfig({
tanstackStart({
srcDirectory: 'src',
}),
- solid({ ssr: true, hot: false, dev: false }),
+ solid({ ssr: true, refresh: false, dev: false }),
],
build: {
outDir: './dist',
@@ -23,7 +22,19 @@ export default defineConfig({
minify: false,
},
test: {
- ...memoryConfig('server'),
+ // Keep lazily-compiled code alive for the whole run: the pinned
+ // collections age code fast enough for V8 to flush unused bytecode,
+ // and the mid-measurement recompile injects a multi-MB allocation
+ // burst at a run-dependent time.
+ execArgv: [
+ '--no-flush-bytecode',
+ // Pre-size the V8 heap so no space has to grow mid-measurement:
+ // heap-growth events allocate several MB at a run-dependent moment,
+ // which flips the measured peak bimodally between identical runs.
+ '--initial-old-space-size=64',
+ '--min-semi-space-size=16',
+ '--max-semi-space-size=16',
+ ],
name: '@benchmarks/memory-server server-fn-churn (solid)',
watch: false,
environment: 'node',
diff --git a/benchmarks/memory/server/scenarios/server-fn-churn/vue/memory.bench.ts b/benchmarks/memory/server/scenarios/server-fn-churn/vue/memory.bench.ts
index 8b5f16ad63..9a5c211fee 100644
--- a/benchmarks/memory/server/scenarios/server-fn-churn/vue/memory.bench.ts
+++ b/benchmarks/memory/server/scenarios/server-fn-churn/vue/memory.bench.ts
@@ -1,16 +1,11 @@
-import { test } from 'vitest'
-import {
- memoryBenchHooks,
- memoryBenchOptions,
-} from '#memory-server/bench-utils'
+import { bench, describe } from 'vitest'
+import { memoryBenchOptions } from '#memory-server/bench-utils'
import { workloadGroup } from './setup'
await workloadGroup.sanity()
-test('memory', async ({ bench }) => {
+describe('memory', () => {
for (const workload of workloadGroup.workloads) {
- await bench(workload.name, memoryBenchHooks(), workload.run).run(
- memoryBenchOptions,
- )
+ bench(workload.name, workload.run, memoryBenchOptions)
}
})
diff --git a/benchmarks/memory/server/scenarios/server-fn-churn/vue/vite.config.ts b/benchmarks/memory/server/scenarios/server-fn-churn/vue/vite.config.ts
index 5ab5ec37e3..0e249b9f3b 100644
--- a/benchmarks/memory/server/scenarios/server-fn-churn/vue/vite.config.ts
+++ b/benchmarks/memory/server/scenarios/server-fn-churn/vue/vite.config.ts
@@ -3,7 +3,6 @@ import { defineConfig } from 'vitest/config'
import codspeedPlugin from '@codspeed/vitest-plugin'
import { tanstackStart } from '@tanstack/vue-start/plugin/vite'
import vueJsx from '@vitejs/plugin-vue-jsx'
-import { memoryConfig } from '../../../../runtime'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -23,7 +22,19 @@ export default defineConfig({
minify: false,
},
test: {
- ...memoryConfig('server'),
+ // Keep lazily-compiled code alive for the whole run: the pinned
+ // collections age code fast enough for V8 to flush unused bytecode,
+ // and the mid-measurement recompile injects a multi-MB allocation
+ // burst at a run-dependent time.
+ execArgv: [
+ '--no-flush-bytecode',
+ // Pre-size the V8 heap so no space has to grow mid-measurement:
+ // heap-growth events allocate several MB at a run-dependent moment,
+ // which flips the measured peak bimodally between identical runs.
+ '--initial-old-space-size=64',
+ '--min-semi-space-size=16',
+ '--max-semi-space-size=16',
+ ],
name: '@benchmarks/memory-server server-fn-churn (vue)',
watch: false,
environment: 'node',
diff --git a/benchmarks/memory/server/scenarios/streaming-peak/react/memory.bench.ts b/benchmarks/memory/server/scenarios/streaming-peak/react/memory.bench.ts
index 8b5f16ad63..9a5c211fee 100644
--- a/benchmarks/memory/server/scenarios/streaming-peak/react/memory.bench.ts
+++ b/benchmarks/memory/server/scenarios/streaming-peak/react/memory.bench.ts
@@ -1,16 +1,11 @@
-import { test } from 'vitest'
-import {
- memoryBenchHooks,
- memoryBenchOptions,
-} from '#memory-server/bench-utils'
+import { bench, describe } from 'vitest'
+import { memoryBenchOptions } from '#memory-server/bench-utils'
import { workloadGroup } from './setup'
await workloadGroup.sanity()
-test('memory', async ({ bench }) => {
+describe('memory', () => {
for (const workload of workloadGroup.workloads) {
- await bench(workload.name, memoryBenchHooks(), workload.run).run(
- memoryBenchOptions,
- )
+ bench(workload.name, workload.run, memoryBenchOptions)
}
})
diff --git a/benchmarks/memory/server/scenarios/streaming-peak/react/vite.config.ts b/benchmarks/memory/server/scenarios/streaming-peak/react/vite.config.ts
index 5d555441b6..5af0f0d138 100644
--- a/benchmarks/memory/server/scenarios/streaming-peak/react/vite.config.ts
+++ b/benchmarks/memory/server/scenarios/streaming-peak/react/vite.config.ts
@@ -3,7 +3,6 @@ import { defineConfig } from 'vitest/config'
import codspeedPlugin from '@codspeed/vitest-plugin'
import { tanstackStart } from '@tanstack/react-start/plugin/vite'
import react from '@vitejs/plugin-react'
-import { memoryConfig } from '../../../../runtime'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
@@ -23,7 +22,19 @@ export default defineConfig({
minify: false,
},
test: {
- ...memoryConfig('server'),
+ // Keep lazily-compiled code alive for the whole run: the pinned
+ // collections age code fast enough for V8 to flush unused bytecode,
+ // and the mid-measurement recompile injects a multi-MB allocation
+ // burst at a run-dependent time.
+ execArgv: [
+ '--no-flush-bytecode',
+ // Pre-size the V8 heap so no space has to grow mid-measurement:
+ // heap-growth events allocate several MB at a run-dependent moment,
+ // which flips the measured peak bimodally between identical runs.
+ '--initial-old-space-size=64',
+ '--min-semi-space-size=16',
+ '--max-semi-space-size=16',
+ ],
name: '@benchmarks/memory-server streaming-peak (react)',
watch: false,
environment: 'node',
diff --git a/benchmarks/memory/server/scenarios/streaming-peak/shared.ts b/benchmarks/memory/server/scenarios/streaming-peak/shared.ts
index c027047408..6b45470329 100644
--- a/benchmarks/memory/server/scenarios/streaming-peak/shared.ts
+++ b/benchmarks/memory/server/scenarios/streaming-peak/shared.ts
@@ -9,7 +9,7 @@ export type { StartRequestHandler }
type Framework = 'react' | 'solid' | 'vue'
const benchmarkSeed = 0xdecafbad
-const streamingPeakIterations = 1
+const streamingPeakIterations = 20
const fallbackMarker = 'streaming-peak-fallback-0'
const requestInit = {
@@ -50,7 +50,7 @@ async function readStreamingBody(response: Response) {
let body = ''
let chunkCount = 0
- for (;;) {
+ while (true) {
const result = await reader.read()
if (result.done) {
@@ -92,21 +92,18 @@ export function createWorkloadGroup(
framework: Framework,
handler: StartRequestHandler,
) {
- const run = async () =>
+ const run = () =>
runSequentialRequestLoop(handler, {
seed: benchmarkSeed,
iterations: streamingPeakIterations,
buildRequest: buildStreamingRequest,
validateResponse: validateStreamingResponse,
+ pinGcBetweenIterations: true,
+ verifyGcFloor: true,
})
return {
- sanity: async () => {
- // Import the route chunks before checking streaming. Cold disk I/O can
- // otherwise outlast the deferred payload and collapse the first response.
- await run()
- await assertStreamingPeakSanity(handler)
- },
+ sanity: () => assertStreamingPeakSanity(handler),
workloads: [
{
name: `mem server streaming-peak chunked (${framework})`,
diff --git a/benchmarks/memory/server/scenarios/streaming-peak/solid/memory.bench.ts b/benchmarks/memory/server/scenarios/streaming-peak/solid/memory.bench.ts
index 8b5f16ad63..138ad2bbde 100644
--- a/benchmarks/memory/server/scenarios/streaming-peak/solid/memory.bench.ts
+++ b/benchmarks/memory/server/scenarios/streaming-peak/solid/memory.bench.ts
@@ -1,16 +1,14 @@
-import { test } from 'vitest'
-import {
- memoryBenchHooks,
- memoryBenchOptions,
-} from '#memory-server/bench-utils'
-import { workloadGroup } from './setup'
+import { bench, describe } from 'vitest'
+import { memoryBenchOptions } from '#memory-server/bench-utils'
-await workloadGroup.sanity()
-
-test('memory', async ({ bench }) => {
- for (const workload of workloadGroup.workloads) {
- await bench(workload.name, memoryBenchHooks(), workload.run).run(
- memoryBenchOptions,
- )
- }
+// TODO(solid-router-v2): re-enable once router-core's SSR stream transformer
+// supports Solid 2's streaming shape. Solid 2's renderToStream emits
+// `