You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Ganesh <ga...@j4fry.org> on 2009/06/05 14:36:48 UTC

Re: Myfaces 2.0 and javascript compression

Hi Werner,

After removing the comments of

        <!--
        <repository>
            <id>Codehaus Snapshots</id>
            <url>http://snapshots.repository.codehaus.org/</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <releases>
                <enabled>false</enabled>
            </releases>
        </repository>
        -->

and

        <!--
        disabled for now must be enabled to enable javascript compression
        <pluginRepository>
            <id>Codehaus Snapshots</id>
            <url>http://snapshots.repository.codehaus.org/</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <releases>
                <enabled>true</enabled>
            </releases>
        </pluginRepository>
        -->

I still don't get any jsf.js neither in api not in impl. Can you please 
explain in more detail how this is meant to work, so I can try and debug it?

Best regards,
Ganesh

Werner Punz schrieb:
> Werner Punz schrieb:
>> Hello since I was asked yesterday.
>>
>> We have a concatenation and build module integrated into the myfaces 
>> 2.0 script compression!
>> Since we are currently bound to the offical alpha release quality 
>> build plugin by maven it is bound to changes.
>> If anyone wants to enable it (it is currently disabled by comments in 
>> the build process) turn off compression, I am currently adding the 
>> latest plugin changes, and i am fixing some minor javascript issues
>> the yahoo compressor is choking on!
>>
>> So, concatenation currently works, compression will be fixed by me 
>> today!
>>
>> Werner
>>
>>
> Ok guys it works now again, just uncomment in the main pom.xml and in 
> the api pom.xml the sections dealing with the javascript compression 
> and it should work.
>
> Never mind that the YUI compressor throws a load of warnings, most of 
> them if not all of them are simply false, the YUI compressor seems to 
> have become somewhat overreactive with its warnings, often showing 
> unused vars in sections where they are clearly used!
>
> The final non compressed jsf file has 3000-4000 locs and the YUI 
> compressor achieves 54% compression rate!
>
> The final file has currently 56 kbyte which is an acceptable size 
> given that it does more things than the RI!
>
> Since we also have our own compression plugin, I have not enabled it 
> due to not being able to get it working.
> I personally think in the long run we should go with the official 
> compression plugin anyway, but I have somewhat of a stomach ache due to
> running an alpha quality plugin in our build process!
>
>
> Werner
>

Re: Myfaces 2.0 and javascript compression

Posted by Werner Punz <we...@gmail.com>.
The reason for now simply is that the official maven javascript plugin 
is alpha quality, as I could see while I was fixing everything on 
friday, it broke at least one namespace within the last two months. I 
did not dare to uncomment it, due to this fact, because it might have 
broken the build for now too often. My personal guess is, that we should 
enabled it at alpha stage and leave it enabled from then on, but for now 
it was simply to early!
It was enough for me now to have it in a working condition to be used 
later on!

Also have in mind that we have a similar functionality in our own 
plugins, but I could not get it up and running and did not have time to 
check out why, and nobody else so far did either.
In the long run I feel easier with the official maven plugin but at the 
current stage I have mixed feelings and probably would use our own one 
if it would work ;-)

I always had a javascript maven plugin in mind when I started with the 
javascript part, hence we use many files and a modularized loosely 
coupled approach instead of having just one big file!
The reason for this simply was having used one in the past with very 
good results and good compression rates!



Werner


