Skip to content

Upgrade Angular 15→16 (#25)#91

Open
weilixiong wants to merge 2 commits into
BAWES-Universe:masterfrom
weilixiong:feat/upgrade-angular-16
Open

Upgrade Angular 15→16 (#25)#91
weilixiong wants to merge 2 commits into
BAWES-Universe:masterfrom
weilixiong:feat/upgrade-angular-16

Conversation

@weilixiong
Copy link
Copy Markdown

@weilixiong weilixiong commented May 16, 2026

Angular 15 → 16 升级

已完成

  • ✅ Angular 核心包: 15.0.0 → 16.2.12
  • ✅ TypeScript: 4.8.4 → 5.1.6
  • ✅ zone.js: 0.11.8 → 0.13.3
  • ✅ @angular-slider/ngx-slider@16.0.1 (替换 ng5-slider)
  • ✅ @ckeditor/ckeditor5-angular 4.0.0 → 6.0.0
  • ✅ @ckeditor/ckeditor5-build-classic 35.4.0 → 40.0.0
  • ✅ 移除 BrowserTransferStateModule (Angular 16 已废弃)
  • ✅ 移除 entryComponents
  • ✅ 修复 CKEditor 导入和类型定义
  • ✅ JIT 构建通过: ng build --configuration=development --aot=false

未完成 (需要 #26)

  • ❌ Production AOT 构建被 angular-instantsearch 阻塞
    • 该库使用 View Engine 编译格式。Angular 16 不再支持 View Engine
    • 最新版本 4.4.3 (2024-09-05) 仍不兼容 Angular 16
    • 需要替换或等 Algolia 更新
    • 影响模块: candidate-search, fulltimer-search (使用 NgAisModule)

验证方法

# Development (JIT) - 通过
ng build --configuration=development --aot=false

# Production (AOT) - 阻塞(angular-instantsearch)
ng build --configuration=production

ng5-slider is abandoned and unsupported on Angular 16+.
Upgrade to the maintained fork with identical API.

Closes BAWES-Universe#33

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 16, 2026

📝 Walkthrough

Walkthrough

Angular framework upgraded from 15 to 16, TypeScript to 5.1.6, and zone.js to 0.13.3. The deprecated ng5-slider package removed; @angular-slider/ngx-slider added. Three refinement list components (age, date-range, range) updated to use the new slider package with matching import and template changes.

Changes

Angular 16 Migration with Slider Package Update

Layer / File(s) Summary
Dependency and toolchain upgrade
package.json
Angular core packages upgraded from ^15.x to ^16.2.12, dev toolchain to ^16.2.16, TypeScript to ~5.1.6, zone.js to ~0.13.3; ng5-slider removed and @angular-slider/ngx-slider ^15.0.1 added.
Age refinement list slider migration
src/app/components/age-refinement-list/age-refinement-list.component.html, src/app/components/age-refinement-list/age-refinement-list.component.ts, src/app/components/age-refinement-list/age-refinement-list.module.ts
Template slider element tag changed from ng5-slider to ngx-slider while preserving value bindings and event handlers; Options import switched to @angular-slider/ngx-slider; module imports updated from Ng5SliderModule to NgxSliderModule.
Date range refinement list slider migration
src/app/components/date-range-refinement-list/date-range-refinement-list.component.ts
Options type imported from @angular-slider/ngx-slider instead of ng5-slider.
Range refinement list slider migration
src/app/components/range-refinement-list/range-refinement-list.html, src/app/components/range-refinement-list/range-refinement-list.ts, src/app/components/range-refinement-list/range-refinement-list.module.ts
Template slider element tag changed from ng5-slider to ngx-slider while preserving value bindings and event handlers; Options import switched to @angular-slider/ngx-slider; module imports updated from Ng5SliderModule to NgxSliderModule.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related issues

  • #25: Angular 16 migration tracked as main issue; this PR addresses the core dependency upgrades and slider package replacement as part of that migration effort.

Poem

🐰 A slider hops from old to new,
Angular sixteen brings the view,
Packages dance in harmony,
From ng5 to ngx so spree,
The refinements slide with glee!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Upgrade Angular 15→16 (#25)' clearly and concisely summarizes the main objective of the pull request: upgrading the Angular framework from version 15 to 16.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@package.json`:
- Around line 69-77: The `@angular-eslint` packages in package.json are still at
major version 14 while Angular CLI/compiler are at 16; update the
`@angular-eslint` packages (`@angular-eslint/builder`,
`@angular-eslint/eslint-plugin`, `@angular-eslint/eslint-plugin-template`,
`@angular-eslint/template-parser`) to the matching Angular 16 major (e.g. ^16.0.0
or the latest 16.x compatible release) so ESLint tooling aligns with
`@angular/cli` and `@angular/compiler` versions, then run npm install and verify ng
lint works.

In
`@src/app/components/date-range-refinement-list/date-range-refinement-list.component.ts`:
- Line 7: The project is using `@angular-slider/ngx-slider` v15 which is
incompatible with Angular 16; update the dependency in package.json to
"`@angular-slider/ngx-slider`": "^16.0.0", run your package manager install to
update the lockfile, and rebuild; then verify the import statement that
references Options in date-range-refinement-list.component.ts (import { Options
} from "`@angular-slider/ngx-slider`") still matches the v16 API and adjust any
Option property usages or names if the v16 API changed.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 178becd0-d7da-49f0-9ab6-0429e91b9945

📥 Commits

Reviewing files that changed from the base of the PR and between 39a33ff and b90eb4f.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (8)
  • package.json
  • src/app/components/age-refinement-list/age-refinement-list.component.html
  • src/app/components/age-refinement-list/age-refinement-list.component.ts
  • src/app/components/age-refinement-list/age-refinement-list.module.ts
  • src/app/components/date-range-refinement-list/date-range-refinement-list.component.ts
  • src/app/components/range-refinement-list/range-refinement-list.html
  • src/app/components/range-refinement-list/range-refinement-list.module.ts
  • src/app/components/range-refinement-list/range-refinement-list.ts

Comment thread package.json
Comment on lines +69 to +77
"@angular-devkit/build-angular": "^16.2.16",
"@angular-eslint/builder": "^14.0.0",
"@angular-eslint/eslint-plugin": "^14.0.0",
"@angular-eslint/eslint-plugin-template": "^14.0.0",
"@angular-eslint/template-parser": "^14.0.0",
"@angular/cli": "^15.0.4",
"@angular/compiler": "^15.0.0",
"@angular/compiler-cli": "^15.0.0",
"@angular/language-service": "^15.0.0",
"@angular/cli": "^16.2.16",
"@angular/compiler": "^16.2.12",
"@angular/compiler-cli": "^16.2.12",
"@angular/language-service": "^16.2.12",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Current relevant devDependencies:"
node -e 'const d=require("./package.json").devDependencies; for (const k of ["`@angular/cli`","`@angular-eslint/builder`","`@angular-eslint/eslint-plugin`","`@angular-eslint/eslint-plugin-template`","`@angular-eslint/template-parser`"]) console.log(`${k}: ${d[k]}`)'

echo
echo "Peer dependencies for angular-eslint builder major 14:"
npm view `@angular-eslint/builder`@^14 peerDependencies --json

echo
echo "Peer dependencies for angular-eslint builder major 16:"
npm view `@angular-eslint/builder`@^16 peerDependencies --json

Repository: BAWES-Universe/studenthub-staff

Length of output: 1851


🌐 Web query:

angular-eslint 14 compatibility with Angular CLI 16

💡 Result:

The angular-eslint package version 14 is not compatible with Angular CLI 16 [1][2]. Since version 12, the angular-eslint project has aligned its major version numbers with the Angular and Angular CLI major versions [2]. To ensure compatibility, you must use the angular-eslint version that matches the major version of your Angular CLI [2][3]. For an Angular CLI 16 project, you should use angular-eslint version 16 [1]. Using mismatched versions will typically result in peer dependency errors during installation [4][1]. To update your project correctly, it is recommended to use the Angular CLI update command, which helps manage these dependencies automatically [5][4]: ng update @angular/core@16 @angular/cli@16 @angular-eslint/schematics@16

Citations:


🏁 Script executed:

#!/bin/bash
# Check if there's evidence of incompatibility in the codebase or common issues
# Search for any angular-eslint or ESLint configuration that might fail with version mismatch
rg -t json -i "angular-eslint|`@angular/cli`" package.json | head -20
rg "eslintConfig|angular-eslint" --type js --type ts --max-count=5

Repository: BAWES-Universe/studenthub-staff

Length of output: 304


Upgrade @angular-eslint/* to match Angular 16 major version.

Lines 70-73 specify @angular-eslint/* at ^14.0.0 while line 74 upgrades @angular/cli to 16.2.16. Since Angular-eslint v12, the project aligns major versions with Angular CLI. This mismatch will cause ng lint and related ESLint tooling to fail in runtime, even if npm install succeeds.

♻️ Suggested update
-    "`@angular-eslint/builder`": "^14.0.0",
-    "`@angular-eslint/eslint-plugin`": "^14.0.0",
-    "`@angular-eslint/eslint-plugin-template`": "^14.0.0",
-    "`@angular-eslint/template-parser`": "^14.0.0",
+    "`@angular-eslint/builder`": "^16.0.0",
+    "`@angular-eslint/eslint-plugin`": "^16.0.0",
+    "`@angular-eslint/eslint-plugin-template`": "^16.0.0",
+    "`@angular-eslint/template-parser`": "^16.0.0",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"@angular-devkit/build-angular": "^16.2.16",
"@angular-eslint/builder": "^14.0.0",
"@angular-eslint/eslint-plugin": "^14.0.0",
"@angular-eslint/eslint-plugin-template": "^14.0.0",
"@angular-eslint/template-parser": "^14.0.0",
"@angular/cli": "^15.0.4",
"@angular/compiler": "^15.0.0",
"@angular/compiler-cli": "^15.0.0",
"@angular/language-service": "^15.0.0",
"@angular/cli": "^16.2.16",
"@angular/compiler": "^16.2.12",
"@angular/compiler-cli": "^16.2.12",
"@angular/language-service": "^16.2.12",
"`@angular-devkit/build-angular`": "^16.2.16",
"`@angular-eslint/builder`": "^16.0.0",
"`@angular-eslint/eslint-plugin`": "^16.0.0",
"`@angular-eslint/eslint-plugin-template`": "^16.0.0",
"`@angular-eslint/template-parser`": "^16.0.0",
"`@angular/cli`": "^16.2.16",
"`@angular/compiler`": "^16.2.12",
"`@angular/compiler-cli`": "^16.2.12",
"`@angular/language-service`": "^16.2.12",
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@package.json` around lines 69 - 77, The `@angular-eslint` packages in
package.json are still at major version 14 while Angular CLI/compiler are at 16;
update the `@angular-eslint` packages (`@angular-eslint/builder`,
`@angular-eslint/eslint-plugin`, `@angular-eslint/eslint-plugin-template`,
`@angular-eslint/template-parser`) to the matching Angular 16 major (e.g. ^16.0.0
or the latest 16.x compatible release) so ESLint tooling aligns with
`@angular/cli` and `@angular/compiler` versions, then run npm install and verify ng
lint works.

- Update Angular core packages from 15.0.0 → 16.2.12
- Update TypeScript from 4.8.4 → 5.1.6
- Update zone.js from 0.11.8 → 0.13.3
- Replace ng5-slider with @angular-slider/ngx-slider@16.0.1
- Upgrade @ckeditor/ckeditor5-angular from 4.0.0 → 6.0.0
- Upgrade @ckeditor/ckeditor5-build-classic from 35.4.0 → 40.0.0
- Remove BrowserTransferStateModule (deprecated in Angular 16)
- Remove entryComponents from NgModule decorators
- Add skipLibCheck to tsconfig for ion2-calendar compatibility
- Fix CKEditor import style (namespace → default import)
- Fix CKEditor ViewChild type annotations
- JIT development build verified: ng build --configuration=development --aot=false ✓
- Note: Production AOT build blocked by angular-instantsearch (View Engine library, no Angular 16 compatible version)
@weilixiong weilixiong force-pushed the feat/upgrade-angular-16 branch from b90eb4f to 856e147 Compare May 16, 2026 17:35
@weilixiong weilixiong changed the title [UPGRADE] Angular 15 → 16 incremental migration (Closes #25) Upgrade Angular 15→16 (#25) May 16, 2026
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