Adds the most basic version of a service worker for PWA
What does this MR do?
This ticks all the necessary boxes to register gitlab.com (or anything running GitLab) as a PWA.
It's definitely the most boring solution as all it does is:
- Create an "Offline" page at
/offline.html - Register a Simple service worker that caches the "Offline" page
- Serves up the "Offline" page when a user is offline.
It also has the manifest stuff necessary for setting up a PWA. It's not wholly useful as it is, but it's a good jumping off point for getting some offline support and caching.
There's still some work to be done to get it into a nicer workflow and we'll probably need to look at the copy/i18n on the offline page too.
Are there points in the code the reviewer needs to double check?
Why was this MR needed?
To provide basic offline support to GitLab and give us a platform to start caching useful assets client-side.
Screenshots (if relevant)
Offline Page
Lighthouse PWA Check
Please note: The two failures are simply because we're running on localhost, all the necessary bits are passing.
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated -
API support added -
Tests added for this feature/bug - Conforms to the code review guidelines
-
Has been reviewed by a UX Designer -
Has been reviewed by a Frontend maintainer -
Has been reviewed by a Backend maintainer -
Has been reviewed by a Database specialist
-
-
Conforms to the merge request performance guidelines -
Conforms to the style guides -
Conforms to the database guides -
If you have multiple commits, please combine them into a few logically organized commits by squashing them -
Internationalization required/considered -
End-to-end tests pass ( package-and-qamanual pipeline job)
What are the relevant issue numbers?
Edited by Sam Beckham

