Skip to content

feat: Migrate Angular 9 Hacker News app to React with Vite + TypeScript#171

Open
devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
devin/1771016867-migrate-angular-to-react
Open

feat: Migrate Angular 9 Hacker News app to React with Vite + TypeScript#171
devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
devin/1771016867-migrate-angular-to-react

Conversation

@devin-ai-integration
Copy link

@devin-ai-integration devin-ai-integration bot commented Feb 13, 2026

feat: Migrate Angular 9 Hacker News app to React 18 + Vite

Summary

Complete rewrite of the Angular 9 Hacker News client to React 18 with Vite and TypeScript. All Angular constructs are replaced with React equivalents:

  • Framework: Angular 9 → React 18 with functional components and hooks
  • Build: Angular CLI → Vite with vite-plugin-pwa for service worker support
  • Routing: Angular Router → React Router v6 with React.lazy() / Suspense for code-splitting (ItemDetails, UserProfile)
  • Data fetching: RxJS Observables → async/await with fetch
  • State: Angular Services + DI → React Context API (SettingsContext with useSettings hook)
  • Styles: SCSS files preserved and migrated; theme system (default/night/amoledblack) kept intact
  • Static assets: Moved from src/assets to public/ per Vite conventions

Deleted all Angular-specific files (angular.json, polyfills, e2e/protractor, zone.js, karma, tslint, ngsw-config, etc.) and replaced yarn.lock with package-lock.json.

Local Testing Screenshots

News Feed (/news/1) — numbered list, pagination, header with nav links and settings gear:
News Feed

Item Details (/item/:id) — story metadata with nested, collapsible comment threads:
Item Details

Review & Testing Checklist for Human

This is a full framework rewrite (113 files changed). Careful manual review is essential.

  • Verify feed navigation — run npm install && npm run dev, open http://localhost:5173, and confirm all feed types (news, newest, show, ask, jobs) load with correct data, pagination, and scroll-to-top behavior
  • Test theme switching — open the settings panel (gear icon), switch between default / night / amoledblack themes, and confirm styles apply correctly across all pages
  • Test item details & comments — click into a story, verify nested comments render with collapse/expand ([-]/[+]) functionality and dangerouslySetInnerHTML renders content safely
  • Test user profile page — click a username; note that during testing the external API (node-hnapi.herokuapp.com/user/:id) returned 404 for all users. Verify whether this is also broken on the original Angular app or a regression
  • Verify PWA — run npm run build && npm run preview, check DevTools → Application for the service worker registration and manifest

Recommended test plan: npm install && npm run dev, navigate all feed types, click into a story with comments, toggle all 3 themes, adjust font size / list spacing in settings, then try the user profile link.

Notes

  • Build passes TypeScript strict-mode compilation and Vite production bundling; CI (Snyk security + license) passes
  • SCSS shows deprecation warnings for @import rules (Dart Sass 3.0 migration needed in future) — not errors
  • dangerouslySetInnerHTML usage for comment/item content mirrors the original Angular [innerHTML] binding
  • No automated tests are included (old Protractor e2e tests were removed with Angular)

Link to Devin run: https://app.devin.ai/sessions/4aa1f0dc3dde4fe1a714706107fa5861
Requested by: @eashansinha

- Replace Angular framework with React 18 + React Router v6
- Convert Angular services to async/await utility functions
- Convert SettingsService to React Context API with useSettings hook
- Convert all Angular components to React functional components
- Replace RxJS Observables with fetch + async/await
- Set up Vite build system with TypeScript strict mode
- Implement lazy loading for ItemDetails and UserProfile routes
- Set up PWA with vite-plugin-pwa (Workbox)
- Migrate all SCSS styles preserving theme system (default/night/AMOLED)
- Move static assets to public/ directory per Vite conventions

Co-Authored-By: Eashan Sinha <eashan.sinha@codeium.com>
@devin-ai-integration
Copy link
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 and CI 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