Skip to content

Use scoped Vitest cleanup in lane regression tests - #7923

Merged
Sheraff merged 1 commit into
fix-router-core-lane-match-loaderfrom
codex/scoped-vitest-cleanup
Jul 30, 2026
Merged

Use scoped Vitest cleanup in lane regression tests#7923
Sheraff merged 1 commit into
fix-router-core-lane-match-loaderfrom
codex/scoped-vitest-cleanup

Conversation

@Sheraff

@Sheraff Sheraff commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • replace 37 broad end-of-test try/finally cleanup wrappers in tests added or modified by fix-router-core-lane-match-loader with test-local onTestFinished callbacks
  • keep teardown registration next to the resource or operation it owns
  • preserve four try/finally blocks where finally must run before later assertions or is itself behavior under test
  • leave global test setup and central Vitest configuration unchanged

Why

The broad wrappers add substantial nesting around each test's assertion path. Test-local cleanup keeps teardown scoped to the individual test and still runs when the test fails, while making the behavior being asserted easier to read.

Validation

  • targeted React Router, Router Core, Router Plugin, Start Server Core, and Vue Router unit tests
  • full Solid Router unit target in client and server modes
  • test:types for all six affected packages
  • test:eslint for all six affected packages
  • Prettier and git diff --check

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 14cc8781-f5f6-4c88-ac30-0b8cb8f376e6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nx-cloud

nx-cloud Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit afaa22d

Command Status Duration Result
nx affected --targets=test:eslint,test:unit,tes... ✅ Succeeded 12m 21s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 2m 10s View ↗

☁️ Nx Cloud last updated this comment at 2026-07-30 12:12:13 UTC

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

4 package(s) bumped directly, 19 bumped as dependents.

🟩 Patch bumps

Package Version Reason
@tanstack/react-router 1.170.18 → 1.170.19 Changeset
@tanstack/router-core 1.171.15 → 1.171.16 Changeset
@tanstack/solid-router 1.170.18 → 1.170.19 Changeset
@tanstack/vue-router 1.170.17 → 1.170.18 Changeset
@tanstack/react-start 1.168.32 → 1.168.33 Dependent
@tanstack/react-start-client 1.168.16 → 1.168.17 Dependent
@tanstack/react-start-rsc 0.1.31 → 0.1.32 Dependent
@tanstack/react-start-server 1.167.22 → 1.167.23 Dependent
@tanstack/router-cli 1.167.21 → 1.167.22 Dependent
@tanstack/router-generator 1.167.21 → 1.167.22 Dependent
@tanstack/router-plugin 1.168.23 → 1.168.24 Dependent
@tanstack/router-vite-plugin 1.167.23 → 1.167.24 Dependent
@tanstack/solid-start 1.168.32 → 1.168.33 Dependent
@tanstack/solid-start-client 1.168.16 → 1.168.17 Dependent
@tanstack/solid-start-server 1.167.22 → 1.167.23 Dependent
@tanstack/start-client-core 1.170.14 → 1.170.15 Dependent
@tanstack/start-plugin-core 1.171.24 → 1.171.25 Dependent
@tanstack/start-server-core 1.169.17 → 1.169.18 Dependent
@tanstack/start-static-server-functions 1.167.19 → 1.167.20 Dependent
@tanstack/start-storage-context 1.167.17 → 1.167.18 Dependent
@tanstack/vue-start 1.168.31 → 1.168.32 Dependent
@tanstack/vue-start-client 1.167.19 → 1.167.20 Dependent
@tanstack/vue-start-server 1.167.22 → 1.167.23 Dependent

@github-actions

Copy link
Copy Markdown
Contributor

Bundle Size Benchmarks

  • Commit: 6f2f45128166
  • Measured at: 2026-07-30T12:01:05.729Z
  • Baseline source: history:a3ee355b5934
  • Dashboard: bundle-size history

The following scenarios have bundle-size changes compared with the baseline:

