2012-04-10

Using dust.js in play framework 2.0

I'm really into trying frameworks and play 2.0 is a really nice package. Something's always missing, and for me and play 2.0 it's dust.js templates.

There's a half official typesafe dust sbt plugin, but

  1. I cannot make it download via ivy/mave/sbt magic
  2. I cannot compile it - how do I let it find play?
So had to make a shameless copy of the nice coffeescript plugin that comes with play 2.0. You can clone my dust sbt play plugin on github.

Just call 
  1. git clone git://github.com/georgkoester/Play20.git  
  2. cd Play20
  3. git checkout dust_play_sbt_plugin 
  4. cd framework
  5. ./build
  6. build-repository
  7. compile
  8. publish-local
and you got a version of play 2.0 with my patch. Of course you could just pull the patch too.

Happy playin!

6 comments:

  1. I don't suppose you know if there's a maven repository for this?

    ReplyDelete
  2. No I didn't mavenize this.
    Best,
    Georg

    ReplyDelete
  3. Would you mind converting dust.js this into a play 2.0 module? (see http://www.objectify.be/wordpress/?p=363)

    Would be useful to use without having to build a modified version of the Play framework.

    ReplyDelete
  4. Following on from the above comment, I'm having a similar issue with the typesafe plugin. Because I cannot compile it, it's hard to make changes and verify they work. If you can convert the work you've done so it's a standalone play 2.0 module which can be compiled and published, then I can update the JavaScript files. I've made a pull request to the typesafehub repo but do not know if they'll accept: https://github.com/typesafehub/play-plugins/pull/17

    The change I would like to make is to update dust.js with the LinkedIn fork: https://github.com/linkedin/dustjs as it contains many bug fixes.

    ReplyDelete
  5. Hi,

    I'm sorry currently I'm on a tight schedule and I moved away from play, so this isn't even near my task list. When time permits I'll blog about what I'm using now.

    But rest assured: I'm still hooked to dustjs and I also moved to the linkedin version!

    Cheers and best of luck,
    Georg

    PS: Failed commenting earlier - this is the reason for moving the blog to http://deverado.wordpress.com

    ReplyDelete
  6. No problem, thanks for the reply! Maybe I'll write a module myself if I get some time.

    ReplyDelete