Ganesh schrieb:
> Hi,
> 
> This is nice stuff - works fine. I'm using Mojarra plus this generated 
> MyFaces jsf.js for the dojo facelets example page and it improves the 
> f:ajax functionality quite a bit! What is your reason to comment it? 
> Could stay uncommented IMO.
> 
> Best regards,
> Ganesh
> 
> Werner Punz schrieb:
>> Hello you just did one pom.xml
>>
>> you have tu uncomment the sections below in the pom.xml from the main 
>> project then in the api pom.xml you have to uncomment following 
>> section, and you should be set!
>>
>> Werner
>>
>>
>>      <!--
>>
>>         <plugins>
>>
>>            javascript plugin adjusted to our build process
>>            please do not delete this it is just disabled for now
>>
>>             <plugin>
>>                 <artifactId>javascript-maven-plugin</artifactId>
>>                 <groupId>org.codehaus.mojo.javascript</groupId>
>>                 <extensions>true</extensions>
>>                 <executions>
>>                      <execution>
>>                         <id>compile</id>
>>                         <goals>
>>                             <goal>compile</goal>
>>                         </goals>
>>                         <phase>process-resources</phase>
>>                         <configuration>
>>
>> <descriptor>${basedir}/src/assembler/jsfscripts-compiler.xml</descriptor>
>>                         </configuration>
>>                     </execution>
>>                     <execution>
>>                         <id>compress</id>
>>                         <goals>
>>                             <goal>compress</goal>
>>                         </goals>
>>                         <phase>process-resources</phase>
>>
>>                         <configuration>
>>
>> <scripts>target/classes/META-INF/resources/javax/faces/ajax/</scripts>
>>                             <compressor>yahooUI</compressor>
>>                         </configuration>
>>                     </execution>
>>                 </executions>
>>                 <configuration>
>>                     
>> <sourceDirectory>src/main/javascript</sourceDirectory>
>>                     <webappDirectory>${basedir}</webappDirectory>
>>
>> <outputDirectory>${basedir}/target/classes/META-INF/resources/javax/faces/ajax/</outputDirectory> 
>>
>>                 </configuration>
>>             </plugin>
>>
>> -->
>>
>> Ganesh schrieb:
>>> Hi Werner,
>>>
>>> After removing the comments of
>>>
>>>        <!--
>>>        <repository>
>>>            <id>Codehaus Snapshots</id>
>>>            <url>http://snapshots.repository.codehaus.org/</url>
>>>            <snapshots>
>>>                <enabled>true</enabled>
>>>            </snapshots>
>>>            <releases>
>>>                <enabled>false</enabled>
>>>            </releases>
>>>        </repository>
>>>        -->
>>>
>>> and
>>>
>>>        <!--
>>>        disabled for now must be enabled to enable javascript compression
>>>        <pluginRepository>
>>>            <id>Codehaus Snapshots</id>
>>>            <url>http://snapshots.repository.codehaus.org/</url>
>>>            <snapshots>
>>>                <enabled>true</enabled>
>>>            </snapshots>
>>>            <releases>
>>>                <enabled>true</enabled>
>>>            </releases>
>>>        </pluginRepository>
>>>        -->
>>>
>>> I still don't get any jsf.js neither in api not in impl. Can you 
>>> please explain in more detail how this is meant to work, so I can try 
>>> and debug it?
>>>
>>> Best regards,
>>> Ganesh
>>>
>>> Werner Punz schrieb:
>>>> Werner Punz schrieb:
>>>>> Hello since I was asked yesterday.
>>>>>
>>>>> We have a concatenation and build module integrated into the 
>>>>> myfaces 2.0 script compression!
>>>>> Since we are currently bound to the offical alpha release quality 
>>>>> build plugin by maven it is bound to changes.
>>>>> If anyone wants to enable it (it is currently disabled by comments 
>>>>> in the build process) turn off compression, I am currently adding 
>>>>> the latest plugin changes, and i am fixing some minor javascript 
>>>>> issues
>>>>> the yahoo compressor is choking on!
>>>>>
>>>>> So, concatenation currently works, compression will be fixed by me 
>>>>> today!
>>>>>
>>>>> Werner
>>>>>
>>>>>
>>>> Ok guys it works now again, just uncomment in the main pom.xml and 
>>>> in the api pom.xml the sections dealing with the javascript 
>>>> compression and it should work.
>>>>
>>>> Never mind that the YUI compressor throws a load of warnings, most 
>>>> of them if not all of them are simply false, the YUI compressor 
>>>> seems to have become somewhat overreactive with its warnings, often 
>>>> showing unused vars in sections where they are clearly used!
>>>>
>>>> The final non compressed jsf file has 3000-4000 locs and the YUI 
>>>> compressor achieves 54% compression rate!
>>>>
>>>> The final file has currently 56 kbyte which is an acceptable size 
>>>> given that it does more things than the RI!
>>>>
>>>> Since we also have our own compression plugin, I have not enabled it 
>>>> due to not being able to get it working.
>>>> I personally think in the long run we should go with the official 
>>>> compression plugin anyway, but I have somewhat of a stomach ache due to
>>>> running an alpha quality plugin in our build process!
>>>>
>>>>
>>>> Werner
>>>>
>>>
>>
> 


Re: Myfaces 2.0 and javascript compression

Posted by Ganesh <ga...@j4fry.org>.
Hi,

This is nice stuff - works fine. I'm using Mojarra plus this generated 
MyFaces jsf.js for the dojo facelets example page and it improves the 
f:ajax functionality quite a bit! What is your reason to comment it? 
Could stay uncommented IMO.

