A quick followup on this minified js concern...

The initial reason why I reopened still holds [1]

Marius and I had a quick chat on this point over IM where we agreed to take it up separate from this particular ticket and see if we can arrive at a consensus.

Conventionally, Lift keeps the un-minified js artifacts in the git repository and yuicompressor minifies them at build time. The templates still keep on referring to the un-minfied form (json2.js, jquery.js etc.) but ResourceServer/JSArtifact does the magic of rewriting the request path to serve the minified js created at build time.

While JQuery13Artifacts follows this convention (references jquery-1.3.2-min.js generated at build time), JQuery14Artifacts doesn't (reference jquery-1.4.2.min.js as distributed from jQuery.com). Consequently, src/main/resources/toserve contains jquery-1.3.2.js (the un-minified form) but jquery-1.4.2.min.js (the minified form) [2].

This is clearly inconsistent and confusing unless one is aware of the build-time trick.

So the question is, should we:

1. Continue using yuicompressor (to compress js files at build time) and apply the strategy universally to all toserve/**/*.js
OR
2. Include the minified version of the js artifacts and get rid of the build time compression trick

While #1 has the clear advantage of having human-readable js files in the repository, it is critically dependent on build time compression. Exact opposite set of argument holds for #2.

And since we are debating on this, the other option could be:

3. Keep both the form (un-minified and minified) available in resources/toserve and serve the un-minified form via gzip filter if user-agent has support for it (most does nowadays) or resort to minified form if user-agent doesn't. The behavior could be controlled via LiftRules even. Of course, this assumes that most production sites would be behind reverse proxies with proper cache control etc. and the overhead of gzip-ing is marginal. Bringing the decision (of minifying) in the framework realm also opens up the possibility of lazily creating one big js (synthetic or cached) and serving the entire stuff as one single response minified or otherwise depending on run.mode.

Thoughts?

- Indrajit

[1] http://www.assembla.com/spaces/liftweb/tickets/363?page=1#comment%3A2
[2] It still contains the vestigial jquery-1.4.1.js which needs to be removed after today's release


On 01/03/10 3:00 AM, Indrajit Raychaudhuri wrote:
I reopened #363 because according to Lift convention, JQuery14Artifacts
should actually refer to the compressed version of jquery-1.4.2 min that
is generated by yuicompressor-maven-plugin (and not minified version
available for download).

Marius, let me know if you agree to this, if not we should actually go
the other way round for the other bundled js (like jquery 1.3) as well
to be consistent.

Cheers, Indrajit

--
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.

Reply via email to