Skip to content
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

fix(migrations): control flow migration omnibus bugfixes #53076

Closed
wants to merge 4 commits into from

Conversation

jessicajaniuk
Copy link
Contributor

@jessicajaniuk jessicajaniuk commented Nov 20, 2023

This is an omnibus of minor formatting and bugfixes to the control flow migration:

  1. preserves leading spaces on inline templates
  2. Better handles self closing tags with or without the /
  3. overall formatting fixes
  4. adds support for *ngFor="x of y; template: templateName"
  5. fixes a bug with building conditions when trailing semicolons are present for NgIf with else and then else
  6. handles cases of transplanted views
  7. Fixes loss of let variable on NgIf else and if then else
  8. Handles case of ngif else or if then else not using semicolon separators
  9. Ensures common module is removed from classes using templateUrl

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix

Does this PR introduce a breaking change?

  • Yes
  • No

@jessicajaniuk jessicajaniuk 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 area: migrations Issues related to `ng update` migrations labels Nov 20, 2023
@ngbot ngbot bot added this to the Backlog milestone Nov 20, 2023
@jessicajaniuk jessicajaniuk force-pushed the more-formatting branch 2 times, most recently from a721c43 to cc1d938 Compare November 21, 2023 17:15

const expected = [
`@for (item of items; track item) {`,
` <ng-container *ngTemplateOutlet="itemTemplate; context: {$implicit: item}">`,
Copy link
Member

Choose a reason for hiding this comment

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

Might be a bit tricky, but NgTemplateOutlet or CommonModule needs to be imported for this to work.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree, though I think this use case is rare enough that if they have to manually add that in, it should be fine for the purposes of the migration.

@jessicajaniuk jessicajaniuk force-pushed the more-formatting branch 2 times, most recently from c322e8f to 4ed3a34 Compare November 21, 2023 21:45
@jessicajaniuk jessicajaniuk changed the title fix(migrations): control flow migration formatting fixes fix(migrations): control flow migration omnibus bugfixes Nov 21, 2023
@jessicajaniuk jessicajaniuk force-pushed the more-formatting branch 2 times, most recently from 9e04765 to abccf34 Compare November 22, 2023 18:41
This fix preserves leading indents in inline templates and also adds better handling for self closing tags
This adds code to cover the rare use case of an ngFor with a template param.
fixes: angular#53068
Common module removal would not happen when a component used a templateUrl due to the checks being in separate files. This change passes the removal analysis back to the original source file to safely remove CommonModule.
@jessicajaniuk jessicajaniuk force-pushed the more-formatting branch 2 times, most recently from dd3f5a2 to 399aa7b Compare November 27, 2023 18:17
@jessicajaniuk
Copy link
Contributor Author

Caretaker Note: This requires a patch CL to land when this syncs in.

@jessicajaniuk jessicajaniuk 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 Nov 27, 2023
@jessicajaniuk jessicajaniuk removed the request for review from AndrewKushnir November 27, 2023 18:30
This makes sure colons after else and then cases get migrated properly.
fixes: angular#53150
pkozlowski-opensource pushed a commit that referenced this pull request Nov 28, 2023
…53076)

Common module removal would not happen when a component used a templateUrl due to the checks being in separate files. This change passes the removal analysis back to the original source file to safely remove CommonModule.

PR Close #53076
pkozlowski-opensource pushed a commit that referenced this pull request Nov 28, 2023
This makes sure colons after else and then cases get migrated properly.
fixes: #53150

PR Close #53076
pkozlowski-opensource pushed a commit that referenced this pull request Nov 28, 2023
…53076)

This adds code to cover the rare use case of an ngFor with a template param.
fixes: #53068

PR Close #53076
pkozlowski-opensource pushed a commit that referenced this pull request Nov 28, 2023
…53076)

Common module removal would not happen when a component used a templateUrl due to the checks being in separate files. This change passes the removal analysis back to the original source file to safely remove CommonModule.

PR Close #53076
pkozlowski-opensource pushed a commit that referenced this pull request Nov 28, 2023
This makes sure colons after else and then cases get migrated properly.
fixes: #53150

PR Close #53076
@jessicajaniuk jessicajaniuk deleted the more-formatting branch November 28, 2023 17:09
Tweniee pushed a commit to Tweniee/angular that referenced this pull request Nov 29, 2023
This fix preserves leading indents in inline templates and also adds better handling for self closing tags

PR Close angular#53076
Tweniee pushed a commit to Tweniee/angular that referenced this pull request Nov 29, 2023
…ngular#53076)

This adds code to cover the rare use case of an ngFor with a template param.
fixes: angular#53068

PR Close angular#53076
Tweniee pushed a commit to Tweniee/angular that referenced this pull request Nov 29, 2023
…ngular#53076)

Common module removal would not happen when a component used a templateUrl due to the checks being in separate files. This change passes the removal analysis back to the original source file to safely remove CommonModule.

PR Close angular#53076
Tweniee pushed a commit to Tweniee/angular that referenced this pull request Nov 29, 2023
…#53076)

This makes sure colons after else and then cases get migrated properly.
fixes: angular#53150

PR Close angular#53076
tbondwilkinson pushed a commit to tbondwilkinson/angular that referenced this pull request Dec 6, 2023
This fix preserves leading indents in inline templates and also adds better handling for self closing tags

PR Close angular#53076
tbondwilkinson pushed a commit to tbondwilkinson/angular that referenced this pull request Dec 6, 2023
…ngular#53076)

This adds code to cover the rare use case of an ngFor with a template param.
fixes: angular#53068

PR Close angular#53076
tbondwilkinson pushed a commit to tbondwilkinson/angular that referenced this pull request Dec 6, 2023
…ngular#53076)

Common module removal would not happen when a component used a templateUrl due to the checks being in separate files. This change passes the removal analysis back to the original source file to safely remove CommonModule.

PR Close angular#53076
tbondwilkinson pushed a commit to tbondwilkinson/angular that referenced this pull request Dec 6, 2023
…#53076)

This makes sure colons after else and then cases get migrated properly.
fixes: angular#53150

PR Close angular#53076
@angular-automatic-lock-bot
Copy link

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 Dec 29, 2023
ChellappanRajan pushed a commit to ChellappanRajan/angular that referenced this pull request Jan 23, 2024
This fix preserves leading indents in inline templates and also adds better handling for self closing tags

PR Close angular#53076
ChellappanRajan pushed a commit to ChellappanRajan/angular that referenced this pull request Jan 23, 2024
…ngular#53076)

This adds code to cover the rare use case of an ngFor with a template param.
fixes: angular#53068

PR Close angular#53076
ChellappanRajan pushed a commit to ChellappanRajan/angular that referenced this pull request Jan 23, 2024
…ngular#53076)

Common module removal would not happen when a component used a templateUrl due to the checks being in separate files. This change passes the removal analysis back to the original source file to safely remove CommonModule.

PR Close angular#53076
ChellappanRajan pushed a commit to ChellappanRajan/angular that referenced this pull request Jan 23, 2024
…#53076)

This makes sure colons after else and then cases get migrated properly.
fixes: angular#53150

PR Close angular#53076
rlmestre pushed a commit to rlmestre/angular that referenced this pull request Jan 26, 2024
This fix preserves leading indents in inline templates and also adds better handling for self closing tags

PR Close angular#53076
rlmestre pushed a commit to rlmestre/angular that referenced this pull request Jan 26, 2024
…ngular#53076)

This adds code to cover the rare use case of an ngFor with a template param.
fixes: angular#53068

PR Close angular#53076
rlmestre pushed a commit to rlmestre/angular that referenced this pull request Jan 26, 2024
…ngular#53076)

Common module removal would not happen when a component used a templateUrl due to the checks being in separate files. This change passes the removal analysis back to the original source file to safely remove CommonModule.

PR Close angular#53076
rlmestre pushed a commit to rlmestre/angular that referenced this pull request Jan 26, 2024
…#53076)

This makes sure colons after else and then cases get migrated properly.
fixes: angular#53150

PR Close angular#53076
amilamen pushed a commit to amilamen/angular that referenced this pull request Jan 26, 2024
This fix preserves leading indents in inline templates and also adds better handling for self closing tags

PR Close angular#53076
amilamen pushed a commit to amilamen/angular that referenced this pull request Jan 26, 2024
…ngular#53076)

This adds code to cover the rare use case of an ngFor with a template param.
fixes: angular#53068

PR Close angular#53076
amilamen pushed a commit to amilamen/angular that referenced this pull request Jan 26, 2024
…ngular#53076)

Common module removal would not happen when a component used a templateUrl due to the checks being in separate files. This change passes the removal analysis back to the original source file to safely remove CommonModule.

PR Close angular#53076
amilamen pushed a commit to amilamen/angular that referenced this pull request Jan 26, 2024
…#53076)

This makes sure colons after else and then cases get migrated properly.
fixes: angular#53150

PR Close angular#53076
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: migrations Issues related to `ng update` migrations merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants