-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Replace the App Cache with a Service Worker #1022
Conversation
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.
Thank you for doing this! I’ve got a few suggestions/questions/comments/whatever — nothing PR-breaking. Feel free to ask me to kick some of them into a separate issue since they’re not directly about changes made in this PR.
Thanks for the fast yet thorough review! I've implemented all of your suggestions, lets get this deployed asap. |
The latest commit sets the I couldn't really do this in a separate PR because it relies on a method added in #1011 (which has already been merged into this PR). |
According to Microsoft's PWABuilder, the demo environment received a 35/40 in the Service Worker category for failing to meet the following criterion:
|
The Push API seems to be mainly a way to send users push notifications. That’s not something we need at the moment, but it might be useful to have an option in the future that prompts users to update their docs when updates become available. |
It works! Thank so much ❤️ |
This PR contains the following changes:
views/*.erb
files. This extends on the work done in Fix layout preferences on Firefox #1011, which has already been merged into this PR.The service worker is enabled by default in production and is opt-in in development. To enable the service worker in development, set the
ENABLE_SERVICE_WORKER
environment variable totrue
when running the server. I have updated our Dockerfiles to set this environment variable so that future versions of our Docker images will have the service worker enabled aswell.These changes have been tested on all our supported browsers:
A live demo is running on sw.devdocs.jmerle.dev.