perf(forms): make built-in ControlValueAccessors more tree-shakable#41146
perf(forms): make built-in ControlValueAccessors more tree-shakable#41146AndrewKushnir wants to merge 1 commit intoangular:masterfrom
Conversation
9e00943 to
557aa6c
Compare
petebacondarwin
left a comment
There was a problem hiding this comment.
An alternative approach would be for all built-in CVAs to extend an internal abstract class. Then you could check for a built-in CVA using instanceof. I feel that this would be a more clean approach than a semi-hidden internal property.
557aa6c to
075d210
Compare
|
Thanks for the review @petebacondarwin 👍 As we discussed, I've updated the code to check whether a given CVA is an instance of a class that directly extends |
|
Also started a Global Presubmit to verify that there are no edge cases that might be affected. |
petebacondarwin
left a comment
There was a problem hiding this comment.
LGTM - one suggestion about the docs.
|
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. |
This commit updates Forms code to avoid direct references to all built-in ControlValueAccessor classes, which
prevents their tree-shaking from production builds. Instead, a new static property is added to all built-in
ControlValueAccessors, which is checked when we need to identify whether a given ControlValueAccessors is a
built-in one.
This PR partially implements #41011.
PR Type
What kind of change does this PR introduce?
Does this PR introduce a breaking change?