Skip to content

chore(deps): upgrade the renderer to Angular 22 - #4

Open
hazeliscoding wants to merge 4 commits into
mainfrom
upgrade/angular-22
Open

hazeliscoding wants to merge 4 commits into
mainfrom
upgrade/angular-22

Conversation

@hazeliscoding

Copy link
Copy Markdown
Owner

The renderer goes from Angular 18.2.14 to 22.2.5, one commit per major. Every major builds clean and passes the renderer's design checks. None of it has run inside Electron yet, so this PR's CI run is the first real runtime check.

Only desktop/renderer changes: package.json, package-lock.json, angular.json, both tsconfigs and five component decorators. The workflows and the main process are untouched.

Commits

  • 6be5c6d Angular 19: @angular/* 18.2.14 → 19.2.25, CLI and build-angular 18.2.21 → 19.2.27, zone.js 0.14.10 → 0.15.1.
  • 0f80aa8 Angular 20: @angular/* → 20.3.35, CLI and build-angular → 20.3.42, TypeScript 5.5.4 → 5.9.3.
  • a77b128 Angular 21: @angular/* → 21.2.26, CLI and build-angular → 21.2.29.
  • b9ef022 Angular 22: @angular/* → 22.2.5, CLI and build-angular → 22.2.6, TypeScript 5.9.3 → 6.0.3.

Checks

Run in desktop/renderer on Linux with Node 24.22.2, first on 18 and then after each major:

  • Build: ng build (production) passed with no warnings every time. The initial bundle went from 360.68 kB to 377.62 kB raw (93.12 to 98.24 kB transfer), under the 500 kB budget.
  • Tests: node scripts/checks.test.mjs (contrast and assets, with their planted-violation controls) passed every time. The renderer has no ng test target.
  • App in Chrome: ng serve (development build) in headless Chrome. The page served, app-root filled in, and the console showed the same four errors as on 18 (see below).
  • Re-check on the final commit: a clean install from the lockfile and the production build both passed. The test step stopped at Unknown argument: watch, since there's no ng test target. The browser check failed on the same four console errors.

Hand fix

  • Decorator formatting (Angular 19): the standalone migration re-indented the decorators it touched to four spaces and dropped the comma after template. I put the original formatting back, so the commit only removes standalone: true and matches the rest of the code. Build and design checks ran again after.

Migrations to know about

  • 19, standalone: standalone: true is gone from the app, onboarding, board, settings and period-picker components, since standalone is the default from 19. The migration left it on the three ui/ components, where it's redundant but valid.
  • 20, angular.json: a new top-level schematics block keeps ng generate on the pre-20 file naming, such as *.component.ts. Nothing changes at runtime.
  • 21, tsconfig.json: "lib": ["ES2022", "dom"] is gone. With target: ES2022, TypeScript's default lib already includes both.
  • 22, tsconfig.app.json: suppresses the nullishCoalescingNotNullable and optionalChainNotNullable diagnostics, because ?. and ?? now narrow types in templates. Angular's guide calls this a temporary opt-out.
  • 22, checked by hand: every component already sets changeDetection: OnPush, so the new OnPush default changes nothing. No template compares a ?. result with null, and ?. now returns undefined. The four data-density attributes sit on plain <table> elements, so data-* no longer binding to inputs doesn't touch them. The routes have no parameters, so the new paramsInheritanceStrategy default doesn't either.

Already failing before the upgrade, left as is

  • Console errors in a plain browser: window.api comes from the Electron preload, so the onboarding dialog and BoardStore.init() throw on their first line: Cannot read properties of undefined (reading 'oauthAvailable'), logged twice, and (reading 'onUpdateState').
  • favicon.ico 404: the renderer has no favicon, so the browser's default request misses.

Known gaps

  • Never run in Electron. Every runtime check above used the dev build in plain Chrome, with no window.api. No data loaded, so the board, onboarding, the update badge and Settings were never exercised. The browser check only shows the bundle serves and starts the same way it did on 18. Users get the production build (outputHashing: all, baseHref: ./index.html), loaded with win.loadFile over file:// in Electron 31.7.7, and I haven't opened that yet.
  • Not run on this branch: the desktop core tests in npm test and the Electron e2e suite (npm run test:e2e). CI runs both.

Heads-up

  • Node: Angular 22 needs ^22.22.3 || ^24.15.0 || >=26 (18 took ^18.19.1 || ^20.11.1 || >=22.0.0). That covers CI, the release runners and any machine that runs npm run dev or npm run build.
  • Electron's Chromium: Electron 31 runs Chromium 126, from June 2024. Angular 22 supports browsers released in the 30 months before 2026-05-07, so 126 is inside its range.
  • Timing: 1.0 waits on a week of daily use of the latest 0.13.x, and v1.0.0 adds no features. So either ship this in a 0.13.x and restart that week, or merge it after the 1.0 tag.

Available, not done

  • @angular/build: npm marks @angular-devkit/build-angular 22.2.6 deprecated ("Angular's Webpack support is deprecated"). The build already uses the application builder, so ng update @angular/cli --name use-application-builder should come down to swapping both builders and the package. That drops 374 lockfile entries only build-angular pulls in, webpack among them. After it, ng serve reads PORT ahead of --port, and npm run dev waits on :4301, so keep PORT unset.
  • Unused packages: nothing under desktop/renderer/src imports @angular/animations or @angular/platform-browser-dynamic, and npm's notice on their 20.x releases calls both deprecated. Bootstrap already uses bootstrapApplication from @angular/platform-browser. Dropping both from package.json should be the whole job.
  • Other optional migrations find nothing here: no Karma, no APP_INITIALIZER-style providers, no Router.getCurrentNavigation, and the templates already use @if, @for and @switch.

Before merging

  • CI: let ci.yml run in full. End-to-end tests is the first run of this renderer inside Electron, and Fixture screenshots waits on the update states in the top bar, the sprints preview, Copy standup and the token field. In Setup Node, check that Node resolved to 22.22.3 or later, since both workflows say node-version: 22. If it's older, set node-version to 24 in ci.yml and release.yml.
  • Screenshots: open the fixture-screenshots artifact next to main's, in both themes, especially update-downloading, update-ready, update-portable, settings-setup, busy-standup and onboarding-token.
  • Windows package: run npm run package:win, install it, and click through sign-in, the board, Settings with the sprints preview, and the update badge. PR CI builds only on ubuntu-latest.
  • Suppressed diagnostics (optional): delete the two "suppress" lines in tsconfig.app.json and build. If nothing warns, drop the block in this PR.
  • Fresh release: @angular/* 22.2.5 came out on 2026-11-06. Give it a few days and run npm audit in desktop/renderer before tagging a release with it.

- @angular/* 18.2.14 -> 19.2.25, @angular/cli and
  @angular-devkit/build-angular -> 19.2.27
- zone.js 0.14.10 -> 0.15.1

Migrations: standalone migration removed `standalone: true` from five
components. Hand fix: restored the original decorator indentation and
trailing comma that the migration had reformatted.
- @angular/* 19.2.25 -> 20.3.35, @angular/cli and
  @angular-devkit/build-angular -> 20.3.42
- typescript 5.5 -> 5.9.3

Migrations: angular.json gained schematic defaults that keep the
previous style-guide file naming. No hand fixes.
- @angular/* 20.3.35 -> 21.2.26, @angular/cli and
  @angular-devkit/build-angular -> 21.2.29

Migrations: tsconfig.json drops the explicit "lib" (target ES2022
already implies it). No hand fixes.
- @angular/* 21.2.26 -> 22.2.5, @angular/cli and
  @angular-devkit/build-angular -> 22.2.6
- typescript 5.9.3 -> 6.0.3

Migrations: tsconfig.app.json suppresses the nullishCoalescingNotNullable
and optionalChainNotNullable extended diagnostics (the migration's
default, since `?.`/`??` now narrow types in templates). No hand fixes.
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