Extending the resources handled by wro4j

26 views
Skip to first unread message

ph...@riand.com

unread,
Feb 18, 2015, 6:01:07 PM2/18/15
to wr...@googlegroups.com
Hello Alex,
I quickly looked at the source code, and found that the CSS and JS resources types are defined in the ResourceType class, without an extension point.
Now, I would like to process other resources like HTML to minify the pages and eventually deduce some JS/CSS groups based on what is being used by the page.
What would be your best advise for such an extension?

Thanks!

Alex Objelean

unread,
Feb 19, 2015, 2:56:20 AM2/19/15
to wr...@googlegroups.com
Hi Phil,

It wasn't really designed for minimizing anything else, but css & js (and its siblings like less, sass, coffeescript, etc). 
Before trying to minimize html, I would ask myself if it is not enough to just gzip it. If you still want to minimize it, you could just create a plain filter, or use something like htmlcompressor 

Cheers,
Alex

--
You received this message because you are subscribed to the Google Groups "wro4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wro4j+un...@googlegroups.com.
To post to this group, send email to wr...@googlegroups.com.
Visit this group at http://groups.google.com/group/wro4j.
For more options, visit https://groups.google.com/d/optout.

ph...@riand.com

unread,
Feb 27, 2015, 6:37:21 PM2/27/15
to wr...@googlegroups.com
Alex,
Sorry, Google didn't notify me about your answer.

There are actually multiple transformations I'd like to run on the HTML:
- Extract the contiguous JS files references and replace them by a single one, pointing to a single aggregated file. Basically, I want to prevent the user from having to manage a separate wro.xml, but do the job automatically.
- I'd like to run some HTML static transformations, like localization (identifying the strings to localize and generate several language dependent html pages)
- Optimize the JS/CSS contained within a page. It is more for an obfuscation standpoint than a real performance optimization.

I believe that WRO4J has the right design for triggering these transformations, don't you think?

Phil.

Alex Objelean

unread,
Mar 2, 2015, 3:07:57 AM3/2/15
to wr...@googlegroups.com, ph...@riand.com
Hi Phil,

I understand your use-case and it seems a very useful feature. I would love adding it in the future. However, I wouldn't mix the code required to support this feature with the core design. I would see it like a separate module, which would use the core design to achieve its goal. I hope you understand my rational. If you have any questions, let me know.

Cheers,
A

On Saturday, 28 February 2015 01:37:21 UTC + 2, ph ... @ riand.com wrote:
Alex,
Sorry, Google did not notify me about your answer.

There are actually multiple transformations I'd like to run on the HTML:
-. Extract the contiguous JS files references and replace them by a single one, pointing to a single aggregated file Basically, I want to prevent the user from having to manage a separate wro.xml, but do the job automatically.
- I'd like to run some HTML static transformations, like localization (identifying the strings to localize and generate several language dependent html pages)
- Optimize the JS / CSS contained within a page It is more for an obfuscation standpoint than a real performance optimization..

I believe that WRO4J has the right design for triggering these transformations, do not you think?

Phil.

On Thursday, February 19, 2015 at 2:56:20 AM UTC-5, Alex Objelean wrote:
Hi Phil,

It was not really designed for minimizing anything else, but css & js (and its siblings like less, sass, coffeescript, etc). 
Trying to minimize html before, Would I ask myself if it is not enough to just gzip it. If you want to minimize it Still, Could you just create a plain filter, or Use something like htmlcompressor 

Cheers,
Alex

On 19 February 2015 at 01:01, < ph ... @ riand.com > wrote:
Hello Alex,
I quickly looked at the source code, and found that the CSS and JS resources types are defined in the ResourceType class, without an extension point.
Now, I would like to process other resources like HTML to minify the pages and eventually deduce some JS / CSS groups based on what is being used by the page.
What would be your best advise for such an extension?

Thanks!

-
You Received this message Because you are subscribed to the Google Groups "wro4j" group.
To unsubscribe from this group and stop Receiving emails from it, Send an Email to wro4j + un ... @ googlegroups.com .
To post to this group, Send Email to wr ... @ googlegroups.com .
For More options, Visit https://groups.google.com/d/ optout .

Reply all
Reply to author
Forward
0 new messages