Reputation: 3466
I am looking at various web frameworks for a new project (social networking + transactions between connected users). I am intrigued by Play (with scala) but need some help in understanding an issue.
In Play, support for CDN+minification is not available in the core but via a separate module greenscript. But using this module requires the system markup in the layout to be replaced with new greenscript based markup. This is different from Rails where you either do not have to add anything to the layouts or get away by appending act_as_* tags to use new plugins. Any idea on whether the long-term Play approach is to let plugins take over the markup for overrides? In that case if there are couple of modules that you want to operate on the same object, say a url, would it be possible in Play?
Any guidance about alternative way to accomplish this in Play would be helpful too.
Upvotes: 5
Views: 147
Reputation: 14373
As the author of greenscript, I would like to encourage you to use greenscript tags instead of using the zero-config mode b/c it uses about 10 percent of the power;-)
The beautiful part of this module is it allow you to declare what ever js/css files you needed into the current file (which could be only one part of the entire view), and no need to worry if one or more of those files are already declared in other places. Further more, once you've declared dependencies among js/css files, you just list the one you use directly, and don't need to worry about it's dependencies. They will get loaded automatically.
And probably those most obvious reason to use tag is it allow merge of js/css files, so that in the end you get only one files (unless you have CDNs), while with the zero-config mode you still have multiple files with each one get minimized/compressed.
Upvotes: 0
Reputation: 16439
Some modules in Play act by providing tags (similar in concept to jsp tags, not in implementation). Greenscript is one of them.
It simply requires you to use a specific tag and during execution time that tag will unfold into the minimization functionality.
If two modules act on the same object (let's say, an anchor href to follow your comment), the compatibility will depend on the implementation of these tags, not on Play. If one of them accepts other tags in its body, it would be possible to mix them, otherwise that won't be allowed.
About Greenscript, it provides a "no-config" mode in which it will automatically minimize all your css/js files without requiring any tag in your pages or any config whatsoever (it works like this by default). This won't affect your inline css/js, but that's easily solvable by moving inline code to its own js/css file.
Upvotes: 2