Closed
Bug 1265885
Opened 9 years ago
Closed 9 years ago
add promise.defer
Categories
(DevTools :: Framework, enhancement, P1)
DevTools
Framework
Tracking
(firefox49 fixed)
Tracking | Status | |
---|---|---|
firefox49 | --- | fixed |
People
(Reporter: tromey, Assigned: jlast)
References
Details
(Whiteboard: [devtools-html])
Attachments
(1 file, 4 obsolete files)
3.65 KB,
patch
|
tromey
:
review+
|
Details | Diff | Splinter Review |
We need promise.defer in devtools, so it will have to be reimplemented
for the de-chrome-ification project.
There's already a copy in devtools.html, but it needs tests at least.
Also some loader magic may be involved here.
Updated•9 years ago
|
Assignee: nobody → jlaster
Status: NEW → ASSIGNED
Iteration: --- → 49.1 - May 9
Flags: qe-verify-
Priority: -- → P1
Assignee | ||
Comment 1•9 years ago
|
||
Attachment #8746587 -
Flags: review?(ttromey)
Comment on attachment 8746587 [details] [diff] [review]
defer.1.patch
Review of attachment 8746587 [details] [diff] [review]:
-----------------------------------------------------------------
I am not sure about this... This uses DOM promises internally whereas we still use Promise.jsm throughout DevTools.
I realize you can't use Promise.jsm from content code, so should we do something to avoid proliferating another promises module? Not sure of my opinions yet, just want to raise the issue.
Also should this module be available to all DevTools code? It might make more since under /devtools/shared then, instead of /devtools/client.
Assignee | ||
Comment 3•9 years ago
|
||
Thanks jryans for bringing up these questions. I meant to raise them in my review.
> should we do something to avoid proliferating another promises module?
I'm not sure of the answer, except that Promise.jsm will obviously not work for *.html projects.
> should this module be available to all DevTools code
At this point I was operating under the assumption that the server would still use Promise.jsm. Does that make sense?
Reporter | ||
Comment 4•9 years ago
|
||
Comment on attachment 8746587 [details] [diff] [review]
defer.1.patch
Review of attachment 8746587 [details] [diff] [review]:
-----------------------------------------------------------------
I'm switching this review to :jryans because he definitely knows a lot more about this area than I do.
I tend to think this should go in devtools/shared. Looking for uses there I see, e.g.
https://dxr.mozilla.org/mozilla-central/source/devtools/shared/DevToolsUtils.js#53
I think this can be run on the client.
I wonder if the defer function should only be installed if it isn't already available.
Also, I wonder if this should only install the "defer" replacement function if no such
function is already available. And, perhaps maybe this should all be hidden in the loader,
also not sure.
::: devtools/client/shared/promise.js
@@ +1,1 @@
> +Promise.defer = function defer() {
There's some boilerplate that should go at the top of new files.
Also I think it would be good if new files were born eslint-clean and had an inclusion
in .eslintignore (like !devtools/x/y/z.js).
Finally, I think a jsdoc comment is needed.
::: devtools/client/shared/test/unit/test_promise.js
@@ +1,1 @@
> +var Cu = Components.utils;
Standard comment header.
Attachment #8746587 -
Flags: review?(ttromey) → review?(jryans)
Comment on attachment 8746587 [details] [diff] [review]
defer.1.patch
Review of attachment 8746587 [details] [diff] [review]:
-----------------------------------------------------------------
Since "Promise.defer" doesn't seem to be part of a future JS version, I think we should avoid installing it onto Promise directly like the approach here.
Instead, let's expose it as a utility function. Since it has a clear, independent purpose I think it should just be a "defer" module that exposes this. I think it's okay for it to use Promise internally (instead of Promise.jsm) since that's where we want to head in general anyway.
Let's also move to devtools/shared for general access. So, that would be devtools/shared/defer.js
Attachment #8746587 -
Flags: review?(jryans) → review-
Assignee | ||
Comment 6•9 years ago
|
||
Attachment #8746587 -
Attachment is obsolete: true
Attachment #8749414 -
Flags: review?(jryans)
Comment on attachment 8749414 [details] [diff] [review]
defer.2.patch
Review of attachment 8749414 [details] [diff] [review]:
-----------------------------------------------------------------
Seems right, but still contains a file from the last version.
::: devtools/client/shared/promise.js
@@ +1,1 @@
> +Promise.defer = function defer() {
I think this file should have been removed...?
Attachment #8749414 -
Flags: review?(jryans) → feedback+
Updated•9 years ago
|
Iteration: 49.1 - May 9 → 49.2 - May 23
Assignee | ||
Comment 8•9 years ago
|
||
Attachment #8749414 -
Attachment is obsolete: true
Assignee | ||
Updated•9 years ago
|
Keywords: checkin-needed
Comment 10•9 years ago
|
||
(In reply to Ryan VanderMeulen [:RyanVM] from comment #9)
> Is there a Try link handy for this patch?
Flags: needinfo?(jlaster)
Reporter | ||
Comment 11•9 years ago
|
||
This has some eslint warnings and one error.
I'll upload a new version momentarily and push it to try.
Flags: needinfo?(jlaster)
Reporter | ||
Comment 12•9 years ago
|
||
MozReview-Commit-ID: 1Paf8cfkh5Q
Attachment #8753833 -
Attachment is obsolete: true
Reporter | ||
Comment 13•9 years ago
|
||
Reporter | ||
Updated•9 years ago
|
Attachment #8756432 -
Flags: review+
Reporter | ||
Comment 14•9 years ago
|
||
set author on the commit
MozReview-Commit-ID: 1Paf8cfkh5Q
Attachment #8756432 -
Attachment is obsolete: true
Reporter | ||
Updated•9 years ago
|
Attachment #8756494 -
Flags: review+
Reporter | ||
Updated•9 years ago
|
Keywords: checkin-needed
Updated•9 years ago
|
Iteration: 49.2 - May 23 → 49.3 - Jun 6
Comment 15•9 years ago
|
||
Keywords: checkin-needed
Comment 16•9 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox49:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 49
Updated•6 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•