Skip to content
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/components/Site/Site.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,6 @@ function Site(props) {
/>
<meta name="mobile-web-app-capable" content="yes" />
<link rel="icon" sizes="192x192" href="/icon_192x192.png" />
<link rel="icon" sizes="512x512" href="/icon_512x512.png" />
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont remove

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then it's causing error in network tab

Screenshot 2026-03-29 at 00 44 00

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it means that its missing in our dist folder, we need to add it back.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

restored the icon. Running fine locally, please review
Screenshot 2026-03-29 at 15 05 25

<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="apple-mobile-web-app-title" content="webpack" />
Expand Down
28 changes: 15 additions & 13 deletions src/sw.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
NetworkOnly,
StaleWhileRevalidate,
} from "workbox-strategies";
/* eslint-enable import/no-extraneous-dependencies */

const cacheName = cacheNames.runtime;

Expand All @@ -25,16 +24,23 @@ const otherManifest = [
url: "/app-shell/index.html",
},
];
const manifestURLs = [...manifest, ...otherManifest].map((entry) => {
const url = new URL(entry.url, self.location);
return url.href;
});
const manifestURLs = [
...new Set(
[...manifest, ...otherManifest].map((entry) => {
const url = new URL(entry.url, self.location);
return url.href;
}),
),
];
self.addEventListener("install", (event) => {
event.waitUntil(
Comment thread
ovflowd marked this conversation as resolved.
caches.open(cacheName).then((cache) => cache.addAll(manifestURLs)),
(async () => {
const cache = await caches.open(cacheName);

await Promise.allSettled(manifestURLs.map((url) => cache.add(url)));
})(),
Comment thread
ovflowd marked this conversation as resolved.
);
});

self.addEventListener("activate", (event) => {
// - [x] clean up outdated runtime cache
event.waitUntil(
Expand All @@ -52,7 +58,6 @@ self.addEventListener("activate", (event) => {
),
);
});

registerRoute(
({ url }) => manifestURLs.includes(url.href),
new NetworkFirst({
Expand Down Expand Up @@ -83,10 +88,7 @@ setDefaultHandler(new NetworkOnly());

// fallback to app-shell for document request
setCatchHandler(({ event }) => {
switch (event.request.destination) {
case "document":
return caches.match("/app-shell/index.html");
default:
return Response.error();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont remove the error handling please

if (event.request.destination === "document") {
return caches.match("/app-shell/index.html");
}
});
Loading