fix(compiler): port specializeControlProperties for Angular >= 21.2 (22.2 compat) - #530
Merged
Merged
Conversation
…21.2 Angular 21.2 introduced ɵɵcontrolCreate/ɵɵcontrol emission for form-field bindings, and 22.2 changed where controlCreate anchors (first element/container start op instead of last anchor op, and ng-template no longer qualifies). Replace the ingest-time and binding-specialization emit sites with a faithful port of the upstream specializeControlProperties phase: - scans Property/Attribute/TwoWayProperty update ops against the ELIGIBLE_CONTROL_PROPERTIES map (formField on 21.2+; formControl, formControlName, ngModel on 22.0+) - anchors ControlCreate after the last eligible create op on 21.2-22.1.x (ElementEnd/ContainerEnd/Template count) and after the first eligible create op on 22.2+ (element/container starts only) - inserts Control right after the source binding update op - gates everything behind angular_version predicates; unknown version behaves like latest Verified: cargo test green; fixture compare suite passes against Angular 22.1.7 and 22.2.0 (835/835 each).
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ports Angular's
specializeControlPropertiespipeline phase so oxc emitsɵɵcontrolCreate()/ɵɵcontrol()for Signal Forms bindings, fixing fixture-compare mismatches against Angular 22.2.0 (the failures seen on the #500 Renovate bump).What changed
specialize_control_properties(template jobs only, betweenspecializeBindingsandconvertAnimations): scansProperty/Attribute/TwoWayPropertyupdate ops, insertsControlCreateafter the owning create op andControlafter the binding update op.ControlCreateand the control insertions insidebinding_specialization— so Attribute-op scanning and version-dependent anchor selection work correctly.AngularVersion:< 21.2: no control instructions.21.2–22.1.x: eligible =formField(Property) / extended set on 22.x;controlCreateanchors after the last eligible create op (Element/ElementStart/ElementEnd/Container/ContainerStart/ContainerEnd/Template).>= 22.2:controlCreateanchors after the first eligible create op (Element/ElementStart/Container/ContainerStartonly), song-templateno longer qualifies andcontrolCreatesits right after the element start.controlCreatenow followselementStart).Verification
cargo test -p oxc_angular_compiler: all green.napi/angular-compiler/e2e/compare): 835/835 pass against both Angular 22.1.7 and 22.2.0 (previously 8 mismatches on 22.2.0).