Skip to content

fix(core): cache ComponentRef inputs and outputs#60156

Closed
crisbeto wants to merge 1 commit intoangular:mainfrom
crisbeto:cache-inputs-outputs
Closed

fix(core): cache ComponentRef inputs and outputs#60156
crisbeto wants to merge 1 commit intoangular:mainfrom
crisbeto:cache-inputs-outputs

Conversation

@crisbeto
Copy link
Copy Markdown
Member

The set of inputs and outputs of a component is static, but the getter for the inputs and outputs property was re-computing them every time which the user might not expect. These changes add a couple of lines to cache them instead.

The set of inputs and outputs of a component is static, but the getter for the `inputs` and `outputs` property was re-computing them every time which the user might not expect. These changes add a couple of lines to cache them instead.
@crisbeto crisbeto added action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release labels Feb 28, 2025
@angular-robot angular-robot bot added the area: core Issues related to the framework runtime label Feb 28, 2025
@ngbot ngbot bot added this to the Backlog milestone Feb 28, 2025
@crisbeto crisbeto marked this pull request as ready for review February 28, 2025 08:41
Copy link
Copy Markdown
Member

@pkozlowski-opensource pkozlowski-opensource left a comment

Choose a reason for hiding this comment

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

Thnx! This was on my radar as well.

@crisbeto crisbeto added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Feb 28, 2025
@mmalerba
Copy link
Copy Markdown
Contributor

This PR was merged into the repository by commit af02914.

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

@mmalerba mmalerba closed this in af02914 Feb 28, 2025
mmalerba pushed a commit that referenced this pull request Feb 28, 2025
The set of inputs and outputs of a component is static, but the getter for the `inputs` and `outputs` property was re-computing them every time which the user might not expect. These changes add a couple of lines to cache them instead.

PR Close #60156
@diesieben07
Copy link
Copy Markdown

Both the resulting array and the objects with in it are mutable, so a caller can now modify the inputs and outputs of a ComponentRef for every subsequent caller.

@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 Apr 5, 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 target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants