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
Diagnostic to flag cases where control flow can break content projection #53190
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.
…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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reviewed-for: public-api
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reviewed-for: public-api
This PR was merged into the repository by commit 4c1d69e. |
…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
…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
…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
…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.
…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.
…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.
…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.
…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.
…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
…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
…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
…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
…t projection diagnostic (angular#53311) 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. PR Close angular#53311
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. |
…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
…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
…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
…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
…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
…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
…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
…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
…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
…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
…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
…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
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
ngContentSelectors
andpreserveWhitespaces
metadata 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-container
as 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.