fix(router-core): preserve replacement promises on loader abort #7814
main fromfix/abort-error-loader-race·opened Summary by CodeRabbit#
- Bug Fixes
- Fixed rapid search/filter navigations to keep the latest loaded data displayed.
- Prevented aborted loader executions from interfering with newer in-flight loads for the same route match.
- Improved concurrent loading behavior during background revalidation, including correct suppression of error UI when a newer load supersedes a failing/aborted one.
- Tests
- Added a regression test covering aborting a reused parent match without clearing the replacement load promise.
- Release
- Patch release for router-core.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelspackage: react-router
github-actions[bot](GitHub profile, opens in a new tab) added labelspackage: router-core
View your CI Pipeline Execution ↗ for commit ebca5c7d15293469881f8fe4bd3ef1c5dbce4144
Command Status Duration Result nx affected --targets=test:eslint,test:unit,tes...❌ Failed 5m 22s View ↗ nx run-many --target=build --exclude=examples/*...✅ Succeeded 25s View ↗
☁️ Nx Cloud last updated this comment at
2026-07-14 04:18:25UTC🚀 Changeset Version Preview#
1 package(s) bumped directly, 22 bumped as dependents.
🟩 Patch bumps#
Package Version Reason @tanstack/router-core1.171.15 → 1.171.16 Changeset @tanstack/react-router1.170.18 → 1.170.19 Dependent @tanstack/react-start1.168.28 → 1.168.29 Dependent @tanstack/react-start-client1.168.16 → 1.168.17 Dependent @tanstack/react-start-rsc0.1.27 → 0.1.28 Dependent @tanstack/react-start-server1.167.22 → 1.167.23 Dependent @tanstack/router-cli1.167.19 → 1.167.20 Dependent @tanstack/router-generator1.167.19 → 1.167.20 Dependent @tanstack/router-plugin1.168.20 → 1.168.21 Dependent @tanstack/router-vite-plugin1.167.20 → 1.167.21 Dependent @tanstack/solid-router1.170.18 → 1.170.19 Dependent @tanstack/solid-start1.168.28 → 1.168.29 Dependent @tanstack/solid-start-client1.168.16 → 1.168.17 Dependent @tanstack/solid-start-server1.167.22 → 1.167.23 Dependent @tanstack/start-client-core1.170.14 → 1.170.15 Dependent @tanstack/start-plugin-core1.171.20 → 1.171.21 Dependent @tanstack/start-server-core1.169.17 → 1.169.18 Dependent @tanstack/start-static-server-functions1.167.19 → 1.167.20 Dependent @tanstack/start-storage-context1.167.17 → 1.167.18 Dependent @tanstack/vue-router1.170.17 → 1.170.18 Dependent @tanstack/vue-start1.168.27 → 1.168.28 Dependent @tanstack/vue-start-client1.167.19 → 1.167.20 Dependent @tanstack/vue-start-server1.167.22 → 1.167.23 Dependent Bundle Size Benchmarks#
- Commit:
8b92316c29b2 - Measured at:
2026-07-14T04:14:09.762Z - Baseline source:
history:11a6a0d8ba4d - Dashboard: bundle-size history
Scenario Current (gzip) Delta vs baseline Initial gzip Raw Brotli Trend react-router.minimal87.39 KiB +40 B (+0.04%) 87.25 KiB 273.70 KiB 75.96 KiB ▁▁▆▆▆▆▆▆▃▃▃█ react-router.full91.11 KiB +49 B (+0.05%) 90.97 KiB 285.60 KiB 79.11 KiB ▁▁▇▇▇▇▇▇▁▁▁█ solid-router.minimal35.58 KiB +56 B (+0.15%) 35.46 KiB 105.89 KiB 32.07 KiB ▁▁▆▆▆▆▆▆▁▁▁█ solid-router.full40.63 KiB +45 B (+0.11%) 40.50 KiB 121.11 KiB 36.56 KiB ▁▁▆▆▆▆▆▆▁▁▁█ vue-router.minimal53.05 KiB +55 B (+0.10%) 52.92 KiB 149.93 KiB 47.65 KiB ▂▂██████▁▁▁▇ vue-router.full58.99 KiB +50 B (+0.08%) 58.86 KiB 168.69 KiB 52.80 KiB ▅▅██████▁▁▁▅ react-start.minimal102.04 KiB +54 B (+0.05%) 101.90 KiB 322.13 KiB 88.22 KiB ▁▄▇▇▇▇▇▇▄▄▄█ react-start.deferred-hydration102.78 KiB +57 B (+0.05%) 101.92 KiB 323.50 KiB 89.04 KiB ▁▃▇▇▇▇▇▇▃▃▃█ react-start.full105.42 KiB +54 B (+0.05%) 105.28 KiB 332.06 KiB 91.12 KiB ▁▄██████▁▁▁▆ react-start.rsbuild.minimal99.75 KiB +78 B (+0.08%) 99.58 KiB 316.56 KiB 85.83 KiB ▁▄▇▇▇▇▇▇▃▃▃█ react-start.rsbuild.minimal-iife100.16 KiB +79 B (+0.08%) 99.99 KiB 317.50 KiB 86.29 KiB ▁▄▇▇▇▇▇▇▃▃▃█ react-start.rsbuild.full102.99 KiB +96 B (+0.09%) 102.82 KiB 326.62 KiB 88.58 KiB ▁▃▆▆▆▆▆▆▂▂▂█ solid-start.minimal49.65 KiB +43 B (+0.08%) 49.52 KiB 152.06 KiB 43.90 KiB ▃▅██████▁▁▁▄ solid-start.deferred-hydration52.91 KiB +42 B (+0.08%) 49.58 KiB 160.10 KiB 46.85 KiB ▃▅██████▁▁▁▄ solid-start.full55.47 KiB +53 B (+0.09%) 55.34 KiB 169.11 KiB 48.91 KiB ▃▆██████▁▁▁▅ vue-start.minimal71.08 KiB +54 B (+0.07%) 70.95 KiB 207.18 KiB 62.95 KiB ▄▇██████▁▁▁▅ vue-start.full75.08 KiB +50 B (+0.07%) 74.95 KiB 219.82 KiB 66.45 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.
- Commit:
More templates
- tanstack-router-react-example-authenticated-routes
- tanstack-router-react-example-authenticated-routes-firebase
- tanstack-router-react-example-basic
- tanstack-router-react-example-basic-default-search-params
- tanstack-router-react-example-basic-devtools-panel
- tanstack-router-react-example-basic-file-based
- tanstack-router-react-example-basic-non-nested-devtools
- tanstack-router-react-example-react-query
- tanstack-router-react-example-basic-react-query-file-based
- tanstack-router-react-example-basic-ssr-file-based
- tanstack-router-react-example-basic-ssr-streaming-file-based
- tanstack-router-react-example-basic-virtual-file-based
- tanstack-router-react-example-basic-virtual-inside-file-based
- tanstack-router-react-example-deferred-data
- tanstack-router-i18n-paraglide
- tanstack-router-react-example-kitchen-sink
- tanstack-router-react-example-kitchen-sink-file-based
- tanstack-router-react-example-kitchen-sink-react-query
- tanstack-router-react-example-kitchen-sink-react-query-file-based
- tanstack-router-react-example-large-file-based
- tanstack-router-react-example-location-masking
- tanstack-router-react-example-navigation-blocking
- tanstack-router-react-example-quickstart
- tanstack-router-react-example-quickstart-esbuild-file-based
- tanstack-router-react-example-quickstart-file-based
- tanstack-router-react-example-quickstart-rspack-file-based
- tanstack-router-react-example-quickstart-webpack-file-based
- router-monorepo-react-query
- router-mono-simple
- router-mono-simple-lazy
- tanstack-router-react-example-scroll-restoration
- tanstack-search-validator-adapters
- tanstack-start-example-bare
- tanstack-start-example-basic
- tanstack-start-example-basic-auth
- tanstack-router-react-example-basic-authjs
- tanstack-start-example-basic-cloudflare
- tanstack-start-example-basic-react-query
- tanstack-start-example-basic-static
- tanstack-start-bun-hosting
- tanstack-start-example-clerk-basic
- tanstack-start-example-convex-trellaux
- tanstack-start-example-counter
- tanstack-start-i18n-paraglide
- tanstack-start-example-large
- tanstack-start-example-material-ui
- tanstack-start-example-rscs
- tanstack-start-streaming-data-from-server-functions
- tanstack-start-example-supabase-basic
- tanstack-start-tailwind-v4
- tanstack-start-example-trellaux
- tanstack-start-example-workos
- tanstack-router-react-example-view-transitions
- tanstack-router-react-example-with-framer-motion
- tanstack-router-react-example-with-trpc
- tanstack-router-react-example-with-trpc-react-query
- tanstack-router-solid-example-authenticated-routes
- tanstack-router-solid-example-authenticated-routes-firebase
- tanstack-router-solid-example-basic
- tanstack-router-solid-example-basic-default-search-params
- tanstack-router-solid-example-basic-devtools-panel
- tanstack-router-solid-example-basic-file-based
- tanstack-router-solid-example-basic-non-nested-devtools
- tanstack-router-solid-example-basic-solid-query
- tanstack-router-solid-example-basic-solid-query-file-based
- tanstack-router-solid-example-basic-ssr-file-based
- tanstack-router-solid-example-basic-ssr-streaming-file-based
- tanstack-router-solid-example-basic-virtual-file-based
- tanstack-router-solid-example-basic-virtual-inside-file-based
- tanstack-router-solid-example-deferred-data
- tanstack-router-solid-i18n-paraglide
- tanstack-router-solid-example-kitchen-sink
- tanstack-router-solid-example-kitchen-sink-file-based
- tanstack-router-solid-example-kitchen-sink-solid-query
- tanstack-router-solid-example-kitchen-sink-solid-query-file-based
- tanstack-router-solid-example-large-file-based
- tanstack-router-solid-example-location-masking
- tanstack-router-solid-example-navigation-blocking
- tanstack-router-solid-example-quickstart
- tanstack-router-solid-example-quickstart-esbuild-file-based
- tanstack-router-solid-example-quickstart-file-based
- tanstack-router-solid-example-quickstart-rspack-file-based
- tanstack-router-solid-example-quickstart-webpack-file-based
- @tanstack/router-solid-mono-simple
- router-solid-mono-simple-lazy
- router-solid-monorepo-solid-query
- tanstack-router-solid-example-scroll-restoration
- tanstack-solid-router-search-validator-adapters
- tanstack-solid-start-example-basic
- tanstack-solid-start-example-basic-auth
- tanstack-solid-start-example-basic-authjs
- tanstack-solid-start-example-basic-cloudflare
- tanstack-solid-start-example-basic-netlify
- tanstack-solid-start-example-basic-nitro
- tanstack-start-example-basic-solid-query
- tanstack-solid-start-example-basic-static
- tanstack-solid-start-bun-hosting
- tanstack-solid-start-example-convex-better-auth
- tanstack-solid-start-example-counter
- tanstack-solid-start-i18n-paraglide
- tanstack-solid-start-example-large
- tanstack-solid-start-streaming-data-from-server-functions
- tanstack-solid-start-example-supabase-basic
- tanstack-solid-start-tailwind-v4
- tanstack-router-solid-example-view-transitions
- tanstack-router-solid-example-with-framer-motion
- tanstack-router-solid-example-with-trpc
- tanstack-router-vue-example-basic-jsx
- tanstack-router-vue-example-basic-file-based-jsx
- tanstack-router-vue-example-basic-file-based-sfc
@tanstack/arktype-adapter
npm i https://pkg.pr.new/@tanstack/arktype-adapter@7814@tanstack/eslint-plugin-router
npm i https://pkg.pr.new/@tanstack/eslint-plugin-router@7814@tanstack/eslint-plugin-start
npm i https://pkg.pr.new/@tanstack/eslint-plugin-start@7814@tanstack/history
npm i https://pkg.pr.new/@tanstack/history@7814@tanstack/nitro-v2-vite-plugin
npm i https://pkg.pr.new/@tanstack/nitro-v2-vite-plugin@7814@tanstack/react-router
npm i https://pkg.pr.new/@tanstack/react-router@7814@tanstack/react-router-devtools
npm i https://pkg.pr.new/@tanstack/react-router-devtools@7814@tanstack/react-router-ssr-query
npm i https://pkg.pr.new/@tanstack/react-router-ssr-query@7814@tanstack/react-start
npm i https://pkg.pr.new/@tanstack/react-start@7814@tanstack/react-start-client
npm i https://pkg.pr.new/@tanstack/react-start-client@7814@tanstack/react-start-rsc
npm i https://pkg.pr.new/@tanstack/react-start-rsc@7814@tanstack/react-start-server
npm i https://pkg.pr.new/@tanstack/react-start-server@7814@tanstack/router-cli
npm i https://pkg.pr.new/@tanstack/router-cli@7814@tanstack/router-core
npm i https://pkg.pr.new/@tanstack/router-core@7814@tanstack/router-devtools
npm i https://pkg.pr.new/@tanstack/router-devtools@7814@tanstack/router-devtools-core
npm i https://pkg.pr.new/@tanstack/router-devtools-core@7814@tanstack/router-generator
npm i https://pkg.pr.new/@tanstack/router-generator@7814@tanstack/router-plugin
npm i https://pkg.pr.new/@tanstack/router-plugin@7814@tanstack/router-ssr-query-core
npm i https://pkg.pr.new/@tanstack/router-ssr-query-core@7814@tanstack/router-utils
npm i https://pkg.pr.new/@tanstack/router-utils@7814@tanstack/router-vite-plugin
npm i https://pkg.pr.new/@tanstack/router-vite-plugin@7814@tanstack/solid-router
npm i https://pkg.pr.new/@tanstack/solid-router@7814@tanstack/solid-router-devtools
npm i https://pkg.pr.new/@tanstack/solid-router-devtools@7814@tanstack/solid-router-ssr-query
npm i https://pkg.pr.new/@tanstack/solid-router-ssr-query@7814@tanstack/solid-start
npm i https://pkg.pr.new/@tanstack/solid-start@7814@tanstack/solid-start-client
npm i https://pkg.pr.new/@tanstack/solid-start-client@7814@tanstack/solid-start-server
npm i https://pkg.pr.new/@tanstack/solid-start-server@7814@tanstack/start-client-core
npm i https://pkg.pr.new/@tanstack/start-client-core@7814@tanstack/start-fn-stubs
npm i https://pkg.pr.new/@tanstack/start-fn-stubs@7814@tanstack/start-plugin-core
npm i https://pkg.pr.new/@tanstack/start-plugin-core@7814@tanstack/start-server-core
npm i https://pkg.pr.new/@tanstack/start-server-core@7814@tanstack/start-static-server-functions
npm i https://pkg.pr.new/@tanstack/start-static-server-functions@7814@tanstack/start-storage-context
npm i https://pkg.pr.new/@tanstack/start-storage-context@7814@tanstack/valibot-adapter
npm i https://pkg.pr.new/@tanstack/valibot-adapter@7814@tanstack/virtual-file-routes
npm i https://pkg.pr.new/@tanstack/virtual-file-routes@7814@tanstack/vue-router
npm i https://pkg.pr.new/@tanstack/vue-router@7814@tanstack/vue-router-devtools
npm i https://pkg.pr.new/@tanstack/vue-router-devtools@7814@tanstack/vue-router-ssr-query
npm i https://pkg.pr.new/@tanstack/vue-router-ssr-query@7814@tanstack/vue-start
npm i https://pkg.pr.new/@tanstack/vue-start@7814@tanstack/vue-start-client
npm i https://pkg.pr.new/@tanstack/vue-start-client@7814@tanstack/vue-start-server
npm i https://pkg.pr.new/@tanstack/vue-start-server@7814@tanstack/zod-adapter
npm i https://pkg.pr.new/@tanstack/zod-adapter@7814commit:
ebca5c7Important
At least one additional CI pipeline execution has run since the conclusion below was written and it may no longer be applicable.
Nx Cloud has identified a possible root cause for your failed CI:#
We determined this failure is unrelated to the PR's changes. The
tanstack-solid-start-e2e-basice2e test failed because port 44231 was already in use in the CI environment (EADDRINUSE), preventing the test server from starting. Our analysis confirms the PR only touched@tanstack/react-routerand@tanstack/router-core, so this is an environment-level issue that requires a re-run.No code changes were suggested for this issue.
Trigger a rerun:
View detailed reasoning on Nx Cloud ↗
🎓 Learn more about Self-Healing CI on [nx.dev](https://nx.dev/docs/features/ci-features/self-healing-ci?utm_source=pull-request&utm_medium=comment)Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/router-core/src/load-matches.ts (1)
777-784: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick winGuard the
loaderPromisereset in the outer catchpackages/router-core/src/load-matches.ts:777-784still clearsmatch._nonReactive.loaderPromiseunconditionally; that can wipe out a newer in-flight load’s promise.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/router-core/src/load-matches.ts` around lines 777 - 784, Update the outer catch around handleRedirectAndNotFound to reset match._nonReactive.loaderPromise only when it still refers to the failed load’s promise, preserving any newer in-flight loader promise. Use the existing loader promise captured by the surrounding load flow and retain the missing-match guard.🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. Inline comments: In `@packages/react-router/tests/loaders.test.tsx`: - Around line 1013-1023: Update the test around the filter-change loop to verify that the root loader actually reruns for the reused parent match, rather than only asserting its in-flight request was aborted. Assert the root loader mock’s call count or configure the root route to depend on the navigation, while preserving the existing abort and error-component assertions. --- Outside diff comments: In `@packages/router-core/src/load-matches.ts`: - Around line 777-784: Update the outer catch around handleRedirectAndNotFound to reset match._nonReactive.loaderPromise only when it still refers to the failed load’s promise, preserving any newer in-flight loader promise. Use the existing loader promise captured by the surrounding load flow and retain the missing-match guard.🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID:
163b889e-c1dd-4e3c-8e15-7c2e75806f38📥 Commits
Reviewing files that changed from the base of the PR and between 11a6a0d8ba4db37714a6b1d723910bdf7dbe38af and 23cc7b8f1df43013b50936021ee53217b41f8b26.
📒 Files selected for processing (2)
packages/react-router/tests/loaders.test.tsxpackages/router-core/src/load-matches.ts
packages/react-router/tests/loaders.test.tsx lines 1018 to 1029Resolvedby LadyBluenotes(GitHub profile, opens in a new tab)@@ -942,0 +1003,21 @@1003+ )1004+ },1005+ })1006+1007+ const router = createRouter({1008+ routeTree: rootRoute.addChildren([indexRoute]),1009+ history,1010+ })1011+1012+ render(<RouterProvider router={router} />)1013+ await act(() => router.latestLoadPromise)1014+1015+ const input = await screen.findByTestId('filter-input')1016+ for (const filter of ['a', 'ab', 'abc', 'abcd', 'abcde', 'abcdef']) {1017+ fireEvent.change(input, { target: { value: filter } })1018+ }1019+ await act(() => router.latestLoadPromise)1020+1021+ expect(rootAbortMock).toHaveBeenCalled()1022+ expect(indexAbortMock).toHaveBeenCalled()1023+ expect(errorComponentMock).not.toHaveBeenCalled()🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash # Inspect how `cause` and match id stability are computed for reused parent matches # across rapid navigations, to confirm root's loader is expected to re-run here. rg -n "cause:|previousRouteMatchId|staleMatchShouldReload" packages/router-core/src/load-matches.ts -C3Repository: TanStack/router
Length of output: 2101
🏁 Script executed:
#!/bin/bash set -euo pipefail echo "== test context ==" sed -n '980,1040p' packages/react-router/tests/loaders.test.tsx echo echo "== load-matches context ==" sed -n '780,950p' packages/router-core/src/load-matches.tsRepository: TanStack/router
Length of output: 7471
🏁 Script executed:
#!/bin/bash set -euo pipefail rg -n "matchId|id =|getMatchId|createMatch" packages/router-core/src packages/react-router/src -C2Repository: TanStack/router
Length of output: 44416
🏁 Script executed:
#!/bin/bash set -euo pipefail echo "== router match-id generation ==" sed -n '1548,1635p' packages/router-core/src/router.ts echo echo "== cause assignment/search handling ==" rg -n "cause\s*=|cause:\s*'|previousActiveMatchesByRouteId|search" packages/router-core/src/router.ts packages/router-core/src/load-matches.ts -C3Repository: TanStack/router
Length of output: 40902
🏁 Script executed:
#!/bin/bash set -euo pipefail sed -n '930,1015p' packages/react-router/tests/loaders.test.tsxRepository: TanStack/router
Length of output: 2778
🏁 Script executed:
#!/bin/bash set -euo pipefail sed -n '160,230p' packages/router-core/src/load-matches.tsRepository: TanStack/router
Length of output: 1833
Root loader rerun isn’t guaranteed here. The root match is reused with the same match id and a
causeofstay, so this assertion only shows an in-flight root load was aborted, not that it re-executed on each search change. If the intent is to cover reused-parent reloads, assert the loader call count or make the root depend on the navigation.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/react-router/tests/loaders.test.tsx` around lines 1013 - 1023, Update the test around the filter-change loop to verify that the root loader actually reruns for the reused parent match, rather than only asserting its in-flight request was aborted. Assert the root loader mock’s call count or configure the root route to depend on the navigation, while preserving the existing abort and error-component assertions.Merging this PR will degrade performance by 24.12%#
:warning: Different runtime environments detected
Some benchmarks with significant performance changes were compared across different runtime environments, which may affect the accuracy of the results.
⚡ 5improved benchmarks❌ 7regressed benchmarks✅ 168untouched benchmarksWarning
Please fix the performance issues or acknowledge them on CodSpeed.
Performance Changes#
Mode Benchmark BASEHEADEfficiency ❌ Memory mem server server-fn-churn (vue)274.8 KB 4,248.2 KB -93.53% ❌ Memory mem server error-paths redirect (vue)304.3 KB 778.3 KB -60.91% ❌ Memory mem server error-paths redirect (solid)441 KB 832.7 KB -47.03% ❌ Memory mem server error-paths unmatched (react)641.2 KB 770.4 KB -16.77% ❌ Simulation client-preload interaction loop (react)57.3 ms 60.6 ms -5.41% ❌ Simulation client-route-tree-scale navigation loop (react)74.2 ms 77.2 ms -3.9% ❌ Memory mem server error-paths not-found (react)266.8 KB 276.3 KB -3.44% ⚡ Memory mem server peak-large-page (react)2,080.9 KB 953.8 KB ×2.2 ⚡ Memory mem server serialization-payload (react)5.3 MB 3.4 MB +53.32% ⚡ Simulation ssr selective (react)64.3 ms 61.9 ms +3.78% ⚡ Simulation ssr selective (solid)74.7 ms 72 ms +3.7% ⚡ Simulation ssr streaming deferred (react)73.1 ms 70.7 ms +3.42% Tip
Investigate this regression by commenting
@codspeedbot fix this regressionon this PR, or directly use the CodSpeed MCP with your agent.
Comparingfix/abort-error-loader-race(ebca5c7) withmain(11a6a0d)
Sign in to join this conversation.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID:
9d8e58ab-8309-4fde-ba8a-9a3d241b10f5📥 Commits
Reviewing files that changed from the base of the PR and between 10d8fc043ba534050fc755922e634ffb23250802 and ebca5c7d15293469881f8fe4bd3ef1c5dbce4144.
📒 Files selected for processing (1)
packages/react-router/tests/loaders.test.tsx🚧 Files skipped from review as they are similar to previous changes (1)
📝 Walkthrough
Walkthrough#
Loader matching now tracks controlled promises per route match, prevents stale aborted loads from clearing replacement promises, and coordinates loader finalization. A regression test covers rapid search updates with reused parent matches.
Changes#
Loader promise lifecycle
packages/router-core/src/load-matches.tsbeforeLoadand load initialization.packages/router-core/src/load-matches.ts,packages/react-router/tests/loaders.test.tsx,.changeset/eight-feet-lose.mdEstimated code review effort: 4 (Complex) | ~45 minutes
Possibly related issues
loaderPromiseandloadPromiselifecycle handling inloadRouteMatch; this PR addresses stale-abort cleanup rather than synchronous fast paths.Suggested reviewers:
sheraff🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)#
✅ Passed checks (4 passed)
✨ Finishing Touches
📝 Generate docstrings
🧪 Generate unit tests (beta)
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