-
Notifications
You must be signed in to change notification settings - Fork 686
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
Update Home Page content after cache hit (#2230) #2453
Update Home Page content after cache hit (#2230) #2453
Conversation
|
Performance Test Results The following fails have been reported by WebpageTest. These numbers indicates a possible performance issue with the PR which requires further manual testing to validate. https://pr-2453.pwa-venia.com : LH Performance Expected 0.85 Actual 0.54, LH Best Practices Expected 1 Actual 0.92 |
- Remove redundant loading flag and null response on no data
- Add page loading state to app context - Add loading icon into header - Trigger page loading from CMS root component
- Add test coverage for new isPageLoading in talon & header
Is This is a well-designed API and hook for page load. We already have that concept in the codebase, but it's not perfect. Did you look at |
@zetlen they have very different purposes. The |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good. I've requested changes in a few places, but nothing significant.
packages/venia-ui/lib/components/PageLoadingIndicator/indicator.css
Outdated
Show resolved
Hide resolved
packages/venia-ui/lib/components/PageLoadingIndicator/indicator.js
Outdated
Show resolved
Hide resolved
This is essentially a leaf-node component, and I'm okay if those proliferate. It's a thin wrapper around |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor suggestion in addition to what's already requested. We need to have a team discussion about redux, but not a blocker to this PR. Looks good 👍
QA approved |
Description
Apollo will not query the GraphQL endpoint for a new version of CMS Page content due to the usage of the default fetch policy, cache only. This PR updates this cache policy to use
cache-and-network
(https://www.apollographql.com/docs/react/api/react-apollo/#optionsfetchpolicy) which will ensure the cached data is rendered, then a request is made to retrieve any new data if available.This fetch policy ensures a quick user experience while ensuring up to date content is rendered on the homepage. If there was a change in content between the cache and GraphQL Apollo automatically handles re-rendering this.
Related Issue
Closes #2230 .
https://jira.corp.magento.com/browse/PWA-471
Acceptance
Verification Stakeholders
@jimbo
@sirugh
@brendanfalkowski
@dhaecker
Specification
https://www.apollographql.com/docs/react/api/react-apollo/#optionsfetchpolicy
Verification Steps
Screenshots / Screen Captures (if appropriate)
New Experience:
Checklist