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

webpack plugin updates for v5 #2087

Merged
merged 28 commits into from
Jul 10, 2019
Merged

webpack plugin updates for v5 #2087

merged 28 commits into from
Jul 10, 2019

Conversation

jeffposnick
Copy link
Contributor

R: @philipwalton

This includes a pretty large refactoring of both of the webpack plugins, to match the proposed design and behavior for v5.

In general, a lot of the webpack code has gotten simpler, and we're sharing more with workbox-build, which should lead to better consistency.

I have not yet updated any of the tests, and I'll be working on that, but I wanted to give you a chance to look at the code changes first.

Additionally, I think a refactoring of the code under https://github.com/GoogleChrome/workbox/tree/wepback-v5/packages/workbox-build/src/entry-points/options is probably in order, as that's now a grab bag of things used directly by both workbox-build and workbox-webpack-plugin. I'd like to save that for a different PR, though.

Fixes #2064, fixes #2059, fixes #2039, fixes #1859, fixes #2021, fixes #2012, fixes #1854, fixes #1774, fixes #1591, fixes #1543, fixes #1363, fixes #1556, fixes #1529, fixes #1454, fixes #1338, fixes #1287, fixes, #1373, fixes #1227, fixes #1513, fixes #1493, fixes #1485

Copy link
Member

@philipwalton philipwalton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me so far (with a few minor nits). I haven't played with the logic yet, but it's great to see so much fo the previous code removed!

@jeffposnick
Copy link
Contributor Author

Okay, the tests are updated.

Post-merge, I think we should be good to cut the first v5 alpha and start getting feedback on the new build tools.

Copy link
Member

@philipwalton philipwalton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I checked the branch out and tried it against one of my webpack projects with code splitting, and it worked exactly as I would expect. I also tried it with the inlineWorkboxRuntime: true option and it worked as I would expect there as well.

I didn't check all the options, but I'm confident it's good enough for alpha, so let's cut a release and get it in front of real users! 🎉

@workbox-pr-bot
Copy link
Collaborator

PR-Bot Size Plugin

Changed File Sizes

File Before After Change GZipped
packages/workbox-background-sync/build/workbox-background-sync.prod.js 3.85 KB 3.81 KB -1% 1.58 KB
packages/workbox-broadcast-update/build/workbox-broadcast-update.prod.js 1.91 KB 1.89 KB -1% 944 B
packages/workbox-build/build/index.js 3.64 KB 3.34 KB -8% 1.32 KB
packages/workbox-cacheable-response/build/workbox-cacheable-response.prod.js 586 B 579 B -1% 345 B
packages/workbox-cli/build/app.js 5.58 KB 5.89 KB +6% 2.07 KB
packages/workbox-core/build/workbox-core.prod.js 5.92 KB 5.88 KB -1% 2.48 KB
packages/workbox-expiration/build/workbox-expiration.prod.js 2.93 KB 2.89 KB -1% 1.25 KB
packages/workbox-google-analytics/build/workbox-offline-ga.prod.js 1.94 KB 1.89 KB -2% 898 B
packages/workbox-precaching/build/workbox-precaching.prod.js 4.24 KB 4.25 KB +0% 1.71 KB
packages/workbox-range-requests/build/workbox-range-requests.prod.js 1.56 KB 1.51 KB -3% 758 B
packages/workbox-webpack-plugin/build/generate-sw.js 5.29 KB 4.14 KB -22% 1.51 KB 🎉
packages/workbox-webpack-plugin/build/inject-manifest.js 7.22 KB 5.16 KB -29% 1.73 KB 🎉
packages/workbox-window/build/workbox-window.dev.umd.js 32.03 KB 30.42 KB -5% 8.07 KB
packages/workbox-window/build/workbox-window.prod.umd.js 4.43 KB 4.54 KB +3% 1.82 KB

New Files

No new files have been added.

All File Sizes

View Table
File Before After Change GZipped
packages/workbox-background-sync/build/workbox-background-sync.prod.js 3.85 KB 3.81 KB -1% 1.58 KB
packages/workbox-broadcast-update/build/workbox-broadcast-update.prod.js 1.91 KB 1.89 KB -1% 944 B
packages/workbox-build/build/_types.js 41 B 41 B 0% 61 B
packages/workbox-build/build/index.js 3.64 KB 3.34 KB -8% 1.32 KB
packages/workbox-cacheable-response/build/workbox-cacheable-response.prod.js 586 B 579 B -1% 345 B
packages/workbox-cli/build/app.js 5.58 KB 5.89 KB +6% 2.07 KB
packages/workbox-cli/build/bin.js 1.16 KB 1.16 KB 0% 580 B
packages/workbox-core/build/workbox-core.prod.js 5.92 KB 5.88 KB -1% 2.48 KB
packages/workbox-expiration/build/workbox-expiration.prod.js 2.93 KB 2.89 KB -1% 1.25 KB
packages/workbox-google-analytics/build/workbox-offline-ga.prod.js 1.94 KB 1.89 KB -2% 898 B
packages/workbox-navigation-preload/build/workbox-navigation-preload.prod.js 652 B 652 B 0% 317 B
packages/workbox-precaching/build/workbox-precaching.prod.js 4.24 KB 4.25 KB +0% 1.71 KB
packages/workbox-range-requests/build/workbox-range-requests.prod.js 1.56 KB 1.51 KB -3% 758 B
packages/workbox-routing/build/workbox-routing.prod.js 3.40 KB 3.40 KB 0% 1.48 KB
packages/workbox-strategies/build/workbox-strategies.prod.js 4.86 KB 4.86 KB 0% 1.19 KB
packages/workbox-streams/build/workbox-streams.prod.js 1.38 KB 1.38 KB 0% 678 B
packages/workbox-sw/build/workbox-sw.js 1.33 KB 1.33 KB 0% 741 B
packages/workbox-webpack-plugin/build/generate-sw.js 5.29 KB 4.14 KB -22% 1.51 KB 🎉
packages/workbox-webpack-plugin/build/index.js 349 B 349 B 0% 255 B
packages/workbox-webpack-plugin/build/inject-manifest.js 7.22 KB 5.16 KB -29% 1.73 KB 🎉
packages/workbox-window/build/workbox-window.dev.umd.js 32.03 KB 30.42 KB -5% 8.07 KB
packages/workbox-window/build/workbox-window.prod.umd.js 4.43 KB 4.54 KB +3% 1.82 KB

Workbox Aggregate Size Plugin

8.97KB gzip'ed (60% of limit)
22.64KB uncompressed

@jeffposnick jeffposnick merged commit 6ce969a into v5 Jul 10, 2019
@jeffposnick jeffposnick deleted the wepback-v5 branch July 10, 2019 13:47
jeffposnick added a commit that referenced this pull request Jul 12, 2019
* Initial GenerateSW changes.

* WIP.

* Basic InjectManifest functionality.

* Normalize webpack option validation.

* Working-ish?

* Copy over some compiler options.

* More mode magic

* Manifest transformations should work

* Normalized error reporting a bit.

* Switch to Proxx's loadz0r config

* Tweak the default exclude

* Play nicely with SplitChunkPlugin

* Add a warning about missing chunks.

* Rename a test.

* Updated a few comments.

* Test-related updates

* Further test fixes.

* Pretty complete GenerateSW test suite.

* InjectManifest tests.

* Linting.

* Copyright dates.

* Update jsdoc-baseline

* lockfile update

* Fix the generate-sw test on Windows.

* Switch to upath

* Fix a proxied call to upath

* Missed a @Private

* A few nits.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants