New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(ivy): support animation @triggers in templates #25849
Conversation
You can preview 56f07e0 at https://pr25849-56f07e0.ngbuilds.io/. |
if (rf & 2) { | ||
$r3$.ɵelementAttribute(0, "@foo", $r3$.ɵbind(ctx.exp)); | ||
$r3$.ɵelementAttribute(1, "@bar", undefined); | ||
$r3$.ɵelementAttribute(2, "@baz", undefined); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is desirable. If the value is constant (undefined
) it shouldn't need to be reevaluated each update, should it? Also, because this doesn't use bind
it will never be NO_CHANGE
, in which case the attribute is thought to have changed during each change detection run.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this test is not canonical, and will confuse people reading it. Can you make it canonical by binding to a value, which may be constant for the test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How's about just setting the undefined
value to be NO_CHANGE
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@matsko It won't do a thing, then ;) Basically, constant attributes are usually applied for RenderFlags.Create
by passing the constant attributes as third argument to elementStart
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK the instructions are gone.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Conditionally on the clean up comments.
|
||
const template = ` | ||
MyComponent.ngComponentDef = $r3$.ɵdefineComponent({ | ||
type: MyComponent, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can use ...
to elide irrelevant text and only keep animations.
MyComponent.ngComponentDef = $r3$.ɵdefineComponent({
...
animations: [{name: "foo123"}, {name: "trigger123"}]
...
});
features: [$r3$.ɵPublicFeature], | ||
consts: 0, | ||
vars: 0, | ||
template: function MyComponent_Template(rf, $ctx$) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, elide irrelevant text.
if (rf & 2) { | ||
$r3$.ɵelementAttribute(0, "@foo", $r3$.ɵbind(ctx.exp)); | ||
$r3$.ɵelementAttribute(1, "@bar", undefined); | ||
$r3$.ɵelementAttribute(2, "@baz", undefined); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this test is not canonical, and will confuse people reading it. Can you make it canonical by binding to a value, which may be constant for the test.
56f07e0
to
bce5721
Compare
You can preview bce5721 at https://pr25849-bce5721.ngbuilds.io/. |
bce5721
to
5d211ba
Compare
You can preview 5d211ba at https://pr25849-5d211ba.ngbuilds.io/. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
No description provided.