Reputation: 12120
I have worked a lot with Dojo in the past and really liked the widget infrastructure that it provides. You can easily separate code and html content, its nicely linked with the require-system used by dojo and last but not least you are given a builder that compresses all and everything into a single small file.
For a new project I would like to use jQuery and I am curious what widget/template/builder infrastructure you could use. I found some libraries here and there but I did not really get an impression of how a whole "stack" could look like.
I am looking forward to your suggestions!
Upvotes: 2
Views: 427
Reputation: 1
Widget factory is your answer. http://wiki.jqueryui.com/w/page/12138135/Widget-factory
WIth jQuery1.7 supporting Asynchronous Module Definition (AMD), HTML template can be easily supported by "text" and isRender http://www.roughlybrilliant.com/jsrender_json_apis_and_jquery_mobile
Pseudo Code:
define(["jquery", "text!templates/myTemplate.html"], function ($, myTemplate) {
$.widget( "namespace.myWidget", $.mobile.listview, {
...
});
});
Upvotes: 0
Reputation: 13516
Try JavaScriptMVC.
The essential component of this package is jQueryMX that provides a basic class framework with models, views (that use templates) and controllers.
Another part of the framework, StealJS, gives you dependency management and build tools that you need.
Upvotes: 1
Reputation: 2657
I'd recommend Backbone http://documentcloud.github.com/backbone/, it a good MVC framework too.
Upvotes: 1