Skip to content

Official qwik support #884

@maiieul

Description

@maiieul

Hi, Qwik core member here 👋

Now that qwik does not use a service-worker by default anymore (it uses <link rel="modulepreload"> instead), I am exploring how we can provide easy service worker, pwa, offline support, and more. This plugin seems like a logical choice.

Are you open to including Qwik support in this repo? I can work on a PR.

Qwik is usually SSR or SSG (through Qwik City). I have been able to hack around the plugin a little and it almost works for offline mode in preview:

  • if I manually add this inline script I can get the js bundles and assets to be cached (using a somewhat default qwikPWA config)
<script dangerouslySetInnerHTML={`if('serviceWorker' in navigator) {window.addEventListener('load', () => {navigator.serviceWorker.register('/sw.js', { scope: '/' })})}`} />
  • but I'm unable to cache the html files whether I'm on an SSR (in preview) or SSG build.

I'd appreciate some hints into what needs to be done if you can :).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions