Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Node.js, CoffeeScript and Streamline
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
niklassaers  
View profile  
 More options Jul 15 2012, 6:28 pm
From: niklassaers <njstrif...@gmail.com>
Date: Sun, 15 Jul 2012 15:28:35 -0700 (PDT)
Local: Sun, Jul 15 2012 6:28 pm
Subject: Node.js, CoffeeScript and Streamline

Hi guys,
I'm an ObjC guy diving into Node for the summer. When I write Node, I use
CoffeeScript, and while working I use supervisor to make sure everything is
compiled right away.

How do I best make streamline.js fit into this workflow? Ideally, I'll just
add _coffee to --extensions at the supervisor command line and be done with
it. But how do I make Node compile the streamline'd coffee files before
reloading?

Cheers

   Nik


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Aseem Kishore  
View profile  
 More options Jul 16 2012, 8:17 am
From: Aseem Kishore <aseem.kish...@gmail.com>
Date: Mon, 16 Jul 2012 08:17:07 -0400
Local: Mon, Jul 16 2012 8:17 am
Subject: Re: Node.js, CoffeeScript and Streamline

Hey Nik,

CoffeeScript and Streamline both come with a require() hook that lets you
simply require() your .coffee and ._js/._coffee files as if they were
regular .js files, compiling them on the fly each time.

So you can have your top-level JS (e.g. app.js or server.js) simply
register these hooks and then require() your files like normal:

// e.g. app.js
require('coffee-script'); // registers automatically
require('streamline').register();
require('./app._coffee');

// app._coffee
console.log 'hello...'
setTimeout _, 1000
console.log '...world'

The only downside to this approach is that each compilation takes a bit of
time. Streamline has support for caching built-in if you pass {cache:
true}, to the register() call.

But that doesn't cache the CoffeeScript compilation, and the cache doesn't
keep up with CoffeeScript version changes, so I made a little helper a
while back to do a bit smarter caching for both:

https://github.com/aseemk/coffee-streamline

We use this with node-dev, a really robust supervisor I've come to really
love:

https://github.com/fgnass/node-dev

And it works great. This is our "top-level" JS file:

https://gist.github.com/1068606

I've been meaning to ask Bruno about whether it might make sense for some
of this better CoffeeScript support / smarter caching to be in Streamline
proper, so it'd be great to get your thoughts.

Hope this helps!

Aseem


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
niklassaers  
View profile  
 More options Jul 17 2012, 2:22 pm
From: niklassaers <njstrif...@gmail.com>
Date: Tue, 17 Jul 2012 11:22:29 -0700 (PDT)
Local: Tues, Jul 17 2012 2:22 pm
Subject: Re: Node.js, CoffeeScript and Streamline

Hi Aseem,
Thanks for the pointers, having it as a part of require is really cool. :-)

I found your coffee-streamline package, and it seems to work really well
:-) I don't know about the politics of what is proper and what is
community, but I'd love for it to be used in the tutorials you find when
first searching for this on Google. :-)

I find it a bit confusing that in the Node community, caching properties
seem to be set in code rather than in config, I guess everyone just builds
their way around this?

Thanks for the gist, looks nice. Also thanks for node-dev, I'll be sure to
play with it

Cheers

   Nik

Den mandag den 16. juli 2012 14.17.07 UTC+2 skrev Aseem Kishore:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »