-
Notifications
You must be signed in to change notification settings - Fork 27k
feat(compiler): Add extended diagnostic to warn when the track functi… #60495
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
Conversation
|
TODOs:
|
packages/compiler-cli/src/ngtsc/typecheck/extended/checks/uninvoked_track_function/index.ts
Outdated
Show resolved
Hide resolved
...tsc/typecheck/extended/test/checks/uninvoked_track_function/uninvoked_track_function.spec.ts
Outdated
Show resolved
Hide resolved
dc5c3a4 to
9bcb2a0
Compare
packages/compiler-cli/src/ngtsc/typecheck/extended/checks/uninvoked_track_function/index.ts
Outdated
Show resolved
Hide resolved
JeanMeche
left a comment
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.
Beside the small nit.
9bcb2a0 to
14ad13f
Compare
|
This doesn't pass the presubmit, it correctly flagged un-invoked functions. |
packages/compiler-cli/src/ngtsc/typecheck/extended/checks/uninvoked_track_function/index.ts
Outdated
Show resolved
Hide resolved
0506479 to
f8af359
Compare
devversion
left a comment
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.
LGTM from my side, adding @crisbeto in case he has other thoughts.
f8af359 to
e732838
Compare
|
FYI this will require a TGP, because extended diagnostics can break existing targets. |
|
I'll take care of the cleanup. |
e732838 to
948c94b
Compare
kirjs
left a comment
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.
Looks great, thanks for adding this
Reviewed-for: public-api
...tsc/typecheck/extended/test/checks/uninvoked_track_function/uninvoked_track_function.spec.ts
Outdated
Show resolved
Hide resolved
...tsc/typecheck/extended/test/checks/uninvoked_track_function/uninvoked_track_function.spec.ts
Outdated
Show resolved
Hide resolved
948c94b to
6e614f2
Compare
6e614f2 to
7e7b170
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.
I actually hope you guys will reevaluate this decision. It should 100% produce a warning
This MR is already good as is, but this test tickles my OCD d:
7e7b170 to
cbea221
Compare
|
TGP is "green". |
|
This PR was merged into the repository by commit 7a97176. The changes were merged into the following branches: main |
|
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. |
…on is not called on @for blocks
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
Fixes #58264
What is the current behavior?
Passing just the function name to the track function basically will make the for loop recreate the list everytime. The function need to be called.
What is the new behavior?
A template diagnostic will warn the developer that they need to call the function in the track part of a @for block for desired performance outcome.
Does this PR introduce a breaking change?
Other information