[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Minified files and source code requirement

On Thu, Oct 27, 2011 at 10:47 AM, Roland Mas <lolando@debian.org> wrote:
>> Requiring the non-minified file to be provided in the same source
>> package is not a very productive use of our time.
>  Right.  In the same way that providing the source for our binaries
> isn't very productive, I guess, because who's going to use it when they
> have the pre-built binaries?  I know this is an exaggeration, but
> there's no substantial difference between the two cases.

But we provide *source packages*. We do not provide the source in the
*binary* package.

That's what Raphael is talking about: having the minified and the
original (non-minified) JavaScript in the *same* package (which would
be the binary package, and also the source package).

I said this in the original thread and I'll repeat it here: if we have
the non-minified JavaScript, then I see no problem in providing only
the minified version in the binary package.

To me, these are equivalents:

Minified Javascript                         == ELF binaries

Original (non-minified) Javascript  == C++ source code

And that's not entirely true, btw, because it depends on what minifier
has been applied. IIRC JSMIN and Packer do not modify the source
(therefore you can always go back to the original JavaScript just by
re-applying whitespace, indendation, etc), while yui-compressor and
Google's do modify the source to remove dead branches, optimize, etc

My proposal:

1. Have multiple versions of JavaScript libraries, very much like we
have multiple versions of binary libraries with soversions, different
package names (libfoo1, libfoo2, etc). We would have libjs-jquery1.4,
libjs-jquery1.6, etc

2. If upstream only provides the original (non-minified) JavaScript,
then we do not have a problem. This never happens, AFAIK.

3. If upstream only provides the minified JavaScript, add the package
for the non-minified JavaScript as a build dependency and re-minify
it. This is what I do in witty, for instance.

4. If upstream provides the original (non-minified) JavaScript *and*
the minified JavaScript, ignore both of them and do same as 3

Pau Garcia i Quiles
(Due to my workload, I may need 10 days to answer)

Reply to: