This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Gavin McFarland
Posted Jun 11 - Read on Facebook

Does anyone know an easy way to use Coffeescript with Framer? Does the file have to be compiled first? Or is there a script that can compile it in the browser? I tried using Mixture to complile the file automatically but I'm not having any luck.

5 Comments

Florian Pnn

I think Koen did a Template for Cactus, so it should be the best solution :)

Gavin McFarland

Ok I'll give that a go. Thanks

Tisho Georgiev

The coffeescript compiler runs just fine in a browser environment, so you can link to the coffee-script.js file (download it from here: http://coffeescript.org/extras/coffee-script.js), then when linking to your coffeescript files, specify a type of "text/coffeescript". Like this:

<script type="text/coffeescript" src="app.coffee"></script>

There's one important caveat. If you open your prototype from the Finder directly into Chrome, it's going to open with the file:// scheme, which has certain restrictions. One of those restrictions is accessing local files through javascript. So in order for the above to run in a browser, you need to either run a local webserver (you can use python for that: http://www.linuxjournal.com/content/tech-tip-really-simple-http-server-python), or you need to run your prototype in Safari, which gets around this particular restriction.

Gavin McFarland

Oh course. No wonder the coffeescript compiler wasn't working as I expected it to. Thanks for that Tisho. Also thanks for the link for setting up a local webserver using python.

Koen Bok

I also just made a little page about this: https://github.com/koenbok/Framer/wiki/LocalLoading

Read the entire post on Facebook