Skip to content

feature: PR 8/8 — Vite PWA, deploy config and Angular removal - #705

Open
devin-ai-integration[bot] wants to merge 1 commit into
devin/react-migration-07-userfrom
devin/react-migration-08-pwa-cutover
Open

feature: PR 8/8 — Vite PWA, deploy config and Angular removal#705
devin-ai-integration[bot] wants to merge 1 commit into
devin/react-migration-07-userfrom
devin/react-migration-08-pwa-cutover

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Aug 26, 2026

Copy link
Copy Markdown

Summary

Final PR of the Angular→React migration: React reaches parity, so Angular is deleted. src/app/, main.ts, polyfills.ts, test.ts, environments/, angular.json, ngsw-config.json, both Angular tsconfigs, karma.conf.js, tslint.json and e2e/ are gone, along with every @angular/*, zone.js, rxjs, rxjs-compat, unfetch, node-fetch, karma/jasmine/protractor/tslint/codelyzer dependency. tsconfig.react.json is promoted to tsconfig.json and the typescript5 npm alias becomes a plain typescript ^5. Also removed the stale yarn.lock (Angular-era, unused — the repo builds from package-lock.json).

Three things a reviewer should look at closely:

Static assets moved into Vite's public dir. angular.json's assets array was the only thing copying src/assets, src/favicon.ico and src/manifest.json into the build, and it's deleted here. They're git mv'd to src/public/… (Vite's default public dir, since root is src), which keeps every existing relative URL in index.htmlassets/icons/…, favicon.ico, /manifest.json — resolving unchanged in both dev and build.

The splash loader now keys off the React root. src/styles.scss hid the static .app-loader via app-root:empty + .app-loader; with <app-root> gone that selector never matches and the splash would sit on screen forever:

-app-root:empty + .app-loader { opacity: 1; z-index: 100; }
+#root:empty + .app-loader { opacity: 1; z-index: 100; }

PWA via vite-plugin-pwa (pinned 1.3.0), production-only, replacing ServiceWorkerModule.register('ngsw-worker.js'):

VitePWA({
  registerType: 'autoUpdate',   // closest match to ngsw's update-on-next-load
  manifest: false,              // keep the hand-written manifest.json + its <link>
  workbox: {
    globPatterns: ['**/*.{html,js,css,eot,svg,cur,jpg,png,webp,gif,otf,ttf,woff,woff2,ani}'],
    navigateFallback: '/index.html',   // deep links offline, as ngsw's `index` did
  },
})

manifest: false is deliberate — the existing hand-written manifest is ported as-is rather than regenerated, so the plugin doesn't emit a competing webmanifest. Two Angular service-worker leftovers in index.html are dropped: a <link rel="manifest" href="manifest.webmanifest"> pointing at a file that doesn't exist, and a duplicate theme-color meta that contradicted the real #b92b27 one. The React entry <script type="module" src="/main.tsx"> is now committed directly in index.html, so the transformIndexHtml shim that existed only to hide .tsx from the Angular CLI is gone.

Deploy: build.outDir: '../dist' puts output at repo-root dist/, which is already what firebase.json serves and what .gitignore ignores — no change needed to either. .travis.yml goes from Node 6.9 to 20 (Vite 6 requires modern Node) and drops the global @angular/cli install; the firebase deploy step is untouched.

Scripts are now dev/startvite, buildvite build, previewvite preview, typechecktsc --noEmit.

Verification

Clean npm install, npm run typecheck and npm run build all pass, and no @angular/zone.js/rxjs reference survives outside package-lock.json. Everything below was checked against vite preview of the production build, so the service worker was active:

All five feeds + pagination (/news/2<ol start="31">, Prev/More correct), item comment tree (73 comments), ask body HTML, poll 126809 with proportional bars, all three themes plus font-size/spacing/new-tab settings persisting across reload.

feed

item with comments

poll

themes and settings

Service worker activated and controlling the page:

service worker

Manifest parsed with the ported name, #b92b27 theme color, standalone display and icons:

manifest

Offline reload of a previously-visited route serving from cache:

offline reload

Known pre-existing gap, unrelated to the migration: /user/:id renders its error state because upstream node-hnapi has dropped that endpoint (GET /user/pgCannot GET /user/pg while /news?page=1 is 200). The Angular app is equally affected today; moving to another data source is a separate decision.

Devin-Org: engineering

Link to Devin session: https://app.devin.ai/sessions/e6419ebe67ff4f749fe1573a8e26cd07
Requested by: @abboudp


Note

Devin errored when opening this Pull Request as abboudp.
As a fallback, Devin opened this PR as itself.


Devin Review

Status Commit
⚪ Not started

Run Devin Review

Devin Review (Staging)

Co-Authored-By: Paul Abboud <abboudpaul112@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 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.

0 participants