On Sat, Nov 19, 2011 at 06:09, Viras <[email protected]> wrote: > However I would avoid sticking to a syntax of a popular framework. E.g. > I'm a fan of jquery and I'm using jquery.mobile for my app with great > success, however if you now force me to stick to a commonJS like syntax > for callback it will be quite confusing.
Existing, non-modular JavaScript shouldn't be a problem to handle for any of the module systems. What syntax do you think we'd be forcing on people to use jquery mobile, for example? In fact, I don't think we'd ever want to "auto-modulize" any existing JS file. You'll continue to use jquery mobile by adding a <script src=> for it in your .html files, or however you currently do it. That said, jQuery has nascent support for some flavor of AMD - https://github.com/jquery/jquery/blob/master/src/exports.js Last note, some folks write JavaScript such that it can be used in multiple environments; underscore can be used in a browser by just <script src>'ing it, used in CommonJS, and it appears now to support AMD: https://github.com/documentcloud/underscore/blob/master/underscore.js#L51 -- Patrick Mueller http://muellerware.org