Scenario Current (gzip) Delta vs baseline Initial gzip Raw Brotli Trend
react-router.minimal 87.21 KiB -145 B (-0.16%) 87.07 KiB 269.46 KiB 75.94 KiB ███████████▁
react-router.full 91.00 KiB -69 B (-0.07%) 90.86 KiB 281.47 KiB 79.30 KiB ███████████▁
solid-router.minimal 34.91 KiB -629 B (-1.73%) 34.79 KiB 100.24 KiB 31.48 KiB ███████████▁
solid-router.full 40.01 KiB -582 B (-1.40%) 39.89 KiB 115.47 KiB 36.00 KiB ███████████▁
vue-router.minimal 52.22 KiB -802 B (-1.48%) 52.08 KiB 143.40 KiB 47.04 KiB ███████████▁
vue-router.full 58.19 KiB -769 B (-1.27%) 58.05 KiB 162.17 KiB 52.25 KiB ███████████▁
react-start.minimal 102.20 KiB +215 B (+0.21%) 102.06 KiB 318.61 KiB 88.84 KiB ▁▁▁▁▁▁▁▁▁▁▁█
react-start.deferred-hydration 102.93 KiB +214 B (+0.20%) 102.08 KiB 319.99 KiB 89.33 KiB ▁▁▁▁▁▁▁▁▁▁▁█
react-start.full 105.61 KiB +251 B (+0.23%) 105.47 KiB 328.61 KiB 91.55 KiB ▁▁▁▁▁▁▁▁▁▁▁█
react-start.rsbuild.minimal 99.91 KiB +223 B (+0.22%) 99.74 KiB 312.99 KiB 86.22 KiB ▁▁▁▁▁▁▁▁▁▁▁█
react-start.rsbuild.minimal-iife 100.31 KiB +219 B (+0.21%) 100.14 KiB 313.93 KiB 86.56 KiB ▁▁▁▁▁▁▁▁▁▁▁█
react-start.rsbuild.full 103.24 KiB +343 B (+0.33%) 103.07 KiB 323.14 KiB 88.92 KiB ▁▁▁▁▁▁▁▁▁▁▁█
solid-start.minimal 49.84 KiB +239 B (+0.47%) 49.71 KiB 148.28 KiB 44.31 KiB ▁▁▁▁▁▁▁▁▁▁▁█
solid-start.deferred-hydration 53.11 KiB +243 B (+0.45%) 49.77 KiB 156.32 KiB 47.28 KiB ▁▁▁▁▁▁▁▁▁▁▁█
solid-start.full 55.11 KiB -318 B (-0.56%) 54.98 KiB 164.07 KiB 48.82 KiB ███████████▁
vue-start.minimal 70.59 KiB -447 B (-0.61%) 70.46 KiB 201.32 KiB 62.65 KiB ███████████▁
vue-start.full 74.57 KiB -476 B (-0.62%) 74.43 KiB 213.93 KiB 66.16 KiB ███████████▁

Current gzip tracks all emitted client JS chunks. Initial gzip tracks only the entry/import graph. Trend sparkline is historical current gzip ending with this PR measurement; lower is better.

@pkg-pr-new

pkg-pr-new Bot commented Jul 30, 2026

Copy link
Copy Markdown
More templates

@tanstack/arktype-adapter

npm i https://pkg.pr.new/@tanstack/arktype-adapter@7923

@tanstack/eslint-plugin-router

npm i https://pkg.pr.new/@tanstack/eslint-plugin-router@7923

@tanstack/eslint-plugin-start

npm i https://pkg.pr.new/@tanstack/eslint-plugin-start@7923

@tanstack/history

npm i https://pkg.pr.new/@tanstack/history@7923

@tanstack/nitro-v2-vite-plugin

npm i https://pkg.pr.new/@tanstack/nitro-v2-vite-plugin@7923

@tanstack/react-router

npm i https://pkg.pr.new/@tanstack/react-router@7923

@tanstack/react-router-devtools

npm i https://pkg.pr.new/@tanstack/react-router-devtools@7923

@tanstack/react-router-ssr-query

npm i https://pkg.pr.new/@tanstack/react-router-ssr-query@7923

@tanstack/react-start

npm i https://pkg.pr.new/@tanstack/react-start@7923

@tanstack/react-start-client

npm i https://pkg.pr.new/@tanstack/react-start-client@7923

@tanstack/react-start-rsc

npm i https://pkg.pr.new/@tanstack/react-start-rsc@7923

@tanstack/react-start-server

npm i https://pkg.pr.new/@tanstack/react-start-server@7923

@tanstack/router-cli

npm i https://pkg.pr.new/@tanstack/router-cli@7923

@tanstack/router-core

npm i https://pkg.pr.new/@tanstack/router-core@7923

@tanstack/router-devtools

npm i https://pkg.pr.new/@tanstack/router-devtools@7923

@tanstack/router-devtools-core

npm i https://pkg.pr.new/@tanstack/router-devtools-core@7923

@tanstack/router-generator

npm i https://pkg.pr.new/@tanstack/router-generator@7923

@tanstack/router-plugin

npm i https://pkg.pr.new/@tanstack/router-plugin@7923

@tanstack/router-ssr-query-core

npm i https://pkg.pr.new/@tanstack/router-ssr-query-core@7923

@tanstack/router-utils

