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:

  1. Create an "Offline" page at /offline.html
  2. Register a Simple service worker that caches the "Offline" page
  3. 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

image

Lighthouse PWA Check

Please note: The two failures are simply because we're running on localhost, all the necessary bits are passing.

image

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

#49108 (moved)

Edited by Sam Beckham

Merge request reports

Loading