<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 22, 2016 at 1:22 PM, Florian Quèze <span dir="ltr"><<a href="mailto:florian@queze.net" target="_blank">florian@queze.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">After extending the browser_parsable_css.js mochitest to verify that<br>
all the files referenced from our CSS actually exist, I started<br>
wondering if it would be possible to reverse the checks to detect the<br>
files we are shipping but that aren't referenced anywhere. I'm<br>
experimenting with this idea in:<br>
<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1316187" rel="noreferrer" target="_blank">https://bugzilla.mozilla.org/<wbr>show_bug.cgi?id=1316187</a><br>
<br>
The general approach is to:<br>
- list all the files and convert their paths to urls,<br>
- parse all the code files (including the binary libxul file) to<br>
extract chrome:// and resource:// urls,<br>
- compare these 2 sets of urls, and report differences.<br>
<br>
I was afraid there would be so many undetectable file references (due<br>
to urls built using string concatenation in the code) that the result<br>
would be useless, but the output I got from my try pushes are<br>
promising enough to make me think this can be pushed past the current<br>
proof of concept.<br>
<br>
There are currently 237 files reported as potentially unused, plus 110<br>
for devtools.<br>
The final test will have a whitelist to cover false-positives, and we<br>
can also whitelist a few unused files that have bugs on file, but I'll<br>
need help to go through this long list, verify for each file if it<br>
should be removed (and if not figure out why), and file bugs.<br>
<br>
I created a google spreadsheet to coordinate this work:<br>
<a href="https://docs.google.com/spreadsheets/d/1lthM18DHQUy2Spn1IN8w-nXHjxU9ion91p996GoAH94/edit" rel="noreferrer" target="_blank">https://docs.google.com/<wbr>spreadsheets/d/<wbr>1lthM18DHQUy2Spn1IN8w-<wbr>nXHjxU9ion91p996GoAH94/edit</a><br>
<br>
Please have a look, and help with the files in areas that are the most<br>
familiar to you!<br></blockquote><div><br></div><div>I think this a great idea.  What would it take to run the test and get the results for Firefox for Android?  We appreciate all these small savings more than Desktop, I think :)<br><br></div><div>Nick<br></div></div></div></div>