Closed Bug 1043323 Opened 10 years ago Closed 7 years ago

treeherder-ui: Switch the repo to a functional directory structure

Categories

(Tree Management :: Treeherder, defect, P4)

defect

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: emorley, Unassigned)

References

Details

Migrated from:
https://github.com/mozilla/treeherder-ui/issues/85

Original summary:
functional folder structure

pnispel commented 24 days ago:

{
I think that this project is a large enough size that it's easy to get confused when looking through the code for some functionality. This issue is to start the conversation about changing the directory structure from:
js --->
controllers
models
services
partials

to a structure based on functionality such as http://trochette.github.io/Angular-Design-Patterns-Best-Practices/#/modularity

This allows somebody to view the folder structure for the app and immediately know what the application does and where code for each functionality lives. For Treeherder it may look something like:

app
+--- assets
|     | +--- img
|     | +--- fonts
+--- css
+--- common
|     | +--- directives
|     | +--- services
|     | +--- providers
+--- header
|     |   header.js / css / html
+--- changeset
|     |   changeset.js / css/ html
|     | +--- revision
|     |       | revision.js / css / html
|     |       | +--- jobs
|     |       |       | jobs.js / css / html
+--- jobs_panel 
|     |  jobs_panel.js / css / html

}
camd commented 24 days ago:

Paul - This is a really good point. I like this approach. It can be hard when certain parts cross functional boundaries. And sometimes common is the right answer to that. Too many levels of depth can also be a bit cumbersome (like in changeset above). But I think this is an excellent conversation to have and we could definitely improve on where we are.

If we do this, we would be well served by having an agreed-upon file prefixes (or suffixes) for the js files. ctrl, dir, srv something like that for controller, directive, service, respectively.

I have mixed feelings on putting the html in there, but maybe that would be great. I think what this would buy us is, if I'm working on the top-nav panel, I don't have to look in so many places. It'll all be in one spot. And that sounds really great. :)

Let's bring this up at the Thursday meeting, ok?
camd commented 24 days ago:

Oh, and definitely +1 for breaking up the treeherder.css file. That thing's a mess in there...
Priority: P4 → P3
Blocks: 1072681
No longer blocks: 1072681
Priority: P3 → P4
Depends on: 1124382
We may do this organically as part of other work, but will likely not do this as a single task.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.