Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
JSF performance improvements
Browse files Browse the repository at this point in the history
- Enabled resource optimization which allows richfaces to compress and unify several of its javascript and css resources into a single request. This mode can be disabled by setting the project stage to ‘Development’ (see web.xml).
- Switch several internally served javascript resources to use the JSF resource filter to allow for caching.
- Replace Richfaces’ provided JSF jquery with a higher versioned one. This script is now back in the war file.
- Remove unnecessary inclusions of the richfaces provided jquery library.
- Reorganize some javascript resources to the bottom of the page per best practices.
- Upgrade Richfaces libraries.
  • Loading branch information
Carlos A. Munoz authored and carlosmunoz committed Aug 29, 2014
1 parent 10103e1 commit 79e7aca
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 15 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -39,7 +39,7 @@
<zanata.client.version>3.3.1</zanata.client.version>
<zanata.common.version>3.3.0</zanata.common.version>

<richfaces.version>4.3.4.Final</richfaces.version>
<richfaces.version>4.3.7.Final</richfaces.version>
<shrinkwrap.desc.version>2.0.0-alpha-5</shrinkwrap.desc.version>

<!-- see http://community.jboss.org/wiki/HibernateCompatibilityMatrix?decorator=print -->
Expand Down
@@ -0,0 +1,2 @@
# Add your own resource redirections
jquery.js=script/jquery-2.0.3-min.js
8 changes: 5 additions & 3 deletions zanata-war/src/main/webapp-jboss/WEB-INF/web.xml
Expand Up @@ -58,12 +58,14 @@
TODO: When this is set to all, css from custom Richfaces components
such as zanata-richfaces-ui components are not loaded.
-->
<param-value>false</param-value>
<param-value>true</param-value>
</context-param>

<!-- Enable this to stop optimizing resources
(for example: to debug javascript) -->
<!--<context-param>
<param-name>org.richfaces.LoadScriptStrategy</param-name>
<param-value>DEFAULT</param-value>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>-->

<!--
Expand Down
3 changes: 0 additions & 3 deletions zanata-war/src/main/webapp/WEB-INF/template/banner.xhtml
Expand Up @@ -6,9 +6,6 @@
xmlns:rich="http://richfaces.org/rich"
xmlns:zanata="http://java.sun.com/jsf/composite/zanata">

<script type="text/javascript"
src="#{request.contextPath}/resources/script/components-script.js"></script>

<script type="text/javascript">
function selectItem(item) {
window.location.href = jQuery(item).find('a').attr("href");
Expand Down
9 changes: 5 additions & 4 deletions zanata-war/src/main/webapp/WEB-INF/template/scripts.xhtml
Expand Up @@ -54,12 +54,13 @@
<!-- -->
<!-- This jQuery needs to import before assets/js/script.min.js (dependency) -->
<!-- -->
<script type="text/javascript"
src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<!--<script type="text/javascript"
src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>-->

<script type="text/javascript"
src="#{applicationConfiguration.webAssetsUrl}/assets/js/script.min.js"></script>

<script type="text/javascript" src="#{request.contextPath}/resources/script/signals.min.js"/>
<script type="text/javascript" src="#{request.contextPath}/resources/script/crossroads.min.js"/>
<h:outputScript library="script" name="components-script.js"/>
<h:outputScript library="script" name="signals.min.js"/>
<h:outputScript library="script" name="crossroads.min.js"/>
</f:view>
1 change: 0 additions & 1 deletion zanata-war/src/main/webapp/language/language.xhtml
Expand Up @@ -26,7 +26,6 @@
</ui:define>

<ui:define name="center_content">
<rich:jQuery query="jquery"/>
<h:form id="memberPanel">
<h1>#{languageTeamAction.locale.retrieveNativeName()}</h1>

Expand Down

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions zanata-war/src/main/webapp/tm/home.xhtml
Expand Up @@ -107,9 +107,6 @@
</ui:define>

<ui:define name="center_content">
<ui:remove><!-- Simply needed to load jQuery --></ui:remove>
<rich:jQuery query="jquery"/>

<s:decorate id="main_content">
<s:fragment
rendered="#{translationMemoryAction.allTranslationMemories.size() eq 0}">
Expand Down

0 comments on commit 79e7aca

Please sign in to comment.