Skip to content

Conversation

@thePunderWoman
Copy link
Contributor

this adds the compiler code to support the animate instructions.

Does this PR introduce a breaking change?

  • Yes
  • No

@thePunderWoman thePunderWoman added state: WIP area: compiler Issues related to `ngc`, Angular's template compiler target: minor This PR is targeted for the next minor release labels Jul 8, 2025
@ngbot ngbot bot added this to the Backlog milestone Jul 8, 2025
@angular-robot angular-robot bot added the area: core Issues related to the framework runtime label Jul 8, 2025
@thePunderWoman thePunderWoman force-pushed the animate-compiler branch 6 times, most recently from 0d81af2 to 1ee1911 Compare July 9, 2025 00:33
@thePunderWoman thePunderWoman marked this pull request as ready for review July 9, 2025 00:54
@thePunderWoman thePunderWoman requested a review from crisbeto July 9, 2025 00:54
it('should generate an animation in function call', () => {
const TEMPLATE = '<p (animate.in)="animateFn($event)"></p>';
expect(tcb(TEMPLATE)).toContain(
'($event: i1.AnimationCallbackEvent): any => { ((this).animateFn)($event); }',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What should the return value be of the animateFn? The TCB here allows any but also only ever returns void or am I reading that incorrectly?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's an interface for it that'll be introduced in the follow up PR called AnimationCallbackEvent. I just wanted to separate out the PRs. So this will get fixed in the next PR.

@thePunderWoman thePunderWoman force-pushed the animate-compiler branch 2 times, most recently from f1cd8d4 to 072cea3 Compare July 9, 2025 18:27
@thePunderWoman thePunderWoman added the action: review The PR is still awaiting reviews from at least one requested reviewer label Jul 9, 2025
@thePunderWoman thePunderWoman force-pushed the animate-compiler branch 2 times, most recently from c93a738 to c1f3d38 Compare July 10, 2025 21:00
@thePunderWoman thePunderWoman force-pushed the animate-compiler branch 2 times, most recently from 1dfa5e3 to be448d5 Compare July 11, 2025 00:12
this adds the compiler code to support the animate instructions.
expect(dtsContents).toContain('static ɵfac: i0.ɵɵFactoryDeclaration<Service, never>;');
});

describe('animate.enter', () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest we have the "compliance" tests which cover the generated code quite nicely - I don't think we need this flavor of test as well. It is nice to have coverage of the @if(...) case though which shows the context save/restore working.

@thePunderWoman thePunderWoman removed the request for review from crisbeto July 16, 2025 20:37
@thePunderWoman thePunderWoman added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Jul 16, 2025
@kirjs
Copy link
Contributor

kirjs commented Jul 16, 2025

This PR was merged into the repository by commit fc8247d.

The changes were merged into the following branches: main

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Aug 16, 2025
@thePunderWoman thePunderWoman deleted the animate-compiler branch August 29, 2025 11:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: compiler Issues related to `ngc`, Angular's template compiler area: core Issues related to the framework runtime target: minor This PR is targeted for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants