nuxeo • Themes

A theme engine for Nuxeo ECM

From SkrinkSafe to YUI Compressor

leave a comment »

To reduce the size of Javascript resources, Nuxeo Theme had until now used the DojoToolkit’s  ShrinkSafe javascript compressor based on a custom version of Rhino (a Mozilla  implementation of Javascript written in Java).

Some Javascript source files could not be safely minified (e.g prototype.js and jquery.js). This is why an extra parameter called shrinkable had been added to the XML resource configuration descriptor:

<resource name="prototype.js">
  <path>nxthemes/html/scripts/prototype.js</path>
  <shrinkable>false</shrinkable>
</resource>

I have now experimented with YUI Compressor and so far all javascript source files that I have tested with have been safely compressed.

YUI Compressor can also compress CSS files which are now being compressed by default.

Compatiblity

Although I haven’t tested yet it says in the changelog:

YUI Compressor 2.4, 2008-10-21
------------------------------
Allowed the YUI Compressor (which uses a modified version of Rhino)
to work alongside the original (unmodified) rhino library by using
a custom class loader.

So let’s hope that incompatibility issues observed between Rhino and customized versions of Rhino have been solved.

The changes are planned for upcoming 5.3.2 release of Nuxeo DM.

Advertisements

Written by Jean-Marc

July 9, 2010 at 13:36

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

%d bloggers like this: