Skip to content

feat(migrations): add migration to remove unclaimed bindings on ng-template - #69718

Open
aparzi wants to merge 1 commit into
angular:mainfrom
aparzi:migration-ng-template-unclaimed-bindings
Open

aparzi wants to merge 1 commit into
angular:mainfrom
aparzi:migration-ng-template-unclaimed-bindings

Conversation

@aparzi

@aparzi aparzi commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.dev application / infrastructure changes
  • Other... Please describe:

What is the new behavior?

Adds a migration that detects and removes property/two-way
bindings (e.g. [foo]="...", [(foo)]="...") on ng-template elements that are not recognized as known properties.

Does this PR introduce a breaking change?

  • Yes
  • No

…mplate

Adds a migration that detects and removes property/two-way
bindings (e.g. `[foo]="..."`, `[(foo)]="..."`) on `ng-template` elements that are not recognized as known properties.
@pullapprove
pullapprove Bot requested a review from JeanMeche July 9, 2026 21:10
@angular-robot angular-robot Bot added detected: feature PR contains a feature commit area: migrations Issues related to `ng update`/`ng generate` migrations labels Jul 9, 2026
@ngbot ngbot Bot added this to the Backlog milestone Jul 9, 2026
@aparzi

aparzi commented Jul 11, 2026

Copy link
Copy Markdown
Contributor Author

Context

This is the follow-up to #69640, where unclaimed property bindings on will start producing a compilation error (as discussed with @JeanMeche in that PR). This migration helps existing codebases adopt that change automatically via ng update.

Why the migration removes the bindings instead of fixing them (e.g. adding missing imports)
Before #69640, these bindings were silently ignored by the compiler: they had no effect at runtime. Removing them is therefore a strictly behavior-preserving transformation — the app behaves exactly the same before and after the migration, which is the safest property an automated migration can have.
Trying to "fix" the binding instead (e.g. by adding a missing directive import) would be heuristic and potentially unsafe: we can't reliably know whether the binding was a missing import, a typo, or an input that no longer exists after the directive evolved — all cases that actually showed up in the TGP run for #69640.
The migration diff itself also acts as a signal: if a developer sees a removed binding they actually intended to work, that's their cue to add the proper import — visibility that the silently-ignored binding never gave them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: migrations Issues related to `ng update`/`ng generate` migrations detected: feature PR contains a feature commit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant