February 2011 plovr release

32 views
Skip to first unread message

Michael Bolin

unread,
Feb 10, 2011, 9:21:20 PM2/10/11
to plovr
I just released a new version of plovr:

http://code.google.com/p/plovr/downloads/detail?name=plovr-0744c5209a34.jar

The release notes on that page do a decent job of summing up the new
features, but I thought I would expand on them a bit here:

(1) Can't remember all those plovr URLs? Me neither. Now if you go to
the root of the web server, you can see the configs that are loaded
along with some key URLs:

http://plovr.com:9810/

There's certainly a lot more that can be added here, and I certainly
plan to in the future.

(2) As shown in the externs documentation (http://plovr.com/
options.html#externs), it is now much easier to leverage the externs
files that are in the contrib directory of the closure-compiler. I
hope to put together a nice example of how to develop a Chrome
extension with plovr, which includes leveraging the
chrome_extensions.js externs file. (This should also make it easier to
develop jQuery code in Advanced compilation mode, though as discussed
on another thread, not that many folks do that.)

(3) Closure: The Definitive Guide gives an example of how to define a
substring() function that you can call from a Closure Template. At
Yext, we finally found the lack of such a function annoying enough
that it was finally time to make this part of our default Closure
development, which meant adding support for custom functions in plovr.
Normally, if you compiled your custom functions in your own jar, you
would have to do something like the following to use them:

java -cp yourjar.jar:plovr.jar org.plovr.cli.Main serve yourconfig.js

And inside yourconfig.js, you would have the option:

"soy-function-plugins": "com.example.MyModule"

which is fine, but perhaps a little tedious, so plovr comes with its
own Guice module (org.plovr.soy.function.PlovrModule) that defines
substring() and list() functions (creating the list() function
required making some nontrivial edits to the Closure Templates source
code: http://groups.google.com/group/closure-templates-discuss/browse_thread/thread/28433189dfd04d12),
so if you want to use those, just add the following to your plovr
config:

"soy-function-plugins": "org.plovr.soy.function.PlovrModule"

though the option also takes an array, so you could always include
both modules, if you wanted:

"soy-function-plugins": [
"org.plovr.soy.function.PlovrModule",
"com.example.MyModule"
]

I debated just enabling "org.plovr.soy.function.PlovrModule" by
default, but I opted not to, for now.

Enjoy!
Michael
Reply all
Reply to author
Forward
0 new messages