serwist

A Swiss Army knife for service workers.

MIT License

Downloads
1.7M
Stars
667
Committers
81

Bot releases are visible (Hide)

serwist - @serwist/[email protected]

Published by github-actions[bot] 8 months ago

Patch Changes

serwist - @serwist/[email protected]

Published by github-actions[bot] 8 months ago

Patch Changes

serwist - @serwist/[email protected]

Published by github-actions[bot] 8 months ago

Patch Changes

serwist - @serwist/[email protected]

Published by github-actions[bot] 8 months ago

Patch Changes

serwist - @serwist/[email protected]

Published by github-actions[bot] 8 months ago

Patch Changes

serwist - @serwist/[email protected]

Published by github-actions[bot] 8 months ago

Major Changes

  • 6c3e789 Thanks @DuCanhGH! - feat(precaching.PrecacheFallbackPlugin): renamed fallbackURL, added support for a matcher

    • fallbackURL has been renamed to fallbackUrls, which should now be an array of strings or PrecacheFallbackEntry's.

      • PrecacheFallbackEntry is an interface that requires a fallback URL and a matcher, which is used to check whether the current fallback entry can be used for a request.

      • To migrate:

        • Old:
        new PrecacheFallbackPlugin({
          fallbackURL: "/~offline",
        });
        
        • New:
        new PrecacheFallbackPlugin({
          fallbackUrls: ["/~offline"],
        });
        // Or
        new PrecacheFallbackPlugin({
          fallbackUrls: [
            {
              url: "/~offline",
              matcher({ request }) {
                return request.destination === "document";
              },
            },
          ],
        });
        
    • With this change, @serwist/sw.fallbacks now also uses PrecacheFallbackPlugin. This means that FallbackEntry.cacheMatchOptions has been removed, for PrecacheController.matchPrecache doesn't support a custom matchOptions. This option is most likely not needed anyway.

      • To migrate:

        • Old:
        fallbacks({
          entries: [
            {
              url: "/~offline",
              revision,
              matcher({ request }) {
                return request.destination === "document";
              },
              cacheMatchOptions: { ignoreSearch: true },
            },
          ],
          runtimeCaching,
        });
        
        • New:
        fallbacks({
          entries: [
            {
              url: "/~offline",
              revision,
              matcher({ request }) {
                return request.destination === "document";
              },
            },
          ],
          runtimeCaching,
        });
        

Patch Changes

serwist - @serwist/[email protected]

Published by github-actions[bot] 8 months ago

Patch Changes

serwist - @serwist/[email protected]

Published by github-actions[bot] 8 months ago

Patch Changes

serwist - @serwist/[email protected]

Published by github-actions[bot] 8 months ago

Patch Changes

serwist - @serwist/[email protected]

Published by github-actions[bot] 8 months ago

Patch Changes

serwist - @serwist/[email protected]

Published by github-actions[bot] 8 months ago

Major Changes

  • 6c3e789 Thanks @DuCanhGH! - feat(precaching.PrecacheFallbackPlugin): renamed fallbackURL, added support for a matcher

    • fallbackURL has been renamed to fallbackUrls, which should now be an array of strings or PrecacheFallbackEntry's.

      • PrecacheFallbackEntry is an interface that requires a fallback URL and a matcher, which is used to check whether the current fallback entry can be used for a request.

      • To migrate:

        • Old:
        new PrecacheFallbackPlugin({
          fallbackURL: "/~offline",
        });
        
        • New:
        new PrecacheFallbackPlugin({
          fallbackUrls: ["/~offline"],
        });
        // Or
        new PrecacheFallbackPlugin({
          fallbackUrls: [
            {
              url: "/~offline",
              matcher({ request }) {
                return request.destination === "document";
              },
            },
          ],
        });
        
    • With this change, @serwist/sw.fallbacks now also uses PrecacheFallbackPlugin. This means that FallbackEntry.cacheMatchOptions has been removed, for PrecacheController.matchPrecache doesn't support a custom matchOptions. This option is most likely not needed anyway.

      • To migrate:

        • Old:
        fallbacks({
          entries: [
            {
              url: "/~offline",
              revision,
              matcher({ request }) {
                return request.destination === "document";
              },
              cacheMatchOptions: { ignoreSearch: true },
            },
          ],
          runtimeCaching,
        });
        
        • New:
        fallbacks({
          entries: [
            {
              url: "/~offline",
              revision,
              matcher({ request }) {
                return request.destination === "document";
              },
            },
          ],
          runtimeCaching,
        });
        

Patch Changes

serwist - @serwist/[email protected]

Published by github-actions[bot] 8 months ago

Major Changes

Patch Changes

serwist - @serwist/[email protected]

Published by github-actions[bot] 8 months ago

Patch Changes

serwist - @serwist/[email protected]

Published by github-actions[bot] 8 months ago

Patch Changes

serwist - @serwist/[email protected]

Published by github-actions[bot] 8 months ago

Patch Changes

serwist - @serwist/[email protected]

Published by github-actions[bot] 8 months ago

Patch Changes

serwist - @serwist/[email protected]

Published by github-actions[bot] 8 months ago

serwist - @serwist/[email protected]

Published by github-actions[bot] 8 months ago

Patch Changes

serwist - @serwist/[email protected]

Published by github-actions[bot] 8 months ago

Patch Changes

serwist - @serwist/[email protected]

Published by github-actions[bot] 8 months ago

Patch Changes

Package Rankings
Top 23.13% on Npmjs.org