-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Extended template checks #42984
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
Extended template checks #42984
Conversation
1db63b9
to
915515b
Compare
packages/compiler-cli/src/ngtsc/extended_template_diagnostics/api/api.ts
Outdated
Show resolved
Hide resolved
packages/compiler-cli/src/ngtsc/extended_template_diagnostics/api/api.ts
Outdated
Show resolved
Hide resolved
packages/compiler-cli/src/ngtsc/extended_template_diagnostics/src/template_checker.ts
Outdated
Show resolved
Hide resolved
packages/compiler-cli/src/ngtsc/extended_template_diagnostics/src/template_checker.ts
Outdated
Show resolved
Hide resolved
...piler-cli/src/ngtsc/extended_template_diagnostics/src/template_checks/banana_in_box_check.ts
Outdated
Show resolved
Hide resolved
...piler-cli/src/ngtsc/extended_template_diagnostics/src/template_checks/banana_in_box_check.ts
Outdated
Show resolved
Hide resolved
...piler-cli/src/ngtsc/extended_template_diagnostics/src/template_checks/banana_in_box_check.ts
Outdated
Show resolved
Hide resolved
...piler-cli/src/ngtsc/extended_template_diagnostics/src/template_checks/banana_in_box_check.ts
Outdated
Show resolved
Hide resolved
packages/compiler-cli/src/ngtsc/extended_template_diagnostics/test/template_checks_spec.ts
Outdated
Show resolved
Hide resolved
915515b
to
fd11c3d
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.
Great work on an initial proposal here, looking really good!
Mostly just a bunch of nitpicks, a few stylistic comments, and a couple questions about edge cases. Nothing too concerning with this PR, hope we can land it soon!
packages/compiler-cli/src/ngtsc/extended_template_diagnostics/BUILD.bazel
Outdated
Show resolved
Hide resolved
packages/compiler-cli/src/ngtsc/extended_template_diagnostics/src/template_checker.ts
Outdated
Show resolved
Hide resolved
packages/compiler-cli/src/ngtsc/extended_template_diagnostics/src/template_checker.ts
Outdated
Show resolved
Hide resolved
packages/compiler-cli/src/ngtsc/extended_template_diagnostics/src/template_checker.ts
Outdated
Show resolved
Hide resolved
packages/compiler-cli/src/ngtsc/extended_template_diagnostics/src/template_checker.ts
Outdated
Show resolved
Hide resolved
...piler-cli/src/ngtsc/extended_template_diagnostics/src/template_checks/banana_in_box_check.ts
Outdated
Show resolved
Hide resolved
...piler-cli/src/ngtsc/extended_template_diagnostics/src/template_checks/banana_in_box_check.ts
Outdated
Show resolved
Hide resolved
...piler-cli/src/ngtsc/extended_template_diagnostics/src/template_checks/banana_in_box_check.ts
Outdated
Show resolved
Hide resolved
packages/compiler-cli/src/ngtsc/extended_template_diagnostics/test/template_checks_spec.ts
Outdated
Show resolved
Hide resolved
packages/compiler-cli/src/ngtsc/extended_template_diagnostics/test/template_checks_spec.ts
Outdated
Show resolved
Hide resolved
packages/compiler-cli/src/ngtsc/extended_template_diagnostics/api/api.ts
Outdated
Show resolved
Hide resolved
737eb07
to
9da58bc
Compare
packages/compiler-cli/src/ngtsc/extended_template_diagnostics/BUILD.bazel
Outdated
Show resolved
Hide resolved
packages/compiler-cli/src/ngtsc/extended_template_diagnostics/src/template_checker.ts
Outdated
Show resolved
Hide resolved
packages/compiler-cli/src/ngtsc/extended_template_diagnostics/api/api.ts
Outdated
Show resolved
Hide resolved
packages/compiler-cli/src/ngtsc/extended_template_diagnostics/src/template_checker.ts
Outdated
Show resolved
Hide resolved
packages/compiler-cli/src/ngtsc/typecheck/test/diagnostics_spec.ts
Outdated
Show resolved
Hide resolved
...piler-cli/src/ngtsc/extended_template_diagnostics/src/template_checks/banana_in_box_check.ts
Outdated
Show resolved
Hide resolved
...piler-cli/src/ngtsc/extended_template_diagnostics/src/template_checks/banana_in_box_check.ts
Outdated
Show resolved
Hide resolved
df24977
to
e12f69e
Compare
e12f69e
to
151c5f9
Compare
151c5f9
to
c5a6f9c
Compare
packages/compiler-cli/src/ngtsc/typecheck/extended/src/template_checker.ts
Outdated
Show resolved
Hide resolved
packages/compiler-cli/src/ngtsc/typecheck/extended/src/template_checker.ts
Outdated
Show resolved
Hide resolved
@@ -203,11 +203,15 @@ export class NullVisitor implements Visitor<void> { | ||
export class RecursiveVisitor implements Visitor<void> { | ||
visitElement(element: Element): void { | ||
visitAll(this, element.attributes); | ||
visitAll(this, element.inputs); | ||
visitAll(this, element.outputs); |
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.
Thanks for making this fix and for keeping it in a separate commit, much easier to understand the context this way!
c5a6f9c
to
2d27ea3
Compare
packages/compiler-cli/src/ngtsc/typecheck/extended/src/template_checks/banana_in_box/spec.ts
Outdated
Show resolved
Hide resolved
2d27ea3
to
9da79f4
Compare
...compiler-cli/src/ngtsc/typecheck/extended/src/template_checks/invalid_banana_in_box/index.ts
Show resolved
Hide resolved
...compiler-cli/src/ngtsc/typecheck/extended/src/template_checks/invalid_banana_in_box/index.ts
Show resolved
Hide resolved
...compiler-cli/src/ngtsc/typecheck/extended/src/template_checks/invalid_banana_in_box/index.ts
Show resolved
Hide resolved
...compiler-cli/src/ngtsc/typecheck/extended/src/template_checks/invalid_banana_in_box/index.ts
Show resolved
Hide resolved
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. |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
The compiler currently doesn't really generates warning.
Issue Number: #42966
What is the new behavior?
This PR introduces the
extended
package which should be able to generate diagnostics after type checking (integration with the compiler should come in a future PR). The API provides an interface forTemplateCheck
s to be authored, the package also has a function to generate the extended template diagnostics. The banana in a box check, that validates the two-way binding syntax is implemented with it's unit test.The
extended
package is private, the only modification to the public API is the newBANANA_IN_BOX
ErrorCode
.Does this PR introduce a breaking change?
Other information