Template Pipeline 3: For a Few Templates More #50118
Closed
alxhub wants to merge 13 commits intoangular:mainfrom
Closed
Template Pipeline 3: For a Few Templates More #50118alxhub wants to merge 13 commits intoangular:mainfrom
alxhub wants to merge 13 commits intoangular:mainfrom
Conversation
This commit adds support to the template pipeline to ingest and process literal array and map expressions. A future phase may process these literal expressions and memoize them into pure functions where required.
The template pipeline implements variadic instruction generation for text node interpolation using an `InterpolationConfig` concept. This commit refactors that code to generalize it to work not just with interpolations, but with all instruction generation for variadic instructions.
This commit introduces a new trait `UsesVarOffset` for expressions which consume variable slots and thus need an offset into the variable slot space to locate their slots.
This commit adds a "shared constant" concept to the `ConstantPool`. This is a generalization of the `LiteralFactory` concept the pool previously supported. For stability's sake, the existing concept isn't modified, but could be unified in the future.
This commit adds the `ConstantPool` to `ComponentCompilation`, making it available to all phases of the template pipeline. Constant extraction is a common operation in pipeline phases.
This commit adds support for generating pure functions in the output `ConstantPool` based on `ir.PureFunctionExpr`s. Note that nothing yet generates these pure function forms - in the future they will be used both in the implementation of the `pipeBindV` instruction as well as literal arrays and maps in expressions.
Previously the helper operations for transforming expressions in the template pipeline would only operate against `ir.Expression`s. This commit changes them to process `o.Expression`s instead, paving the way to use them for transformations of native expressions in addition to IR expressions.
This commit transforms literal arrays and maps within expressions in the template pipeline into `ir.PureFunctionExpr` expressions, in order to memoize the allocation of objects and arrays inside the update pass of change detection.
This commit adds support for ternary expressions in the ingest operation of the template pipeline.
The logic for `insertBefore` in template pipeline operation lists has a bug when inserting at the end of a list. This commit fixes the safety assertions to be more accurate.
020dc18 to
f2dbd5d
Compare
This commit adds end-to-end support for pipes in the template pipeline. This support works across multiple steps: 1. Pipes are first ingested as `ir.PipeBindingExpr`s during the ingest step. 2. A "pipe creation" phase inserts operations to instantiate each required pipe, based on the presence of those `ir.PipeBindingExpr`s. 3. A "variadic pipe" phase transforms pipes with more than 4 arguments into variadic pipe bindings, which use a literal array argument. This literal array will be later memoized into a pure function invocation. 4. A special phase (`phaseAlignPipeVariadicVarOffset`) reconciles a difference in variable slot assignment logic between the template pipeline and the `TemplateDefinitionBuilder`, to ensure that the pipeline output can pass the existing tests. This phase should not affect runtime semantics and can be dropped once matching output is no longer necessary. 5. Reification emits pipe instructions based on the argument count.
This commit adds ingest and transformation support for property writes and keyed writes to the template pipeline.
…peline This commit adds support for interpolated properties to the template pipeline.
f2dbd5d to
f488a2f
Compare
dylhunn
approved these changes
May 30, 2023
Contributor
dylhunn
left a comment
There was a problem hiding this comment.
This makes sense to me, although it might be nice to go through the pure function and pipe support commits together in the future.
Contributor
|
This PR was merged into the repository by commit 9847085. |
dylhunn
pushed a commit
that referenced
this pull request
Jun 1, 2023
…ons (#50118) The template pipeline implements variadic instruction generation for text node interpolation using an `InterpolationConfig` concept. This commit refactors that code to generalize it to work not just with interpolations, but with all instruction generation for variadic instructions. PR Close #50118
|
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. |
ChellappanRajan
pushed a commit
to ChellappanRajan/angular
that referenced
this pull request
Jan 23, 2024
…ne (angular#50118) This commit adds support to the template pipeline to ingest and process literal array and map expressions. A future phase may process these literal expressions and memoize them into pure functions where required. PR Close angular#50118
ChellappanRajan
pushed a commit
to ChellappanRajan/angular
that referenced
this pull request
Jan 23, 2024
…ons (angular#50118) The template pipeline implements variadic instruction generation for text node interpolation using an `InterpolationConfig` concept. This commit refactors that code to generalize it to work not just with interpolations, but with all instruction generation for variadic instructions. PR Close angular#50118
ChellappanRajan
pushed a commit
to ChellappanRajan/angular
that referenced
this pull request
Jan 23, 2024
…ngular#50118) This commit introduces a new trait `UsesVarOffset` for expressions which consume variable slots and thus need an offset into the variable slot space to locate their slots. PR Close angular#50118
ChellappanRajan
pushed a commit
to ChellappanRajan/angular
that referenced
this pull request
Jan 23, 2024
…gular#50118) This commit adds a "shared constant" concept to the `ConstantPool`. This is a generalization of the `LiteralFactory` concept the pool previously supported. For stability's sake, the existing concept isn't modified, but could be unified in the future. PR Close angular#50118
ChellappanRajan
pushed a commit
to ChellappanRajan/angular
that referenced
this pull request
Jan 23, 2024
…ons (angular#50118) This commit adds the `ConstantPool` to `ComponentCompilation`, making it available to all phases of the template pipeline. Constant extraction is a common operation in pipeline phases. PR Close angular#50118
ChellappanRajan
pushed a commit
to ChellappanRajan/angular
that referenced
this pull request
Jan 23, 2024
angular#50118) This commit adds support for generating pure functions in the output `ConstantPool` based on `ir.PureFunctionExpr`s. Note that nothing yet generates these pure function forms - in the future they will be used both in the implementation of the `pipeBindV` instruction as well as literal arrays and maps in expressions. PR Close angular#50118
ChellappanRajan
pushed a commit
to ChellappanRajan/angular
that referenced
this pull request
Jan 23, 2024
angular#50118) Previously the helper operations for transforming expressions in the template pipeline would only operate against `ir.Expression`s. This commit changes them to process `o.Expression`s instead, paving the way to use them for transformations of native expressions in addition to IR expressions. PR Close angular#50118
ChellappanRajan
pushed a commit
to ChellappanRajan/angular
that referenced
this pull request
Jan 23, 2024
…ne (angular#50118) This commit transforms literal arrays and maps within expressions in the template pipeline into `ir.PureFunctionExpr` expressions, in order to memoize the allocation of objects and arrays inside the update pass of change detection. PR Close angular#50118
ChellappanRajan
pushed a commit
to ChellappanRajan/angular
that referenced
this pull request
Jan 23, 2024
…ular#50118) This commit adds support for ternary expressions in the ingest operation of the template pipeline. PR Close angular#50118
ChellappanRajan
pushed a commit
to ChellappanRajan/angular
that referenced
this pull request
Jan 23, 2024
The logic for `insertBefore` in template pipeline operation lists has a bug when inserting at the end of a list. This commit fixes the safety assertions to be more accurate. PR Close angular#50118
ChellappanRajan
pushed a commit
to ChellappanRajan/angular
that referenced
this pull request
Jan 23, 2024
…0118) This commit adds end-to-end support for pipes in the template pipeline. This support works across multiple steps: 1. Pipes are first ingested as `ir.PipeBindingExpr`s during the ingest step. 2. A "pipe creation" phase inserts operations to instantiate each required pipe, based on the presence of those `ir.PipeBindingExpr`s. 3. A "variadic pipe" phase transforms pipes with more than 4 arguments into variadic pipe bindings, which use a literal array argument. This literal array will be later memoized into a pure function invocation. 4. A special phase (`phaseAlignPipeVariadicVarOffset`) reconciles a difference in variable slot assignment logic between the template pipeline and the `TemplateDefinitionBuilder`, to ensure that the pipeline output can pass the existing tests. This phase should not affect runtime semantics and can be dropped once matching output is no longer necessary. 5. Reification emits pipe instructions based on the argument count. PR Close angular#50118
ChellappanRajan
pushed a commit
to ChellappanRajan/angular
that referenced
this pull request
Jan 23, 2024
…ar#50118) This commit adds ingest and transformation support for property writes and keyed writes to the template pipeline. PR Close angular#50118
ChellappanRajan
pushed a commit
to ChellappanRajan/angular
that referenced
this pull request
Jan 23, 2024
…peline (angular#50118) This commit adds support for interpolated properties to the template pipeline. PR Close angular#50118
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
(includes commits from #50008 from @dylhunn)