Skip to content

animations: template animate.* has no v20.2 gate, no ɵɵAnimationsFeature on 20.2.0–20.3.0, and a different order; host (animate.*) listeners before 20.2 #701

Closed

Description

@Brooooooklyn

Found while reviewing #697. #697 fixed the host animate.* path. The template path and the host listeners before v20.2 still differ from ngtsc.

Source: <p animate.leave="out" [animate.enter]="e" (animate.leave)="g($event)"></p>

                     ngtsc                                     Oxc
20.1.8 (no animate)  consts ["animate.leave","out", 3, …]       ɵɵanimateLeave("out")
                     ɵɵdomProperty("animate.enter", ctx.e)      ɵɵanimateEnter(cb)
                     ɵɵlistener("animate.leave", …)             ɵɵanimateLeaveListener(…)
                                                                → instructions @angular/core 20.1 doesn't export

20.2.0               features: [ɵɵAnimationsFeature()]          (no features)
                                                                → ɵɵanimateLeave throws: no ElementRegistry

20.2.0 and 22.2.4    ɵɵanimateEnter(cb)                         ɵɵanimateLeave("out")
(order)              ɵɵanimateLeave("out")                      ɵɵanimateEnter(cb)

Also, before v20.2 a host (animate.enter) / (animate.leave) listener emits ɵɵanimateEnterListener / ɵɵanimateLeaveListener in full compile and in the linker. ngtsc 19.2 / 20.1 emit ɵɵlistener("animate.enter", …). [attr.animate.*] has the same gap.

To do:

  • Gate the template animate.* attributes, properties and listeners, and the host listeners, on supports_animate_instructions() (>= 20.2).
  • Add ɵɵAnimationsFeature() on 20.2.0–20.3.0 when the template uses animate.leave (Angular's analyzeTemplateForAnimations), the same way fix: align host bindings, .d.ts injection and SSR/linker with ngtsc (#686–#696) #697 does for host bindings (needs_animations_feature).
  • Emit bound animate.* before static ones on an element, as ngtsc does.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions