Why is choo-service-worker not being used?
See original GitHub issuechoo-service-worker
is commented and installed in a fresh choo app and I don’t know why? if we uncomment that line tests would also start green and we could also close #22
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
Issues · choojs/choo-service-worker - GitHub
There aren't any open issues. You could search all of GitHub or try an advanced search. ProTip! What's not been updated in a...
Read more >choo | Yarn - Package Manager
The way in which Choo handles hashes in the URL has proved confusing for both newcomers and seasoned Choo users. In a prior...
Read more >create-choo-app 1.12.3 on npm - Libraries.io
When you first open up your application in a browser, you'll probably see a warning page about HTTPS connections being untrusted. No worries ......
Read more >ECMAScript 6 Tools Awesome - DirDev.com
Babel - Turn ES6+ code into vanilla ES5 with no runtime ... Used by several of the transpilers listed above, including regenerator and...
Read more >15.xml - jsDelivr
... monthly https://www.jsdelivr.com/package/npm/choo-service-worker monthly ... https://www.jsdelivr.com/package/npm/chrome-tracing-testing-do-not-use ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
So, I’ll answer to most of your comment, but first I think I didn’t put much emphasis in this offline guide from Jake Archibald, is pretty much the main resource of almost anything I have to say here haha. So, here we go:
Cool, considering there is different kinds of files in a web app, I think that the file list mentioned is the minimum resources to have your app running offline, but still people could load resources that are not in that list. I would do as you say and map that list to the initial cache files, and maybe comment out or point to On install - not as a dependency strategy from the guide I linked, to guide people that want to load resources without changing that environment var of the file lists. This would look like this
I guess that having service-worker activation only when NODE_ENV is set to true is enough. Anyway I’m not against this, but if we keep this commented, we should mention in comments that running tests in fresh installs will always fail until the line is uncommented or
choo-service-worker
is uninstalled.True to all of that. We are not registering resources when fetch fails, not sure why you said that haha.
👍
👍
Well that’s how the BackgroundSync API works, you just send tags, like some kind of signaling to the service worker, that’s what we are doing in choo-service-worker.
Well this is actually a bit similar to the background sync thing, because both actions are dispatched from the client to the service worker. The difference is that background sync is dispatched fro the client, but not the user, think about twitter in the browser, when you have a new tweet, the home page tells you there are n new tweets, without needing your interaction, this could be done with background sync dispatched in a time interval (not sure how they are actually doing it, just guessing haha). On the other hand, an user could save for offline (add to cache) voluntarily, for example, check Una Kravets blog, if you pick a random post, you’ll see a link to save for offline, so this will go in cache only when the user wants. Ideal for blog posts or gallerys with several Gb of images when users only want a few of them.
So wrapping up, I think we should:
FILE_LIST
env var as the core files to be cached for offline.sync
event listener.The client should get some updates too:
With the latest PR service workers are enabled in production and tests are passing. Closing 😃