Daniel you ask me to explain some things i thought was common practice.
Below i try to give explanations ; please help me fix, refine, or reject
them.

On 06/05/2013 19:31, Daniel Kahn Gillmor wrote:
> On 05/06/2013 09:18 AM, Jérémy Lal wrote:
> 
>> First please note that i am not talking here about minified versions
>> of javascript files that are shipped in upstream tarballs [0].
>>
>> Please comment about what could be part of our javascript policy [1].
>> It might help future javascript maintainers.
>>
>> A package that distribute minified files for convenience
>> * must distribute the unminified files
> 
> Why?  We don't demand that C programs distribute C source alongside the
> binaries.  This is what source packages are for.

An essential difference between C and Javascript is that C is compiled,
and Javascript is interpreted.
Before minifying was so easy, nobody minified Javascript files, and
it is perfectly fine to use unminified Javascript files in production.

The obvious advantage of keeping unminified files by default is keeping
this advantage of being able to debug a Javascript program right away,
since all modern web browsers ship full-featured debuggers.
 
>> * should name the minified files like "foo.min.js"
> 
> I'm also not yet convinced of this (but i possibly could be if it was
> explained more clearly).  why not just encourage all packages to ship a
> canonical set of files, and ship them minified if possible?

Do you mean that for example,
/usr/share/javascript/jquery/jquery.js
is minified (when possible), and if one want to have the unminified version,
one has to install the source package ?


>> * should not minify all files blindly
>>   (i'm thinking of jquery.ui.datepicker-xx.js)
> 
> Again, why not?  If we believe in our minification techniques, what is
> the harm?

If the previous answer to my question is yes, then yes, why not.
Even if it is no, i guess this idea makes no real sense.
 
>> * if no minifier was available at build time, the minified files must
>>   symlink to the unminified ones (instead of being removed or empty).
> 
> This one makes sense to me -- we don't want to ship minified files in
> version N and then have them get ripped out in version N+1 when people
> might be relying on linking to them.
> 
>> * a node-foo package should not distribute minified files.
> 
> Again, why?

For the "keep it easily debuggable" reason. It brings absolutely no
real advantage to have minified versions for nodejs modules.
> 
> Sorry for all the n00b questions.  Feel free to point me to
> documentation that already answers them that i might have missed.

No problem at all,
the idea was to clarify and your questions are helping.

Jérémy.



Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Pkg-javascript-devel mailing list
Pkg-javascript-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-javascript-devel

Reply via email to