Skip to content

Replace interpolation instructions #61639

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

Closed
wants to merge 5 commits into from

Conversation

crisbeto
Copy link
Member

These changes replace the propertyInterpolateX, classMapInterpolateX, styleMapInterpolateX and stylePropInterpolateX instructions with their non-interpolated equivalents and a call to the interpolateX helper 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 as interpolateX under the hood. Furthermore it may lead to some byte savings, because we have more opportunities to chain instructions now.

crisbeto added 5 commits May 23, 2025 09:03
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.
@crisbeto crisbeto added action: review The PR is still awaiting reviews from at least one requested reviewer target: rc This PR is targeted for the next release-candidate labels May 23, 2025
@angular-robot angular-robot bot added the area: core Issues related to the framework runtime label May 23, 2025
@ngbot ngbot bot added this to the Backlog milestone May 23, 2025
@crisbeto crisbeto marked this pull request as ready for review May 23, 2025 09:05
@@ -28,7 +30,9 @@ import {
* @codeGenApi
*/
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.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@crisbeto
Copy link
Member Author

Passing TGP

@crisbeto
Copy link
Member Author

Caretaker note: we'll have to patch cl/762367094 together with these changes.

@crisbeto crisbeto added action: merge The PR is ready for merge by the caretaker merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels May 23, 2025
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
@thePunderWoman
Copy link
Contributor

This PR was merged into the repository by commit 289ae50.

The changes were merged into the following branches: main, 20.0.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action: merge The PR is ready for merge by the caretaker area: core Issues related to the framework runtime merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note target: rc This PR is targeted for the next release-candidate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy