-
-
Couldn't load subscription status.
- Fork 34
Upgrade project to Angular 18 #3473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
WalkthroughUpgrades Angular-related dependencies from 17.x to 18.2.x, updates rxjs/tslib/zone.js versions, revises Browserslist targets, and migrates Angular CLI configuration: switches builder to application, renames targets from browserTarget to buildTarget, updates entry points and polyfills, and adjusts build budgets and flags. Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as Developer
participant CLI as Angular CLI
participant Builder as Build System (application)
participant Browser as Browser
Dev->>CLI: ng serve / ng build (Angular 18)
CLI->>Builder: buildTarget (application) with browser entry & polyfills[]
Note over Builder: Uses updated budgets and flags
Builder-->>CLI: Build artifacts
CLI-->>Browser: Serve application
Note over Browser: Targets per updated .browserslistrc
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
testapps/ngx/angular.json (1)
200-207: Critical: Incomplete migration from browserTarget to buildTarget.The prerender configuration still uses the deprecated
browserTargetproperty (lines 201 and 205) instead ofbuildTarget. This inconsistency will cause build failures or warnings in Angular 18.Apply this diff to complete the migration:
"configurations": { "stage": { - "browserTarget": "sampleapp:build:stage", + "buildTarget": "sampleapp:build:stage", "serverTarget": "sampleapp:server:stage" }, "development": { - "browserTarget": "sampleapp:build:development", + "buildTarget": "sampleapp:build:development", "serverTarget": "sampleapp:server:development" } },
🧹 Nitpick comments (1)
testapps/ngx/package.json (1)
42-42: Consider version range consistency for ng-packagr.This file uses an exact version
18.2.1for ng-packagr, whilepackages/ngx/package.jsonuses^18.2.1. While not critical, consider using consistent version ranges across the monorepo unless there's a specific reason for the exact pinning in the test app.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
package-lock.jsonis excluded by!**/package-lock.jsonpnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (4)
packages/ngx/package.json(2 hunks)testapps/ngx/.browserslistrc(1 hunks)testapps/ngx/angular.json(3 hunks)testapps/ngx/package.json(1 hunks)
🔇 Additional comments (8)
packages/ngx/package.json (2)
22-33: LGTM! Consistent Angular 18 upgrade.All Angular core dependencies are consistently upgraded to version 18.2.14, and the supporting libraries (rxjs, tslib, zone.js) are updated to compatible versions.
36-51: LGTM! Build tooling properly upgraded.The Angular CLI, build tools, and ng-packagr are all consistently upgraded to version 18.x, aligning with the framework upgrade.
testapps/ngx/.browserslistrc (1)
8-18: LGTM! Modernized browser support matrix.The updated Browserslist configuration aligns with Angular 18's recommended browser support, appropriately dropping IE 11 and focusing on recent versions of modern browsers.
testapps/ngx/package.json (1)
18-33: LGTM! Consistent Angular 18 upgrade.All Angular dependencies are properly upgraded to version 18.2.14 with supporting libraries updated to compatible versions.
testapps/ngx/angular.json (4)
22-22: LGTM! Migrated to Angular 18 application builder.The migration from
browsertoapplicationbuilder is correct for Angular 18 and enables the new esbuild-based build system.
26-27: LGTM! Entry points updated correctly.The renaming of
maintobrowserand conversion ofpolyfillsto an array format aligns with the Angular 18 application builder requirements.
55-61: Verify the stricter bundle budgets are appropriate.The budget limits have been significantly tightened:
- Initial: 500KB warning / 1MB error (previously likely 2MB)
- Component styles: 2KB warning / 4KB error (previously likely 6KB)
While stricter budgets promote better performance, ensure these limits align with your actual bundle sizes and won't cause false positives during development. Test the build to confirm these thresholds are achievable.
94-111: LGTM! Build target references updated.The
browserTargetreferences have been correctly renamed tobuildTargetin the serve and extract-i18n configurations, aligning with Angular 18 conventions.
Summary by CodeRabbit
Chores
Refactor
Notes