npm i https://pkg.pr.new/@tanstack/router-utils@7923

@tanstack/router-vite-plugin

npm i https://pkg.pr.new/@tanstack/router-vite-plugin@7923

@tanstack/solid-router

npm i https://pkg.pr.new/@tanstack/solid-router@7923

@tanstack/solid-router-devtools

npm i https://pkg.pr.new/@tanstack/solid-router-devtools@7923

@tanstack/solid-router-ssr-query

npm i https://pkg.pr.new/@tanstack/solid-router-ssr-query@7923

@tanstack/solid-start

npm i https://pkg.pr.new/@tanstack/solid-start@7923

@tanstack/solid-start-client

npm i https://pkg.pr.new/@tanstack/solid-start-client@7923

@tanstack/solid-start-server

npm i https://pkg.pr.new/@tanstack/solid-start-server@7923

@tanstack/start-client-core

npm i https://pkg.pr.new/@tanstack/start-client-core@7923

@tanstack/start-fn-stubs

npm i https://pkg.pr.new/@tanstack/start-fn-stubs@7923

@tanstack/start-plugin-core

npm i https://pkg.pr.new/@tanstack/start-plugin-core@7923

@tanstack/start-server-core

npm i https://pkg.pr.new/@tanstack/start-server-core@7923

@tanstack/start-static-server-functions

npm i https://pkg.pr.new/@tanstack/start-static-server-functions@7923

@tanstack/start-storage-context

npm i https://pkg.pr.new/@tanstack/start-storage-context@7923

@tanstack/valibot-adapter

npm i https://pkg.pr.new/@tanstack/valibot-adapter@7923

@tanstack/virtual-file-routes

npm i https://pkg.pr.new/@tanstack/virtual-file-routes@7923

@tanstack/vue-router

npm i https://pkg.pr.new/@tanstack/vue-router@7923

@tanstack/vue-router-devtools

npm i https://pkg.pr.new/@tanstack/vue-router-devtools@7923

@tanstack/vue-router-ssr-query

npm i https://pkg.pr.new/@tanstack/vue-router-ssr-query@7923

@tanstack/vue-start

npm i https://pkg.pr.new/@tanstack/vue-start@7923

@tanstack/vue-start-client

npm i https://pkg.pr.new/@tanstack/vue-start-client@7923

@tanstack/vue-start-server

npm i https://pkg.pr.new/@tanstack/vue-start-server@7923

@tanstack/zod-adapter

npm i https://pkg.pr.new/@tanstack/zod-adapter@7923

commit: afaa22d

@codspeed-hq

codspeed-hq Bot commented Jul 30, 2026

Copy link
Copy Markdown

Merging this PR will regress 12 benchmarks

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 4 improved benchmarks
❌ 12 regressed benchmarks
✅ 164 untouched benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Memory mem server peak-large-page (react) 959.7 KB 2,055.5 KB -53.31%
Memory mem client unique-location-churn (react) 665.1 KB 764.6 KB -13.02%
Simulation ssr request loop (solid) 151 ms 164.6 ms -8.25%
Simulation ssr server-fn not-found (solid) 61.7 ms 66.8 ms -7.62%
Simulation ssr server-fn POST (solid) 64.8 ms 69.4 ms -6.74%
Memory mem server error-paths error (solid) 912.6 KB 965.3 KB -5.45%
Simulation ssr server-fn send-context (solid) 65.9 ms 69.7 ms -5.35%
Simulation ssr server-fn GET (solid) 70.7 ms 74.4 ms -4.94%
Memory mem server server-fn-churn (vue) 263.6 KB 274.4 KB -3.94%
Simulation ssr selective (solid) 70.2 ms 73 ms -3.75%
Simulation ssr server-fn multipart (solid) 62.2 ms 64.2 ms -3.1%
Simulation ssr server-fn raw-stream (solid) 108.4 ms 111.7 ms -3.03%
Memory mem server error-paths not-found (vue) 2,368.1 KB 341.7 KB ×6.9
Memory mem server error-paths unmatched (react) 604.3 KB 271.3 KB ×2.2
Memory mem client unique-location-churn (solid) 542.4 KB 465 KB +16.65%
Memory mem server error-paths redirect (solid) 283.2 KB 272.9 KB +3.76%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing codex/scoped-vitest-cleanup (afaa22d) with fix-router-core-lane-match-loader (1d20a9d)

Open in CodSpeed

@Sheraff
Sheraff merged commit b8204ea into fix-router-core-lane-match-loader Jul 30, 2026
25 of 26 checks passed
@Sheraff
Sheraff deleted the codex/scoped-vitest-cleanup branch July 30, 2026 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant