Closed Bug 1311178 Opened 3 years ago Closed 3 years ago

devtools ships many duplicate files

Categories

(DevTools :: General, defect, P1)

defect

Tracking

(firefox52 fixed)

RESOLVED FIXED
Firefox 52
Tracking Status
firefox52 --- fixed

People

(Reporter: catlee, Assigned: jryans)

References

Details

Attachments

(2 files)

About 161k of the total 227k of duplicate files we ship are in devtools. It would be awesome to remove these dupes if possible!

From https://archive.mozilla.org/pub/firefox/nightly/2016/10/2016-10-17-03-02-09-mozilla-central/mozilla-central-win64-nightly-bm71-build1-build3.txt.gz:

(I've limited this to just devtools duplicates)

05:20:08     INFO -  c:/builds/moz2_slave/m-cen-w64-ntly-000000000000000/build/src/obj-firefox/_virtualenv/Scripts/python.exe c:/builds/moz2_slave/m-cen-w64-ntly-000000000000000/build/src/toolkit/mozapps/installer/find-dupes.py ../../dist/firefox
05:20:10     INFO -  Duplicates 205 bytes:
05:20:10     INFO -    browser/chrome/devtools/skin/promisedebugger.css
05:20:10     INFO -    modules/commonjs/index.js
05:20:10     INFO -  Duplicates 805 bytes:
05:20:10     INFO -    browser/chrome/browser/skin/classic/browser/controlcenter/warning-gray.svg
05:20:10     INFO -    browser/chrome/devtools/skin/images/security-state-broken.svg
05:20:10     INFO -  Duplicates 851 bytes:
05:20:10     INFO -    browser/chrome/devtools/skin/images/command-scratchpad.svg
05:20:10     INFO -    browser/chrome/devtools/skin/images/tool-scratchpad.svg
05:20:10     INFO -  Duplicates 918 bytes:
05:20:10     INFO -    browser/chrome/devtools/content/dom/main.js
05:20:10     INFO -    browser/chrome/devtools/modules/devtools/client/dom/main.js
05:20:10     INFO -  Duplicates 986 bytes:
05:20:10     INFO -    browser/chrome/devtools/content/dom/dom.html
05:20:10     INFO -    browser/chrome/devtools/modules/devtools/client/dom/dom.html
05:20:10     INFO -  Duplicates 1069 bytes:
05:20:10     INFO -    modules/devtools/Console.jsm
05:20:10     INFO -    modules/devtools/shared/Console.jsm
05:20:10     INFO -  Duplicates 1080 bytes:
05:20:10     INFO -    modules/devtools/Simulator.jsm
05:20:10     INFO -    modules/devtools/shared/apps/Simulator.jsm
05:20:10     INFO -  Duplicates 1111 bytes:
05:20:10     INFO -    browser/modules/devtools/client/framework/gDevTools.jsm
05:20:10     INFO -    browser/modules/devtools/gDevTools.jsm
05:20:10     INFO -  Duplicates 1121 bytes:
05:20:10     INFO -    browser/chrome/browser/skin/classic/browser/connection-secure.svg
05:20:10     INFO -    browser/chrome/devtools/skin/images/security-state-secure.svg
05:20:10     INFO -  Duplicates 1125 bytes:
05:20:10     INFO -    modules/devtools/Loader.jsm
05:20:10     INFO -    modules/devtools/shared/Loader.jsm
05:20:10     INFO -  Duplicates 1199 bytes:
05:20:10     INFO -    browser/chrome/devtools/skin/images/debugger-prettyprint.svg
05:20:10     INFO -    browser/chrome/devtools/skin/images/tool-styleeditor.svg
05:20:10     INFO -  Duplicates 1647 bytes:
05:20:10     INFO -    browser/chrome/devtools/skin/images/debugger-blackbox.svg
05:20:10     INFO -    browser/chrome/devtools/skin/images/itemToggle.svg
05:20:10     INFO -  Duplicates 1719 bytes:
05:20:10     INFO -    browser/chrome/devtools/modules/devtools/client/dom/content/components/search.svg
05:20:10     INFO -    browser/chrome/devtools/modules/devtools/client/jsonview/css/search.svg
05:20:10     INFO -  Duplicates 1730 bytes:
05:20:10     INFO -    browser/chrome/devtools/skin/images/filetypes/store.svg
05:20:10     INFO -    browser/chrome/devtools/skin/images/tool-storage.svg
05:20:10     INFO -  Duplicates 2045 bytes:
05:20:10     INFO -    browser/chrome/devtools/modules/devtools/client/jsonview/css/controls@2x.png
05:20:10     INFO -    browser/chrome/devtools/skin/images/controls@2x.png
05:20:10     INFO -  Duplicates 2174 bytes:
05:20:10     INFO -    browser/chrome/devtools/content/dom/content/dom-view.css
05:20:10     INFO -    browser/chrome/devtools/modules/devtools/client/dom/content/dom-view.css
05:20:10     INFO -  Duplicates 2201 bytes:
05:20:10     INFO -    browser/chrome/devtools/content/projecteditor/lib/helpers/readdir.js
05:20:10     INFO -    browser/chrome/devtools/modules/devtools/client/projecteditor/lib/helpers/readdir.js
05:20:10     INFO -  Duplicates 2324 bytes:
05:20:10     INFO -    browser/chrome/devtools/content/memory/initializer.js
05:20:10     INFO -    browser/chrome/devtools/modules/devtools/client/memory/initializer.js
05:20:10     INFO -  Duplicates 6090 bytes:
05:20:10     INFO -    browser/chrome/devtools/content/shared/theme-switching.js
05:20:10     INFO -    browser/chrome/devtools/modules/devtools/client/shared/theme-switching.js
05:20:10     INFO -  Duplicates 6542 bytes:
05:20:10     INFO -    browser/chrome/devtools/content/shared/frame-script-utils.js
05:20:10     INFO -    browser/chrome/devtools/modules/devtools/client/shared/frame-script-utils.js
05:20:10     INFO -  Duplicates 6970 bytes:
05:20:10     INFO -    browser/chrome/devtools/content/inspector/fonts/fonts.js
05:20:10     INFO -    browser/chrome/devtools/modules/devtools/client/inspector/fonts/fonts.js
05:20:10     INFO -  Duplicates 7372 bytes:
05:20:10     INFO -    browser/chrome/devtools/modules/devtools/client/themes/variables.css
05:20:10     INFO -    browser/chrome/devtools/skin/variables.css
05:20:10     INFO -  Duplicates 13038 bytes:
05:20:10     INFO -    browser/chrome/devtools/content/inspector/inspector.xhtml
05:20:10     INFO -    browser/chrome/devtools/modules/devtools/client/inspector/inspector.xhtml
05:20:10     INFO -  Duplicates 14106 bytes:
05:20:10     INFO -    browser/chrome/devtools/content/framework/toolbox-options.js
05:20:10     INFO -    browser/chrome/devtools/modules/devtools/client/framework/toolbox-options.js
05:20:10     INFO -  Duplicates 20906 bytes:
05:20:10     INFO -    browser/chrome/devtools/modules/devtools/client/themes/common.css
05:20:10     INFO -    browser/chrome/devtools/skin/common.css
05:20:10     INFO -  Duplicates 62639 bytes:
05:20:10     INFO -    browser/chrome/devtools/skin/images/security-state-local.svg
05:20:10     INFO -    browser/chrome/devtools/skin/images/tabs-icon.svg
I think I have a fairly good idea on what to do with most of these...  I'll take a look.
Assignee: nobody → jryans
Status: NEW → ASSIGNED
Priority: -- → P3
(In reply to Chris AtLee [:catlee] from comment #0)
> 05:20:10     INFO -  Duplicates 205 bytes:
> 05:20:10     INFO -    browser/chrome/devtools/skin/promisedebugger.css
> 05:20:10     INFO -    modules/commonjs/index.js

promisedebugger.css is empty, let's remove it.  Filed bug 1311506 to possibly remove all of this disabled feature.

> 05:20:10     INFO -  Duplicates 805 bytes:
> 05:20:10     INFO -   
> browser/chrome/browser/skin/classic/browser/controlcenter/warning-gray.svg
> 05:20:10     INFO -   
> browser/chrome/devtools/skin/images/security-state-broken.svg

We want DevTools to be separate from /browser and intend to ship separately in the future, let's accept this duplicate.

> 05:20:10     INFO -  Duplicates 851 bytes:
> 05:20:10     INFO -   
> browser/chrome/devtools/skin/images/command-scratchpad.svg
> 05:20:10     INFO -   
> browser/chrome/devtools/skin/images/tool-scratchpad.svg

No reason to have two, removed command-scratchpad.svg.

> 05:20:10     INFO -  Duplicates 918 bytes:
> 05:20:10     INFO -    browser/chrome/devtools/content/dom/main.js
> 05:20:10     INFO -   
> browser/chrome/devtools/modules/devtools/client/dom/main.js

This file is only loaded as chrome://, removed the resource:// version.

> 05:20:10     INFO -  Duplicates 986 bytes:
> 05:20:10     INFO -    browser/chrome/devtools/content/dom/dom.html
> 05:20:10     INFO -   
> browser/chrome/devtools/modules/devtools/client/dom/dom.html

This file is only loaded as chrome://, removed the resource:// version.

> 05:20:10     INFO -  Duplicates 1069 bytes:
> 05:20:10     INFO -    modules/devtools/Console.jsm
> 05:20:10     INFO -    modules/devtools/shared/Console.jsm
> 05:20:10     INFO -  Duplicates 1080 bytes:
> 05:20:10     INFO -    modules/devtools/Simulator.jsm
> 05:20:10     INFO -    modules/devtools/shared/apps/Simulator.jsm
> 05:20:10     INFO -  Duplicates 1111 bytes:
> 05:20:10     INFO -   
> browser/modules/devtools/client/framework/gDevTools.jsm
> 05:20:10     INFO -    browser/modules/devtools/gDevTools.jsm

These are add-on compat wrappers, I think we need to keep them.

> 05:20:10     INFO -  Duplicates 1121 bytes:
> 05:20:10     INFO -   
> browser/chrome/browser/skin/classic/browser/connection-secure.svg
> 05:20:10     INFO -   
> browser/chrome/devtools/skin/images/security-state-secure.svg

We want DevTools to be separate from /browser and intend to ship separately in the future, let's accept this duplicate.

> 05:20:10     INFO -  Duplicates 1125 bytes:
> 05:20:10     INFO -    modules/devtools/Loader.jsm
> 05:20:10     INFO -    modules/devtools/shared/Loader.jsm

These are add-on compat wrappers, I think we need to keep them.

> 05:20:10     INFO -  Duplicates 1199 bytes:
> 05:20:10     INFO -   
> browser/chrome/devtools/skin/images/debugger-prettyprint.svg
> 05:20:10     INFO -   
> browser/chrome/devtools/skin/images/tool-styleeditor.svg

No reason to have two, removed debugger-prettyprint.svg.

> 05:20:10     INFO -  Duplicates 1647 bytes:
> 05:20:10     INFO -   
> browser/chrome/devtools/skin/images/debugger-blackbox.svg
> 05:20:10     INFO -    browser/chrome/devtools/skin/images/itemToggle.svg

No reason to have two, removed debugger-blackbox.svg.

> 05:20:10     INFO -  Duplicates 1719 bytes:
> 05:20:10     INFO -   
> browser/chrome/devtools/modules/devtools/client/dom/content/components/
> search.svg
> 05:20:10     INFO -   
> browser/chrome/devtools/modules/devtools/client/jsonview/css/search.svg

This one is no longer accurate after bug 1309577.  However, it did leave behind a dead reference to search-box.css, now removed.

> 05:20:10     INFO -  Duplicates 1730 bytes:
> 05:20:10     INFO -   
> browser/chrome/devtools/skin/images/filetypes/store.svg
> 05:20:10     INFO -    browser/chrome/devtools/skin/images/tool-storage.svg

No reason to have two, removed store.svg.

> 05:20:10     INFO -  Duplicates 2045 bytes:
> 05:20:10     INFO -   
> browser/chrome/devtools/modules/devtools/client/jsonview/css/controls@2x.png
> 05:20:10     INFO -    browser/chrome/devtools/skin/images/controls@2x.png

jsonview/css/controls*.png seems unused, removed.

> 05:20:10     INFO -  Duplicates 2174 bytes:
> 05:20:10     INFO -   
> browser/chrome/devtools/content/dom/content/dom-view.css
> 05:20:10     INFO -   
> browser/chrome/devtools/modules/devtools/client/dom/content/dom-view.css

Only loaded as resource://, removed as chrome://.

> 05:20:10     INFO -  Duplicates 2201 bytes:
> 05:20:10     INFO -   
> browser/chrome/devtools/content/projecteditor/lib/helpers/readdir.js
> 05:20:10     INFO -   
> browser/chrome/devtools/modules/devtools/client/projecteditor/lib/helpers/
> readdir.js

Only loaded as chrome://, removed as resource://.

> 05:20:10     INFO -  Duplicates 2324 bytes:
> 05:20:10     INFO -    browser/chrome/devtools/content/memory/initializer.js
> 05:20:10     INFO -   
> browser/chrome/devtools/modules/devtools/client/memory/initializer.js

Only loaded as chrome://, removed as resource://.

> 05:20:10     INFO -  Duplicates 6090 bytes:
> 05:20:10     INFO -   
> browser/chrome/devtools/content/shared/theme-switching.js
> 05:20:10     INFO -   
> browser/chrome/devtools/modules/devtools/client/shared/theme-switching.js

Only loaded as chrome://, removed as resource://.

> 05:20:10     INFO -  Duplicates 6542 bytes:
> 05:20:10     INFO -   
> browser/chrome/devtools/content/shared/frame-script-utils.js
> 05:20:10     INFO -   
> browser/chrome/devtools/modules/devtools/client/shared/frame-script-utils.js

Only loaded as chrome://, removed as resource://.

> 05:20:10     INFO -  Duplicates 6970 bytes:
> 05:20:10     INFO -   
> browser/chrome/devtools/content/inspector/fonts/fonts.js
> 05:20:10     INFO -   
> browser/chrome/devtools/modules/devtools/client/inspector/fonts/fonts.js

Only loaded as resource://, removed as chrome://.

> 05:20:10     INFO -  Duplicates 7372 bytes:
> 05:20:10     INFO -   
> browser/chrome/devtools/modules/devtools/client/themes/variables.css
> 05:20:10     INFO -    browser/chrome/devtools/skin/variables.css

Converted chrome:// callers to resource://, removed chrome://.

> 05:20:10     INFO -  Duplicates 13038 bytes:
> 05:20:10     INFO -   
> browser/chrome/devtools/content/inspector/inspector.xhtml
> 05:20:10     INFO -   
> browser/chrome/devtools/modules/devtools/client/inspector/inspector.xhtml

Only loaded as chrome://, removed as resource://.

> 05:20:10     INFO -  Duplicates 14106 bytes:
> 05:20:10     INFO -   
> browser/chrome/devtools/content/framework/toolbox-options.js
> 05:20:10     INFO -   
> browser/chrome/devtools/modules/devtools/client/framework/toolbox-options.js

Only loaded as resource://, removed as chrome://.

> 05:20:10     INFO -  Duplicates 20906 bytes:
> 05:20:10     INFO -   
> browser/chrome/devtools/modules/devtools/client/themes/common.css
> 05:20:10     INFO -    browser/chrome/devtools/skin/common.css

Converted chrome:// callers to resource://, removed chrome://.

> 05:20:10     INFO -  Duplicates 62639 bytes:
> 05:20:10     INFO -   
> browser/chrome/devtools/skin/images/security-state-local.svg
> 05:20:10     INFO -    browser/chrome/devtools/skin/images/tabs-icon.svg

Renamed tabs-icon.svg to globe.svg, removed security-state-local.svg.
Comment on attachment 8802689 [details]
Bug 1311178 - Remove various duplicate DevTools files.

https://reviewboard.mozilla.org/r/87016/#review86670

::: devtools/client/jsonview/css/moz.build:13
(Diff revision 1)
> -    'controls@2x.png',
>      'general.css',
>      'headers-panel.css',
>      'json-panel.css',
>      'main.css',
>      'read-only-prop.svg',

Can you remove this file as well (read-only-prop.svg) ?
It's a duplicate of devtools/client/themes/images/firebug/read-only.svg and it's not being used anywhere.

::: devtools/client/themes/debugger.css:153
(Diff revision 1)
>  /* Debugger unblackbox button */
>  
>  #black-boxed-message-button > .button-box > .button-icon {
>    width: 16px;
>    height: 16px;
> -  background-image: url(images/debugger-blackbox.svg);
> +  background-image: url(images/itemToggle.svg);

I'd love to see this file renamed to item-toggle.svg. camelCase is inconsistent with our file naming.
Comment on attachment 8802690 [details]
Bug 1311178 - Expose some DevTools CSS as resource:// only.

https://reviewboard.mozilla.org/r/87018/#review86676

Clearing until searchbox issue is fixed.
Attachment #8802690 - Flags: review?(ntim.bugs)
Comment on attachment 8802689 [details]
Bug 1311178 - Remove various duplicate DevTools files.

https://reviewboard.mozilla.org/r/87016/#review86678
Attachment #8802689 - Flags: review?(ntim.bugs)
Comment on attachment 8802689 [details]
Bug 1311178 - Remove various duplicate DevTools files.

https://reviewboard.mozilla.org/r/87016/#review86670

> Can you remove this file as well (read-only-prop.svg) ?
> It's a duplicate of devtools/client/themes/images/firebug/read-only.svg and it's not being used anywhere.

Sure, I've removed it.

> I'd love to see this file renamed to item-toggle.svg. camelCase is inconsistent with our file naming.

Sure, I've made this change.  I also renamed several `itemArrow*` files similarly.
Comment on attachment 8802690 [details]
Bug 1311178 - Expose some DevTools CSS as resource:// only.

https://reviewboard.mozilla.org/r/87018/#review87484

There are 3 issues with this patch:
- Command button icons disappear when checked (this is because the --checked-icon-state variables for both themes don't have the full path)
- The options icon is invisible in the Style Editor and the perf tool (for the same reason but with the --tool-options-image variable)
- The browser_parsable_css.js failures (which look trivial to fix)
Attachment #8802690 - Flags: review?(ntim.bugs)
Comment on attachment 8802689 [details]
Bug 1311178 - Remove various duplicate DevTools files.

https://reviewboard.mozilla.org/r/87016/#review87486
Attachment #8802689 - Flags: review?(ntim.bugs) → review+
Comment on attachment 8802690 [details]
Bug 1311178 - Expose some DevTools CSS as resource:// only.

https://reviewboard.mozilla.org/r/87018/#review87484

Thanks for catching these!  They should all be resolved now.  I tried to search for more images in vars to update, but didn't notice any others.
(In reply to J. Ryan Stinnett [:jryans] (use ni?) from comment #17)
> https://treeherder.mozilla.org/#/
> jobs?repo=try&revision=bcd9676b13c966a7dca011520bd5fef24667973a

This run shows some linting errors, pretty sure they will go away on rebase.
Comment on attachment 8802690 [details]
Bug 1311178 - Expose some DevTools CSS as resource:// only.

https://reviewboard.mozilla.org/r/87018/#review87814

Thanks!
Attachment #8802690 - Flags: review?(ntim.bugs) → review+
Pushed by jryans@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/bee97e02aa91
Remove various duplicate DevTools files. r=ntim
https://hg.mozilla.org/integration/autoland/rev/868407a1bd36
Expose some DevTools CSS as resource:// only. r=ntim
Pushed by archaeopteryx@coole-files.de:
https://hg.mozilla.org/integration/autoland/rev/3765535641d5
Remove various duplicate DevTools files: touch clobber to fix bustage on OS X. r=clobber DONTBUILD
Pushed by philringnalda@gmail.com:
https://hg.mozilla.org/mozilla-central/rev/54f7bdea8976
Remove various duplicate DevTools files: touch clobber to fix bustage on OS X. r=clobber
See Also: → 1315679
Depends on: 1319928
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.