Skip to content
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

Reduce excess file system writes by implementing query queue #3237

Merged
merged 3 commits into from
Dec 16, 2017

Commits on Dec 16, 2017

  1. Reduce excess file system writes by implementing query queue

    There are multiple ways that running queries can be triggered. Previous
    to this PR, Gatsby had done some de-duping of queries but in practice,
    queries for pages/layouts can often be running multiple times in short
    succession. This is normally fine-ish but @Gaeron was running into
    troubles while editing markdown on reactjs.org where webpack would error
    when it detected a change in a file and before it could read it, Gatsby
    would start writing to the file again before webpack could finish
    reading it resulting in a JSON.parse error due to the incomplete JSON.
    
    On top of this, Gatsby would write out the result of every query if even
    the query returned the same result as previously.
    
    To address these this PR adds a query queue that deduplicates
    added pages/layouts. This means we're writing out results far less
    often.
    
    Second we hash each query result and only write to file if the result
    has changed which means far less work for webpack and far faster hot
    reloading of query updates to the browser.
    KyleAMathews committed Dec 16, 2017
    Configuration menu
    Copy the full SHA
    719cd41 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d15b696 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    785b97a View commit details
    Browse the repository at this point in the history