Skip to content

feat: widen support to Angular 20-22 - #17

Merged
JasonWeinzierl merged 4 commits into
mainfrom
peer-22
Aug 27, 2026
Merged

feat: widen support to Angular 20-22#17
JasonWeinzierl merged 4 commits into
mainfrom
peer-22

Conversation

@JasonWeinzierl

@JasonWeinzierl JasonWeinzierl commented Aug 23, 2026

Copy link
Copy Markdown
Collaborator

Description

  • Widen the peer dependency range from Angular 21 to Angular 20-22, to support the Angular versions under active support (https://angular.dev/reference/releases#actively-supported-versions).
    • Added a peer dependency CI script to ensure compatibility works.
      • There are alternative ways to accomplish this. I considered: (1) using ng new to bootstrap fresh projects. Seemed to be more than we need, and probably slower. (2) in-place modifying the package.json dependencies to 20, 21, and 22. Less isolated than the temporary directory approach and risks mutating the library so the test isn't accurate.
    • Downgrade the repository (and demo site) to Angular 20 because per Angular documentation (https://angular.dev/tools/libraries/creating-libraries#ensuring-library-version-compatibility), you should build libraries with the lowest supported Angular version.
  • Replaced .nvmrc with .node-version, thanks for the recommendation in Feature/angular v22 support #7 .
  • Added platform-browser to the peer dependencies to fix pnpm support and avoid a hidden dependency.
  • Did demo app simplifications per Feature/angular v22 support #7 .

Related issues

Fixes #6

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that changes the public API)
  • Documentation only
  • Refactor, test, or chore (no user-facing change)

Breaking changes

None

This should not be a breaking change since we're maintaining support for Angular 21.

Test plan

  • npm run build
  • npm test
  • npm run lint
  • Verified in the demo app (if applicable)

Checklist

  • Issue discussed or bug clearly described (link issue when applicable)
  • Tests added or updated for behavioral changes
  • Documentation updated (README, JSDoc, migration notes as needed)
  • Public API changes documented; breaking changes called out
  • CHANGELOG updated (if the repository maintains one and the change is user-facing)
  • Commit messages follow Conventional Commits
  • I agree to follow the OpenNG Foundation Code of Conduct

Additional context

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Expands Angular support to versions 20–22, updates the project baseline to Angular 20, and migrates tests to Vitest.

Changes:

  • Widens Angular peer dependencies and adds compatibility CI.
  • Updates dependencies, documentation, and Node version configuration.
  • Replaces Karma/Jasmine testing with Vitest.

Reviewed changes

Copilot reviewed 13 out of 14 changed files in this pull request and generated 1 comment.

Show a summary per file
File Summary
tsconfig.spec.json Configures Vitest globals.
src/app/toasts.spec.ts Migrates tests to Vitest APIs.
scripts/test-peer-compatibility.mjs Adds Angular-version compatibility testing.
README.md Documents Angular 20–22 support.
projects/ngx-toastr/package.json Widens Angular peer dependencies.
package.json Updates Angular and test tooling dependencies.
karma.conf.js Removes obsolete Karma configuration.
angular.json Configures the Vitest test target; critical issue: invalid Karma-style coverage option names will prevent ng test from running.
.nvmrc Replaced by .node-version.
.node-version Defines the Node.js version.
.github/workflows/publish.yml Uses .node-version.
.github/workflows/pr-title.yml Uses .node-version.
.github/workflows/ci.yml Adds Angular compatibility testing.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread angular.json
- Downgrade the repo version to Angular 20 because Angular documentation states you should build with the oldest supported version.
- Install zone.js because Angular 20 needs it.
- Expand peer range to all Angular versions still under active declared support.
- Add CI script to validate peer compatibility.
- Add `platform-browser` to peer deps to avoid hidden dependency and support pnpm
@JasonWeinzierl
JasonWeinzierl force-pushed the peer-22 branch 5 times, most recently from 68770f8 to 5b3943a Compare August 24, 2026 21:13
@JasonWeinzierl JasonWeinzierl mentioned this pull request Aug 24, 2026
12 tasks
@JasonWeinzierl JasonWeinzierl changed the title feat: support Angular 20-22 feat: widen support to Angular 20-22 Aug 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 13 out of 14 changed files in this pull request and generated no new comments.

@majora2007

Copy link
Copy Markdown

Any chance we can get this merged? This is the last dependency blocking my update to Angular 22.

@JasonWeinzierl
JasonWeinzierl merged commit 0b28d79 into main Aug 27, 2026
13 checks passed
@JasonWeinzierl
JasonWeinzierl deleted the peer-22 branch August 27, 2026 17:11
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.

Add support for Angular v22

4 participants