Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Clarifications about Play with scala's approach to modules

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.

like image 377
Tabrez Avatar asked Nov 04 '22 10:11

Tabrez


1 Answers

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.

like image 70
Pere Villega Avatar answered Nov 09 '22 07:11

Pere Villega