-
Notifications
You must be signed in to change notification settings - Fork 27k
Template Pipeline 3: For a Few Templates More #50118
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
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
left a comment
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.
This makes sense to me, although it might be nice to go through the pure function and pipe support commits together in the future.
|
This PR was merged into the repository by commit 9847085. |
…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. |
…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
…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
…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
…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
…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
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
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
…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
…ular#50118) This commit adds support for ternary expressions in the ingest operation of the template pipeline. PR Close angular#50118
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
…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
…ar#50118) This commit adds ingest and transformation support for property writes and keyed writes to the template pipeline. PR Close angular#50118
…peline (angular#50118) This commit adds support for interpolated properties to the template pipeline. PR Close angular#50118
(includes commits from #50008 from @dylhunn)