Skip to content
Source
Sign inSign up
TanStack/router

perf(router-core): evaluate synchronous loadRouteMatch fast paths #7791

ClosedLadyBluenotes(GitHub profile, opens in a new tab) opened this issue 0 comments

Goal

Evaluate whether loadRouteMatch can avoid unnecessary promise allocation and microtasks on synchronous paths without changing current match-loading behavior.

Scope

  • Start from the current match-loading implementation and its controlled-promise lifecycle.
  • Preserve preload opt-out, preload adoption, stale reload modes, pending timing, invalidation, abort handling, redirects, not-found behavior, and head execution.
  • Preserve parent loader context semantics for root and child routes.
  • Preserve in-flight loader error propagation and cleanup of loaderPromise and loadPromise.
  • Add focused regression coverage for synchronous fresh and skipped paths, preload opt-out, root and child parentMatchPromise, background redirects, pending cleanup, invalidation, and SSR paths.
  • Measure router-core bundle and navigation performance before accepting the added complexity.

This continues the original exploration in #5018

Sign in to join this conversation.