Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

1. Getting Started > Caveats

Caveats

Now that you know how to compile CoffeeScript inline in your HTML document, I would like to point out a few things. First, everything that we discuss in this book, in terms of scope, anonymous function wrappers, and so on, all holds true when compiling CoffeeScript in this fashion. So it’s important to keep this in mind when writing your code like this.

Second, and this is probably the big one to take away here, is that this is not a particularly fast way of compiling your CoffeeScript. When deploying this to production, it means all your users will have to download an extra 162.26KB file to compile your CoffeeScript. Then after the page loads, the compiler has to go through the page looking for the text/coffeescript tags, compile them, and then execute them. That’s not a very good user experience.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial