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
feat(workbox): workbox 3 + offlinePage #60
Merged
Merged
Changes from 2 commits
Commits
Show all changes
51 commits
Select commit
Hold shift + click to select a range
71fd73e
Update workbox version
manniL 5d6da43
Migrate as far as possible
manniL ad667f6
fix: typos
manniL d7f76b1
chore: update workbox-build
manniL be984d7
chore: improve code layout
manniL fbe94c3
Merge branch 'master' into feature-update-workbox
galvez 008c80e
Add scriptExtensions
galvez 1500988
Add scriptExtensions (2)
galvez 503b4e8
Fixed lint issue
galvez 48a33fe
Split scriptExtensions into caching/routingExtensions
galvez b419b21
Sync latest master
galvez db2969a
Ongoing work on offlinePage support
galvez 9e02827
Split scriptExtensions into caching/routingExtensions (2)
galvez 17d2273
Split scriptExtensions into caching/routingExtensions (3)
galvez 1c14733
Update eslint-standard
galvez bebad44
Contextualize eslint config
galvez 45ab60a
Trying to fix upath error
galvez ad386a5
Update deps
galvez ad93e22
Update deps (2)
galvez 81c7a51
Disable catch-all if offlinePage defined
galvez 574e2de
Fix syntax error
galvez 6e05406
Fix /.* route
galvez 890d094
Clean up template
galvez a514b0d
Remove name from main package
galvez a036ea5
Fix placement of options
galvez 96b8531
Remove npm bin
galvez 3f4ab8b
reponse -> response
galvez 092da26
Fix placement of cachingExtensions
galvez 95600ca
Readd injection placeholder
galvez 1f98a99
Move offlinePage to _runtimeCaching
galvez d93c6d4
Use lodash.pick()
galvez 86a2f7f
Remove unused params
galvez ad5de91
Fix cacheId
galvez d1f29b0
Fix staleWhileRevalidate ref
galvez f3bf70e
Fix refs
galvez 0e1b9a8
Debugging offlinePage
galvez d0cc8ac
Precache offlinePage
galvez b202189
Precache offlinePage (2)
galvez e3b1113
Offline page tweaks
galvez 6a4dad5
Offline page tweaks (2)
galvez c673017
Offline page tweaks (3)
galvez cfb72d4
Offline page tweaks (4)
galvez f9c2e75
Offline page tweaks (5)
galvez 3973c0e
Offline page tweaks (6)
galvez 1d6d212
Offline page tweaks (7)
galvez 4ba6913
Offline page tweaks (8)
galvez e6a7e78
Offline page tweaks (9)
galvez b8e2cf0
Offline page tweaks (10)
galvez 469ff25
Offline page tweaks (11)
galvez b2bb50c
Update docs
galvez 663651e
Add note to docs
galvez File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,6 @@ | |
"access": "public" | ||
}, | ||
"dependencies": { | ||
"workbox-build": "^2.1.2" | ||
"workbox-build": "^3.0.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
importScripts(<%= options.importScripts.map(i => `'${i}'`).join(', ') %>) | ||
|
||
const workboxSW = new self.WorkboxSW(<%= JSON.stringify(options.wbOptions, null, 2) %>) | ||
workbox.precaching.precacheAndRoute([], <%= JSON.stringify(options.wbOptions, null, 2) %>) | ||
|
||
workboxSW.precache([]) | ||
|
||
<% if(options.clientClaims) { %> | ||
workbox.clientClaims() | ||
<% } %> | ||
|
||
<% options.runtimeCaching.forEach(r => { | ||
const strategy = JSON.stringify(r.strategyOptions || {}) | ||
%> | ||
workboxSW.router.registerRoute(new RegExp('<%= r.urlPattern %>'), workboxSW.strategies.<%= r.handler %>(<%= strategy %>), '<%= r.method %>') | ||
workbox.routing.registerRoute(new RegExp('<%= r.urlPattern %>'), workboxSW.strategies.<%= r.handler %>(<%= strategy %>), '<%= r.method %>') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, will fix! |
||
<% }) %> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can also use lodash
_.pick