Compare commits

...
5 Commits
Author SHA1 Message Date
github-actions[bot] 335b01f60e chore: bump version to 0.21.5 2026-03-12 20:01:20 +00:00
Frederic CabassutandClaude Opus 4.6 ba1ddd4489 fix: restrict SW API caching to GET requests to avoid intercepting mutations
Workbox route matching intercepts all HTTP methods, which caused PUT/POST
requests (e.g. preferences updates) to be handled by the SW strategy
handler instead of passing through directly. Restrict API and attachment
cache rules to GET-only using function-based urlPattern.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 21:00:56 +01:00
github-actions[bot] 541f910564 chore: bump version to 0.21.4 2026-03-12 19:56:04 +00:00
Frederic CabassutandClaude Opus 4.6 27e59989b5 fix: register PWA service worker via virtual:pwa-register for offline support
@vite-pwa/sveltekit does not auto-inject SW registration into SSR HTML.
Add explicit registration via virtual:pwa-register in root layout onMount,
inject webmanifest link via virtual:pwa-info, disable SvelteKit's built-in
SW registration to avoid conflicts, and add required dependencies.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 20:53:38 +01:00
github-actions[bot] c949b40a20 chore: pin docker-compose to v0.21.3 [skip ci] 2026-03-12 19:24:11 +00:00
8 changed files with 46 additions and 6 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
services:
crumbs:
image: ghcr.io/bretzel-app/crumbs:0.21.2
image: ghcr.io/bretzel-app/crumbs:0.21.3
container_name: crumbs
ports:
- "3000:3000"
+3 -1
View File
@@ -1,7 +1,7 @@
{
"name": "crumbs",
"private": true,
"version": "0.21.3",
"version": "0.21.5",
"type": "module",
"license": "MIT",
"author": "Bretzel (https://bretzel.app)",
@@ -84,7 +84,9 @@
"typescript": "^5.9.3",
"vite": "^7.3.1",
"vite-plugin-istanbul": "^7.2.1",
"vite-plugin-pwa": "^1.2.0",
"vitest": "^3.2.4",
"workbox-window": "^7.4.0",
"yaml": "^2.8.2"
},
"pnpm": {
+6
View File
@@ -165,9 +165,15 @@ importers:
vite-plugin-istanbul:
specifier: ^7.2.1
version: 7.2.1(vite@7.3.1(@types/node@25.3.5)(jiti@2.6.1)(lightningcss@1.31.1)(terser@5.46.0)(tsx@4.21.0)(yaml@2.8.2))
vite-plugin-pwa:
specifier: ^1.2.0
version: 1.2.0(vite@7.3.1(@types/node@25.3.5)(jiti@2.6.1)(lightningcss@1.31.1)(terser@5.46.0)(tsx@4.21.0)(yaml@2.8.2))(workbox-build@7.4.0)(workbox-window@7.4.0)
vitest:
specifier: ^3.2.4
version: 3.2.4(@types/node@25.3.5)(jiti@2.6.1)(lightningcss@1.31.1)(terser@5.46.0)(tsx@4.21.0)(yaml@2.8.2)
workbox-window:
specifier: ^7.4.0
version: 7.4.0
yaml:
specifier: ^2.8.2
version: 2.8.2
+3
View File
@@ -1,3 +1,6 @@
/// <reference types="vite-plugin-pwa/info" />
/// <reference types="vite-plugin-pwa/vanillajs" />
// See https://svelte.dev/docs/kit/types#app.d.ts
// for information about these interfaces
declare global {
+23
View File
@@ -1,7 +1,30 @@
<script lang="ts">
import '../app.css';
import { onMount } from 'svelte';
import { pwaInfo } from 'virtual:pwa-info';
let { children } = $props();
onMount(async () => {
if (pwaInfo) {
const { registerSW } = await import('virtual:pwa-register');
registerSW({
immediate: true,
onRegistered(r: ServiceWorkerRegistration | undefined) {
console.log('SW Registered:', r);
},
onRegisterError(error: Error) {
console.log('SW registration error', error);
}
});
}
});
const webManifest = $derived(pwaInfo ? pwaInfo.webManifest.linkTag : '');
</script>
<svelte:head>
{@html webManifest}
</svelte:head>
{@render children()}
+4 -1
View File
@@ -5,7 +5,10 @@ const config = {
kit: {
adapter: adapter({
out: 'build'
})
}),
serviceWorker: {
register: false
}
}
};
+5 -2
View File
@@ -52,7 +52,9 @@ export default defineConfig({
}
},
{
urlPattern: /\/api\/notes\/.*\/attachments\?attachmentId=/,
urlPattern: ({ request, url }) =>
request.method === 'GET' &&
/\/api\/notes\/.*\/attachments\?attachmentId=/.test(url.href),
handler: 'CacheFirst',
options: {
cacheName: 'attachment-cache',
@@ -60,7 +62,8 @@ export default defineConfig({
}
},
{
urlPattern: /^https?:\/\/.*\/api\//,
urlPattern: ({ request, url }) =>
request.method === 'GET' && /\/api\//.test(url.pathname),
handler: 'NetworkFirst',
options: {
cacheName: 'api-cache',
+1 -1
View File
@@ -280,7 +280,7 @@
<li><a href="https://github.com/bretzel-app/crumbs/blob/main/docs/DEPLOYMENT.md" target="_blank" rel="noopener">Docs</a></li>
<li><a href="https://github.com/bretzel-app/crumbs/blob/main/LICENSE" target="_blank" rel="noopener">License</a></li>
</ul>
<span class="footer-version">v0.21.3</span>
<span class="footer-version">v0.21.5</span>
</div>
</footer>