Modernize: upgrade Angular 9 → 17 (standalone, esbuild, RxJS 7, ESLint, GitHub Actions)#299
Open
devin-ai-integration[bot] wants to merge 17 commits into
Open
Modernize: upgrade Angular 9 → 17 (standalone, esbuild, RxJS 7, ESLint, GitHub Actions)#299devin-ai-integration[bot] wants to merge 17 commits into
devin-ai-integration[bot] wants to merge 17 commits into
Conversation
Co-Authored-By: Eddie Mattout <eddie.mattout@cognition.ai>
Co-Authored-By: Eddie Mattout <eddie.mattout@cognition.ai>
…ling) Co-Authored-By: Eddie Mattout <eddie.mattout@cognition.ai>
Co-Authored-By: Eddie Mattout <eddie.mattout@cognition.ai>
…a ng update (feature: angular upgrade) Co-Authored-By: Eddie Mattout <eddie.mattout@cognition.ai>
Co-Authored-By: Eddie Mattout <eddie.mattout@cognition.ai>
Co-Authored-By: Eddie Mattout <eddie.mattout@cognition.ai>
Co-Authored-By: Eddie Mattout <eddie.mattout@cognition.ai>
Co-Authored-By: Eddie Mattout <eddie.mattout@cognition.ai>
Co-Authored-By: Eddie Mattout <eddie.mattout@cognition.ai>
…fills (feature: angular upgrade) Co-Authored-By: Eddie Mattout <eddie.mattout@cognition.ai>
… tslib/@types/node, add prettier (feature: deps) Co-Authored-By: Eddie Mattout <eddie.mattout@cognition.ai>
…ature: linting) Co-Authored-By: Eddie Mattout <eddie.mattout@cognition.ai>
…iceWorker, loadComponent lazy routes (feature: standalone) Co-Authored-By: Eddie Mattout <eddie.mattout@cognition.ai>
…est polyfills, add CommentPipe specs Co-Authored-By: Eddie Mattout <eddie.mattout@cognition.ai>
Co-Authored-By: Eddie Mattout <eddie.mattout@cognition.ai>
…asminewd2 (Protractor types) Co-Authored-By: Eddie Mattout <eddie.mattout@cognition.ai>
Author
🤖 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
End-to-end modernization of this Hacker News PWA from Angular 9.0 → 17.3, executed as a phased orchestration (core upgrade as the critical path; CI/CD, deps, RxJS, lint, standalone, and modern-syntax work folded in at their dependency milestones). Final state builds, lints, and tests green.
Result: production build
287 kB / 78 kB gzip(was ~340 kB),npm run lint0 errors,npm test3 passing.What changed
ng updateone major at a time (10→11→12→13→14→15→16→17). Switched the build to the Angular 17 esbuildapplicationbuilder:browserbuilder →application,main→browser, polyfills inlined ("polyfills": ["zone.js"]),src/polyfills.tsdeleted,outputPathobject form, service worker wired via config path.unfetch(nativefetch) and unusednode-fetch;@types/node12→20;tslib→^2.6; addedprettier; droppedyarn.lock(standardized on npm); added.npmrclegacy-peer-deps=truefor the upgrade installs.rxjs-compat, fixed deep imports (rxjs/Observable,rxjs/Subscription→rxjs). The "not ESM" CommonJS warning is gone.angular-eslint. New.eslintrc.json,ng linttarget,tslint.jsonremoved. Fixed all lint errors (empty lifecycle hooks, unused vars via object-formsubscribe({ next, error }),Functiontype,(data as any)→ index access,itemselector →app-item). The two template a11y rules (click-events-have-key-events,interactive-supports-focus) are set towarnrather than rewriting every interaction handler — surfaced, not blocking.@angular/core:standalonemigration (convert → prune modules → bootstrap). All*.module.tsremoved;main.tsnow usesbootstrapApplicationwithprovideRouter+provideServiceWorker; lazy routes useloadComponent(item/:id,user/:id).AppComponentimportsHeaderComponent/FooterComponent(the schematic missed these since they came viaCoreModule).@angular/core:control-flow— all*ngIf/*ngFor→@if/@for; blanketCommonModulereplaced with granular imports (NgStyle,CommentPipe, …)..github/workflows/ci.yml:npm ci→ lint → test → prod build on Node 20).Test setup fix (worth a look)
Removing
polyfills.tsbroke the Karma test context (ReferenceError: Zone is not defined). Fixed by adding"polyfills": ["zone.js", "zone.js/testing"]to thetesttarget and dropping the manualimport 'zone.js/testing'fromtest.ts. Added aChromeHeadlessNoSandboxlauncher for CI containers and aCommentPipespec (the repo previously had zero specs, which made Karma exit non-zero on an empty suite).Notes / follow-ups
e2eis left in place (removed only the obsolete@types/jasminewd2); swapping to Playwright/Jest was listed as optional and is out of scope here.npm ci.Link to Devin session: https://app.devin.ai/sessions/49a846b2263445d298332bb02df7ef47
Requested by: @eddiemattout-cog
Devin Review
0a3f727