jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
Signup
Mojo Web Minifier Maven Plugin
  • Mojo Web Minifier Maven Plugin
  • MWEBMINI-4

New minifier

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: New Feature New Feature
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Won't Fix
  • Affects Version/s: None
  • Fix Version/s: None
  • Labels:
    None
  • Patch Submitted:
    Yes
  • Number of attachments :
    0

Description

I rewrote most of the code.

Now it will minify the css files also and use the existing tags from the html, instead of creating new ones, preserving the script declarations in the head and body. It minimized the html file also, removing comments and spaces. Split points are now created according to the tag's ID attribute.

The closure javascript minifier searches for function names in strings that shouldn't be replaced (needed the rhino parser for that, which had a hexadecimal parsing bug, that's why I have included it in the code) and adds other externs also for the advanced compilation.

The CSS minifier changes the relative paths when merged (since relative paths a relative to the file itself, which changes, once merged) and warns for nonexistent paths etc.

And other minor and major changes.

The code still needs some generalization and changes:
• Javascript property renaming should be enableable in the advanced phase
• YUI CSS minifier should also be added as an option
• the yui and closure options should be separated and if the same css and javascript files are included in different HTML files, they should be resolved, not compressed in a different file
• the compression shouldn't run if the parent directory's modified date didn't change.
• tests

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Pap Lőrinc added a comment - 02/Mar/12 6:33 AM

The plugin declaration might look like this:
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>webminifier-maven-plugin</artifactId>
<version>2.0.0</version>
<executions>
<execution>
<phase>prepare-package</phase>
<goals>
<goal>minify-js</goal>
</goals>
</execution>
</executions>
<configuration>
<jsCompressorType>CLOSURE</jsCompressorType>
<closureCompilationLevel>ADVANCED_OPTIMIZATIONS</closureCompilationLevel>
<sourceDirectory>.</sourceDirectory>
<destinationDirectory>target/min</destinationDirectory>
<htmlIncludes>
<htmlInclude>login.html</htmlInclude>
<htmlInclude>index.html</htmlInclude>
</htmlIncludes>
<externNamespaces>
<externNamespace>Ext</externNamespace>
<externNamespace>tinymce</externNamespace>
</externNamespaces>
<isDebug>false</isDebug>
<removeAllUnreferencedResources>true</removeAllUnreferencedResources>
<header>
/*****************************************************************

  • Copyright © ..
    *****************************************************************/
    </header>
    </configuration>
    </plugin>

and the css and js tags with splitpoints, like this:
<link rel="stylesheet" type="text/css" href="lib/ejschart/dist/EJSChart.css" id="EJSChart.css"/>

<script type="text/javascript" src="lib/ejschart/src/EJSChart_source.js" id="EJSChart"></script>
<script type="text/javascript" src="lib/ejschart/src/EJSChart_Gauges_source.js"></script>
<script type="text/javascript" src="lib/ejschart/src/EJSChart_SVGExport_source.js"></script>

Lőrinc

Show
Pap L&#337;rinc added a comment - 02/Mar/12 6:33 AM The plugin declaration might look like this: <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>webminifier-maven-plugin</artifactId> <version>2.0.0</version> <executions> <execution> <phase>prepare-package</phase> <goals> <goal>minify-js</goal> </goals> </execution> </executions> <configuration> <jsCompressorType>CLOSURE</jsCompressorType> <closureCompilationLevel>ADVANCED_OPTIMIZATIONS</closureCompilationLevel> <sourceDirectory>.</sourceDirectory> <destinationDirectory>target/min</destinationDirectory> <htmlIncludes> <htmlInclude>login.html</htmlInclude> <htmlInclude>index.html</htmlInclude> </htmlIncludes> <externNamespaces> <externNamespace>Ext</externNamespace> <externNamespace>tinymce</externNamespace> </externNamespaces> <isDebug>false</isDebug> <removeAllUnreferencedResources>true</removeAllUnreferencedResources> <header> /***************************************************************** Copyright © .. *****************************************************************/ </header> </configuration> </plugin> and the css and js tags with splitpoints, like this: <link rel="stylesheet" type="text/css" href="lib/ejschart/dist/EJSChart.css" id="EJSChart.css"/> <script type="text/javascript" src="lib/ejschart/src/EJSChart_source.js" id="EJSChart"></script> <script type="text/javascript" src="lib/ejschart/src/EJSChart_Gauges_source.js"></script> <script type="text/javascript" src="lib/ejschart/src/EJSChart_SVGExport_source.js"></script> Lőrinc
Hide
Permalink
Christopher Hunt added a comment - 02/Mar/12 6:40 AM

Please be aware that web minifier is being used in production by a number of organisations. I'm a little bewildered as to why you thought a re-write should be necessary. I'm also a little concerned about backwards compatibility with what is already in place.

