Skip to content

TB Angular upgrade v22 - #7147

Open
cdavalos7 wants to merge 6 commits into
tensorflow:masterfrom
cdavalos7:feature/upgrade21-22
Open

TB Angular upgrade v22#7147
cdavalos7 wants to merge 6 commits into
tensorflow:masterfrom
cdavalos7:feature/upgrade21-22

Conversation

@cdavalos7

@cdavalos7 cdavalos7 commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Motivation for features / changes

Upgrades Angular from 21 to 22, continuing the one-major-version-per-PR series.

Also enables strictTemplates. The flag was already set but never reached the
Angular compiler due to a gap in the Bazel build tooling. Fixing that surfaced
the template errors this PR resolves.

Versions

  • @angular/* to ^22.0.0. compiler and common pinned to exactly 22.1.1
    because of exact peer requirements.
  • typescript 5.9.3 to 6.0.3. compiler-cli@22 requires >=6.0 <6.1.
  • @ngrx/* stays at ^21.0.0. It works with Angular 22.

Technical description of changes

  • Patched @bazel/concatjs so angularCompilerOptions from the root tsconfig.json reaches the compiler. This is what made strictTemplates actually apply.

  • Patched @bazel/concatjs to map @angular/localize types, needed by a new TypeScript 6.0 error on side-effect imports.

  • Added a tsc_wrapped binary in tensorboard/defs that ships typescript in its runfiles. Without it, tf_ts_library targets fail in CI only.

  • strictTemplates touched 38 source files. Clean up summary:

    • Type corrections, mostly event handler params and inputs or outputs whose declared types never matched what callers passed.
    • Five real bugs, all previously silent. A dialog reading a field that does not exist, a misspelled event property, two trackBy functions receiving the index instead of the item, an observable field assigned a plain value, and an input never passed down from its container.
    • Dead template code removed, all verified inert at runtime. Bindings to non-existent outputs and members, plus a Material floatLabel="never" that stopped being valid several versions ago.
  • strictNullInputTypes is false here, since AsyncPipe is typed T | null and rejects all 166 async bindings. A follow-up PR moves those containers onto signals and turns it back on.

Verification

  • //tensorboard/webapp/... builds clean, 691 targets.
  • Karma green, 2014 specs plus 66 in feature_flag.

@crisbeto

Copy link
Copy Markdown
Contributor

Heads-up that you'll probably need #7144

@cdavalos7 cdavalos7 changed the title 1st commit Angular 22 to review CI checks. Tested locally. TB Angular 22 Aug 14, 2026
…non-null assertions from async pipe bindings strictNullInputTypes rejects every `[x]="obs$ | async"` binding, because

AsyncPipe.transform is typed `T | null` regardless of the observable. Disable the check and remove the assertions.
@cdavalos7
cdavalos7 marked this pull request as ready for review August 18, 2026 21:26
@cdavalos7 cdavalos7 changed the title TB Angular 22 TB Angular upgrade v22 Aug 19, 2026
@cdavalos7
cdavalos7 requested a review from arcra August 19, 2026 00:01
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.

2 participants