Skip to content

Releases: DuCanhGH/next-pwa

@ducanh2912/[email protected]

05 Feb 13:05
c840228
Compare
Choose a tag to compare

NOTE: despite this being a major update, you shouldn't have too many troubles migrating from v7 to v8.

Major Changes

  • 73a4f26: BREAKING CHANGE (typescript): renamed Fallbacks to FallbackRoutes, /register to /workbox.

    • Some JSDoc has also been added to FallbackRoutes.

    • Changing /register to /workbox should have minimal impact, you only need to change "@ducanh2912/next-pwa/register" in compilerOptions.types to "@ducanh2912/next-pwa/worker".

    BREAKING CHANGE (PluginOptions): removed PluginOptions.exclude.

    • You should use PluginOptions.buildExcludes instead. It is almost the same as PluginOptions.exclude, except for the fact that it doesn't override the plugin's exclude function, which is used to exclude files that shouldn't/can't be precached.

    style(code): renamed register.ts to sw-entry.ts.

    • I think this name conveys the meaning of the file better, as it doesn't only register the SW but also handles some of the plugin's features.

    NOTE: How to upgrade:

    • Change "@ducanh2912/next-pwa/register" in your tsconfig.json's compilerOptions.types to "@ducanh2912/next-pwa/worker".

    • Change exclude to buildExcludes like so:

    import withPWAInit from "@ducanh2912/next-pwa";
    
    const withPWA = withPWAInit({
      // your other options,
      workboxOptions: {
        exclude: [],  
      },
    });
    
    export default withPWA({
      // your Next config
    });

    to

    import withPWAInit from "@ducanh2912/next-pwa";
    
    const withPWA = withPWAInit({
      // your other options,
      buildExcludes: [],
    });
    
    export default withPWA({
      // your Next config
    });
    • If you have used the interface Fallbacks somewhere in your code, just change it to FallbackRoutes.

Minor Changes

  • 0646231: feat(core): support for path aliases in custom worker

    • This does it by copying Next.js's webpackConfig.resolve into custom worker's Webpack config.

Patch Changes

  • 4172cd0: chore(deps, code): updated all deps, cleaned up some code, removed subdomainPrefix.

    • This will remove subdomainPrefix from types.ts, but it will only trigger TS if you still have that option, because it stopped doing anything ages ago.

    • Cleaned up some code while I was finding a way to better support offline.

@ducanh2912/[email protected]

28 Jan 08:31
e754066
Compare
Choose a tag to compare

Patch Changes

  • ecc1fe7: fix(core): fixed user's webpack config being overridden if the plugin is disabled

    • Before this patch, the plugin used to override user-defined or other plugins' Webpack custom config because it early returned the config (without calling nextConfig.webpack?.()) if it was disabled. This fixes it by calling nextConfig.webpack?.() before doing anything else.

    chore(types): changed compilerOptions.moduleResolution to "nodeNext".

    • This shouldn't impact users. It is only meant to force me to write .js at the end of import paths and stuff.

    docs(README): refined main README.md

    • Rewrote README.md to fix grammar issues and decouple tips into TIPS.md. I also fixed/removed some broken links.

    chore(deps): ran deps:update-all

    • Nothing too special...

@ducanh2912/[email protected]

24 Jan 09:40
d817859
Compare
Choose a tag to compare

Patch Changes

  • 1bcc70c:
    docs(types.ts): fixed links, added example for PluginOptions.register, PluginOptions.buildExcludes.

    • This patch add an example of registering the SW on your own with register: false and an example of how buildExcludes should look like.
    • It also removed an invalid link (which led to Github's 404 page) and an old link (which led to a deprecated example).

    chore(deps): ran deps:update-all.

    • To clarify the previous patch's message, this is meant to be done at least once a month, but it can be done anytime.

    style(code): cleaned up index.ts.

    • Replaced _fallbacks with hasFallbacks as copying pluginOptions.fallbacks just to indicate that the user did use this feature wasn't really necessary, and can be simplified to using a boolean.

@ducanh2912/[email protected]

14 Jan 11:51
49c7122
Compare
Choose a tag to compare

Patch Changes

  • 8274a95:

    fix(deps): moved swc-loader to devDependencies and peerDependencies, added note that reminds users to install swc-loader when using fallbacks and custom worker in PluginOptions.

    • swc-loader being in dependencies didn't do anything as webpack wants it declared in the user's package.json, so I moved it to devDependencies and added it to peerDependencies (optional).

    docs(README): fixed example create-next-app command (added --example flag).

    • Before this change it wasn't a really valid command; while create-next-app does run, it will crash on trying to create a https://github.com/DuCanhGH/next-pwa/tree/master/examples/basic folder.

    chore(lockfile): moved to pnpm-lock.yaml's v6 format.

    • This doesn't change anything, I just think it is nice to migrate as it will become the default anyway.

@ducanh2912/[email protected]

14 Jan 08:25
bbed92f
Compare
Choose a tag to compare

Minor Changes

  • f224625:
    feat(core): added support for /_offline.tsx page in appDir.

    • With this version, app/_offline/page.tsx will automatically enable the fallback worker just like pages/_offline.tsx.

    chore(deps): updated all dependencies

    • This version also bumps every dependency to their latest versions. This process is done monthly.

@ducanh2912/[email protected]

22 Dec 22:06
2856e5e
Compare
Choose a tag to compare

Minor Changes

  • b6f10be:

    refactor(core): replaced babel with swc.

    • This version replaces babel-loader with swc-loader when building fallback workers and custom workers so that we don't have to use the old next/babel anymore.

    • There should be no changes needed except for deleting babel-loader and @babel/core from your devDependencies if you don't need them anymore, because this package doesn't.

    refactor(examples): converted every example to Typescript, renamed some, deprecated some.

@ducanh2912/[email protected]

09 Dec 11:23
2903432
Compare
Choose a tag to compare

Patch Changes

  • 360c94a: Fix @ducanh2912/next-pwa not having a README.md on npm

v7.0.2

06 Dec 02:18
Compare
Choose a tag to compare

7.0.2 (2022-12-06)

Bug Fixes

  • issues: fix issue template [skip ci] (fb3bd76)

v7.0.1

05 Dec 08:49
Compare
Choose a tag to compare

7.0.1 (2022-12-05)

Bug Fixes

  • types: InjectManifest's options and GenerateSW's shouldn't be interchangeable anymore (1dfb305)

v7.0.0

05 Dec 07:24
Compare
Choose a tag to compare

7.0.0 (2022-12-05)

Bug Fixes

  • types: fixed JSDoc not working properly (259ac35)

BREAKING CHANGES

  • types: you should now pass workbox-webpack-plugin's GenerateSW
    and InjectManifest options to workboxOptions instead of the general
    options (PluginOptions).