cra-template / pwa

MIT License
161 stars 112 forks source link

Upgrading Workbox to v6 and above #18

Open Transfusion opened 3 years ago

Transfusion commented 3 years ago

Use Case: I want to define a custom import { Strategy } from "workbox-strategies"; (that fetches data from IndexedDB, so I can use the registerRoute syntax of Workbox).

https://developers.google.com/web/tools/workbox/modules/workbox-strategies#custom_strategies

https://github.com/GoogleChrome/workbox/pull/2455

Strategy.ts was only introduced in v6.

Will there be any adverse effects if I simply npm i workbox-strategies@6.1.0, along with all the other related packages? I'll update this issue after I try shortly.

ZYinMD commented 3 years ago

@Transfusion Did you find any adverse effects?

ZYinMD commented 3 years ago

You could check the "breaking changes" section in the v6 release note for details.

I did the upgrade, and found no adverse effect.

sm2017 commented 2 years ago

@ZYinMD You mean, No need to change the code to update? @jeffposnick can you please take a look?

piotr-cz commented 2 years ago

@ZYinMD How did you upgrade? The react-scripts@^4.0.0 dependes on workbox-webpack-plugin@5.1.4 which depends on workbox-build@5.1.4

npm ls workbox-build

`-- react-scripts@4.0.3
  `-- workbox-webpack-plugin@5.1.4
    `-- workbox-build@5.1.4