-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Don't set NodeFlags.JavaScriptFile on JSON, avoid asking for JSDoc outside of JS #52641
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
@typescript-bot test this |
Heya @jakebailey, I've started to run the diff-based top-repos suite on this PR at 3b20e70. You can monitor the build here. Update: The results are in! |
Heya @jakebailey, I've started to run the diff-based top-repos suite (tsserver) on this PR at 3b20e70. You can monitor the build here. Update: The results are in! |
Heya @jakebailey, I've started to run the parallelized Definitely Typed test suite on this PR at 3b20e70. You can monitor the build here. |
Heya @jakebailey, I've started to run the diff-based user code test suite on this PR at 3b20e70. You can monitor the build here. Update: The results are in! |
Heya @jakebailey, I've started to run the perf test suite on this PR at 3b20e70. You can monitor the build here. Update: The results are in! |
Heya @jakebailey, I've started to run the diff-based user code test suite (tsserver) on this PR at 3b20e70. You can monitor the build here. Update: The results are in! |
Heya @jakebailey, I've started to run the extended test suite on this PR at 3b20e70. You can monitor the build here. |
@jakebailey Here are the results of running the user test suite comparing Everything looks good! |
1 similar comment
@jakebailey Here are the results of running the user test suite comparing Everything looks good! |
Heya @jakebailey, I've run the RWC suite on this PR - assuming you're on the TS core team, you can view the resulting diff here. |
Do we need to better-harden these at all? TypeScript/src/compiler/binder.ts Line 3287 in 6b43f82
|
Probably, I guess all of those (there are other checks sorta like it) may be doing more work than needed. Clearly nothing actually fails... (We could also harden |
Maybe it's not worth changing the flag thing at all, if it makes those sort of "is outside of TS" checks harder. Or maybe we need to do the opposite and instead have a helper which says "if in TS". |
@jakebailey Here are the results of running the top-repos suite comparing Everything looks good! |
1 similar comment
@jakebailey Here are the results of running the top-repos suite comparing Everything looks good! |
@jakebailey Here they are:
CompilerComparison Report - main..52641
System
Hosts
Scenarios
TSServerComparison Report - main..52641
System
Hosts
Scenarios
StartupComparison Report - main..52641
System
Hosts
Scenarios
Developer Information: |
Seems like no change in performance, but, a little bit of a memory improvement? Hard to say if that's specifically not setting the flag or the jsdoc change itself. I guess I can split this PR in two. |
@typescript-bot perf test this |
Heya @jakebailey, I've started to run the perf test suite on this PR at f6f3090. You can monitor the build here. Update: The results are in! |
@jakebailey Here they are:
CompilerComparison Report - main..52641
System
Hosts
Scenarios
TSServerComparison Report - main..52641
System
Hosts
Scenarios
StartupComparison Report - main..52641
System
Hosts
Scenarios
Developer Information: |
Hm, hard to say if that's actually better. I guess the only question I have is if it's worth it to change the flags; I think the checker change is totally fine as it reduces the work we do, and I can do that without changing this flags behavior (though I don't think the flag being on there is a good idea in general). |
This reverts commit f6f3090.
I found this with #52640 as we ask for JSDoc tags on something that isn't a JS file without first checking, which could be a bug, but in this particular case is just a waste of CPU time.
I also noticed that we check that the node isn't also JSON, which seemed weird, because how can something be both JSON and JS? It turns out that JSON files get both context flags set, and so this extra condition is required (the only use of
isInJsonFile
in the checker!). But, nothing fails if we just make the twoNodeFlags
mutually exclusive, so I've done that.