twirl 1.2.0 released

202 views
Skip to first unread message

Greg Methvin

unread,
Jun 6, 2016, 4:06:24 AM6/6/16
to play-framework, Play framework dev
Hi everyone,

We've just pushed a 1.2.0 release of twirl. Notably, this includes the ability to generate templates as classes, so they can be dependency injected (see https://github.com/playframework/twirl/pull/100).

Note that there are some minor incompatibilities with twirl 1.1.x, mainly in import scoping, so we're not going to upgrade in the 2.5.x branch of Play. To upgrade manually, you can add the sbt plugin to your project/plugins.sbt:

addSbtPlugin("com.typesafe.sbt" % "sbt-twirl" % "1.2.0")

If you're injecting your template classes, you should add the @Inject annotation to the constructor of the generated template classes by adding this to build.sbt:

TwirlKeys.constructorAnnotations += "@javax.inject.Inject()"

--
Greg Methvin
Senior Software Engineer

James Ward

unread,
Jun 9, 2016, 9:27:41 PM6/9/16
to Play framework dev, play-fr...@googlegroups.com
Cool.  Any news on injecting into templates?

-James

Michael Slinn

unread,
Jun 10, 2016, 9:41:21 AM6/10/16
to Play framework dev, play-fr...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages