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.
Related Work#
This continues the original exploration in #5018