Add a loading indicator for slower connections #12624
Open
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.
On devices with slower connection (<4G) the initial response (this file) shows a blank white page while bundle gets loaded.
Users (and even me as a developer) have experienced this and mistake the site for being unavailable/broken when actually the initial response is sent and JavaScript gets loading.
This should not be the default behavior - even a simple text
Loading ...with zero styling text gives some information. It does not leave me worrying if the page is broken - but that something is going on and I should wait.Adding a fancy svg loader like here does not add to file size (1.9 vs 2.3kB).
Thus something as simple as this would work fine and it will be replaced by react after load anyways.
While this not an issue when using frameworks like Next, Gatsby or Remix and the load times can be reduced with code splitting, create-react-app should come out of the box being able to be deployed.