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

Add deferred udpates and postMessage fallback #1673

Merged
merged 5 commits into from
Oct 4, 2018

Conversation

philipwalton
Copy link
Member

Fixes #1399

This PR is an initial pass at making the workbox-broadcast-cache-update plugin work with cache updates on navigation requests. It also adds a basic fallback to postMessage()-ing all window clients in browsers that don't support the Broadcast Channel API.

Note, this PR includes some breaking changes to go along with some of our plans for v4, so I've tagged it accordingly. I'll update this PR with a complete list of breaking changes after the review, but for now the main points are:

  • A channel name is no longer required (it defaults to workbox, which will be the same default used by workbox-window).
  • Public BroadcastCacheUpdate and broadcastUpdate methods now take destructured params rather than position params (which made the most sense since channel name is now optional).
@philipwalton philipwalton added the Breaking Change Denotes a "major" semver change. label Oct 3, 2018
@philipwalton philipwalton added this to the v4 milestone Oct 3, 2018
@coveralls
Copy link

coveralls commented Oct 3, 2018

Coverage Status

Coverage increased (+0.2%) to 86.266% when pulling b638170 on broadcast-cache-updates into 59e7d4f on master.

@workbox-pr-bot
Copy link
Collaborator

PR-Bot Size Plugin

Changed File Sizes

File Before After Change GZipped
packages/workbox-broadcast-cache-update/build/workbox-broadcast-cache-update.prod.js 1.12 KB 2.05 KB +83% 1.00 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.51 KB 3.51 KB 0% 1.45 KB
packages/workbox-broadcast-cache-update/build/workbox-broadcast-cache-update.prod.js 1.12 KB 2.05 KB +83% 1.00 KB ☠️
packages/workbox-build/build/_types.js 41 B 41 B 0% 61 B
packages/workbox-build/build/index.js 4.02 KB 4.02 KB 0% 1.57 KB
packages/workbox-cache-expiration/build/workbox-cache-expiration.prod.js 3.88 KB 3.88 KB 0% 1.37 KB
packages/workbox-cacheable-response/build/workbox-cacheable-response.prod.js 587 B 587 B 0% 347 B
packages/workbox-cli/build/app.js 6.76 KB 6.76 KB 0% 2.27 KB
packages/workbox-cli/build/bin.js 2.32 KB 2.32 KB 0% 1.03 KB
packages/workbox-core/build/workbox-core.prod.js 7.47 KB 7.47 KB 0% 2.90 KB
packages/workbox-google-analytics/build/workbox-google-analytics.prod.js 2.12 KB 2.12 KB 0% 1.03 KB
packages/workbox-navigation-preload/build/workbox-navigation-preload.prod.js 660 B 660 B 0% 319 B
packages/workbox-precaching/build/workbox-precaching.prod.js 5.81 KB 5.81 KB 0% 2.24 KB
packages/workbox-range-requests/build/workbox-range-requests.prod.js 1.63 KB 1.63 KB 0% 797 B
packages/workbox-routing/build/workbox-routing.prod.js 2.87 KB 2.87 KB 0% 1.31 KB
packages/workbox-strategies/build/workbox-strategies.prod.js 5.09 KB 5.09 KB 0% 1.24 KB
packages/workbox-streams/build/workbox-streams.prod.js 1.57 KB 1.57 KB 0% 740 B
packages/workbox-sw/build/workbox-sw.js 1.50 KB 1.50 KB 0% 811 B
packages/workbox-webpack-plugin/build/generate-sw.js 8.04 KB 8.04 KB 0% 2.57 KB
packages/workbox-webpack-plugin/build/index.js 742 B 742 B 0% 470 B
packages/workbox-webpack-plugin/build/inject-manifest.js 10.30 KB 10.30 KB 0% 3.23 KB

Workbox Aggregate Size Plugin

9.97KB gzip'ed (66% of limit)
26.56KB uncompressed

@philipwalton philipwalton changed the base branch from master to next October 3, 2018 21:55
@philipwalton
Copy link
Member Author

Rebased after changing the base branch from master to next (since there are breaking changes).

Copy link
Contributor

@jeffposnick jeffposnick left a comment

Choose a reason for hiding this comment

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

Just the one comment about the for loop. but otherwise 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Breaking Change Denotes a "major" semver change.
4 participants