Best regards,
Ganesh

Werner Punz schrieb:
> Hello you just did one pom.xml
>
> you have tu uncomment the sections below in the pom.xml from the main 
> project then in the api pom.xml you have to uncomment following 
> section, and you should be set!
>
> Werner
>
>
>      <!--
>
>         <plugins>
>
>            javascript plugin adjusted to our build process
>            please do not delete this it is just disabled for now
>
>             <plugin>
>                 <artifactId>javascript-maven-plugin</artifactId>
>                 <groupId>org.codehaus.mojo.javascript</groupId>
>                 <extensions>true</extensions>
>                 <executions>
>                      <execution>
>                         <id>compile</id>
>                         <goals>
>                             <goal>compile</goal>
>                         </goals>
>                         <phase>process-resources</phase>
>                         <configuration>
>
> <descriptor>${basedir}/src/assembler/jsfscripts-compiler.xml</descriptor>
>                         </configuration>
>                     </execution>
>                     <execution>
>                         <id>compress</id>
>                         <goals>
>                             <goal>compress</goal>
>                         </goals>
>                         <phase>process-resources</phase>
>
>                         <configuration>
>
> <scripts>target/classes/META-INF/resources/javax/faces/ajax/</scripts>
>                             <compressor>yahooUI</compressor>
>                         </configuration>
>                     </execution>
>                 </executions>
>                 <configuration>
>                     
> <sourceDirectory>src/main/javascript</sourceDirectory>
>                     <webappDirectory>${basedir}</webappDirectory>
>
> <outputDirectory>${basedir}/target/classes/META-INF/resources/javax/faces/ajax/</outputDirectory> 
>
>                 </configuration>
>             </plugin>
>
> -->
>
> Ganesh schrieb:
>> Hi Werner,
>>
>> After removing the comments of
>>
>>        <!--
>>        <repository>
>>            <id>Codehaus Snapshots</id>
>>            <url>http://snapshots.repository.codehaus.org/</url>
>>            <snapshots>
>>                <enabled>true</enabled>
>>            </snapshots>
>>            <releases>
>>                <enabled>false</enabled>
>>            </releases>
>>        </repository>
>>        -->
>>
>> and
>>
>>        <!--
>>        disabled for now must be enabled to enable javascript compression
>>        <pluginRepository>
>>            <id>Codehaus Snapshots</id>
>>            <url>http://snapshots.repository.codehaus.org/</url>
>>            <snapshots>
>>                <enabled>true</enabled>
>>            </snapshots>
>>            <releases>
>>                <enabled>true</enabled>
>>            </releases>
>>        </pluginRepository>
>>        -->
>>
>> I still don't get any jsf.js neither in api not in impl. Can you 
>> please explain in more detail how this is meant to work, so I can try 
>> and debug it?
>>
>> Best regards,
>> Ganesh
>>
>> Werner Punz schrieb:
>>> Werner Punz schrieb:
>>>> Hello since I was asked yesterday.
>>>>
>>>> We have a concatenation and build module integrated into the 
>>>> myfaces 2.0 script compression!
>>>> Since we are currently bound to the offical alpha release quality 
>>>> build plugin by maven it is bound to changes.
>>>> If anyone wants to enable it (it is currently disabled by comments 
>>>> in the build process) turn off compression, I am currently adding 
>>>> the latest plugin changes, and i am fixing some minor javascript 
>>>> issues
>>>> the yahoo compressor is choking on!
>>>>
>>>> So, concatenation currently works, compression will be fixed by me 
>>>> today!
>>>>
>>>> Werner
>>>>
>>>>
>>> Ok guys it works now again, just uncomment in the main pom.xml and 
>>> in the api pom.xml the sections dealing with the javascript 
>>> compression and it should work.
>>>
>>> Never mind that the YUI compressor throws a load of warnings, most 
>>> of them if not all of them are simply false, the YUI compressor 
>>> seems to have become somewhat overreactive with its warnings, often 
>>> showing unused vars in sections where they are clearly used!
>>>
>>> The final non compressed jsf file has 3000-4000 locs and the YUI 
>>> compressor achieves 54% compression rate!
>>>
>>> The final file has currently 56 kbyte which is an acceptable size 
>>> given that it does more things than the RI!
>>>
>>> Since we also have our own compression plugin, I have not enabled it 
>>> due to not being able to get it working.
>>> I personally think in the long run we should go with the official 
>>> compression plugin anyway, but I have somewhat of a stomach ache due to
>>> running an alpha quality plugin in our build process!
>>>
>>>
>>> Werner
>>>
>>
>

