Skip to content

fix(core): inject migration: replace param with this.#60713

Closed
RussellSprouts wants to merge 1 commit intoangular:mainfrom
RussellSprouts:inject-comments
Closed

fix(core): inject migration: replace param with this.#60713
RussellSprouts wants to merge 1 commit intoangular:mainfrom
RussellSprouts:inject-comments

Conversation

@RussellSprouts
Copy link
Copy Markdown

The inject migration tool inserts const foo = this.foo if code in the constructor references the constructor parameter foo. If foo is a readonly property, we can instead replace foo with this.foo. This allows more properties to be moved out of the constructor with combineMemberInitializers.
For now, it only touches initializers, not all of the code in the constructor.

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.dev application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@pullapprove pullapprove bot requested a review from kirjs April 2, 2025 19:20
@angular-robot angular-robot bot added the area: core Issues related to the framework runtime label Apr 2, 2025
@ngbot ngbot bot added this to the Backlog milestone Apr 2, 2025
@AndrewKushnir AndrewKushnir requested review from crisbeto and removed request for kirjs April 2, 2025 20:49
The inject tool inserts `const foo = this.foo` if code
in the constructor referenced the constructor parameter `foo`.
If `foo` is a readonly property, we can instead replace `foo` with
`this.foo`. This allows more properties to be moved out of the
constructor with combineMemberInitializers.
For now, it only touches initializers, not all of the code in the
constructor.
@crisbeto crisbeto added action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release labels Apr 9, 2025
@kirjs
Copy link
Copy Markdown
Contributor

kirjs commented Apr 10, 2025

This PR was merged into the repository by commit 11d441f.

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

kirjs pushed a commit that referenced this pull request Apr 10, 2025
The inject tool inserts `const foo = this.foo` if code
in the constructor referenced the constructor parameter `foo`.
If `foo` is a readonly property, we can instead replace `foo` with
`this.foo`. This allows more properties to be moved out of the
constructor with combineMemberInitializers.
For now, it only touches initializers, not all of the code in the
constructor.

PR Close #60713
@kirjs kirjs closed this in 11d441f Apr 10, 2025
@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 May 11, 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.

3 participants