progressive-web-appssingle-spa

Can a single-spa application also be a progressive web app?


We are looking at using single-spa.js for micro frontends. One question that has been asked is if a single-spa app can also be a progressive web app (PWA). Searching hasn't revealed much information on the matter. The individual apps will be react-apps if that's important. Thanks in advance.


Solution

  • The reason you're not finding much is because there is no difference between the single-spa architecture and every other website when it comes to Progressive Web Apps (which refers to several sets of browser APIs). With single-spa, you can use any browser APIs that you wish. Typically the service worker is setup in the root config. There's only one specific thing I'd call out: per the browser spec, you can only have one service worker per web page, which means it can’t be one service worker per microfrontend (only one big shared one).