Can you please re-state what you would like to see in terms of functionality.

Thanks for your enthusiasm and support of Webminifier.

Show
Christopher Hunt added a comment - 02/Mar/12 6:40 AM Please be aware that web minifier is being used in production by a number of organisations. I'm a little bewildered as to why you thought a re-write should be necessary. I'm also a little concerned about backwards compatibility with what is already in place. Can you please re-state what you would like to see in terms of functionality. Thanks for your enthusiasm and support of Webminifier.
Hide
Permalink
Pap L&#337;rinc added a comment - 02/Mar/12 6:44 AM

Please feel free to browse the code I have provided.

Show
Pap L&#337;rinc added a comment - 02/Mar/12 6:44 AM Please feel free to browse the code I have provided.
Hide
Permalink
Christopher Hunt added a comment - 02/Mar/12 7:40 AM

I've looked at your code and my concerns remain; more so even by the fact that you have no tests at all.

Thanks again for your submission and support for Webminifier.

Show
Christopher Hunt added a comment - 02/Mar/12 7:40 AM I've looked at your code and my concerns remain; more so even by the fact that you have no tests at all. Thanks again for your submission and support for Webminifier.
Hide
Permalink
Pap L&#337;rinc added a comment - 02/Mar/12 7:47 AM

Ok, please decide if you want to merge it, or if I should create a separate project for it.

Show
Pap L&#337;rinc added a comment - 02/Mar/12 7:47 AM Ok, please decide if you want to merge it, or if I should create a separate project for it.
Hide
Permalink
Christopher Hunt added a comment - 02/Mar/12 8:15 AM

I think it is really great that you'd like to contribute, but what I'm seeing is a complete re-write with no tests and no rationale for why it has been re-written.

If you'd like to contribute then that's great, but I find it hard to understand the need for a re-write at this stage.

Thanks once again.

Show
Christopher Hunt added a comment - 02/Mar/12 8:15 AM I think it is really great that you'd like to contribute, but what I'm seeing is a complete re-write with no tests and no rationale for why it has been re-written. If you'd like to contribute then that's great, but I find it hard to understand the need for a re-write at this stage. Thanks once again.
Hide
Permalink
Pap L&#337;rinc added a comment - 02/Mar/12 8:22 AM

Please read the description I wrote for this issue, I highlight some of the features and motivations behind the rewrite.
The rest is in the code that I still encourage you to read. Please stop taking it as an insult against your code, it's unprofessional. I learned many things from your code, but it needed changes.

Show
Pap L&#337;rinc added a comment - 02/Mar/12 8:22 AM Please read the description I wrote for this issue, I highlight some of the features and motivations behind the rewrite. The rest is in the code that I still encourage you to read. Please stop taking it as an insult against your code, it's unprofessional. I learned many things from your code, but it needed changes.
Hide
Permalink
Christopher Hunt added a comment - 02/Mar/12 8:34 AM

I have read your initial description, looked at your code, but I'm still bewildered as to why you thought everything had to be re-written.

If you'd like to incorporate the functionality you desire, leveraging the existing code base, and supplying tests then you'll be very welcome. Please raise individually JIRAs for the features that you would like to see, or any bugs that you wish to report.

Thanks once again.

Show
Christopher Hunt added a comment - 02/Mar/12 8:34 AM I have read your initial description, looked at your code, but I'm still bewildered as to why you thought everything had to be re-written. If you'd like to incorporate the functionality you desire, leveraging the existing code base, and supplying tests then you'll be very welcome. Please raise individually JIRAs for the features that you would like to see, or any bugs that you wish to report. Thanks once again.
Hide
Permalink
Pap L&#337;rinc added a comment - 02/Mar/12 8:41 AM

Why would I do that?
I already made a version that is working for me.

Show
Pap L&#337;rinc added a comment - 02/Mar/12 8:41 AM Why would I do that? I already made a version that is working for me.
Hide
Permalink
Christopher Hunt added a comment - 04/Mar/12 4:21 PM

I've discussed this submission with some colleagues and we have decided to not proceed with it for the reasons previously stated. Thanks again for your support and enthusiam.

Show
Christopher Hunt added a comment - 04/Mar/12 4:21 PM I've discussed this submission with some colleagues and we have decided to not proceed with it for the reasons previously stated. Thanks again for your support and enthusiam.

People

  • Assignee:
    Christopher Hunt
    Reporter:
    Pap L&#337;rinc
Vote (0)
Watch (0)

Dates

  • Created:
    02/Mar/12 6:29 AM
    Updated:
    05/Mar/12 1:10 AM
    Resolved:
    04/Mar/12 4:21 PM
  • Atlassian JIRA (v5.2.7#850-sha1:b2af0c8)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.