Skip to content

Conversation

@mmalerba
Copy link
Contributor

@mmalerba mmalerba commented Feb 22, 2025

Stop down-leveling the nullish coalescing (??) operator in templates. Depending on the ES version typescript may still down-level it.

Note: This does not change the semantics of ?? in templates, which currently doesn't match the semantics in TS/JS, as this would be a much more breaking change. The main difference is that a && b ?? c is treated the same as a && (b ?? c) in our template, while its considered invalid in TS/JS

@angular-robot angular-robot bot added the area: compiler Issues related to `ngc`, Angular's template compiler label Feb 22, 2025
@ngbot ngbot bot added this to the Backlog milestone Feb 22, 2025
@mmalerba mmalerba force-pushed the null branch 3 times, most recently from fa6d7ec to 05fcf72 Compare February 25, 2025 22:25
Stop down-leveling the nullish coalescing (`??`) operator in templates.
Depending on the ES version typescript may still down-level it.
Updates tests to reflect the fact that we no loger down-level nullish
coalescing.
Fixes outputted nullish coalescing expressions to not drop parentheses
when it would change the meaning of the expression.
@mmalerba mmalerba marked this pull request as ready for review February 28, 2025 23:25
@mmalerba mmalerba requested a review from crisbeto February 28, 2025 23:26
@mmalerba mmalerba added the target: major This PR is targeted for the next major release label Mar 1, 2025
@mmalerba mmalerba added the action: merge The PR is ready for merge by the caretaker label Mar 4, 2025
@mmalerba
Copy link
Contributor Author

mmalerba commented Mar 4, 2025

This PR was merged into the repository by commit ffb19e6.

The changes were merged into the following branches: main

@mmalerba mmalerba closed this in 2a23209 Mar 4, 2025
mmalerba added a commit that referenced this pull request Mar 4, 2025
Updates tests to reflect the fact that we no loger down-level nullish
coalescing.

PR Close #60060
mmalerba added a commit that referenced this pull request Mar 4, 2025
…60060)

Fixes outputted nullish coalescing expressions to not drop parentheses
when it would change the meaning of the expression.

PR Close #60060
@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 Apr 4, 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: compiler Issues related to `ngc`, Angular's template compiler target: major This PR is targeted for the next major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants