Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Or:

  define(function(require) {
     var a = require('a');
     var b = require('b');
     var c = require('c');
     ...
  });


This approach does actually address a lot of the complaints:

- Boilerplate is greatly reduced (though still present) - Way less error-prone since you're not relying on keeping two separate lists of dependencies in same the order

But, it still does require rewriting before use (to add the module name), so I don't see a huge win here either way.

I'll also point out that this "sugared" syntax was added to requirejs after we started developing. If it were there at the start, perhaps we would have used that instead.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: