-
Notifications
You must be signed in to change notification settings - Fork 685
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
Implement basic offline experience for Venia (PWA) #374
Comments
Kamino cloned this issue to magento-research/pwa-studio |
Marking as in progress from @pcvonz and team -- preview here: http://upward.bargreen.io |
Some notes on the obstacles I've encountered so far. Let me know if anything sounds incorrect: Problem: Refreshing a page when offline results in a cache miss if that page wasn't refreshed directly. When first visiting Venia, upward will return an html file, however, every subsequent load doesn't, which creates a problem when trying to cache every visited page. Possible Solution: This is a pretty easy fix: Cache requests in the Problem: The Possible Solution: (slap dash, probably not what we want) Bypass Possible Solution 2: Probably the way it should be done 😅 Cache each query to {
'/': {data: {urlResolver: {type: "CMS_PAGE", id: 2}}}
'/crown-summit-backpack.html': {data: {urlResolver: {type: "PRODUCT", id: 3}}}
} Is it weird if we use Related issue in the Workbox repo Hopefully that all makes sense, I'm still learning this as I go along. It's also pretty late on a Friday 😄 |
Possible solution 3 (for the Looks like the ability to make a [1] Related issue |
Great progress so far! Adding a few comments here on things I've seen. They may not all be relevant to this issue, but I wanted to make sure it's down.
|
* Update readme - Add troubleshooting section for `connection not secure` * Add web app manifest, offline mode - Add Apollo simple persistence for persistent cache of graphql queries - Add html files to SW runtime cache - Fix venia favicon (fixes serving images via upward in general) - Add new venia icons * Fix venia config * Offline mode integrated into resolveUnknownRoute - If offline loads component from localStorage - If offline and component not in cache, load NotFound root component - Add fallback page to venia-upward yml - Switch to inject-manifest in webpack * Add inject-mainfest option to PWA-Buildpack * Add tests - Add test for offline functionality of resolveUnkownRoute - Add test for injectManifest of ServiceWorkerPlugin * Add venia icons to manifest, fix injectManifest - SW.js is now served with `Service-Worker-Allowed` header - manifest icons are moved to the dist directory with `copy-webpack-plugin` - manifest.webmanifest -> manifest.json * Add copy-webpack-plugin * Add offline indicator * Style offline indicator, fix offline to online - `getRouteComponent` now checks if the current route has the `NotFoundComponent` stored in state. If so, reload the route when online Progress towards #374 * Add online indicator - Shows online status when switching from offline -> online - Animation for both online and offline * Clean up, comment * Revert upward change * Update ServiceWorkerPlugin to accept config - ServiceWorkerPlugin takes in `injectManifestConfig` - Update tests - Cache chunks via workbox-webpack * Rename `media` directory to `images` Resolves `/media` proxying to the magento backend instead of to the `/dist` folder to serve static content * Add theme color to head * Remove fallback code. Opening seprate issue. * Switch test url from store.com to example.com * Address PR feedback * Fix small issues and lint
This issue is for the following packages:
[ ]
venia-concept
[ ]
pwa-buildpack
[X]
peregrine
[ ]
pwa-module
[ ]
pwa-devdocs
Description
As a shopper, I want basic feedback on the Venia storefront when my device is having connectivity issues or offline so that I know that I can have an uninterrupted shopping experience.
This is a requirement for PWA per Google Lighthouse and applies to all of the Venia storefront.
Assumptions
Tasks
The text was updated successfully, but these errors were encountered: