feat: migrate from Angular 20 to Angular 21#291
Merged
MaudeLaflamme merged 1 commit intoVilledeMontreal:masterfrom Mar 31, 2026
Merged
feat: migrate from Angular 20 to Angular 21#291MaudeLaflamme merged 1 commit intoVilledeMontreal:masterfrom
MaudeLaflamme merged 1 commit intoVilledeMontreal:masterfrom
Conversation
4a1f552 to
0c91fb3
Compare
MaudeLaflamme
requested changes
Mar 27, 2026
Collaborator
|
@francischabot Peux-tu rebase ta branche sur master, puis squash tous tes commits en un seul et limiter le message à 1-2 phrases seulement, par exemple "chore: upgrade to angular v21" serait suffisant. |
0c91fb3 to
a96866c
Compare
BREAKING CHANGES: - Angular 21.2.0 (all @angular/* packages) - Angular CDK 21.2.0 (flat package structure with exports map) - TypeScript 5.9.3 - zone.js 0.16.1 - angular-eslint 21.2.0 - ng-packagr 21.2.0 Key changes: - tsconfig: moduleResolution changed from 'node' to 'bundler', module from 'esnext' to 'es2022' (required for CDK 21 flat package format) - EventEmitter no longer extends RxJS Subject: modal-container uses Subject for internal _animationStateChanged, snack-bar wraps onMicrotaskEmpty with from(), tabs stores Subscription objects for proper cleanup - Replace detectChanges() with markForCheck() in lifecycle hooks of pagination, system-header, and dropdown-menu components - Remove unused ChangeDetectorRef from button component - file-input: private to protected for _isDragOver (typeCheckHostBindings) - modal-ref: typed KeyboardEvent for CDK 21 overlay keydown events - Add provideZoneChangeDetection() to test modules (Angular 21 TestBed uses zoneless CD internally, requiring explicit zone CD for zone-based component tests) - Add provideZoneChangeDetection to storybook AppModule - Add .npmrc with legacy-peer-deps=true (Storybook 9 peer dep conflict) fix(radio): correct ViewChild and ContentChildren decorators in radio button group The radio button group component had incorrect decorator syntax that caused 'Cannot read properties of undefined (reading children)' errors in Storybook and potentially in production apps. Issues fixed: - staticContainer was using malformed @ContentChildren with read: ViewChild() instead of proper @ViewChild decorator - _radios QueryList was missing @ContentChildren decorator entirely - Added null safety check in setAriaDescribedByToDescription() to handle cases where staticContainer might not be initialized yet The fixes ensure that: - staticContainer properly references the #container template element - _radios properly queries all BaoRadioButtonComponent children - No runtime errors occur during component initialization feat(storybook): upgrade from v9 to v10 Storybook v10, unlike v9, natively supports Angular 21 (peer dep range >=18.0.0 <22.0.0). This eliminates the need for npm overrides that were forcing Angular peer dependency resolution for @storybook/angular. Packages upgraded: - storybook: ^9.1.16 → ^10.2.15 - @storybook/angular: ^9.1.16 → ^10.2.15 - @storybook/addon-docs: ^9.1.16 → ^10.2.15 - @storybook/addon-links: ^9.1.16 → ^10.2.15 - @storybook/addon-a11y: ^9.1.16 → ^10.2.15 - eslint-plugin-storybook: ^0.11.5 → ^10.2.15 Configuration changes: - Removed npm overrides section from package.json (no longer needed) - Removed zone.js from Storybook polyfills (Angular 21 uses zoneless CD) - Removed provideZoneChangeDetection from app.module.ts (not needed) fix: package-lock.json + lint Signed-off-by: Francis Chabot <francis.chabot@montreal.ca>
a96866c to
fa310a2
Compare
MaudeLaflamme
approved these changes
Mar 31, 2026
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.
Must be merged after #290
Upgrades the library from Angular 20 to Angular 21, fixes a pre-existing radio button bug uncovered during migration, and upgrades Storybook from v9 to v10.
Angular 21 migration
@angular/*and@angular/cdkpackages bumped to~21.2.0typescript→~5.9.3,zone.js→~0.16.1,@typescript-eslint→8.56.1tsconfig.json:moduleResolution: "bundler",module: "ES2022"(required by CDK 21 exports map)EventEmitterno longer extendsSubject(modal, snack-bar, tabs),detectChanges()replaced withmarkForCheck()(pagination, system-header, dropdown-menu)provideZoneChangeDetection()to fix NG0100 errors in Angular 21 TestBedRadio button fix
@ContentChildren/@ViewChilddecorators inradio-group.component.tsstaticContainerbefore accessing childrenStorybook v9 → v10
@storybook/*packages upgraded to^10.2.15(v10 natively supports Angular 21)zone.jsimport from Storybookpolyfills.ts(eliminates NG0914 warning)Tests
TOTAL: 111 SUCCESS