-
Notifications
You must be signed in to change notification settings - Fork 26.2k
refactor(core): usage strategy should detect ambiguous query usage #30215
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
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
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
@devversion Think this should be |
c4c9448
to
790f933
Compare
@kara I'm not sure if it's really considered a fix, but I agree that it's not a refactor either. Renamed to |
790f933
to
d2dc2f8
Compare
d2dc2f8
to
eabc4ad
Compare
…ous query usage Currently we always just set the timing to `false` if we aren't able to analyze a given call expression or new expression. e.g. ```ts ngOnInit() { thirdPartyCallSync(() => this.query.doSomething()) } ``` In that case the `thirdPartyCallSync` function comes from the `node_modules` and is only defined through types while there is no code for the actual function logic that can be analyzed. This makes it impossible to tell whether the given call expression actually causes the specified arrow function to be executed synchronously or not. In order to be able to make this better, we now peek into the passed arrow function and check for a synchronous query usage. If so, we set the query timing to static and mark it as ambiguous. This ensures that the usage strategy is less "magical" and more correct with third-party code. Additionally since functions like `setTimeout` are not analyzable but known to be asynchronous, there is a hard-coded list of known functions which shouldn't be marked as ambiguous. Resolves FW-1214. As planned within https://hackmd.io/hPiLWpPlQ4uynC1luIBdfQ
eabc4ad
to
5065c25
Compare
…ous query usage (#30215) Currently we always just set the timing to `false` if we aren't able to analyze a given call expression or new expression. e.g. ```ts ngOnInit() { thirdPartyCallSync(() => this.query.doSomething()) } ``` In that case the `thirdPartyCallSync` function comes from the `node_modules` and is only defined through types while there is no code for the actual function logic that can be analyzed. This makes it impossible to tell whether the given call expression actually causes the specified arrow function to be executed synchronously or not. In order to be able to make this better, we now peek into the passed arrow function and check for a synchronous query usage. If so, we set the query timing to static and mark it as ambiguous. This ensures that the usage strategy is less "magical" and more correct with third-party code. Additionally since functions like `setTimeout` are not analyzable but known to be asynchronous, there is a hard-coded list of known functions which shouldn't be marked as ambiguous. Resolves FW-1214. As planned within https://hackmd.io/hPiLWpPlQ4uynC1luIBdfQ PR Close #30215
…ous query usage (angular#30215) Currently we always just set the timing to `false` if we aren't able to analyze a given call expression or new expression. e.g. ```ts ngOnInit() { thirdPartyCallSync(() => this.query.doSomething()) } ``` In that case the `thirdPartyCallSync` function comes from the `node_modules` and is only defined through types while there is no code for the actual function logic that can be analyzed. This makes it impossible to tell whether the given call expression actually causes the specified arrow function to be executed synchronously or not. In order to be able to make this better, we now peek into the passed arrow function and check for a synchronous query usage. If so, we set the query timing to static and mark it as ambiguous. This ensures that the usage strategy is less "magical" and more correct with third-party code. Additionally since functions like `setTimeout` are not analyzable but known to be asynchronous, there is a hard-coded list of known functions which shouldn't be marked as ambiguous. Resolves FW-1214. As planned within https://hackmd.io/hPiLWpPlQ4uynC1luIBdfQ PR Close angular#30215
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. |
Currently we always just set the timing to
false
if we aren'table to analyze a given call expression or new expression. e.g.
In that case the
thirdPartyCallSync
function comes from thenode_modules
and is only defined through types while there is no code for the
actual function logic that can be analyzed. This makes it impossible
to tell whether the given call expression actually causes the specified
arrow function to be executed synchronously or not. In order to be able
to make this better, we now peek into the passed arrow function and
check for a synchronous query usage. If so, we set the query timing to
static and mark it as ambiguous. This ensures that the usage strategy is
less "magical" and more correct with third-party code.
Additionally since functions like
setTimeout
are not analyzable but knownto be asynchronous, there is a hard-coded list of known functions which
shouldn't be marked as ambiguous.
Resolves FW-1214. As planned within https://hackmd.io/hPiLWpPlQ4uynC1luIBdfQ