-
Notifications
You must be signed in to change notification settings - Fork 388
Conversation
My first thought is that if sw-precache could read in, manipulate and spit If that were the case it would make sense for developers to learn about But this has been my view from the first time I played with sw-precache. On Wed, 6 Jan 2016, 19:49 Jeffrey Posnick [email protected] wrote:
|
|
@gauntface @addyosmani: I think the majority of common |
Hey All—I've updated this PR based on feedback, but also added in a new Getting Started guide that I would like to ship along with the I'm flagging @jpmedley especially to review the new Getting Started content, which you can also preview at https://github.com/GoogleChrome/sw-precache/blob/sw-toolbox-integration/GettingStarted.md |
Looks good to me - getting started guide is super useful and concise. Out of interest, in the |
Are you asking whether |
I'll merge this early next week unless there are any objections. |
I didn't already LGTM this because I haven't had the chance to thoroughly review the docs part, but I can give you an LGTM on the code part. |
A helpful analogy when thinking about your App Shell is to the code and | ||
resources that would be published to an App Store for a native iOS or Android | ||
application. | ||
|
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.
"A helpful analogy is to think of your App Shell as the code and resources that would be published to an app store for a native iOS or Android application."
Suggested rewrite because I had a little trouble parsing the text as written.
Pete asked me to look it over. Can you address my comments? |
I went over and addressed @jpmedley's comments in person. |
@wibblymat @gauntface @petele @addyosmani
Here's my first cut of what an integration between
sw-precache
andsw-toolbox
could look like. As part of yoursw-precache
config in your build process, you can now include aruntimeCaching
array that includes one or more entries. Each entry will result in asw-toolbox
-style handler in the generated service worker file. For example, including this in the config:Results in this being added to the end of the generated service worker file:
There are some existing rough patches that make this not suitable for merging yet, but I wanted to get some concrete feedback at this stage.
A few random bits:
sw-toolbox.js
contents are included inline in the generated service worker file. By inlining the contents as opposed to pulling them in withimportScripts()
, I'm hoping to avoid some of the messier bits that we ran into with<platinum-sw>
, where it took some effort to get the dependent files served from the correct URL. The downside is that the generated service worker file is now ~25kb (~8kb gzip-ed).master
branch ofsw-toolbox
, since the changes to support RegExp routing isn't in a tagged release yet.