Skip to content

refactor(react-router): cache outlet child lookups#6851

Closed
Sheraff wants to merge 1 commit intorefactor-signalsfrom
opencode/react-outlet-child-store
Closed

refactor(react-router): cache outlet child lookups#6851
Sheraff wants to merge 1 commit intorefactor-signalsfrom
opencode/react-outlet-child-store

Conversation

@Sheraff
Copy link
Contributor

@Sheraff Sheraff commented Mar 8, 2026

Note

i'm not convinced we need this. It does yield a stable 1% client-nav improvement at the cost of more code. There might be an architecture-driven solution that would benefit all 3 adapters:

  1. add depth to each route definition, this is known at initialization
  2. then you just need to look up that index in the matchIds array

Summary

  • add a shared childMatchIdByRouteId derived store in the React router store factory
  • have Outlet read the next child match from that store on both the client and server instead of scanning matchesId
  • leave the local test addition out of this PR per request

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 8, 2026

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

Run ID: 61b870bb-1512-44ff-9548-b5cea8241de1

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
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch opencode/react-outlet-child-store

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

@nx-cloud
Copy link

nx-cloud bot commented Mar 8, 2026

View your CI Pipeline Execution ↗ for commit 0361303

Command Status Duration Result
nx affected --targets=test:eslint,test:unit,tes... ✅ Succeeded 13m 52s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 1m 15s View ↗

☁️ Nx Cloud last updated this comment at 2026-03-08 07:07:45 UTC

@github-actions
Copy link

github-actions bot commented Mar 8, 2026

Bundle Size Benchmarks

  • Commit: 4ea2a62787d0
  • Measured at: 2026-03-08T06:54:56.423Z
  • Baseline source: history:4ea2a62787d0
  • Dashboard: bundle-size history
Scenario Current (gzip) Delta vs baseline Raw Brotli Trend
react-router.minimal 87.78 KiB +960 B (+1.08%) 276.67 KiB 76.38 KiB ▁▁▁▁▁▃▃▃▃▃▃█
react-router.full 91.03 KiB +1.15 KiB (+1.27%) 287.36 KiB 79.08 KiB ▁▁▁▁▁▂▂▂▂▂▂█
solid-router.minimal 35.26 KiB -930 B (-2.51%) 106.65 KiB 31.64 KiB ▆▆▆▆▆██████▁
solid-router.full 39.73 KiB -786 B (-1.90%) 120.25 KiB 35.58 KiB ▅▅▅▅▅██████▁
vue-router.minimal 53.06 KiB +1.03 KiB (+1.98%) 152.02 KiB 47.59 KiB ▁▁▁▁▁▂▂▂▂▂▂█
vue-router.full 58.09 KiB +1.24 KiB (+2.19%) 168.08 KiB 51.96 KiB ▁▁▁▁▁▂▂▂▂▂▂█
react-start.minimal 100.44 KiB +1.03 KiB (+1.04%) 315.86 KiB 86.87 KiB ▁▁▁▁▁▃▃▃▃▃▃█
react-start.full 103.85 KiB +1.07 KiB (+1.04%) 326.03 KiB 89.80 KiB ▁▁▁▁▁▂▂▂▂▂▂█
solid-start.minimal 47.58 KiB -929 B (-1.87%) 144.28 KiB 42.07 KiB ▆▆▆▆▆██████▁
solid-start.full 53.20 KiB -782 B (-1.42%) 160.78 KiB 46.84 KiB ▅▅▅▅▅██████▁

Trend sparkline is historical gzip bytes ending with this PR measurement; lower is better.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 8, 2026

More templates

@tanstack/arktype-adapter

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

@tanstack/eslint-plugin-router

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

@tanstack/history

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

@tanstack/nitro-v2-vite-plugin

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

@tanstack/react-router

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

@tanstack/react-router-devtools

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

@tanstack/react-router-ssr-query

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

@tanstack/react-start

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

@tanstack/react-start-client

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

@tanstack/react-start-server

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

@tanstack/router-cli

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

@tanstack/router-core

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

@tanstack/router-devtools

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

@tanstack/router-devtools-core

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

@tanstack/router-generator

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

@tanstack/router-plugin

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

@tanstack/router-ssr-query-core

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

@tanstack/router-utils

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

@tanstack/router-vite-plugin

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

@tanstack/solid-router

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

@tanstack/solid-router-devtools

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

@tanstack/solid-router-ssr-query

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

@tanstack/solid-start

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

@tanstack/solid-start-client

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

@tanstack/solid-start-server

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

@tanstack/start-client-core

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

@tanstack/start-fn-stubs

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

@tanstack/start-plugin-core

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

@tanstack/start-server-core

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

@tanstack/start-static-server-functions

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

@tanstack/start-storage-context

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

@tanstack/valibot-adapter

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

@tanstack/virtual-file-routes

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

@tanstack/vue-router

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

@tanstack/vue-router-devtools

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

@tanstack/vue-router-ssr-query

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

@tanstack/vue-start

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

@tanstack/vue-start-client

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

@tanstack/vue-start-server

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

@tanstack/zod-adapter

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

commit: 18db703

@codspeed-hq
Copy link

codspeed-hq bot commented Mar 8, 2026

Merging this PR will not alter performance

✅ 6 untouched benchmarks


Comparing opencode/react-outlet-child-store (0361303) with refactor-signals (4a410d8)

Open in CodSpeed

@Sheraff Sheraff closed this Mar 8, 2026
@Sheraff Sheraff deleted the opencode/react-outlet-child-store branch March 8, 2026 09:29
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