[Project_owners] Anyone interested? Extension Minimizer Tool

Axel Hecht axel at pike.org
Mon May 19 01:40:15 PDT 2008


Eric H. Jung wrote:
> If anyone else is interested in a tool like this, please reply here or at https://www.mozdev.org/bugs/show_bug.cgi?id=19120
> 
> 
> I'd like to request a new mozilla-specific tool for mozdev. 
> 
> The tool would do the following:
> 
> 0. User uploads XPI to a page.
> 1. Tool determines if the XPI defines DTD entities that aren't used.
> 2. Tool determines if the XPI defines properties that aren't used.
> 
> Results are reported back to the user. An advanced version might offer the XPI,
> stripped of unused entities and properties (i.e. "minified") to the user for
> download. The advanced version might also have options to strip CSS, XUL, and
> JS of extra whitespace, although I don't imagine many extension authors would
> use that.
> 
> Why is this important? Addons that have many localizations tend to build up
> lots of "string" cruft over time. Some entities and properties are no longer
> used, but they still exist in various DTD and property files. This can inflate
> XPI size needlessly, especially when there are a lot of localizations.
> 
> Manually searching for entities and properties not in use can be extremely
> labor-intensive when there are hundreds or thousands of them.
> 
> To simply implementation, the tool could ignore DTDs defined in XUL files (at
> least for an initial implementation) and instead just parse *.dtd and
> *.property files.

You can't reliably do that for un-used properties, as the keys to many 
of those are dynamically created.

I know that gandalf has been writing tools for that back in his flock 
days, we'd probably have better chances to write these today.

To check consistencies between localizations, I strongly recommend to 
not use compare-locales.pl, but the current python implementations.

http://developer.mozilla.org/en/docs/Compare-locales has more info. The 
compare-packs is currently only on hg, I need to publish an updated version.

Axel


More information about the Project_owners mailing list