Skip to content

Replace interpolation instructions#61639

Closed
crisbeto wants to merge 5 commits intoangular:mainfrom
crisbeto:more-interpolations
Closed

Replace interpolation instructions#61639
crisbeto wants to merge 5 commits intoangular:mainfrom
crisbeto:more-interpolations

Conversation

@crisbeto
Copy link
Copy Markdown
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
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.
Copy link
Copy Markdown
Member

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
Copy Markdown
Member Author

Passing TGP

@crisbeto
Copy link
Copy Markdown
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
Copy Markdown
Contributor

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

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

@angular-automatic-lock-bot
Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jun 26, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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