Skip to content

feat(pwa): rebuild service worker on Serwist with offline page and update flow - #130

Merged
yashiels merged 1 commit into
mainfrom
agent/pwa-pr2-serwist
Sep 10, 2026
Merged

yashiels merged 1 commit into
mainfrom
agent/pwa-pr2-serwist

Conversation

@yashiels

Copy link
Copy Markdown
Owner

Closes #129

PR2 of the Oracle-approved PWA plan (docs/pwa-plan.md).

What

  • Replace handwritten public/sw.js with Serwist 10 built via @serwist/build injectManifest + esbuild (scripts/build-sw.mjs, runs after next build)
  • Routing policy per plan: analytics/vidsrc origins + RSC Flight requests + TMDB API = NetworkOnly; static /_next assets cache-first; TMDB images cache-first bounded (300 entries, 14 days, statuses [0,200]); navigation fallback to /offline
  • Static /offline page (OfflineClient + styles)
  • Update flow: skipWaiting:false / clientsClaim:true, armed-reload UpdateToast on waiting worker + SKIP_WAITING message channel, sw.js served with updateViaCache:no-store registration
  • Old cache cleanup on activate (skystream-v1 legacy)
  • eslint: built public/sw.js ignored, VIDSRC_ORIGIN build global declared for src/sw

Verification

  • pnpm test: 26 suites, 363 passed (53 new SW tests)
  • pnpm run lint: 0 errors, 4 pre-existing warnings
  • pnpm build: succeeds, [build-sw] wrote public/sw.js (14 precached URLs)
  • git diff origin/main: zero added comments

@yashiels
yashiels merged commit ec0b005 into main Sep 10, 2026
2 of 3 checks passed
@yashiels
yashiels deleted the agent/pwa-pr2-serwist branch September 10, 2026 21:33

@sentinel-skyner sentinel-skyner Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛡️ Sentinel review

Found 1 clear maintainability issue.

1 inline comment below.

Automated review via cursorbridge:gpt-5.3-codex. Findings only — not an approval. Push new commits to re-review.

Comment thread .gitignore

# Generated by scripts/build-sw.mjs during `pnpm build`
public/sw.js

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛡️ Low public/sw.js is marked as generated/ignored, but this PR still modifies that file as a tracked artifact. .gitignore does not apply to already tracked files, so builds will continue to produce churn in git and can cause accidental commits of regenerated output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(pwa): PR2 service worker rebuild on Serwist + offline page

1 participant