-
Notifications
You must be signed in to change notification settings - Fork 51
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
Make :async feature awesome #20
Comments
We ran into an obscure bug because of the We were trying to schedule CPU intensive work to occur after an animation frame (task) had finished. goog.nextTick schedules a task to run after the frame has finished (and rendered), but the promise based implementation scheduled the work as a microtask. The microtask runs in the same task as the animation frame, therefore delaying rendering of the animation frame until the CPU intensive work has finished. The docstring for nexttick says:
I know that |
Just to add to what @danielcompton reported ... the development version of our app showed a bug (because it was using the patched But in some sense we were lucky. If this patch was masking a bug at dev time (instead of causing one at dev time), that would have been worse because you have much less chance of debugging optimised (production) code. I would suggest that this Edit: Hmm. I guess I mean it should be harder to include accidentally (eg: via |
I'm sorry to hear about the problems it caused. Thanks for sharing your experience.
This :async thing should be general, not only core.async specific. So I wanted to apply it globally. Also people could run into these timing issues with core.async alone. Do you think a fix for this issue would be to use original |
See binaryage/cljs-devtools#20 (comment) for more details.
That sounds possible. We can test that against our internal app to see if that fixes the problem. My understanding of how it would work would be:
As long as the promise was resolved in a separate task (triggered by the original nexttick), I think that should work. However, I'm still a little bit cautious about this feature for re-frame apps, as it is quite sensitive to the behaviour of the JS task queue. |
I tried a few experiments and I cannot make it to work. As soon as I introduce |
I think we will have to wait for chrome devs to add proper support for postMessage/onmessage and treat them as async operations. At that point this |
relevant issues in Chromium: |
Thanks for your detailed investigation on this :) I'll follow those chrome bugs. |
Tracked as a new chromium issue here: |
See binaryage/cljs-devtools#20 (comment) for more details.
FYI: the upstream issue was fixed, the :async feature will be removed from cljs-devtools eventually https://bugs.chromium.org/p/chromium/issues/detail?id=661705 |
Should the |
The |
This is a placeholder issue for people who want to track the progress of this experimental feature.
The announcement from Slack:
The text was updated successfully, but these errors were encountered: