Module: Meta Languages for SilverStripe

9 Jul

Meta languages are becoming vastly more popular in web development, and can really give your code a boost. Languages such as LESS, SASS, and CoffeeScript add new features to CSS and JavaScript that aren’t available in their plain state. In fact, the SilverStripe 3 backend was written in SASS to create its rich stylesheets.

The downside of using meta languages is that they must be compiled. There are a number of solutions available to make this easy, but to me, nothing beats the old fashioned “save and refresh” pattern. The Meta Languages module allows you to add meta languages in their uncompiled state to a SilverStripe project and compile them at run time transparently.

Give your code the horsepower it deserves, and take advantage of one or many meta languages. With this module, it’s easier than ever!

3 Responses to “Module: Meta Languages for SilverStripe”

  1. Matthew Balaam 08. Aug, 2012 at 10:19 am #

    This looks like yet another great module Uncle Cheese. I currently use the Silverstripe Compass module for compiling my SCSS files, but I have been looking into trying CoffeSecript .

    I have one query, at the moment I combine my JS and CSS files using this method:

    Would you consider adding a way of combining generated JS and CSS files in a similar manner into your module? Or do you think it would be better to keep this separate?

  2. Will 20. Dec, 2012 at 7:19 pm #

    Sass / CoffeeScript are both awesome, so this looks like a good idea. How does the module compile them though? Is it using php ports of the ruby compilers? If so, are they reliable ports (updated often, 100% compatible etc) ?

    Great to see Silverstripe keeping up with the modern internet. Keep up the good work UncleC.


    • unclecheese 03. Jan, 2013 at 9:11 am #

      Hi, Will,

      CoffeeScript is compiled from the shell, using the “coffee” executable, which is why it’s important to set your compile environments properly. You’re not likely to have that installed on a remote server. SASS is compiled using its official PHP compiler, while LESS uses an unofficial compiler for PHP maintained by a thirdparty, and it is known to have a few limitations, mostly with more advanced syntax.

      I love this module, though. I’m not much of a LESS or SASS guy, but I do love my CoffeeScript, and this makes it painless to integrate.