Repository navigation
Closed
Description
Describe the bug
- At the time of writing,
latestversion is v1.44.0 - The initial load of a skeleton React app using the router is perceivably slow (~500ms from React profiler)
- v1.28.1 is the latest good version (good as in not perceivably slow) which suggests that v1.28.2 introduced a regression
Your Example Website or App
Steps to Reproduce the Bug or Issue
- Bad: https://stackblitz.com/edit/tanstack-router-vjwuwc?file=index.html,package.json,package-lock.json,src%2Fmain.tsx,vite.config.js
- Good: https://stackblitz.com/edit/tanstack-router-u6raco?file=index.html,package.json,package-lock.json,src%2Fmain.tsx,vite.config.js
The only difference between Good and Bad is the router version.
- Refresh the page on the StackBlitz browser
- Notice that
This sentence is from Reactloads instantly in the Good version, almost at the same time asThis sentence is from HTML. - Notice that
This sentence is from Reactloads after a delay in the Bad version, ~500ms afterThis sentence is from HTML
Expected behavior
As a user, I expected no perceivable delays on initial app load
Screenshots or Videos
No response
Platform
- macOS
- Chrome Version 126.0.6478.127 (Official Build) (arm64)
Additional context
No response
Reacted by Flip van Haaren, Greg Zapp, Nicolas Guerrero and Dubzer
Metadata
Metadata
Assignees
Labels
No labels
Activity
ericchernuka commentedon Jul 10, 2024
Wonder if this is related to #1899
cheec commentedon Jul 11, 2024
Thanks @ericchernuka for the pointer! Sounds like a workaround for now would be to set
defaultPendingMinMsto 0cheec commentedon Jul 11, 2024
cc #1646
schiller-manuel commentedon Jul 16, 2024
this will be fixed by #1907
reproducer with pre-release package: https://stackblitz.com/edit/tanstack-router-mp74sr?file=index.html,package.json,package-lock.json,src%2Fmain.tsx,vite.config.js
levrik commentedon Aug 1, 2024
@schiller-manuel I'm still seeing this
500msdelay on1.45.11. SettingdefaultPendingMinMsto0still works as a workaround.Edit:
It turned out to not happen when I remove
beforeLoadfrom my routes. These are non-async and only return an object which adds atitleproperty to the router's context so all routes can be joined and set indocument.title. Is it expected thatdefaultPendingMinMsapplies already whenbeforeLoadis set to a non-async method?schiller-manuel commentedon Aug 1, 2024
@levrik can you please open a new issue by and provide a minimal complete example by forking one of the existing router examples on stackblitz?
e.g. https://tanstack.com/router/v1/docs/framework/react/examples/quickstart-file-based