Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am not by any means a CoffeeScript expert, but from the experience I do have, it seems like a good fit to QV Extensions.
I.e. writing the extension object in CoffeeScript syntax rather than Javascript, compiling to Javascript, then deploying the extension as usual.
Has anyone tried this? Good/bad experiences?
Searching for coffeescript in the forums here return exactly zero results... which is a bit surprising to me.
/Göran
I have used CoffeeScript code for BubbleChart and converted it to JavaScript and it worked just fine.
Js2coffee: convert JavaScript code to CoffeeScript
Sean
Sure, it's really just javascript anyways when you trans-compiled it.
I can see it being useful if you want to embark on a larger project but for most extensions that spans maybe 400 lines of code, well it might just be a little bit of overkill.
We tried it internally but since it added another layer of complexity onto something that weren't really complex to begin with we just stopped. If you want polyfills and additional syntactic sugar if would recommend a pure javascript library such as underscore.js or something similar as that might be easier to hand off to another dev down the line without having them learn coffeescript.
I just converted my code to JS just to make it easier as coffeescript some times introduces new problems
Good points all of you.
True, it might be overkill migrating a project to CoffeeScript, but on the other hand: for someone with limited JS experience, CoffeeScript might provide a bit easier learning curve. Speaking from my own experience, I've never really gotten the hang of JS properly - at times it feels outright hostile
I don't have nearly the same issues with CoffeScript though, so I guess a combination of the two is a good way forward (for me at least).
In the spirit of sharing, I put together a CoffeeScript version of Brian Munz' extension template. Works great.