The files do all exist in the jars, so it's possible you can configure Jawr to do this if you wanted too. But currently there is no way to have trinidad NOT link to the common js.

Truthfully though, Trinidad is pretty light on the javascript and library segmentation (unless it's done intelligently) may actually cause performance loss. Why? In the case of the Trinidad JS, once the library is loaded, it's cached. This would mean that Jawr should not simply aggregate the JS for components displayed, but would have to load the library in well defined *blocks* so that they could be cached as well. I have seen solutions like this work, and work very well, for large javascript libraries provided things are loaded in blocks - the real key is granularity.

Also, do you guys have any ideas if Jawr would work in a portlet environment?

Scott

Renzo Tomaselli wrote:
Looks really good.
For Trinidad users - a rather obvious question: since Trinidad appears to do more or less the same - is there any chance to wire things so that single files (js and css) are rendered ? I know that Trinidad does merging on the fly - so that we are not allowed to configure Jawr with Trinidad files (such as /adf/jsLibs/Common1_0_7.js and the filtered out skin css file).

-- Renzo

Jordi Sellés wrote:
Hi to everyone on the list, this is my first posting announcing the availability of a new Facelets related tool.

Jawr <https:%5C%5Cjawr.dev.java.net> is an Open Source library which offers two complementary uses for java and Facelets web applications in which javascript is heavily used:

    * First, it's a productivity tool, since it allows to develop
      javascript components in separate files, each representing a
      module, as opposed to having all the code in one or two files
      for performance reasons. Working with separate files makes
      development, maintenance and version control a lot easier.

    * On the other hand, Jawr is a performance tool which will
      perceivably improve page loading times. When in production
      mode, all the modules which were split in separate files are
      bundled together (into one or several files, as per
      configuration), then minified, then compressed and sent to the
      client using aggressive caching headers. This reduces the
      number of HTTP requests required to load a full page and also
      the size in kilobytes that a user must download. Jawr
      implements many of the good practices defined in this very
      interesting article which I recommend everyone to read: serving
      javascript fast
      <http://www.thinkvitamin.com/features/webapps/serving-javascript-fast>.

Jawr is configured by adding a servlet to our application and creating a simple .properties file to configure the way components are to be bundled. CSS files can also benefit from bundling and compression. Once configured, a Facelets tag library is used to reference the bundles previously defined.

These tags will work differently in development and production modes (which are set by a flag in the properties file). When in development mode, links to the separate, uncompressed modules are generated so that we can debug them using, say, Firebug. Each links gets a random parameter added to the URL so that upon every refresh of our page the browser is force to reload the script. On the other hand, in production mode links to the bundled, minified and compressed version of the scripts are generated. There is no need to change anything in the pages for this to happen, only a flag switch in the properties file is needed.

Other interesting features are traditional and Grails web apps support, the ability to define custom postprocessors to change dynamically the contents of bundled scripts, the ability to define global bundles that are always imported into pages automatically, defining bundles which are included within a defined conditional comment for MSIE, obfuscating the scripts, etc...

Jawr has an Apache 2.0 license, and can be configured to use JSmin or the YUI Compressor under the hood, both with a BSD style license. The full project documentation is at https:\\jawr.dev.java.net <https:%5C%5Cjawr.dev.java.net>. You can find about the specifics for using Jawr with Facelets here <https://jawr.dev.java.net/docs/facelets.html>.

regards,
Jordi Hernandez Selles

------------------------------------------------------------------------
Sigue de cerca las últimas tendencias y lo que más rompe MSN Vídeo <http://video.msn.com/video.aspx?mkt=es-es>

Reply via email to