fix(compiler): move defer trigger assertions out of parser#61747
Closed
crisbeto wants to merge 1 commit intoangular:mainfrom
Closed
fix(compiler): move defer trigger assertions out of parser#61747crisbeto wants to merge 1 commit intoangular:mainfrom
crisbeto wants to merge 1 commit intoangular:mainfrom
Conversation
When defer blocks have a reference-based trigger without a parameter, we infer it from the placeholder block. This requires some validations like ensuring that there's only one element in the placeholder. The validations are currently implemented at the parser level which can affect tools like linters that need to pass `preserveWhitespaces: true` in order to get accurate source mappings. These changes move the validations into the template type checker so that they still get flagged, but much later in the process. Moving them over involves a bit more work, because the template type checker also sets `preserveWhitespaces: true`. Fixes angular#61725.
crisbeto
commented
May 29, 2025
|
|
||
| if (name === null) { | ||
| let trigger: Element | null = null; | ||
| let target: Element | null = null; |
Member
Author
There was a problem hiding this comment.
This change is unrelated. I just noticed that the variable name was shadowing one of the parameters.
AndrewKushnir
approved these changes
May 29, 2025
Contributor
AndrewKushnir
left a comment
There was a problem hiding this comment.
Reviewed-for: public-api
AndrewKushnir
approved these changes
May 29, 2025
Member
Author
atscott
approved these changes
May 29, 2025
Contributor
atscott
left a comment
There was a problem hiding this comment.
reviewed-for: public-api
Contributor
|
This PR was merged into the repository by commit a70f03a. The changes were merged into the following branches: main, 20.0.x |
kirjs
pushed a commit
that referenced
this pull request
May 30, 2025
When defer blocks have a reference-based trigger without a parameter, we infer it from the placeholder block. This requires some validations like ensuring that there's only one element in the placeholder. The validations are currently implemented at the parser level which can affect tools like linters that need to pass `preserveWhitespaces: true` in order to get accurate source mappings. These changes move the validations into the template type checker so that they still get flagged, but much later in the process. Moving them over involves a bit more work, because the template type checker also sets `preserveWhitespaces: true`. Fixes #61725. PR Close #61747
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When defer blocks have a reference-based trigger without a parameter, we infer it from the placeholder block. This requires some validations like ensuring that there's only one element in the placeholder. The validations are currently implemented at the parser level which can affect tools like linters that need to pass
preserveWhitespaces: truein order to get accurate source mappings.These changes move the validations into the template type checker so that they still get flagged, but much later in the process. Moving them over involves a bit more work, because the template type checker also sets
preserveWhitespaces: true.Fixes #61725.