Skip to content

Migrate Angular 14 to 18 - #605

Merged
dcaslin merged 38 commits into
masterfrom
dcaslin/angular-migration
Apr 4, 2026
Merged

Migrate Angular 14 to 18#605
dcaslin merged 38 commits into
masterfrom
dcaslin/angular-migration

Conversation

@dcaslin

@dcaslin dcaslin commented Mar 27, 2026

Copy link
Copy Markdown
Owner

Summary

Complete Angular migration from 14.2 to 18.2, going one major version at a time:

  • RxJS 6.6 → 7.8: Replaced 17 toPromise() calls with firstValueFrom() across 10 files
  • Angular 14 → 15: Core migration schematics, removed relativeLinkResolution
  • Angular Material 14 → 15: MDC component migration (59 files updated by schematic)
  • Angular 15 → 16: TypeScript 4.8 → 5.1, zone.js 0.13, guard interfaces removed
  • Angular 16 → 17: TypeScript 5.4, zone.js 0.14, removed 84 legacy Material imports across 58 files, fixed mat-slider/SwUpdate/SCSS APIs
  • Angular 17 → 18: HttpClientModule → provideHttpClient, Material SCSS to m2- functions
  • Dependencies: angular-eslint 14→18, typescript-eslint 5→8, FontAwesome angular 0.11→0.15
  • Cleanup: Removed ngcc postinstall, deprecated theming imports, legacy component aliases
  • Version bumped to 29.0.0

All 185 tests pass. Lint clean (0 errors). Build compiles.

Test plan

  • npm run test:ci — 185/185 tests pass
  • npm run lint — 0 errors (469 no-explicit-any warnings expected)
  • npx ng build — dev build succeeds
  • CI passes
  • Visual smoke test on localhost

🤖 Generated with Claude Code

dcaslin and others added 30 commits March 26, 2026 21:51
RxJS 7 is required for Angular 16+. toPromise() is deprecated in
RxJS 7 — replaced all 17 call sites across 10 files with
firstValueFrom() from rxjs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- TypeScript 5.4, zone.js 0.14
- Removed legacy Material component imports (84 occurrences across 58 files)
- Fixed mat-slider API (thumbLabel -> discrete, added matSliderThumb input)
- Fixed form field appearance (standard -> outline)
- Updated SwUpdate API (available/activated -> versionUpdates)
- Removed deprecated @angular/material/theming SCSS imports
- Updated SCSS from legacy to non-legacy Material mixins

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Migration path: Angular 14 → 15 → 16 → 17 → 18

Key changes:
- RxJS 6.6 → 7.8 (toPromise → firstValueFrom, 17 call sites)
- TypeScript 4.8 → 5.4
- Angular Material legacy → MDC components (84 imports, SCSS)
- zone.js 0.11 → 0.14
- FontAwesome angular-fontawesome 0.11 → 0.15 (spin/pulse → animation)
- angular-eslint 14 → 18, typescript-eslint 5 → 8
- SwUpdate API modernized (available → versionUpdates)
- HttpClientModule → provideHttpClient
- Removed ngcc postinstall
- Removed deprecated @angular/material/theming imports
- Fixed mat-slider API, form field appearance
- Updated ESLint config for v8 rule changes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
All 7 phases of the modernization plan are now complete.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- gear-parser: mw?.tier → (mw?.tier ?? 0) for safe comparison
- milestone-parser: optional indexOf → nullish coalescing fallback
- Theme files: use map-based API for m2-define-light/dark-theme

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…y warning

Remove redundant mat-button from elements that also have mat-icon-button
(NG0300 in Material 15+). Use all-component-colors() instead of
all-component-themes() for secondary themes to avoid duplicate density styles.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add [tabPanel] binding and <mat-tab-nav-panel> wrapper to all 10
mat-tab-nav-bar instances across player, clan, pursuits, triumphs,
collections, uber-list, and lost-sector-next-days components.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Check vendors?.data before iterating to handle cases where the
vendor data array hasn't been populated yet.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Wrap in arrow functions to preserve the BungieService instance context.
Passing a method reference directly as map(this.x.method) loses 'this'.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Material 15+ uses MDC-based components with different CSS classes:
- .mat-tab-label → .mat-mdc-tab
- .mat-tab-link → .mat-mdc-tab-link
- .mat-table/row/cell → .mat-mdc-table/row/cell
- .mat-card* → .mat-mdc-card*
- .mat-form-field* → .mat-mdc-form-field*
- .mat-input-element → .mat-mdc-input-element
- .mat-radio-* → .mat-mdc-radio-*
- .mat-checkbox-* → .mdc-checkbox/.mdc-form-field
- .mat-chip → .mat-mdc-chip
- .mat-dialog-content → .mat-mdc-dialog-content
- .mat-nav-list → .mat-mdc-nav-list
- .mat-stroked-button → .mat-mdc-outlined-button
- .mat-list-item-content → .mdc-list-item__content

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- mat-line → matListItemLine
- mat-list-icon → matListItemIcon

Fixes garbled rendering in lost sectors and nightfall list items.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Density was only generated inside .default-theme via all-component-themes(),
so .light-theme and .black-theme (using all-component-colors()) got default
Material density instead. Moving density to global scope fixes select
dropdowns and other components being taller in non-default themes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
MDC components at density 0 are larger than the old legacy Material
components. Using density -2 brings row heights, form fields, and
button toggles back to the compact sizing the app had before migration.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
MDC mat-icon-button has a larger default size that was overriding the
custom tag button dimensions in the gear table.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The button-toggle-label-content class was NOT renamed in the MDC
migration — it stays as .mat-button-toggle-label-content. The earlier
rename to .mat-mdc-button-toggle-label-content broke the line-height
override, making the toggle bar too tall.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
MDC mat-icon-button defaults to 48px (40px at density -2), but form field
suffix buttons (clear, help) were ~20px in legacy Material. Add global
override to size them at 24px inside mat-form-field.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
MDC form fields render as rounded rectangles with hidden labels.
Override globally to restore legacy look: transparent background,
bottom border only, and always-visible floating label in resting
position.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
dcaslin and others added 8 commits April 3, 2026 15:07
MDC fill form fields add 16px horizontal padding on the wrapper,
making fields 32px wider than legacy. Zero out the padding to
restore the original sizing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adjust infix padding (16px top, 6px bottom), min-height (unset), font
size (13px), and line-height (15px) to match legacy Material's ~53px
form field height. Hide subscript wrapper that MDC reserves by default.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
MDC tab links default to flex-grow: 1, causing them to stretch across
the full nav bar width. Legacy tabs used min-width: 160px and flex-grow: 0.
Match the legacy behavior for consistent tab sizing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Use font-size: inherit throughout the fill form field chain so fields
  inherit from their container context (e.g. 13px in gear-body, 16px default)
  instead of the hardcoded 13px override that was wrong for some pages
- Remove hardcoded dark-theme-only border-bottom color and rely on MDC
  line-ripple which is already theme-aware (works in both light and dark)
- Remove redundant line-ripple color overrides

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add flex-wrap: wrap to .milestone-row so "Resets in X days" wraps
below the reward description instead of staying inline.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
MDC button toggle sets explicit 16px font-size, blocking inheritance
from container (e.g. 13px in .gear-body). Set font-size: inherit on
the toggle element so it matches the surrounding context, bringing
the gear page toggle bar width closer to production.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
MDC components use letter-spacing: 1.25px per the Material Design spec,
but legacy Angular Material used normal letter-spacing. This made tabs
and buttons look more spread out and less compact than production.
Reset letter-spacing to normal on .mat-mdc-tab, .mat-mdc-tab-link,
and .mdc-button.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
package-lock.json had stale resolved URLs pointing to npm.fontawesome.com
(the private FontAwesome Pro registry) for free FA packages that are
available on the public npm registry. CI fails with E401 because it
doesn't have FontAwesome registry credentials. Updated the three
resolved URLs to use registry.npmjs.org instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dcaslin
dcaslin merged commit 4b88b72 into master Apr 4, 2026
1 check passed
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