Skip to content
Source
Sign inSign up
TanStack/router

refactor(router-core): loadMatches extra microtask #4967

MergedSheraff(GitHub profile, opens in a new tab)merged 3 commits intomain fromrefs/pull/4967/headmerged by Sheraff(GitHub profile, opens in a new tab)

Showing 2 changed files with 15 additions and 26 deletions.

x
0 of 2 viewed, 2 left
1 addition and 1 deletionpackages/react-router/tests/store-updates-during-navigation.test.tsxModified
View file
@@ -183,7 +183,7 @@
// This number should be as small as possible to minimize the amount of work
// that needs to be done during a navigation.
// Any change that increases this number should be investigated.
- expect(updates).toBe(8)
+ expect(updates).toBe(7)
​
test('hover preload, then navigate, w/ async loaders', async () => {
14 additions and 25 deletionspackages/router-core/src/router.tsModified
View file
@@ -2930,33 +2930,22 @@
try {
- await new Promise<void>((resolveAll, rejectAll) => {
- ;(async () => {
- try {
- // Execute all beforeLoads one by one
- for (let i = 0; i < innerLoadContext.matches.length; i++) {
- const beforeLoad = this.handleBeforeLoad(innerLoadContext, i)
- if (isPromise(beforeLoad)) await beforeLoad