Skip to content

fix: i18n property bindings use I18n AttributeMarker in consts array#1

Merged
Brooooooklyn merged 1 commit into
mainfrom
fix/const-ref-index-i18n-attribute-extraction
Feb 4, 2026
Merged

fix: i18n property bindings use I18n AttributeMarker in consts array#1
Brooooooklyn merged 1 commit into
mainfrom
fix/const-ref-index-i18n-attribute-extraction

Conversation

@Brooooooklyn
Copy link
Copy Markdown
Member

@Brooooooklyn Brooooooklyn commented Feb 4, 2026

Property bindings with i18n-* markers (e.g., [heading]="title" i18n-heading) were extracted as BindingKind::Property (marker 3) instead of BindingKind::I18n (marker 6), causing const index mismatches with Angular's output.

Two fixes:

  • Parser (html_to_r3.rs): pass i18n metadata from i18n-* attributes to bracket and bind- property bindings, matching Angular's categorizePropertyAttributes
  • attribute_extraction.rs: convert Property ops with i18n_message to BindingKind::I18n, ported from Angular's attribute_extraction.ts

Note

Medium Risk
Changes IR extraction/categorization for property bindings, which can alter generated consts arrays and directive matching/i18n behavior at runtime. Scope is narrow and backed by new integration tests.

Overview
Aligns i18n handling with Angular by propagating i18n-* metadata onto bind-foo and [foo] property bindings during HTML-to-R3 transform, and by extracting property ops with an i18n_message as BindingKind::I18n (while preserving Template bindings).

Adds integration coverage to assert both bracket property bindings and interpolated attributes with i18n-* markers produce AttributeMarker.I18n (6) entries in the generated consts array.

Written by Cursor Bugbot for commit af86328. This will update automatically on new commits. Configure here.

Property bindings with i18n-* markers (e.g., [heading]="title" i18n-heading)
were extracted as BindingKind::Property (marker 3) instead of BindingKind::I18n
(marker 6), causing const index mismatches with Angular's output.

Two fixes:
- Parser (html_to_r3.rs): pass i18n metadata from i18n-* attributes to bracket
  and bind- property bindings, matching Angular's categorizePropertyAttributes
- attribute_extraction.rs: convert Property ops with i18n_message to
  BindingKind::I18n, ported from Angular's attribute_extraction.ts

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@Brooooooklyn Brooooooklyn merged commit c19950c into main Feb 4, 2026
3 checks passed
@Brooooooklyn Brooooooklyn deleted the fix/const-ref-index-i18n-attribute-extraction branch February 4, 2026 00:48
BenjaminDobler added a commit to BenjaminDobler/oxc-angular-compiler that referenced this pull request Mar 23, 2026
ɵɵtextInterpolate1/2/...N always require all positional string args
including the trailing suffix. When the suffix was an empty string, it
was incorrectly dropped, causing `undefined` to be concatenated at
runtime (e.g. `#1undefined` instead of `voidzero-dev#1`).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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