Repository: tez Updated Branches: refs/heads/master 01ebb64d5 -> 3466f77b9
TEZ-3146. Tez UI 2: CSS & JS assets in the UI must be minified (sree) Project: http://git-wip-us.apache.org/repos/asf/tez/repo Commit: http://git-wip-us.apache.org/repos/asf/tez/commit/3466f77b Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/3466f77b Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/3466f77b Branch: refs/heads/master Commit: 3466f77b9f7ab697271c03bc9a3d496854f83f9e Parents: 01ebb64 Author: Sreenath Somarajapuram <[email protected]> Authored: Wed Apr 20 11:00:03 2016 +0530 Committer: Sreenath Somarajapuram <[email protected]> Committed: Wed Apr 20 11:00:03 2016 +0530 ---------------------------------------------------------------------- CHANGES.txt | 1 + pom.xml | 5 +++++ tez-ui2/pom.xml | 30 +++++++++++++++++++++++++ tez-ui2/src/main/webapp/WEB-INF/wro.xml | 9 ++++++++ tez-ui2/src/main/webapp/ember-cli-build.js | 11 ++++++--- 5 files changed, 53 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tez/blob/3466f77b/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index e794834..eab656b 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -12,6 +12,7 @@ ALL CHANGES: TEZ-3214. Tez UI 2: Pagination in All DAGs TEZ-3210. Tez UI 2: license should account for numeral, more-js, loader.js , etc TEZ-3087. Tez UI 2: Add log links in task & attempt details page + TEZ-3146. Tez UI 2: CSS & JS assets in the UI must be minified Release 0.8.3: 2016-04-14 http://git-wip-us.apache.org/repos/asf/tez/blob/3466f77b/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index e18cef6..5b9cef5 100644 --- a/pom.xml +++ b/pom.xml @@ -942,6 +942,11 @@ <artifactId>maven-clean-plugin</artifactId> <version>3.0.0</version> </plugin> + <plugin> + <groupId>ro.isdc.wro4j</groupId> + <artifactId>wro4j-maven-plugin</artifactId> + <version>1.7.9</version> + </plugin> </plugins> </pluginManagement> http://git-wip-us.apache.org/repos/asf/tez/blob/3466f77b/tez-ui2/pom.xml ---------------------------------------------------------------------- diff --git a/tez-ui2/pom.xml b/tez-ui2/pom.xml index 5fa7469..25d6008 100644 --- a/tez-ui2/pom.xml +++ b/tez-ui2/pom.xml @@ -177,10 +177,36 @@ </executions> </plugin> + <!-- Asset minifier --> + <plugin> + <groupId>ro.isdc.wro4j</groupId> + <artifactId>wro4j-maven-plugin</artifactId> + <executions> + <execution> + <phase>prepare-package</phase> + <goals> + <goal>run</goal> + </goals> + </execution> + </executions> + <configuration> + <minimize>true</minimize> + <targetGroups>tez-ui,vendor</targetGroups> + <destinationFolder>${basedir}/target/minified-resources/assets</destinationFolder> + <contextFolder>${webappDir}/dist/assets</contextFolder> + <wroFile>${basedir}/src/main/webapp/WEB-INF/wro.xml</wroFile> + </configuration> + </plugin> + <!-- Package into war --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> + <executions> + <execution> + <phase>package</phase> + </execution> + </executions> <configuration> <webXml>${basedir}/src/main/webapp/WEB-INF/web.xml</webXml> <warSourceDirectory>${webappDir}/dist</warSourceDirectory> @@ -189,6 +215,10 @@ <filtering>false</filtering> <directory>${basedir}/src/main/resources/</directory> </resource> + <resource> + <filtering>false</filtering> + <directory>${basedir}/target/minified-resources</directory> + </resource> </webResources> </configuration> </plugin> http://git-wip-us.apache.org/repos/asf/tez/blob/3466f77b/tez-ui2/src/main/webapp/WEB-INF/wro.xml ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/WEB-INF/wro.xml b/tez-ui2/src/main/webapp/WEB-INF/wro.xml new file mode 100644 index 0000000..2709c6f --- /dev/null +++ b/tez-ui2/src/main/webapp/WEB-INF/wro.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<groups xmlns="http://www.isdc.ro/wro"> + <group name='vendor'> + <js>/vendor.js</js> + </group> + <group name='tez-ui'> + <js>/tez-ui.js</js> + </group> +</groups> http://git-wip-us.apache.org/repos/asf/tez/blob/3466f77b/tez-ui2/src/main/webapp/ember-cli-build.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/ember-cli-build.js b/tez-ui2/src/main/webapp/ember-cli-build.js index 7386782..d380982 100644 --- a/tez-ui2/src/main/webapp/ember-cli-build.js +++ b/tez-ui2/src/main/webapp/ember-cli-build.js @@ -24,16 +24,21 @@ var EmberApp = require('ember-cli/lib/broccoli/ember-app'); var MergeTrees = require('broccoli-merge-trees'); module.exports = function(defaults) { + var isProd = EmberApp.env() === 'production'; var app = new EmberApp(defaults, { storeConfigInMeta: false, minifyCSS: { - enabled: false + enabled: isProd + }, + minifyJS: { + // Will be minified by wro4j-maven-plugin for performance + enabled: false, }, fingerprint: { enabled: false }, - minifyJS: { - enabled: false + sourcemaps: { + enabled: !isProd } });
