Repository navigation
Conversation
There was a problem hiding this comment.
I don't feel great about adding a parameter like this, but I couldn't find another way to distinguish between listener and non-listener scopes.
There was a problem hiding this comment.
I'm curious why we need to? Naively, I'd expect that we should generate the same variables inside listener functions. Or am I missing something?
There was a problem hiding this comment.
It's because, while in the current setup of the pipeline listeners have the same scope as their declaration view, they're technically child views, hence why we resolve @let declarations in them using ɵɵreadContextLet and why they currently generate nextContext calls.
116fa9f to
9817db7
Compare
dylhunn
left a comment
There was a problem hiding this comment.
As per VC -- my only suggested structural change is that optimization for let should probably be its own phase, since it has let-specific knowledge (e.g. extracting initializers from storeLet).
Thanks for the nice work!
There was a problem hiding this comment.
Since the reads are optimized out, can we do the same for the declaration and therefore the reserved binding slots?
There was a problem hiding this comment.
I was considering this as well, but decided not to do it for now after chatting with Pawel. I left the context here: https://github.com/angular/angular/pull/56299/files#diff-f271e852d3ef9ded1fc03c94fead7cdc6e6c7d645202ad33399d2f7d63a0a9a4R24-R29
There was a problem hiding this comment.
I'm curious why we need to? Naively, I'd expect that we should generate the same variables inside listener functions. Or am I missing something?
ca1c36d to
3a92693
Compare
…line These changes integrate let declarations into the template pipeline. This involves a few operations: * Producing a `declareLet` instruction call at creation time to initialize the declaration. * Producing a `storeLet` instruction call in the place of the let declaration, including the necessary `advance` calls beforehand. * For let declarations used within their declaration view, moving the `const` to be placed right after the `storeLet` call to ensure the their value has been computed. * For let declarations that are _only_ used in their declaration view, removing the `storeLet` call and inlining the expression into the constant statement.
|
This PR was merged into the repository by commit 64990a5. The changes were merged into the following branches: main, 18.0.x |
…line (#56299) These changes integrate let declarations into the template pipeline. This involves a few operations: * Producing a `declareLet` instruction call at creation time to initialize the declaration. * Producing a `storeLet` instruction call in the place of the let declaration, including the necessary `advance` calls beforehand. * For let declarations used within their declaration view, moving the `const` to be placed right after the `storeLet` call to ensure the their value has been computed. * For let declarations that are _only_ used in their declaration view, removing the `storeLet` call and inlining the expression into the constant statement. PR Close #56299
|
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. |
These changes integrate let declarations into the template pipeline. This involves a few operations:
declareLetinstruction call at creation time to initialize the declaration.storeLetinstruction call in the place of the let declaration, including the necessaryadvancecalls beforehand.constto be placed right after thestoreLetcall to ensure the their value has been computed.storeLetcall and inlining the expression into the constant statement.