After yet another day of being distracted WAY too much by twitter, I recall a tweet that Paul Cowan posted:
“what are people using to combine all their .js files into 1?”
So, for the purpose of testing this library (and given the fact that Mads Kristensen has created a small wrapper around it) I opted to play with the RESTful API. My aims were to build a quick and dirty HttpHandler around this library that would mash all my .js files together, send them to be complied and stuff the results into the cache.
With this in mind I give you my 15 minute spike: www.dotlesscss.com/mashpotato.zip
If you download this solution you’ll see a web project that references my HttpHandler and has the following config section:
<add verb="GET" path="*.mash" validate="false" type="MashPotato.Core.ClosureHttpHandler, MashPotato.Core"/>
Looking in scripts.mash you’ll see:
Also, notice the “cache=true” uri parameter… guess what this does?
I’d say there’s likely to be hundreds of issues as it took me approximately twice as long to write this blog post than to write the handler, but off the top of my head here goes:
- Googles RESTful API has a size limit of the amount of data that can be posted to it so no mashing up your large framework scripts like JQuery.
- Obviously, the console application should perform much better than the RESTful API
- I don’t know, it took me 10 mins I’m sure it’s buggy as hell.