-
Notifications
You must be signed in to change notification settings - Fork 275
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
Offline mode (PWA) #133
Comments
If WordPress Playground was a Progressive Web App, it could be:
Technically, this would require downloading all the WordPress assets that are currently now hosted on the server. Doing it in the background in idle time after the initial paint should be fine. |
@adamziel I will explore this one and see if I can make any progress on it. |
I started by adding the Vite PWA plugin and configuring it. |
Playground loads only a part of WordPress on the first load. Other files are loaded as needed, we will need to find a way to preload all files for full offline support. |
The offline mode mostly works when we shipping a full, zipped WordPress release. That's what the PR previewer does, e.g. try previewing this PR. We could add a separate offline mode very easily just by using that full zip bundle and caching it in the Service Worker. |
After some discussion with @WordPress/playground-maintainers we create a list of tasks that should add offline and PWA support:
|
Should Playground use browser storage and support networking as the default option when installed? If yes, it would be great for us to add a site switcher because we can't modify the url. |
## Motivation for the change, related issues We want to [make Playground available offline](#133). This PR is a first step and adds support for installing Playground as a PWA. Offline support will be implemented separately. ## Implementation details The PR adds a `manifest.json` file and loads it on the Playground website. This allows browsers to install Playground as a PWA ## Testing Instructions (or ideally a Blueprint) - Checkout this branch - Open Playground in [a browser that supports PWA installing](https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Guides/Making_PWAs_installable#browser_support) - Confirm that you can install Playground as a PWA
It would be handy, yes, but it's not a blocker. |
I wasn't able to get to this today but plan to look at this tomorrow if you don't tackle it first, @bgrgicak. |
In a future iteration of offline support, we could add a background check to see if there were any updates to Playground and update the cache with the latest version of Playground. Today this will work on reload, but mobile and desktop apps aren't usually reloaded. |
I got offline support to work in the browser. Here is a list of all open PR that are required to make it work.
|
Please share any future comments in this PR |
Please use the project scoping PR to discuss this feature
Network access on contributor days is always problematic.
Once we have something like #104, it would be helpful to have offline support for WordPress Playground. This way, a new contributor could download WordPress Playground once and then be able to use it for the rest of the day.
The text was updated successfully, but these errors were encountered: