Fix/reloading screen while refreshing #2
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.
Description
changes:
Show the restarting page while data is refreshing can be enabled by setting
ENABLE_GATSBY_RESTARTING_SCREEN_ON_REFRESH env variable
Updated docs with the new env variable
Showing the restarting page is not only useful to have some feedback in the UI about what is going on behind the scenes, but also to be able to make a request to the development server without having to wait.
Why is this useful?
This is specially useful for non-developer gatsby-users that use gatsby develop in a preview environment and they need the data up to date, or to know what is going on if data is refreshing.
It is also useful for doing health-checks when having the development server in a container as a preview server. Otherwise health-checks can fail because development server cannot respond while refreshing.
Why an env variable to enable the restarting screen?
There were some tests making use of the refresh endpoint for the preview, I am not sure that this is something we want to show in all the scenarios, so I created this env variable to be able to opt in.
Related MR
gatsbyjs#24887