curljs

With AMD modules, when (or why) is it OK to use require() within define()?

时光怂恿深爱的人放手 提交于 2019-12-03 04:20:28
问题 My understanding of AMD modules (using for example RequireJs or curl.js) is: require() is used to asynchronously load different modules and when loaded then the callback fn is executed. And to define a module, you would have separate scripts that use define() But I've seen some modules use require() inside their function definition, e.g. define([a, b, c], function(i, ii, iii){ require([d, e, f], function(d, e, f) { // do some stuff with these require()'d dependancies }) /* rest of the code

Example of using Coffeescript classes and RequireJS (or Curljs or similar) for client side browser library

ぐ巨炮叔叔 提交于 2019-12-03 02:21:58
问题 We want to develop a browser (client side only) library using Coffeescript, and in particular, we tend to use the "class" capability of Coffeescript quite a bit, in addition to pure functions. The library will be relatively large, so we want to start out using a well defined module pattern, but not to the point where we want a single coffee file for every coffeescript "class". We don't want to compile the coffee files on the fly, but rather as a specific build step, and would prefer to not

With AMD modules, when (or why) is it OK to use require() within define()?

六月ゝ 毕业季﹏ 提交于 2019-12-02 18:40:20
My understanding of AMD modules (using for example RequireJs or curl.js) is: require() is used to asynchronously load different modules and when loaded then the callback fn is executed. And to define a module, you would have separate scripts that use define() But I've seen some modules use require() inside their function definition, e.g. define([a, b, c], function(i, ii, iii){ require([d, e, f], function(d, e, f) { // do some stuff with these require()'d dependancies }) /* rest of the code for this module */ }) But I find this confusing because I would have thought that if a module has

Example of using Coffeescript classes and RequireJS (or Curljs or similar) for client side browser library

偶尔善良 提交于 2019-12-02 15:52:15
We want to develop a browser (client side only) library using Coffeescript, and in particular, we tend to use the "class" capability of Coffeescript quite a bit, in addition to pure functions. The library will be relatively large, so we want to start out using a well defined module pattern, but not to the point where we want a single coffee file for every coffeescript "class". We don't want to compile the coffee files on the fly, but rather as a specific build step, and would prefer to not have to concat all the outputted JS into one file. As a final requirement, we will be using something