Closed Bug 1145262 Opened 9 years ago Closed 9 years ago

Modularize debugger frontend

Categories

(DevTools :: Debugger, defect)

x86
macOS
defect
Not set
normal

Tracking

(firefox40 fixed)

RESOLVED FIXED
Firefox 40
Tracking Status
firefox40 --- fixed

People

(Reporter: jlong, Assigned: jlong)

Details

Attachments

(2 files, 4 obsolete files)

As part of a Q1 goal to being cleaning up the debugger some, let's start by making things more componentized and removing the globals. I think this might be pretty painless, but I could be wrong.
Renaming because I'm not going to do as much refactoring as I originally thought. The most important thing right now is to split up the views into separate files and change some of the global references to local where it's easy. There are still a bunch of global variables but that's ok for now.
Summary: Reduce use of globals in debugger frontend → Modularize debugger frontend
Attached patch 1145262.patch (obsolete) — Splinter Review
Comment on attachment 8587026 [details] [diff] [review]
1145262.patch

This basically just splits up debugger-panes.js into multiple files (1 per view). I'd like to also do this to debugger-toolbar.js.

It's a lot more files, which is annoying because of jar.mn, but I find it a whole lot easier to navigate and we can start treating each view more modularly so they are easier to improve individually.
Attachment #8587026 - Flags: review?(vporof)
Previously I wanted to re-use our module system but that requires a bunch of refactoring to pass window/document instances around. It pains me that we don't have modules yet, but this is a really good start at least.
victor, I'm going on PTO for the rest of the week but it would be nice to land this when I get back, as it will bitrot quickly. if you have time!
Attached patch 1145262.patch (obsolete) — Splinter Review
Forgot to add the license text to the new files
Attachment #8587026 - Attachment is obsolete: true
Attachment #8587026 - Flags: review?(vporof)
Attachment #8589250 - Flags: review?(vporof)
Attached patch 1145262-panes.patch (obsolete) — Splinter Review
also forgot to add strict mode to the new files. I'm going to post another patch which breaks up debugger-toolbar.js in a similar fashion.
Attachment #8589250 - Attachment is obsolete: true
Attachment #8589250 - Flags: review?(vporof)
Attachment #8591891 - Flags: review?(vporof)
Attached patch 1145262-toolbar.patch (obsolete) — Splinter Review
Victor, don't worry if you can't get to these this week. I can get Eddy to take a look next week.

Note that these are only incremental restructurings, it feels a little weird how we are passing DebuggerView and DebuggerController instances around but this is just a first step towards making dependencies more explicit. Please keep in mind this a first step. Landing things in pieces is the only way this will work.
Attachment #8591894 - Flags: review?(vporof)
Assignee: nobody → jlong
Comment on attachment 8591891 [details] [diff] [review]
1145262-panes.patch

Review of attachment 8591891 [details] [diff] [review]:
-----------------------------------------------------------------

Looks like a mechanical change to me.

rs=me with green try push
Attachment #8591891 - Flags: review?(vporof) → review+
Comment on attachment 8591894 [details] [diff] [review]
1145262-toolbar.patch

Review of attachment 8591894 [details] [diff] [review]:
-----------------------------------------------------------------

rs=me with green try push
Attachment #8591894 - Flags: review?(vporof) → review+
I thought I had done a try push, but I can't find it anymore, so here's a new one: https://treeherder.mozilla.org/#/jobs?repo=try&revision=0700aea454ec
Green try, let's try to get it checked in!
Keywords: checkin-needed
Needs rebasing.
Keywords: checkin-needed
Attachment #8591891 - Attachment is obsolete: true
Attachment #8591894 - Attachment is obsolete: true
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/972e2aea8912
https://hg.mozilla.org/mozilla-central/rev/28cf16c94de5
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 40
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: