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

Major Changes

  • dc12dda Thanks @DuCanhGH! - chore(webpack-plugin): removed mode

    • This option was already a no-op before that, so this simply removes it from the types.
    • To migrate, just remove mode from your options.

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

  • dc12dda Thanks @DuCanhGH! - chore(sw): renamed urlPattern to matcher

    • Quoting jeffposnick:

    Workbox used to go all-in on RegExp based routing for runtime caching, and the runtimeCaching options in our build tools use the property named urlPattern to configure the match criteria. This criteria is passed in under the hood to the first parameter of registerRoute(), which is overloaded and takes either a string, a RegExp, or a matchCallback function.

    Beyond the fact that this overloaded can be confusing, I think it's doubly-confusing that the runtimeCaching property is called urlPattern, in that it makes it seem like only a RegExp pattern is supported.

    I'd like to change that name to match as an alias for urlPattern, and then eventually deprecate urlPattern in a future release of Workbox.

    • To migrate, simply rename urlPattern to matcher.

      • Old:
      registerRuntimeCaching(
        {
          urlPattern: /\.(?:jpg|jpeg|gif|png|svg|ico|webp)$/i,
          handler: new StaleWhileRevalidate({
            cacheName: "static-image-assets",
            plugins: [
              new ExpirationPlugin({
                maxEntries: 64,
                maxAgeSeconds: 24 * 60 * 60, // 24 hours
              }),
            ],
          }),
        },
        {
          urlPattern: /\.(?:js)$/i,
          handler: new StaleWhileRevalidate({
            cacheName: "static-js-assets",
            plugins: [
              new ExpirationPlugin({
                maxEntries: 32,
                maxAgeSeconds: 24 * 60 * 60, // 24 hours
              }),
            ],
          }),
        },
        {
          urlPattern: /\.(?:css|less)$/i,
          handler: new StaleWhileRevalidate({
            cacheName: "static-style-assets",
            plugins: [
              new ExpirationPlugin({
                maxEntries: 32,
                maxAgeSeconds: 24 * 60 * 60, // 24 hours
              }),
            ],
          }),
        }
      );
      
      • New:
      registerRuntimeCaching(
        {
          matcher: /\.(?:jpg|jpeg|gif|png|svg|ico|webp)$/i,
          handler: new StaleWhileRevalidate({
            cacheName: "static-image-assets",
            plugins: [
              new ExpirationPlugin({
                maxEntries: 64,
                maxAgeSeconds: 24 * 60 * 60, // 24 hours
              }),
            ],
          }),
        },
        {
          matcher: /\.(?:js)$/i,
          handler: new StaleWhileRevalidate({
            cacheName: "static-js-assets",
            plugins: [
              new ExpirationPlugin({
                maxEntries: 32,
                maxAgeSeconds: 24 * 60 * 60, // 24 hours
              }),
            ],
          }),
        },
        {
          matcher: /\.(?:css|less)$/i,
          handler: new StaleWhileRevalidate({
            cacheName: "static-style-assets",
            plugins: [
              new ExpirationPlugin({
                maxEntries: 32,
                maxAgeSeconds: 24 * 60 * 60, // 24 hours
              }),
            ],
          }),
        }
      );
      

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

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

  • dc12dda Thanks @DuCanhGH! - chore(google-analytics): migrated to the singleton Router instance

    • We now use @serwist/routing.registerRoute, rather than @serwist/routing.Router like in the past, for initialize.

    • You don't need to do anything to migrate.

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

serwist - @serwist/[email protected]

Published by github-actions[bot] 8 months ago

Patch Changes

Package Rankings
Top 23.13% on Npmjs.org