Turbo Native와 Workbox를 활용한 오프라인 우선 전략
Turbo Native 하이브리드 앱에서 오프라인 사용자 경험을 보장하려면 서비스 워커 라이브러리인 Workbox를 활용한 오프라인 우선 전략이 필수적이다.
Turbo Native와 Workbox를 활용한 오프라인 우선 전략
Turbo Native 하이브리드 앱에서 오프라인 사용자 경험을 보장하려면 서비스 워커 라이브러리인 Workbox를 활용한 오프라인 우선 전략이 필수적이다.
Regarding local development of apps that have service workers, a simpler fix is to open them in an Incognito / Private Browsing window. That way the SW gets reinstalled and you start fresh. Never have an old SW sitting around ready ruin your day.
https://social.tchncs.de/@teleclimber/111190583948649111
I got this by reading through the #Workbox docs: https://developer.chrome.com/docs/workbox/improving-development-experience/#service-worker-development-aids
Oof wasted a bunch of time again due to this gotcha: - work on an app's frontend on localhost - some time later: work on a different app's frontend also on localhost and same port ...BUT nothing works. The browser is mysteriously using old version of my built JS 🤬 Rebuild over and over, disable cache refresh refresh... nothing makes those old assets go away. 💡 The first app installs a service worker. Because it's the same IP+port, the second app uses it too, and caches things unexpectedly.
Who still thinks writing a Service Worker for basic features (performance with cache, offline fallback) is cumbersome?
Using #Workbox recipes make it so easy!
Here's the Service Worker for https://pack11ty.dev 😍
https://github.com/nhoizey/pack11ty/blob/main/src/assets/js/service-worker.js
If someone is creating service workers with #Workbox recipes and injectManifest, a build with #esbuild, and doesn't have any issues, I'm interested! 😅
I have a very strange issue:
https://github.com/GoogleChrome/workbox/issues/3207
Bonus points if this is with @eleventy
Library Affected: workbox-cli 6.5.4 (using injectManifest) and workbox-recipes 6.5.4 Browser & Platform: At least Chrome stable, couldn't replicate in Firefox where devtools are less powerful for s...
Is it ok to use Workbox's `injectManifest` with the recent recipes `warmCache` option?
I tried this without success in the Service Worker in Pack11ty:
```javascript
staticResourceCache({
warmCache: self.__WB_MANIFEST,
});
```
Other caches are warmed up, not this one.
Today, nearing release of 1.0, the SvelteKit Docs added an example hand-rolled Service Worker Implementation and also points to Vite Plugin PWA, but I personally prefer to use Workbox Modules myself to not write the low-level bits myself but still own the logic.
Right on time, because I just released my article on how to do it:
Create an offline-first and installable PWA with SvelteKit and workbox-precaching
https://www.sarcevic.dev/offline-first-installable-pwa-sveltekit-workbox-precaching
Making a #nuxt 3 app into #pwa should be completely trivial - and it is. Until something doesn't work and I have no idea how to figure out why. I guess I need to learn about #workbox. I was hoping to do more creative stuff with my time.
(Not complaining - I'm loving nuxt 3 and the upgrade is probably half of the code from nuxt 2 - so my productivity is minus 1000 lines of code, I guess.)
🎉 New blog
The year is 2020. Service workers are still rocket science. Humanity still hasn't nailed service worker updates. The search continues.
https://dev.to/thepassle/on-pwa-update-patterns-4fgm