Show loading bar on initial load - #3285
Open
david-crespo wants to merge 2 commits into
Open
david-crespo wants to merge 2 commits into
david-crespo wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
It's kind of a look-and-feel thing, more than anything else. I think a loading bar on pageload gives "SPA energy". And to be fair, this is an SPA! But a lot of our loaders are prefetching, so moment-to-moment feels more server-rendered. To that end, it seems more appropriate to have really minimal initial loading state. That said, it is an SPA at the end of the day, and while I personally don't expect to see a loading bar on my landing page, I don't really mind it either. |
Collaborator
Author
|
Trying it out now, I don't love it. I think I'd rather have a subtle ripple on the skeleton. |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I kinda thought we did this already, but apparently not. So I was curious what it would take. The first commit just moves the loading bar component to its own file without making any changes, and then the second commit makes the change. It's mildly interesting because in order for the loading bar to not get swapped out when the initial loader completes (and the skeleton fallback gets replaced with the actual app), it needs to be rendered outside of the router provider but it still needs to listen to routing events, so it uses
useSyncExternalStoreto subscribe to events on the router.I can live without it — it's kind of nice, but an animation on the skeleton itself (and the middle not being so empty) might be better.
2026-07-08-loading-bar-init.mp4