Skip to content

React migration phase 6: PWA service worker and manifest, Angular removal, deploy and docs - #871

Closed
vibhaseshadri-cognition wants to merge 4 commits into
devin/1791295373-react-phase5-userfrom
devin/1791295423-react-phase6-pwa
Closed

vibhaseshadri-cognition wants to merge 4 commits into
devin/1791295373-react-phase5-userfrom
devin/1791295423-react-phase6-pwa

Conversation

@vibhaseshadri-cognition

Copy link
Copy Markdown

Summary

Last phase of the Angular → React migration: the React app takes over PWA/offline support, the deploy and the docs, and the Angular app is removed. Stacked on Phase 5 (#870).

PWA (react/vite.config.ts, vite-plugin-pwa + Workbox), mapped from ngsw-config.json:

ngsw-config React
app group, installMode: prefetch (index.html, favicon, *.css, *.js) precache globPatterns: ['index.html', 'favicon.ico', '**/*.{js,css}']
assets group, installMode: lazy, updateMode: prefetch (/assets/**, images/fonts) runtime StaleWhileRevalidate cache assets, same-origin, same extensions
navigationUrls → index.html navigateFallback: '/index.html'
  • src/manifest.json → generated manifest.webmanifest (same icons, theme_color #b92b27, display: standalone, orientation: portrait, start_url), name changed to "React HN". Registered with registerType: 'autoUpdate' and a deferred registerSW.js, like Angular's registerWhenStable.
  • New e2e/pwa.spec.ts: checks the manifest is served, waits for the service worker to activate, then goes offline and checks that a reload and client-side navigation still render the shell.

Angular removal: src/, e2e/ (Protractor), angular.json, karma.conf.js, ngsw-config.json, tslint.json, the root tsconfigs, browserslist, the root package.json and yarn.lock.

  • firebase.json now serves react/dist with the SPA rewrite, and sends sw.js with no-cache so service worker updates reach clients.
  • .travis.yml (deploy only) runs Node 20, builds react/ and deploys to Firebase. Lint, unit tests and e2e run in the GitHub Actions React CI workflow.
  • README.md and CONTRIBUTING.md are rewritten for the React app.
  • react/src/setupTests.ts stubs window.scrollTo, which jsdom doesn't implement. This removes the "Not implemented" noise from the route tests.

Not ported: the Universal Analytics snippet (UA-…). Google has shut down Universal Analytics. Page-view tracking (usePageViews) only fires when a ga global exists, so a GA4 tag can be added later.

Checks run locally on this branch: format, lint, typecheck, 136 unit tests (100% coverage), build, and 35 Playwright tests.

Devin-Org: engineering

Link to Devin session: https://app.devin.ai/sessions/89cdada34e094c0b8a61fae52bf25e08
Open in Devin Desktop: https://app.devin.ai/desktop/session/89cdada34e094c0b8a61fae52bf25e08?variant=devin
Requested by: @vibhaseshadri-cognition

@devin-ai-integration

Copy link
Copy Markdown

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

devin-ai-integration Bot and others added 4 commits October 6, 2026 14:54
…g ngsw-config (migration phase 6)

Co-Authored-By: Vibha  Seshadri <vibha.seshadri@cognition.ai>
…s (migration phase 6)

Co-Authored-By: Vibha  Seshadri <vibha.seshadri@cognition.ai>
Co-Authored-By: Vibha  Seshadri <vibha.seshadri@cognition.ai>
…ed up (migration phase 6)

Co-Authored-By: Vibha  Seshadri <vibha.seshadri@cognition.ai>
@devin-ai-integration
devin-ai-integration Bot force-pushed the devin/1791295373-react-phase5-user branch from 3c494cd to 6dbadd5 Compare October 6, 2026 14:54
@devin-ai-integration
devin-ai-integration Bot force-pushed the devin/1791295423-react-phase6-pwa branch from 1b5439f to 125d631 Compare October 6, 2026 14:54
@devin-ai-integration

Copy link
Copy Markdown
React HN end-to-end UI test (production preview, HEAD 125d631)

This covers the whole stack, #867 through #871. It was tested in a browser against the npm run build && npm run preview build, with live HN API data. No migration regressions were found. Every step below passed:

  • Feeds:
    • Navigation between feeds and active-link highlighting.
    • Pagination: page 2 starts at 31, and Prev returns to page 1.
    • Jobs-specific rendering.
  • Story pages:
    • External and internal title links.
    • Nested comments with collapse and expand.
    • Back navigation.
    • The error state for /item/abc.
  • Settings dialog:
    • Themes, title font size and list spacing, persisted across a reload.
    • The new-tab setting.
    • Keyboard: focus moves into the dialog, Tab stays inside it, and Escape closes it and returns focus to the cog.
  • Unknown URLs (/news, /foo/bar) keep the shell. The skip link focuses nav#navigation.
  • At a 375px width, the mobile metadata and back controls appear and work.
  • PWA:
    • The manifest is served (React HN, 4 icons) and the service worker activates.
    • Offline, a reload and client-side navigation still render the shell.
    • Feeds recover once back online.
Desktop feed Mobile comments
Feed pagination Mobile comments and back control
Persisted settings Offline client-side navigation
Settings retained after reload Offline shell and feed error
API caveats
  • The live node-hnapi /user/<id> endpoint returns a 404, so the profile page shows its error state against live data. The populated profile below was checked against a stubbed response.
  • The ask feed returned 13 items, which is what the API sent.
  • Offline checks were run with the HTTP cache disabled, so only the service worker cache was in play.

Stubbed profile

Written by Devin

@devin-ai-integration

Copy link
Copy Markdown

Closing as part of the nightly demo-repo reset — reopen if this demo artifact is still needed.

@devin-ai-integration
devin-ai-integration Bot deleted the devin/1791295423-react-phase6-pwa branch October 26, 2026 12:11
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