-
Notifications
You must be signed in to change notification settings - Fork 168
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
addDynamicDependency should be foolproof #6607
Comments
No need to use On the other hand, I question the need for additional checks here. If you pass a string with inappropriate contents to e.g. |
I think it's too easy to make a mistake here. |
That will require the user expression to be executed synchronously in the browser loop. |
Promise processing is added to the microtask queue which is purged after the currently running script but before the browser can continue with other tasks such as rendering or processing user events. I don't see why the current way of running would be a problem assuming the user doesn't do heavy number chunking in the expression. Any (reasonable) way of doing I/O from the user expression will still be asynchronous. |
That's the point. I'm just trying to make it "perfect" . |
#6602 introduces a new API to add a dependency.
The method accepts JS expression which is supposed to return a
Promise
.We may not rely that users will read javadocs and use it properly.
There is a check on the client side that the expression is a
Promise
.But that's not enough.
We should either:
Promise
.I think the last approach should be doable via using an
async
function which awaits for expression execution.await
will automatically wrap the expression into aPromise
if it's not already aPromise
.So it will work automatically out of the box.
I have only some doubts about GWT unit tests. It might be an issue to make them work with this change.
The text was updated successfully, but these errors were encountered: