Diagnostic to flag cases where control flow can break content projection#53190
Closed
crisbeto wants to merge 4 commits intoangular:mainfrom
Closed
Diagnostic to flag cases where control flow can break content projection#53190crisbeto wants to merge 4 commits intoangular:mainfrom
crisbeto wants to merge 4 commits intoangular:mainfrom
Conversation
…T nodes When doing directive matching in the compiler, we need to be able to create a selector from an AST node. We already have the utility, but these changes simplify the public API and expose it so it can be used in `compiler-cli`.
…spaces during template type checking These changes expose the `ngContentSelectors` and `preserveWhitespaces` metadata to the TCB so they can be used in the next commit to implement a new diagnostic.
…tainer The control flow projection diagnostic will mention `ng-container` as a workaround for projection multiple nodes. These changes add a couple of tests to ensure that the approach works.
1 task
…ent projection This is a follow-up to the fix from angular#52414. It adds a diagnostic that will tell users when a control flow is preventing its direct descendants from being projected into a specific component slot.
385331c to
2233493
Compare
Member
Author
dylhunn
approved these changes
Nov 27, 2023
Contributor
dylhunn
left a comment
There was a problem hiding this comment.
reviewed-for: public-api
jessicajaniuk
approved these changes
Nov 27, 2023
Contributor
jessicajaniuk
left a comment
There was a problem hiding this comment.
reviewed-for: public-api
Member
|
This PR was merged into the repository by commit 4c1d69e. |
crisbeto
added a commit
to crisbeto/angular
that referenced
this pull request
Dec 1, 2023
…t projection diagnostic These changes add an option to the `extendedDiagnostics` field that allows the check from angular#53190 to be disabled. This is a follow-up based on a recent discussion.
crisbeto
added a commit
to crisbeto/angular
that referenced
this pull request
Dec 6, 2023
…t projection diagnostic These changes add an option to the `extendedDiagnostics` field that allows the check from angular#53190 to be disabled. This is a follow-up based on a recent discussion.
|
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. |
ChellappanRajan
pushed a commit
to ChellappanRajan/angular
that referenced
this pull request
Jan 23, 2024
…T nodes (angular#53190) When doing directive matching in the compiler, we need to be able to create a selector from an AST node. We already have the utility, but these changes simplify the public API and expose it so it can be used in `compiler-cli`. PR Close angular#53190
ChellappanRajan
pushed a commit
to ChellappanRajan/angular
that referenced
this pull request
Jan 23, 2024
…spaces during template type checking (angular#53190) These changes expose the `ngContentSelectors` and `preserveWhitespaces` metadata to the TCB so they can be used in the next commit to implement a new diagnostic. PR Close angular#53190
ChellappanRajan
pushed a commit
to ChellappanRajan/angular
that referenced
this pull request
Jan 23, 2024
…tainer (angular#53190) The control flow projection diagnostic will mention `ng-container` as a workaround for projection multiple nodes. These changes add a couple of tests to ensure that the approach works. PR Close angular#53190
ChellappanRajan
pushed a commit
to ChellappanRajan/angular
that referenced
this pull request
Jan 23, 2024
…ent projection (angular#53190) This is a follow-up to the fix from angular#52414. It adds a diagnostic that will tell users when a control flow is preventing its direct descendants from being projected into a specific component slot. PR Close angular#53190
rlmestre
pushed a commit
to rlmestre/angular
that referenced
this pull request
Jan 26, 2024
…T nodes (angular#53190) When doing directive matching in the compiler, we need to be able to create a selector from an AST node. We already have the utility, but these changes simplify the public API and expose it so it can be used in `compiler-cli`. PR Close angular#53190
rlmestre
pushed a commit
to rlmestre/angular
that referenced
this pull request
Jan 26, 2024
…spaces during template type checking (angular#53190) These changes expose the `ngContentSelectors` and `preserveWhitespaces` metadata to the TCB so they can be used in the next commit to implement a new diagnostic. PR Close angular#53190
rlmestre
pushed a commit
to rlmestre/angular
that referenced
this pull request
Jan 26, 2024
…tainer (angular#53190) The control flow projection diagnostic will mention `ng-container` as a workaround for projection multiple nodes. These changes add a couple of tests to ensure that the approach works. PR Close angular#53190
rlmestre
pushed a commit
to rlmestre/angular
that referenced
this pull request
Jan 26, 2024
…ent projection (angular#53190) This is a follow-up to the fix from angular#52414. It adds a diagnostic that will tell users when a control flow is preventing its direct descendants from being projected into a specific component slot. PR Close angular#53190
amilamen
pushed a commit
to amilamen/angular
that referenced
this pull request
Jan 26, 2024
…T nodes (angular#53190) When doing directive matching in the compiler, we need to be able to create a selector from an AST node. We already have the utility, but these changes simplify the public API and expose it so it can be used in `compiler-cli`. PR Close angular#53190
amilamen
pushed a commit
to amilamen/angular
that referenced
this pull request
Jan 26, 2024
…spaces during template type checking (angular#53190) These changes expose the `ngContentSelectors` and `preserveWhitespaces` metadata to the TCB so they can be used in the next commit to implement a new diagnostic. PR Close angular#53190
amilamen
pushed a commit
to amilamen/angular
that referenced
this pull request
Jan 26, 2024
…tainer (angular#53190) The control flow projection diagnostic will mention `ng-container` as a workaround for projection multiple nodes. These changes add a couple of tests to ensure that the approach works. PR Close angular#53190
amilamen
pushed a commit
to amilamen/angular
that referenced
this pull request
Jan 26, 2024
…ent projection (angular#53190) This is a follow-up to the fix from angular#52414. It adds a diagnostic that will tell users when a control flow is preventing its direct descendants from being projected into a specific component slot. PR Close angular#53190
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.
Note: this is a resubmit of #52726.
These changes are a follow-up to the fix from #52414. They add a new diagnostic to the compiler that will flag cases where an element would've been projected into a specific slot of a component, but it isn't because it exists inside of a control flow node that has multiple root nodes. Aside from the diagnostic, I have to move some code around so it can be reused. Includes the following commits:
refactor(compiler): expose utility for creating CSS selectors from AST nodes
When doing directive matching in the compiler, we need to be able to create a selector from an AST node. We already have the utility, but these changes simplify the public API and expose it so it can be used in
compiler-cli.refactor(compiler-cli): expose ng-content selectors and preserveWhitespaces during template type checking
These changes expose the
ngContentSelectorsandpreserveWhitespacesmetadata to the TCB so they can be used in the next commit to implement a new diagnostic.test(core): add tests for control flow content projection with ng-container
The control flow projection diagnostic will mention
ng-containeras a workaround for projection multiple nodes. These changes add a couple of tests to ensure that the approach works.fix(compiler-cli): add diagnostic for control flow that prevents content projection
This is a follow-up to the fix from #52414. It adds a diagnostic that will tell users when a control flow is preventing its direct descendants from being projected into a specific component slot.