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

[Patch port] fix(compiler-cli): don't type check the bodies of control flow nodes in basic mode #55558

Closed
wants to merge 1 commit into from

Conversation

crisbeto
Copy link
Member

This is a port of #55360 to the patch release. I had to adjust some of the code and the tests since the TCB shape changed in v18, but the underlying logic is the same.

Angular only checks the contents of template nodes in full type checking mode. After v17, the new control flow always had its body checked, even in basic mode, which started revealing compilation errors for apps that were using the schematic to automatically switch to the new syntax.

These changes mimic the old behavior by not checking the bodies of if, switch and for blocks in basic mode. Note that the expressions of the blocks are still going to be checked.

Fixes #52969.

…in basic mode

Angular only checks the contents of template nodes in full type checking mode. After v17, the new control flow always had its body checked, even in basic mode, which started revealing compilation errors for apps that were using the schematic to automatically switch to the new syntax.

These changes mimic the old behavior by not checking the bodies of `if`, `switch` and `for` blocks in basic mode. Note that the expressions of the blocks are still going to be checked.

Fixes angular#52969.
@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 area: compiler Issues related to `ngc`, Angular's template compiler labels Apr 26, 2024
@ngbot ngbot bot added this to the Backlog milestone Apr 26, 2024
@pkozlowski-opensource pkozlowski-opensource 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 Apr 26, 2024
@crisbeto crisbeto added merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note and removed merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note labels Apr 26, 2024
@crisbeto
Copy link
Member Author

Caretaker note: this is ready to go. The mergability check is taking a long time to run for some reason.

@AndrewKushnir
Copy link
Contributor

This PR was merged into the repository by commit 51ac883.

AndrewKushnir pushed a commit that referenced this pull request Apr 26, 2024
…in basic mode (#55558)

Angular only checks the contents of template nodes in full type checking mode. After v17, the new control flow always had its body checked, even in basic mode, which started revealing compilation errors for apps that were using the schematic to automatically switch to the new syntax.

These changes mimic the old behavior by not checking the bodies of `if`, `switch` and `for` blocks in basic mode. Note that the expressions of the blocks are still going to be checked.

Fixes #52969.

PR Close #55558
@fidlip
Copy link

fidlip commented May 16, 2024

Hi, thanks for this PR. Is there some plan to manage "checkControlFlowBodies" flag state from configuration in future?

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: compiler Issues related to `ngc`, Angular's template compiler 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

4 participants