next.js
75b2993c - Address review: fix replaced-transition leak, harden event construction

Commit
9 hours ago
Address review: fix replaced-transition leak, harden event construction - Mark a transition as replaced when the action queue discards its action, and drop replaced transitions once no live navigation remains in their race: previously a discarded transition whose replacer failed lingered in the buffer and was misattributed to a later, unrelated commit's abort sweep with the wrong replacedBy id. - Keep discarded actions tracked on the reject path (mirroring the resolve path) and share the action-type narrowing via getInstrumentationTransition. - Build event payloads behind a guard so a describe failure degrades the event instead of breaking dispatch or HistoryUpdater, and skip building from/to when no module registered the corresponding hook (hook presence precomputed at init). - Reuse searchParamsToUrlQuery and a shared isCatchAllParamType predicate instead of local re-implementations. - Move the prefetch-intent type into link.tsx as LinkPrefetchIntent now that transition events no longer carry it. - Correct the RouterTransitionStartEvent.from doc example for unprefetched in-flight navigations. - Add unit tests for the replaced/sweep bookkeeping.
Author
Committer
Parents
Loading