3 ms·
> if/when browsers natively support CS. They won't, and source maps are not native support. Check out AMD with RequireJS (make sure you optimize) for your "im
by ryanflorence 15y ago
> if/when browsers natively support CS.
They won't, and source maps are not native support.
Check out AMD with RequireJS (make sure you optimize) for your "import" stuff. I haven't incorporated optimization yet for the project, but you can see how it works with my snackJS project http://github.com/rpflorence/snack/tree/amd-coffee/lib http://github.com/rpflorence/snack/tree/amd-coffee/lib
- latchkey 15y agoThanks Ryan. I've looked at the RequireJS/AMD import stuff and it seems really over engineered for what I need. I feel like there is too much declaration going on. For now I think I'll wait to see what else people come up with along these lines.
- ryanflorence 15y agoWell, AMD is essentially a CommonJS format, so this is what "people have come up with" for the browsers until real modules show up :) http://wiki.commonjs.org/wiki/Modules/AsynchronousDefinition http://wiki.commonjs.org/wiki/Modules/AsynchronousDefinition
- latchkey 15y agoThanks for the pointer, I made sure to read it. What I don't like about it is having to 'define' all the modules that I'm going to use. That is just too error prone. I'd rather just create a CS class in a file and include the entire file when I need to. More similar to the way that an import statement works in Java. For now, as I already mentioned, I'm simulating import style functionality with LabJS, which works great. While not perfect, it allows me to async load everything I need as well as minimize the amount of data on the wire. Here is a description of what I've done... http://lookfirst.com/2011/12/optimizing-your-javascript-delivery.html http://lookfirst.com/2011/12/optimizing-your-javascript-deli...
- Griever 15y agoIIRC I believe i read from Paul Irish (I could be mistaken) that Chrome is working to support projects such as CoffeeScript for debugging. No idea how tjry plan to implement this, but I found it to be an exciting possibility.