Closed
Bug 640055
Opened 15 years ago
Closed 15 years ago
Move all files to the "var %modulename% = exports" method of exporting
Categories
(Mozilla QA Graveyard :: Mozmill Tests, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: gmealer, Unassigned)
References
Details
(Whiteboard: [module-refactor])
Attachments
(1 file)
|
10.99 KB,
patch
|
whimboo
:
review+
|
Details | Diff | Splinter Review |
Henrik has taken to doing something cool in his submissions. After defining the doc namespace with @name, he then creates an alias to the common.js exports object with the desired name of the namespace.
I like this method because it clearly establishes--within the file itself--how we'd like other files to import it.
Ex:
/**
* @namespace Defines wrapper methods for back-end services
*/
var services = exports;
Note to Henrik: we don't need @name services anymore. It'll use the name of the var as it should. We only needed @name when there was no actual variable.
Comment 1•15 years ago
|
||
Makes it even simpler then. :)
Summary: Move all files to the var [modulename] = exports method of exporting → Move all files to the "var %modulename% = exports" method of exporting
| Reporter | ||
Comment 2•15 years ago
|
||
https://github.com/geoelectric/mozmill-api-refactor/tree/ms1-exports
Note that I didn't add namespace jsdocs for files that didn't have it already. We still need to figure out the best way to document the map, so I'm intentionally holding off.
Attachment #519540 -
Flags: review?(hskupin)
Comment 3•15 years ago
|
||
Comment on attachment 519540 [details] [diff] [review]
Added module namespace aliases for exports and removed unnecessary @names from namespaces
>+var dom = exports;
As talked on IRC please add a jsdoc comment for the dom module.
>+var navBar = exports;
Question here is should we use camelCase or simply have an 1:1 naming schema with the file name:
session.js -> var session = exports;
navbar.js -> var navbar = exports;
The latter option would make it more clear that we put objects onto the module scope.
Otherwise looks fine. r=me with the first part updated.
Attachment #519540 -
Flags: review?(hskupin) → review+
| Reporter | ||
Comment 4•15 years ago
|
||
Will do on the dom comment.
Re: camelCasing, I originally had it as "navbar" and "tabbar," but checked the current project and we'd camel-cased domUtils and similar. So I changed it.
I could go either way, though I think there are some compound words (like tabbar) where it's a bit ugly. I thought about the exact same thing re: matching filename to identifier, and agree that'd be the reason, if any.
| Reporter | ||
Comment 5•15 years ago
|
||
Landed on master: https://github.com/geoelectric/mozmill-api-refactor/commit/04cad37b20879df1a238d2de02fbafbedab47b81
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Updated•7 years ago
|
Product: Mozilla QA → Mozilla QA Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•