Re: Myfaces 2.0 and javascript compression

Posted by Werner Punz <we...@gmail.com>.
Hello you just did one pom.xml

you have tu uncomment the sections below in the pom.xml from the main 
project then in the api pom.xml you have to uncomment following section, 
and you should be set!

Werner


      <!--

         <plugins>

            javascript plugin adjusted to our build process
            please do not delete this it is just disabled for now

             <plugin>
                 <artifactId>javascript-maven-plugin</artifactId>
                 <groupId>org.codehaus.mojo.javascript</groupId>
                 <extensions>true</extensions>
                 <executions>
                      <execution>
                         <id>compile</id>
                         <goals>
                             <goal>compile</goal>
                         </goals>
                         <phase>process-resources</phase>
                         <configuration>
 
<descriptor>${basedir}/src/assembler/jsfscripts-compiler.xml</descriptor>
                         </configuration>
                     </execution>
                     <execution>
                         <id>compress</id>
                         <goals>
                             <goal>compress</goal>
                         </goals>
                         <phase>process-resources</phase>

                         <configuration>
 
<scripts>target/classes/META-INF/resources/javax/faces/ajax/</scripts>
                             <compressor>yahooUI</compressor>
                         </configuration>
                     </execution>
                 </executions>
                 <configuration>
                     <sourceDirectory>src/main/javascript</sourceDirectory>
                     <webappDirectory>${basedir}</webappDirectory>
 
<outputDirectory>${basedir}/target/classes/META-INF/resources/javax/faces/ajax/</outputDirectory>
                 </configuration>
             </plugin>

-->

Ganesh schrieb:
> Hi Werner,
> 
> After removing the comments of
> 
>        <!--
>        <repository>
>            <id>Codehaus Snapshots</id>
>            <url>http://snapshots.repository.codehaus.org/</url>
>            <snapshots>
>                <enabled>true</enabled>
>            </snapshots>
>            <releases>
>                <enabled>false</enabled>
>            </releases>
>        </repository>
>        -->
> 
> and
> 
>        <!--
>        disabled for now must be enabled to enable javascript compression
>        <pluginRepository>
>            <id>Codehaus Snapshots</id>
>            <url>http://snapshots.repository.codehaus.org/</url>
>            <snapshots>
>                <enabled>true</enabled>
>            </snapshots>
>            <releases>
>                <enabled>true</enabled>
>            </releases>
>        </pluginRepository>
>        -->
> 
> I still don't get any jsf.js neither in api not in impl. Can you please 
> explain in more detail how this is meant to work, so I can try and debug 
> it?
> 
> Best regards,
> Ganesh
> 
> Werner Punz schrieb:
>> Werner Punz schrieb:
>>> Hello since I was asked yesterday.
>>>
>>> We have a concatenation and build module integrated into the myfaces 
>>> 2.0 script compression!
>>> Since we are currently bound to the offical alpha release quality 
>>> build plugin by maven it is bound to changes.
>>> If anyone wants to enable it (it is currently disabled by comments in 
>>> the build process) turn off compression, I am currently adding the 
>>> latest plugin changes, and i am fixing some minor javascript issues
>>> the yahoo compressor is choking on!
>>>
>>> So, concatenation currently works, compression will be fixed by me 
>>> today!
>>>
>>> Werner
>>>
>>>
>> Ok guys it works now again, just uncomment in the main pom.xml and in 
>> the api pom.xml the sections dealing with the javascript compression 
>> and it should work.
>>
>> Never mind that the YUI compressor throws a load of warnings, most of 
>> them if not all of them are simply false, the YUI compressor seems to 
>> have become somewhat overreactive with its warnings, often showing 
>> unused vars in sections where they are clearly used!
>>
>> The final non compressed jsf file has 3000-4000 locs and the YUI 
>> compressor achieves 54% compression rate!
>>
>> The final file has currently 56 kbyte which is an acceptable size 
>> given that it does more things than the RI!
>>
>> Since we also have our own compression plugin, I have not enabled it 
>> due to not being able to get it working.
>> I personally think in the long run we should go with the official 
>> compression plugin anyway, but I have somewhat of a stomach ache due to
>> running an alpha quality plugin in our build process!
>>
>>
>> Werner
>>
>