-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Track pages/layouts without queries fixes #3139 #3148 #3094 #3218
Merged
Conversation
This file contains 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
This bug was hard to track down as it manifested itself in a weird way. Gatsby tracks external changes which indicate a need to re-run GraphQL queries. Which is normally fine since Gatsby also is tracking which queries would be dirtied by the external change (e.g. a query depends on a file — when that file is changed, the query is "dirty" and needs run again). But pages/layouts *without* queries weren't being tracked which meant that on every external change, Gatsby would think it needed to run those queries again. During the build process. Gatsby assumes that external data won't change so during the bootstrap, it waits for the initials set of queries to finish running but during later stages, it doesn't. Because sites with lots of pages with no queries were running their queries over and over, this meant that occassionally webpack would try to load a JSON file (queries are written out as JSON files) that wasn't finished writing. This PR fixes the problem as now during build, Gatsby only attempts to run queries for page/layout components without queries during the initial bootstrap.
ghost
assigned KyleAMathews
Dec 14, 2017
ghost
added
the
review
label
Dec 14, 2017
Deploy preview ready! Built with commit 4527061 |
@KyleAMathews thanks for explaining this in such detail - it's like scratching an inch that I've had since I tried debugging it last week. heh |
2 tasks
This was referenced May 28, 2022
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.
This bug was hard to track down as it manifested itself in a weird way.
Gatsby tracks external changes which indicate a need to re-run GraphQL
queries. Which is normally fine since Gatsby also is tracking which
queries would be dirtied by the external change (e.g. a query depends
on a file — when that file is changed, the query is "dirty" and needs
run again). But pages/layouts without queries weren't being tracked
which meant that on every external change, Gatsby would think it needed
to run those queries again.
During the build process. Gatsby assumes that external data won't change
so during the bootstrap, it waits for the initials set of queries to
finish running but during later stages, it doesn't.
Because sites with lots of pages with no queries were running their
queries over and over, this meant that occassionally webpack would try
to load a JSON file (queries are written out as JSON files) that wasn't
finished writing.
This PR fixes the problem as now during build, Gatsby only attempts to
run queries for page/layout components without queries during the
initial bootstrap.