[Announce] wro4j-1.4.7 released!

79 views
Skip to first unread message

Alex Objelean

unread,
Jun 30, 2012, 3:53:16 AM6/30/12
to wr...@googlegroups.com
This release contains a fix for 33 issues. Most noteable of them are:
  • Expose model resources as JSON
  • Handlebars support
  • HoganJs support
  • Bourbon Sass Mixins support
  • Support for RequestHandler concept
  • Alternative CssDataUri processor implementation (safe for older browsers)
  • CssDataUri processor encodes also fonts
  • Simplified NamingStrategy & HashStrategy configuration
Also, there are many other bug fixes and improvements.

The complete list of fixed issues can be found here (or here: http://code.google.com/p/wro4j/wiki/ReleaseNotes)

Thanks to all contributors (@ivarconr@heldeen@svanders & others)

Thanks,
Alex

Ivar

unread,
Jun 30, 2012, 4:34:08 AM6/30/12
to wr...@googlegroups.com
Another great release, good work Alex!

Ivar
> --
> You received this message because you are subscribed to the Google Groups
> "wro4j" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/wro4j/-/mlID93LzVFgJ.
> To post to this group, send email to wr...@googlegroups.com.
> To unsubscribe from this group, send email to
> wro4j+un...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/wro4j?hl=en.

Alex Objelean

unread,
Jul 1, 2012, 5:17:54 AM7/1/12
to wr...@googlegroups.com
Working on it. Will add a link to this post when ready.

Cheers,
Alex

On Sunday, July 1, 2012 4:34:36 AM UTC+3, jasonc...@gmail.com wrote:
Any docs on using the new handlebars support?

Jason

Alex Objelean

unread,
Jul 2, 2012, 2:18:41 PM7/2/12
to wr...@googlegroups.com
Sorry for delay. Here is the wiki page documenting HandlebarsJsProcessor: http://code.google.com/p/wro4j/wiki/HandlebarsJsProcessor

Cheers,
Alex

Alex Objelean

unread,
Jul 5, 2012, 3:45:58 AM7/5/12
to wr...@googlegroups.com
That's correct. This is something I forgot to implement, but will definitely will fix for next release. 
Until then, you are free to extend HandlebarsJsProcessor and override getArgument() method. The sample implementation can look like the one from DustJsProcessor:


  @Override
  protected String getArgument(Resource resource) {
    final String name = resource == null ? "" : FilenameUtils.getBaseName(resource.getUri());
    return String.format("'%s'", name);
  }

Update the ProcessorsFactory with your custom implementation of HandlebarsJsProcessor. If you have question about how to do this, let me know. 

Cheers,
Alex

On Thursday, 5 July 2012 04:18:25 UTC+3, Jason Corbett wrote:
I'm not super familiar with wro4j development, but it looks like this method may be the reason that I get null for the name:

in wro4j-extensions/src/main/java/ro/isdc/wro/extensions/processor/js/JsTemplateCompilerProcessor.java
 50   /**
 51    * @param resource
 52    *          {@link Resource} being processed by compiler.
 53    * @return arguments consumed by the js compile script.
 54    */
 55   protected String getArgument(final Resource resource) {
 56     return null;
 57   }


On Wednesday, July 4, 2012 6:38:44 PM UTC-6, jasonc...@gmail.com wrote:
Awesome, and thanks.  The only issue I have is that the compiler always uses null as the name of the template.  When I compile with the command line, it uses the name of the template file as the name.  I looked at the code  (wro4j-extensions/src/main/java/ro/isdc/wro/extensions/processor/support/handlebarsjs/HandlebarsJs.java, and the compile function takes a "name".  How (or can I) get the name of the template set to the filename of the template file?

This is so exciting.  I use wro4j to combine and compress javascript files at runtime for my project, and it works great, and makes development super easy.  Handlebars support is wonderful.  I just need the name of the template.  Right now if you have more than one template, it overwrites the template with the last one compiled (all of the templates have the same name, null, so you only get the last one).

Jason Corbett
Reply all
Reply to author
Forward
0 new messages