Closed Bug 1402387 Opened 7 years ago Closed 7 years ago

CamelCase all React component files in \devtools\client\jsonview\components\

Categories

(DevTools :: JSON Viewer, enhancement, P3)

enhancement

Tracking

(firefox57 fix-optional, firefox58 fixed)

RESOLVED FIXED
Firefox 58
Tracking Status
firefox57 --- fix-optional
firefox58 --- fixed

People

(Reporter: pbro, Assigned: jselmanovski1, Mentored)

References

Details

(Keywords: good-first-bug)

Attachments

(1 file, 2 obsolete files)

We recently agreed to name our React component file names using the CamelCase convention.

However the files in \devtools\client\jsonview\components\ do not follow this convention, so let's rename them.

This is an easy fix, but make sure you read the contribution docs before starting: http://docs.firefox-dev.tools/ so that you can build Firefox locally and verify that things still work after your change.
After building, just running the built Firefox and opening the JSONViewer (by requesting a JSON response) should be enough of a test that things still work.
Blocks: 1402389
Depends on: 1402390
Depends on: 1402391
No longer depends on: 1402390
No longer depends on: 1402391
No longer blocks: 1402389
Can I take this? I wanna start collaborating
(In reply to migueluseche from comment #1)
> Can I take this? I wanna start collaborating
I see you've already shown interested in a similar bug: bug 1402391. Why don't you start over there and I'll then assign this one to you too once the other is done? Sounds good?
I'm a student at Seneca college learning open source, and I was hoping to work on this bug for my course as a good start.  If no one else is currently working on it, I'd like to give it a try.  Look forward to hearing back!
(In reply to jselmanovski1 from comment #3)
> I'm a student at Seneca college learning open source, and I was hoping to
> work on this bug for my course as a good start.  If no one else is currently
> working on it, I'd like to give it a try.  Look forward to hearing back!
Sure, thank you for helping!

On top of comment 0, here are a few more precisions:

- the moz.build file in this directory will also need to be updated (it lists the files)
- we use a module loading system in DevTools, so you will also need to update the require path in some of the files you will change.
For example, there is a file in this directory called json-panel.js, here you will rename it to JsonPanel.js, right?
But if you look into main-tabbed-area.js, you will see that it requires json-panel like this:
  const { JsonPanel } = createFactories(require("./json-panel"));
So, you will also need to update this to
  const { JsonPanel } = createFactories(require("./JsonPanel"));
so that the module loader still finds the right file, after you've renamed it.
The same should be done in other similar pars of the code.

Once you've done all the changes, please make sure to build your local Firefox version based on these changes, then run it and verify that the JSON Viewer still works.
To do this, simply request a JSON response from a server, and the JSON Viewer will open in the tab automatically.
You can try this for example: http://md5.jsontest.com/?text=this%20is%20a%20test

I'll assign the bug to you now, let me know if you need more help.
Assignee: nobody → jselmanovski1
Status: NEW → ASSIGNED
Awesome...I'll get started on this.  One of my classmates, Dan Epstein, recently completed a patch for CamelCase in the Frameworks path so if I have any questions, I have a few people to ask.

Thanks Brosset
Hey Patrick,

I've started working on this and have a question.  In the path, there is another directory.  Should I make a change to that as well?

Example
=======
Original: \devtools\client\jsonview\components\reps\toolbar.js
New: \devtools\client\jsonview\components\reps\ToolBar.js

I will start with everything else, but would like to know if this is something you're looking for as well.

Thanks Pat

- Jiel
Attached patch Bug1402387Fix.patch (obsolete) — Splinter Review
Tested locally after performing mach clobber and mach build to ensure everything is working by using the test link provided by Patrick.
Attachment #8914108 - Flags: review?(pbrosset)
(In reply to jselmanovski1 from comment #6)
> I've started working on this and have a question.  In the path, there is
> another directory.  Should I make a change to that as well?
Yes, let's convert all components under devtools/client/jsonview/components/ including sub-directories.
Comment on attachment 8914108 [details] [diff] [review]
Bug1402387Fix.patch

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

Looks great. Thank you.
As I said in my last comment, let's also rename the reps/toolbar.js file to reps/Toolbar.js and we should be good to go.
Attachment #8914108 - Flags: review?(pbrosset)
By changing the sub-directory file (reps/toolbar.js to reps/ToolBar.js) and testing locally using the example JSON response provided, this should fix and close this bug.

Thanks Brosset
Attachment #8914874 - Flags: review?(pbrosset)
Comment on attachment 8914874 [details] [diff] [review]
CamelCased reps/toolbar.js to reps/ToolBar.js to complete the bug.

Just doing some cleanup. I merged the 2 patches together and pushed them to our mozreview platform so it's easier to review and then land.
Attachment #8914874 - Attachment is obsolete: true
Attachment #8914874 - Flags: review?(pbrosset)
Comment on attachment 8914108 [details] [diff] [review]
Bug1402387Fix.patch

Oh, and I've also made a small change: renamed ToolBar.js to Toolbar.js since the class itself is Toolbar, that was more consistent.
I'll do a final review of the code now. But things look great to me!
Attachment #8914108 - Attachment is obsolete: true
Comment on attachment 8915006 [details]
Bug 1402387 - CamelCased all React component files in /devtools/client/jsonview/components/;

https://reviewboard.mozilla.org/r/186274/#review191292

Alright this looks good. Thank you for submitting this patch. I'll push to CI now to see if tests still work fine, and then we can land this.
Attachment #8915006 - Flags: review?(pbrosset) → review+
Pushed by pbrosset@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/11f27f6d5059
CamelCased all React component files in /devtools/client/jsonview/components/;r=pbro
https://hg.mozilla.org/mozilla-central/rev/11f27f6d5059
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 58
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: