Replace interpolation instructions#61639
Closed
crisbeto wants to merge 5 commits intoangular:mainfrom
Closed
Conversation
Replaces all of the `stylePropInterpolateX` instructions with the existing `styleProp` with an interpolated value.
Replaces the `styleMapInterpolateX` instructions with the existing `styleMap` and a passed-in interpolated value in order to simplify the runtime.
Replaces the `classMapInterpolateX` instructions with `classMap` plus a call to `interpolate` in order to simplify the runtime. The only difference between `classMapInterpolateX` and `classMap` was that the former passes `keyValueArraySet` into `checkStylingMap` while the latter passes `classKeyValueArraySet`. This doesn't appear to matter, because the interpolation instructions always have a string value which means that the function is never called.
Updates the `ɵɵinterpolate` instruction so it doesn't call into `interpolation1` under the hood since it requires a prefix/suffix and we know there isn't one.
Replaces the `propertyInterpolateX` instructions with calls to `property` and the `interpolate` helper. This allows us to drop the dedicated interpolation instructions and simplify the runtime for future work.
pkozlowski-opensource
approved these changes
May 23, 2025
| export function ɵɵinterpolate(v0: any): string | NO_CHANGE { | ||
| return interpolation1(getLView(), '', v0, ''); | ||
| // Avoid calling into the `interpolate` functions since | ||
| // we know that we don't have a prefix or suffix. |
There was a problem hiding this comment.
nit: I would drop this comment as it refers to something we don't do and I'm not sure it adds new information / value.
Member
Author
Member
Author
|
Caretaker note: we'll have to patch cl/762367094 together with these changes. |
thePunderWoman
pushed a commit
that referenced
this pull request
May 26, 2025
Replaces the `styleMapInterpolateX` instructions with the existing `styleMap` and a passed-in interpolated value in order to simplify the runtime. PR Close #61639
thePunderWoman
pushed a commit
that referenced
this pull request
May 26, 2025
Replaces the `classMapInterpolateX` instructions with `classMap` plus a call to `interpolate` in order to simplify the runtime. The only difference between `classMapInterpolateX` and `classMap` was that the former passes `keyValueArraySet` into `checkStylingMap` while the latter passes `classKeyValueArraySet`. This doesn't appear to matter, because the interpolation instructions always have a string value which means that the function is never called. PR Close #61639
thePunderWoman
pushed a commit
that referenced
this pull request
May 26, 2025
Updates the `ɵɵinterpolate` instruction so it doesn't call into `interpolation1` under the hood since it requires a prefix/suffix and we know there isn't one. PR Close #61639
thePunderWoman
pushed a commit
that referenced
this pull request
May 26, 2025
Replaces the `propertyInterpolateX` instructions with calls to `property` and the `interpolate` helper. This allows us to drop the dedicated interpolation instructions and simplify the runtime for future work. PR Close #61639
thePunderWoman
pushed a commit
that referenced
this pull request
May 26, 2025
Replaces all of the `stylePropInterpolateX` instructions with the existing `styleProp` with an interpolated value. PR Close #61639
thePunderWoman
pushed a commit
that referenced
this pull request
May 26, 2025
Replaces the `styleMapInterpolateX` instructions with the existing `styleMap` and a passed-in interpolated value in order to simplify the runtime. PR Close #61639
thePunderWoman
pushed a commit
that referenced
this pull request
May 26, 2025
Replaces the `classMapInterpolateX` instructions with `classMap` plus a call to `interpolate` in order to simplify the runtime. The only difference between `classMapInterpolateX` and `classMap` was that the former passes `keyValueArraySet` into `checkStylingMap` while the latter passes `classKeyValueArraySet`. This doesn't appear to matter, because the interpolation instructions always have a string value which means that the function is never called. PR Close #61639
thePunderWoman
pushed a commit
that referenced
this pull request
May 26, 2025
Updates the `ɵɵinterpolate` instruction so it doesn't call into `interpolation1` under the hood since it requires a prefix/suffix and we know there isn't one. PR Close #61639
thePunderWoman
pushed a commit
that referenced
this pull request
May 26, 2025
Replaces the `propertyInterpolateX` instructions with calls to `property` and the `interpolate` helper. This allows us to drop the dedicated interpolation instructions and simplify the runtime for future work. PR Close #61639
Contributor
|
This PR was merged into the repository by commit 289ae50. The changes were merged into the following branches: main, 20.0.x |
|
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 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.
These changes replace the
propertyInterpolateX,classMapInterpolateX,styleMapInterpolateXandstylePropInterpolateXinstructions with their non-interpolated equivalents and a call to theinterpolateXhelper introduced in #61557. In total this allows us to remove 37 instructions from the runtime, simplifying maintenance and making it easier to ship features in the future. Performance should be identical, because all of these instructions were calling into the same helpers asinterpolateXunder the hood. Furthermore it may lead to some byte savings, because we have more opportunities to chain instructions now.