It's been used as part of the Narrative JavaScript project to parse the JavaScript-like njs language and compile it back to JavaScript.
http://www.neilmix.com/narrativejs/doc/
The concatenation in Stitch and Sprockets is generally pretty great and reminds me a lot of Python modules. Unfortunately, I really missed the auto-loading `const_missing` behavior from Rails.
To minimize imports, we export most of our classes to `window` and simply `require` static class dependancies to enforce sequencing. Then we loop over every module & make sure they were all required at least once before instantiating any classes.
In CoffeeScript, exporting to `window` is as easy prepending '@' to the class name. We then `require` base classes and other statically needed modules for sequencing. Example:
require 'model'
require 'static_thing'
class @User extends @Model
# Explicit requirement needed as the class is being defined
@foo = StaticThing.bar()
# But not here, if we `require` everything before kicking off the app
x: -> new DynamicThing()
I wonder if burrito could be used to automatically add those require statements for Model and StaticThing to the top of the file. Then, it would be nice to wrap DynamicThing in `require('dynamic_thing').DynamicThing`. That would be super awesome.
6 comments
[ 2.3 ms ] story [ 24.4 ms ] threadIt's been used as part of the Narrative JavaScript project to parse the JavaScript-like njs language and compile it back to JavaScript. http://www.neilmix.com/narrativejs/doc/
The concatenation in Stitch and Sprockets is generally pretty great and reminds me a lot of Python modules. Unfortunately, I really missed the auto-loading `const_missing` behavior from Rails.
To minimize imports, we export most of our classes to `window` and simply `require` static class dependancies to enforce sequencing. Then we loop over every module & make sure they were all required at least once before instantiating any classes.
In CoffeeScript, exporting to `window` is as easy prepending '@' to the class name. We then `require` base classes and other statically needed modules for sequencing. Example:
I wonder if burrito could be used to automatically add those require statements for Model and StaticThing to the top of the file. Then, it would be nice to wrap DynamicThing in `require('dynamic_thing').DynamicThing`. That would be super awesome.