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
perf(ivy): chain styling instructions #33837
Conversation
b2de2d6
to
4de440d
Compare
@@ -25,10 +24,14 @@ const IMPORTANT_FLAG = '!important'; | |||
* A styling expression summary that is to be processed by the compiler | |||
*/ | |||
export interface StylingInstruction { |
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.
Since we're only using one property on this interface, why not just return a array of StylingInstructionCall
instances?
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.
It's set up like this so that it's easier to group calls to the same instruction together. If we wanted to change it, we'd have to do something like StylingInstructionCall[][]
instead, but that would mean looping through all the calls when we're trying to figure out whether to chain them.
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.
ah I see. I missed the reference
member. This is fine.
@@ -133,7 +135,7 @@ export function stylePropInternal( | |||
* | |||
* @codeGenApi | |||
*/ | |||
export function ɵɵclassProp(className: string, value: boolean | null): void { | |||
export function ɵɵclassProp(className: string, value: boolean | null): TsickleIssue1009 { |
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.
Add a comment explaining the return value and why it's an instance of TsickleIssue1009
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.
Isn't this the point of the TsickleIssue1009
type in the first place? Also Andrew mentioned that this isn't an issue anymore so as soon as these changes land I'll clean out all the usages of the TsickleIssue1009
type.
4de440d
to
0ae1352
Compare
The feedback has been addressed @matsko. |
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.
LGTM aside from typos. Note that we should be careful with the G3 presubmit for this because we are changing binding order in some cases, which could break some G3 targets.
packages/compiler-cli/test/compliance/r3_view_compiler_styling_spec.ts
Outdated
Show resolved
Hide resolved
packages/compiler-cli/test/compliance/r3_view_compiler_styling_spec.ts
Outdated
Show resolved
Hide resolved
@@ -25,10 +24,14 @@ const IMPORTANT_FLAG = '!important'; | |||
* A styling expression summary that is to be processed by the compiler | |||
*/ | |||
export interface StylingInstruction { |
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.
ah I see. I missed the reference
member. This is fine.
Adds support for chaining of `styleProp`, `classProp` and `stylePropInterpolateX` instructions whenever possible which should help generate less code. Note that one complication here is for `stylePropInterpolateX` instructions where we have to break into multiple chains if there are other styling instructions inbetween the interpolations which helps maintain the execution order.
0ae1352
to
caa2a7d
Compare
Adds support for chaining of `styleProp`, `classProp` and `stylePropInterpolateX` instructions whenever possible which should help generate less code. Note that one complication here is for `stylePropInterpolateX` instructions where we have to break into multiple chains if there are other styling instructions inbetween the interpolations which helps maintain the execution order. PR Close angular#33837
Adds support for chaining of `styleProp`, `classProp` and `stylePropInterpolateX` instructions whenever possible which should help generate less code. Note that one complication here is for `stylePropInterpolateX` instructions where we have to break into multiple chains if there are other styling instructions inbetween the interpolations which helps maintain the execution order. PR Close #33837 PR Close #34340
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. |
Adds support for chaining of
styleProp
,classProp
andstylePropInterpolateX
instructions whenever possible which should help generate less code. Note that one complication here is forstylePropInterpolateX
instructions where we have to break into multiple chains if there are other styling instructions inbetween the interpolations which helps maintain the execution order.