Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to workbox-webpack-plugin v4 #6725

Merged
merged 2 commits into from Apr 5, 2019

Conversation

@r0ughnex
Copy link
Contributor

commented Mar 28, 2019

DESCRIPTION:

  • Resolves #6659: Updated the workbox-webpack-plugin from v3 to latest v4 and also tested some of the new configuration options such as skipWaiting and cleanupOutdatedCaches after ejecting the app.

  • Resolves #6243: The new version automatically solves the issue where a registered service worker still tries to load an old resource, after workbox has cleaned up its old cache after an update.

TESTS COMPLETED:

  • Change the app code to serviceWorker.register() and run build, then check if workbox caches the relevant files and if the service worker installs correctly and triggers the onSuccess callback.

  • Add flag skipWaiting: true to the webpack.config.js, then update the app code and perhaps also the version number in package.json, then repeat the test above and check if the new service worker takes over the application and triggers the onUpdate callback. Older outdated workbox caches should be deleted at the point (from logs visible on the dev console in localhost)

  • Add flag cleanupOutdatedCaches: false, repeat the test above and check if the new service worker takes over the application. Older outdated workbox cache should not deleted now (this option is only available in versions 4.x.x and above).

Update to workbox-webpack-plugin v4
- Resolves #6659: Updated the workbox-webpack-plugin from v3 to latest v4 and also tested some of the new configuration options such as skipWaiting and cleanupOutdatedCaches after ejecting the app.
@r0ughnex

This comment has been minimized.

Copy link
Contributor Author

commented Mar 28, 2019

@iansu: This is my first ever contribution to create-react-app, so thanks for letting me take this up. I tried my best to test the new version of the plugin under a few scenarios (before and after ejecting). Let me know if I need to do anything else.

@iansu iansu self-assigned this Mar 28, 2019

@iansu iansu added this to In progress in v3 via automation Mar 28, 2019

@iansu iansu added this to the 3.0 milestone Mar 28, 2019

@jadbox

This comment has been minimized.

Copy link

commented Mar 28, 2019

This workbox update is important as it improves a number of things, including adding the much needed skipWaiting() message handler (which I'd had to otherwise manually inject in dozens of CRA projects):
GoogleChrome/workbox#1929

@jadbox

This comment has been minimized.

Copy link

commented Apr 3, 2019

@iansu this is a pretty simple change and should be backwards compatible. Can we get this into v2.x instead of holding this back until v3 milestone?

@iansu

This comment has been minimized.

Copy link
Collaborator

commented Apr 3, 2019

We are not planning to do any more releases of the 2.x line. We are hoping to release 3.0 in the very near future so this should be available soon.

@iansu iansu closed this Apr 4, 2019

v3 automation moved this from In progress to Done Apr 4, 2019

@iansu iansu reopened this Apr 4, 2019

v3 automation moved this from Done to In progress Apr 4, 2019

@iansu iansu merged commit ffcd896 into facebook:master Apr 5, 2019

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
netlify/create-react-app/deploy-preview Docs deploy preview succeeded
Details

v3 automation moved this from In progress to Done Apr 5, 2019

@lock lock bot locked and limited conversation to collaborators Apr 10, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.