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(gatsby-plugin-offline): Change navigation handler logic #13502

Merged
merged 30 commits into from
Aug 8, 2019
Merged

fix(gatsby-plugin-offline): Change navigation handler logic #13502

merged 30 commits into from
Aug 8, 2019

Conversation

valin4tor
Copy link
Contributor

@valin4tor valin4tor commented Apr 19, 2019

The more "stable" part of #11965

Changes:

  • Remove page path whitelist
  • Whenever a path has finished prefetching, store the name of its resource files in the IDB
  • Replace resetWhitelist API with clearPathResources, which clears the page resource dependencies
  • When loading a page from SW, check the correct app bundle is present and all the resources for the page
    • If not, or if the resource filename list isn't found, serve from the network

Rationale: using the path whitelist turned out to be buggy, especially during upgrades when files could be in inconsistent state. Many of the initial bugs were fixed, but some of the fixes are more workarounds than proper solutions which can still result in temporary white screen flashes.

Therefore these changes should be more reliable, since by checking the main bundle is present as well as the required resource files, we can be more sure that the latest essential files are cached rather than just looking at a list.

@valin4tor valin4tor requested a review from a team as a code owner May 1, 2019 13:11
@m-allanson
Copy link
Contributor

@davidbailey00 I'm going to close this for now. Let's come back and re-open it once you're back in (Gatsby) action!

@m-allanson m-allanson closed this Jun 26, 2019
@valin4tor valin4tor reopened this Aug 7, 2019
@valin4tor valin4tor requested a review from a team as a code owner August 7, 2019 11:37
@valin4tor valin4tor removed the request for review from a team August 7, 2019 13:13
@sidharthachatterjee sidharthachatterjee added bot: merge on green Gatsbot will merge these PRs automatically when all tests passes and removed status: WIP labels Aug 8, 2019
Copy link
Contributor

@sidharthachatterjee sidharthachatterjee left a comment

Choose a reason for hiding this comment

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

Looks great! Let's ship this 👍

@valin4tor
Copy link
Contributor Author

ayy

image

Copy link
Contributor

@sidharthachatterjee sidharthachatterjee left a comment

Choose a reason for hiding this comment

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

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: merge on green Gatsbot will merge these PRs automatically when all tests passes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants