fix: don't dynamically load the app adapter (prevent blank flash) #97
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 switched the AppAdapter to a React.Lazy component a while back. This has the advantage of code-splitting the bundle, so that we can analyze what's in the adapter vs the shell itself. However, it had the consequence of causing the Headerbar to wait until the entire application has loaded before rendering. This meant that, for applications with moderate bundle sizes like the Query Playground and also in low-bandwidth situations the entire page would flash "blank white" for a noticeable duration.
This change reverts the Adapter code-splitting, so that the shell displays the adapter (including the headerbar) on first render. It also adds displays full-page screen cover and loading spinner while the app bundle loads, rather than an empty div. You can test this behavior by setting "slow 3g" in dev tools. Note that there is also a loading spinner displayed while the AuthBoundary loads its data - we'll want to consolidate these once we have either first-class suspense for data loading (from React) or implement a LoadingBoundary ourselves (using Context)