Skip to content

Phase 3: PWA service worker, Playwright e2e, 100% coverage and Angular removal - #575

Open
vibhaseshadri-cognition wants to merge 8 commits into
devin/1785951605-react-phase1-scaffoldfrom
devin/1786020546-react-phase3-pwa-cleanup
Open

Phase 3: PWA service worker, Playwright e2e, 100% coverage and Angular removal#575
vibhaseshadri-cognition wants to merge 8 commits into
devin/1785951605-react-phase1-scaffoldfrom
devin/1786020546-react-phase3-pwa-cleanup

Conversation

@vibhaseshadri-cognition

@vibhaseshadri-cognition vibhaseshadri-cognition commented Aug 6, 2026

Copy link
Copy Markdown

Summary

Final phase of the Angular → React migration: the React app moves from web/ to the repo root, the Angular app and its
toolchain are deleted, and the PWA + e2e story is restored on the React stack.

This branch is based on Phase 1 (#570) and already contains the four Phase 2 ports (#571 #572 #573 #574) merged in, so
its diff shrinks to just the Phase 3 work once those land.

PWA. vite-plugin-pwa replaces the Angular service worker; the manifest is expressed inline in vite.config.ts
with the same fields src/manifest.json had (name, four android-chrome-* icons, #b92b27 theme colour, standalone /
portrait, ./?utm_source=web_app_manifest start url). Workbox precaches the app shell and adds runtime caching for the
API:

navigateFallback: 'index.html',
runtimeCaching: [{
    urlPattern: /^https:\/\/node-hnapi\.herokuapp\.com\/.*$/,
    handler: 'NetworkFirst',
    options: { cacheName: 'hn-api', networkTimeoutSeconds: 10, expiration: { maxEntries: 100, maxAgeSeconds: 86400 } },
}]

index.html regains the full Angular head (description, OG/twitter cards, theme-color, msapplication tiles, apple-touch
icons, mask-icon, the #skip link, .app-loader splash and the <noscript> fallback) plus the inline Google Analytics
snippet that App.tsx's pageview tracking calls into.

E2E. Protractor is replaced by Playwright (e2e/app.spec.ts) running against the production build via
vite preview. Every node-hnapi.herokuapp.com request is fulfilled from e2e/fixtures.ts, so the suite is
deterministic and works offline; it covers the //news/1 redirect, feed navigation from the header, pagination
(start=31, prev/More visibility), opening an item and collapsing a nested comment, opening a user from a comment, and
the settings modal incl. theme switching persisted across a reload.

Coverage. npm run test:coverage is now 100% statements/branches/functions/lines over src/. Four tests were added
for the last gaps: a feed response that resolves after unmount, UserPage on a route without an :id, a poll whose
poll_votes_count is missing, and switching the theme back to default.

Angular removal. Deleted src/app, e2e/ (Protractor), angular.json, karma.conf.js, ngsw-config.json,
tslint.json, browserslist, the Angular tsconfig*.json, yarn.lock, .travis.yml and the root package.json
(@angular/*, rxjs, zone.js, unfetch, Karma/Jasmine). web/* moved up to the root, so npm ci && npm run dev
works from a fresh clone and firebase.json's public: dist keeps pointing at the Vite output. CI now runs
lint/test/build plus a second e2e job; README and CONTRIBUTING describe the React stack.

Verified locally: npm run lint, npm test (104 passing), npm run build, npm run test:e2e (6 passing).

Link to Devin session: https://app.devin.ai/sessions/6382e57ba3ff4a388ee6e9bd0ad2d37d
Requested by: @vibhaseshadri-cognition


Devin Review

Status Commit
⚪ Not started

Run Devin Review

💡 Connect your GitHub account to enable automatic code reviews.

Open in Devin Review (Staging)

devin-ai-integration Bot and others added 8 commits August 6, 2026 12:45
Co-Authored-By: Vibha  Seshadri <vibha.seshadri@cognition.ai>
Co-Authored-By: Vibha  Seshadri <vibha.seshadri@cognition.ai>
…l to React

Co-Authored-By: Vibha  Seshadri <vibha.seshadri@cognition.ai>
…t (Phase 2c)

Co-Authored-By: Vibha  Seshadri <vibha.seshadri@cognition.ai>
…-details' into devin/1786020546-react-phase3-pwa-cleanup
…nto devin/1786020546-react-phase3-pwa-cleanup
… Angular removal

Adds vite-plugin-pwa (Workbox app shell + NetworkFirst caching of the HN API), ports the index.html head and Google Analytics snippet, replaces the Protractor e2e with a fixture-driven Playwright suite, closes the remaining coverage gaps, and removes the Angular app now that the React port is at parity (the app moves from web/ to the repo root).
@devin-ai-integration

Copy link
Copy Markdown

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

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.

1 participant