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

Fix writing out new page information (so new pages hot reload) during development #8570

Merged
merged 2 commits into from
Sep 27, 2018

Conversation

KyleAMathews
Copy link
Contributor

@KyleAMathews KyleAMathews commented Sep 26, 2018

This was broken when we switched from storing pages in an object to a
Map as we used to create new objects whenver page data was updated so
comparing an old version of the pages to the new worked but stopped
working with Map as we started directly mutating.

Turning off the comparison altogether now as creating pages isn't that common & we debounce writes which should be enough to reduce io/cpu problems from too many pages being created.

… development

This was broken when we switched from storing pages in an object to a
Map as we used to create new objects whenver page data was updated so
comparing an old version of the pages to the new worked but stopped
working with Map as we started directly mutating.

We now make a shallow clone of the pages Map so we can compare old and
new versions.
@KyleAMathews KyleAMathews requested a review from a team as a code owner September 26, 2018 23:16
Copy link
Contributor

@pieh pieh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor

@DSchau DSchau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks to be the fix! 👍 Thanks @pieh for already reviewing!

@m-allanson m-allanson merged commit a96eb02 into master Sep 27, 2018
@m-allanson m-allanson deleted the fix-new-pages branch September 27, 2018 10:22
lipis added a commit to lipis/gatsby that referenced this pull request Sep 27, 2018
* 'master' of github.com:gatsbyjs/gatsby:
  Add blog post on v2 reach router (gatsbyjs#8508)
  feat: add self to community page (gatsbyjs#8572)
  feat: update sites.yml (gatsbyjs#8589)
  Add an example to the sourceNodes docs (gatsbyjs#8585)
  chore(release): Publish
  fix: add compat fix for gatsby-cli v2 with gatsby v1 (gatsbyjs#8581)
  fix: fix unhandled rejection when no browser found when running with --open flag (gatsbyjs#8507)
  Fix writing out new page information (so new pages hot reload) during development (gatsbyjs#8570)
  Run coverage at the end of jest and configure thresholds (gatsbyjs#8371)
  chore(release): Publish
  chore: update gatsby-source-drupal version in using-drupal example (gatsbyjs#8497)
  Typo fix in gatsby-source-graphql/README.md (gatsbyjs#8562)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants