Skip to content

refactor(router-core): executeBeforeLoad remove dead code - #6517

Merged
Sheraff merged 1 commit into
mainfrom
refactor-router-core-execute-before-load-remove-dead-code
Jan 25, 2026
Merged

refactor(router-core): executeBeforeLoad remove dead code#6517
Sheraff merged 1 commit into
mainfrom
refactor-router-core-execute-before-load-remove-dead-code

Conversation

@Sheraff

@SheraffSheraff commented Jan 25, 2026

Copy link
Copy Markdown
Collaborator

Building match context manually has been replaced with a buildMatchContext function call in #6070 but this variable was left over. It isn't much, but it does do a non-trivial .getMatch() call.

Summary by CodeRabbit

  • Refactor
    • Optimized internal context handling during route loading to improve performance and processing efficiency.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai

coderabbitaiBot commented Jan 25, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Removed parent match and context computation from the executeBeforeLoad function in load-matches.ts. The parent match derivation, parent match context extraction, and context augmentation are deleted. Context merging is now deferred to the match context building phase after loaders complete.

Changes

Cohort / File(s)Summary
Parent context computation removal
packages/router-core/src/load-matches.ts
Deleted 7 lines computing parentMatchId, parentMatch, and parentMatchContext from executeBeforeLoad. Context merging deferred to buildMatchContext phase.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested labels

package: router-core

Suggested reviewers

  • schiller-manuel

Poem

🐰 Context deferred, computation light,
Parent match handling takes its flight,
Seven lines removed with careful care,
BuildMatchContext waits to gather there!
Cleaner flow, simpler might,
Routes loading oh so right! 🌟

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check nameStatusExplanation
Title check✅ PassedThe title accurately describes the main change: removing dead code from the executeBeforeLoad function in router-core, which is clearly reflected in the code summary.
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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

@nx-cloud

nx-cloudBot commented Jan 25, 2026

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit 1d5cac8

CommandStatusDurationResult
nx affected --targets=test:eslint,test:unit,tes...✅ Succeeded1m 15sView ↗

☁️ Nx Cloud last updated this comment at 2026-01-25 22:01:12 UTC

@pkg-pr-new

Copy link
Copy Markdown
More templates

@tanstack/arktype-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/arktype-adapter@6517

@tanstack/eslint-plugin-router

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

@tanstack/history

npm i https://pkg.pr.new/TanStack/router/@tanstack/history@6517

@tanstack/nitro-v2-vite-plugin

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

@tanstack/react-router

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

@tanstack/react-router-devtools

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

@tanstack/react-router-ssr-query

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

@tanstack/react-start

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start@6517

@tanstack/react-start-client

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-client@6517

@tanstack/react-start-server

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-server@6517

@tanstack/router-cli

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

@tanstack/router-core

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

@tanstack/router-devtools

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

@tanstack/router-devtools-core

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

@tanstack/router-generator

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

@tanstack/router-plugin

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

@tanstack/router-ssr-query-core

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

@tanstack/router-utils

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

@tanstack/router-vite-plugin

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

@tanstack/solid-router

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

@tanstack/solid-router-devtools

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

@tanstack/solid-router-ssr-query

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

@tanstack/solid-start

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start@6517

@tanstack/solid-start-client

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-client@6517

@tanstack/solid-start-server

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-server@6517

@tanstack/start-client-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-client-core@6517

@tanstack/start-fn-stubs

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-fn-stubs@6517

@tanstack/start-plugin-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-plugin-core@6517

@tanstack/start-server-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-core@6517

@tanstack/start-static-server-functions

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

@tanstack/start-storage-context

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-storage-context@6517

@tanstack/valibot-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/valibot-adapter@6517

@tanstack/virtual-file-routes

npm i https://pkg.pr.new/TanStack/router/@tanstack/virtual-file-routes@6517

@tanstack/vue-router

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

@tanstack/vue-router-devtools

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

@tanstack/vue-router-ssr-query

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

@tanstack/vue-start

npm i https://pkg.pr.new/TanStack/router/@tanstack/vue-start@6517

@tanstack/vue-start-client

npm i https://pkg.pr.new/TanStack/router/@tanstack/vue-start-client@6517

@tanstack/vue-start-server

npm i https://pkg.pr.new/TanStack/router/@tanstack/vue-start-server@6517

@tanstack/zod-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/zod-adapter@6517

commit: 1d5cac8

@Sheraff
Sheraff merged commit 02019f1 into mainJan 25, 2026
7 of 8 checks passed
@Sheraff
Sheraff deleted the refactor-router-core-execute-before-load-remove-dead-code branch January 25, 2026 22:03
Sign up for freeto 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

@Sheraff