Closed
Bug 1440320
Opened 7 years ago
Closed 7 years ago
Convert devtools/shared from Task.jsm/yield to async/await
Categories
(DevTools :: General, enhancement)
DevTools
General
Tracking
(firefox60 fixed)
RESOLVED
FIXED
Firefox 60
Tracking | Status | |
---|---|---|
firefox60 | --- | fixed |
People
(Reporter: ochameau, Assigned: ochameau)
References
Details
Attachments
(2 files, 5 obsolete files)
Similar to bug 1437828 but this time focused on devtools/shared folder.
Assignee | ||
Updated•7 years ago
|
Assignee: nobody → poirot.alex
Assignee | ||
Comment 1•7 years ago
|
||
Finally got a green try on this:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=d79447da166fa51503dd9984d5af3356745fdb2e
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Assignee | ||
Comment 9•7 years ago
|
||
As for the server, I split the work with the same kind of intermediate patches to ease the review. But I plan to merge them all before merging.
Also attached the xpcshell script to have it reviewed, but I'll remove it.
Most of the patches at fully automated and boring to review. I read them completely to review them.
The most interesting part to review are:
* the xpcshell script
- kIgnorePaths list all the files that shouldn't be converted to async
I ignored:
* gcli for now. We may try to convert it if we don't remove it soon enough.
* task.js, as there is no point in modifying it if we want to remove it.
* css-properties front, because of bug 1440322. This is going to require more analysis.
- generatorWhitelist and generatorWhitelistPrefixes
List all the files that uses generators outside of Task usage, i.e. real generators.
This is one of the biggest task to do while crafting these refactoring patches.
* the "manual fixes" patches
Address a couple of naive eslint fixes, but also real errors introduced by the xpcshell script.
It sometimes fails on complex setup.
If you are concerned about converting the client at the same time, I'm making progress on bug 1440321.
I may have it ready next week if I don't hit any big roadblock.
Assignee | ||
Comment 10•7 years ago
|
||
Also, a quick note about the "promise issues regarding client codebase", which also impact shared, by extension.
This is specific to Promise and not Task. This is related to the switch from privileged Promise, that are always alive and never destroyed, to Promise coming from panel's document. These second promises lifecycle is linked to their document. Whenever the document is destroyed, its promises are destroyed and stops resolving. You still get valid JS references to them, still can call resolve/reject callbacks, but they will stop resolving. Thus breaking many test and also introducing real races during toolbox closing.
So Task isn't introducing the same issues AFAIK. This is why I'm trying to do Task refactoring before Promises in shared and client folders.
Assignee | ||
Comment 11•7 years ago
|
||
> - kIgnorePaths list all the files that shouldn't be converted to async
I also ignore devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_04.js, I think, for the same reason as bug 1438121.
Assignee | ||
Comment 12•7 years ago
|
||
Try run with --rebuild 5 looks green as well:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=5ed0b91e96987ffca64fd9ac538177f88b7c199e&selectedJob=163891960
Comment 13•7 years ago
|
||
mozreview-review |
Comment on attachment 8953250 [details]
Bug 1440320 - Removed unused methods from async-utils module.
https://reviewboard.mozilla.org/r/222534/#review228914
Thanks for this cleanup! :)
Attachment #8953250 -
Flags: review?(jryans) → review+
Comment 14•7 years ago
|
||
mozreview-review |
Comment on attachment 8953251 [details]
Bug 1440320 - Convert Task.jsm to async/await in devtools/shared.
https://reviewboard.mozilla.org/r/222536/#review228916
Looks great to me! :)
Attachment #8953251 -
Flags: review?(jryans) → review+
Comment 15•7 years ago
|
||
mozreview-review |
Comment on attachment 8953252 [details]
Bug 1440320 - Put spaces before parentheses in "async function()" pattern.
https://reviewboard.mozilla.org/r/222538/#review228918
Attachment #8953252 -
Flags: review?(jryans) → review+
Comment 16•7 years ago
|
||
mozreview-review |
Comment on attachment 8953253 [details]
Bug 1440320 - Get rid of the now useless require("devtools/shared/task").
https://reviewboard.mozilla.org/r/222540/#review228920
Looks good overall! :)
::: devtools/shared/async-utils.js:16
(Diff revision 1)
> *
> * See Task documentation at https://developer.mozilla.org/en-US/docs/Mozilla/JavaScript_code_modules/Task.jsm.
> */
>
> -var {Task} = require("devtools/shared/task");
>
Nit: remove extra blank line
::: devtools/shared/security/socket.js:55
(Diff revision 1)
> return Cc["@mozilla.org/nss_errors_service;1"]
> .getService(Ci.nsINSSErrorsService);
> });
>
> -const { Task } = require("devtools/shared/task");
>
Nit: remove extra blank line
::: devtools/shared/task.js
(Diff revision 1)
> * fulfilled. "Task.spawn" returns a promise that is resolved when the task
> * completes successfully, or is rejected if an exception occurs.
> *
> * -----------------------------------------------------------------------------
> *
> - * const {Task} = require("devtools/shared/task");
I think we should keep this line. These are docs for the task lib itself.
Attachment #8953253 -
Flags: review?(jryans) → review+
Comment 17•7 years ago
|
||
mozreview-review |
Comment on attachment 8953254 [details]
Bug 1440320 - Convert generators to async functions in devtools/shared
https://reviewboard.mozilla.org/r/222542/#review228922
Attachment #8953254 -
Flags: review?(jryans) → review+
Comment 18•7 years ago
|
||
mozreview-review |
Comment on attachment 8953255 [details]
Bug 1440320 - manual fixes
https://reviewboard.mozilla.org/r/222544/#review228926
Looks good! :)
::: commit-message-96e50:1
(Diff revision 1)
> +Bug 1440320 - manual fixes r=jryans
I think the summary should be more detailed, like "Manual cleanup of Task conversion in devtools/shared" or something.
Attachment #8953255 -
Flags: review?(jryans) → review+
Great work, thanks for doing this! :D
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Assignee | ||
Updated•7 years ago
|
Attachment #8953249 -
Attachment is obsolete: true
Assignee | ||
Updated•7 years ago
|
Attachment #8953252 -
Attachment is obsolete: true
Assignee | ||
Updated•7 years ago
|
Attachment #8953253 -
Attachment is obsolete: true
Assignee | ||
Updated•7 years ago
|
Attachment #8953254 -
Attachment is obsolete: true
Assignee | ||
Updated•7 years ago
|
Attachment #8953255 -
Attachment is obsolete: true
Comment 22•7 years ago
|
||
Pushed by apoirot@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a32e89eb6712
Removed unused methods from async-utils module. r=jryans
https://hg.mozilla.org/integration/autoland/rev/c40bf199f612
Convert Task.jsm to async/await in devtools/shared. r=jryans
Comment 23•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/a32e89eb6712
https://hg.mozilla.org/mozilla-central/rev/c40bf199f612
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox60:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 60
Updated•6 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•