Phase 3: PWA service worker, Playwright e2e, 100% coverage and Angular removal - #575
Open
vibhaseshadri-cognition wants to merge 8 commits into
Conversation
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>
…evin/1786020546-react-phase3-pwa-cleanup
…-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 EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Final phase of the Angular → React migration: the React app moves from
web/to the repo root, the Angular app and itstoolchain 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-pwareplaces the Angular service worker; the manifest is expressed inline invite.config.tswith the same fields
src/manifest.jsonhad (name, fourandroid-chrome-*icons,#b92b27theme colour, standalone /portrait,
./?utm_source=web_app_manifeststart url). Workbox precaches the app shell and adds runtime caching for theAPI:
index.htmlregains the full Angular head (description, OG/twitter cards, theme-color, msapplication tiles, apple-touchicons, mask-icon, the
#skiplink,.app-loadersplash and the<noscript>fallback) plus the inline Google Analyticssnippet that
App.tsx's pageview tracking calls into.E2E. Protractor is replaced by Playwright (
e2e/app.spec.ts) running against the production build viavite preview. Everynode-hnapi.herokuapp.comrequest is fulfilled frome2e/fixtures.ts, so the suite isdeterministic and works offline; it covers the
/→/news/1redirect, 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, andthe settings modal incl. theme switching persisted across a reload.
Coverage.
npm run test:coverageis now 100% statements/branches/functions/lines oversrc/. Four tests were addedfor the last gaps: a feed response that resolves after unmount,
UserPageon a route without an:id, a poll whosepoll_votes_countis missing, and switching the theme back todefault.Angular removal. Deleted
src/app,e2e/(Protractor),angular.json,karma.conf.js,ngsw-config.json,tslint.json,browserslist, the Angulartsconfig*.json,yarn.lock,.travis.ymland the rootpackage.json(
@angular/*,rxjs,zone.js,unfetch, Karma/Jasmine).web/*moved up to the root, sonpm ci && npm run devworks from a fresh clone and
firebase.json'spublic: distkeeps pointing at the Vite output. CI now runslint/test/build plus a second
e2ejob; 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