Herding Code: Herding Code 118: Paul Betts on SassAndCoffee

This episode of Herding Code the guys talk to Paul Betts about SassAndCoffee, a NuGet package that adds runtime Sass and CoffeeScript compilation to ASP.NET. Jon asks Paul about his role on the Office Labs team [Spoiler alert! Since this podcast, Paul has started a new job at GitHub!] Jon asks Pa.

Paul explains how SassAndCoffee is designed to eliminate fiddling, so he’s gone to great lengths to make the NuGet package just work without any setup.

Kevin points out that this is at run-time rather than at build. Paul talks about the advantages of run-time compilation (especially interactive CSS edit / refresh) as well as potential downsides (performance, potential for compilation errors). Scott K also mentions that it might be useful for CDN deployment and continuous integration.

Jon asks about the new package definition file the 1.0 release, and Paul explains how it tells Visual Studio that the .coffee files are to be included with the project build.

Paul explains how the CoffeeScript compiler works using an HttpHandler, Jurrassic, and V8. Jon asks if he’d looked at IronJS, and Paul describes why that didn’t work for him.

Paul explains the hurdles he went through to get V8 running under an ASP.NET HttpHandler, since V8 assumes that it will always be accessed from a single threaded process.

Jon asks Paul about his use of uglify.js for Javascript optimization and compression.

Scott K asks about the ability to swap out other compilers, e.g. the Google Closure Compiler.

Paul talks about some of the commits he’s had recently, including support for Nancy, better cache configuration and some useful refactoring. Jon and Paul discuss how some refactoring patches – especially blind Resharpering – are less than helpful.

The discussion shifts to how Paul got Sass working without requiring the user to have a local Ruby installation, including some crazy tricks with the DLR’s platform resource library to embed a portion of the Ruby standard library as an embedded resource in the NuGet package via a virtual R: drive.

Jon asks if it’s possible for others to reuse Paul’s Ruby embedding technique in other applications.