Open Bug 1365607 Opened 3 years ago Updated 11 months ago
[meta] Switch devtools to async/await from task
Like bug 1353542 did for other parts of the browser, it would be good to switch devtools from Task to real async+await. That bug has some scripts used for the conversion. Also, Florian offered to help a bit in https://bugzilla.mozilla.org/show_bug.cgi?id=1353542#c8
DevTools bug triage (filter on CLIMBING SHOES).
Priority: -- → P3
it might be better doing this at the same time as bug 1414177.
Here's a tweaked version of Florian's conversion script that I was able to run on RDM. To use: <obj-dir>/dist/bin/xpcshell <script> <directory to convert>
Also try running: To use: <obj-dir>/dist/bin/xpcshell <script> <directory to convert> --replace-generators as a second pass to replace non-task generators (which is usually correct, but may require more review).
Priority: P3 → P5
Summary: Switch devtools to async/await from Task.jsm/yield → [meta] Switch devtools to async/await from Task.jsm/yield
Quick summary of Task.jsm refactoring. All devtools folders are now converted to async/await! All? No, almost all. I ignored gcli, old webconsole tests and old debugger. Which are planned to be dropped. And various tests that started failing when converted to async/await. They are all tracked in dependent bugs.
Note: As of bug 1446833 the remaining devtools tests added as generators are not being run (for instance, ./mach test devtools/client/memory/test/unit/test_action-toggle-inverted.js succeeds with only a single subtest). I discovered this while investigating bug 1451333 and thought you might want to know :)
(In reply to Alexandre Poirot [:ochameau] from comment #8) > Thanks for the heads up. > I didn't particularly chased the "function*" occurences, we probably should > as a second part of this meta bug. You should also look for 'yield' if you weren't already. Note that bug 1446833 only affected xpcshell tests, not mochitests.
The cleanup is almost finished. There is only one last usage in production code: https://searchfox.org/mozilla-central/source/devtools/client/shared/redux/middleware/task.js#25 This code should be easy to remove as no other code should be producing Task generators... They should all be async functions now. Otherwise, it is only tests, mostly old debugger tests and a couple of comments still referring to Tasks: https://searchfox.org/mozilla-central/search?q=%5CsTask%5C.&case=true®exp=true&path=devtools%2F Finally, we should be able to remove the task module: https://searchfox.org/mozilla-central/source/devtools/shared/task.js
Summary: [meta] Switch devtools to async/await from Task.jsm/yield → [meta] Switch devtools to async/await from task.js/yield
You need to log in before you can comment on or make changes to this bug.