New Official jQuery Plugins Provide Templating, Data Linking and Globalization

Posted on by

As the jQuery project has grown, so have the needs of the developer community. As a project, we’re focused on building the best features possible and providing them in a reliable and open manner. Like most open-source projects, the software we’re able to offer is in no small part due to the generosity of many volunteers who donate their time and coding skills to make jQuery and jQuery UI some of the most widely used JavaScript libraries available.

In March, we announced at MIX 2010 that Microsoft had committed to supporting the jQuery Project via code contributions and resources. Shortly thereafter, Microsoft made available for public review their first jQuery plugin which provided client-side templating capabilities to the jQuery community. This was soon followed by their second plugin, jQuery Data Link, which offered data synchronization capabilities and, most recently, the jQuery Globalization plugin which offers globalization information to JavaScript applications for over 350 cultures ranging from Scottish Gaelic, Frisian, Hungarian, Japanese, to Canadian English.

During the seven months of development, the jQuery and Microsoft teams worked closely to ensure that the code conformed to the best practices specified by the jQuery project and filled specific needs of the jQuery community. We also ensured that any code contributed would be available to the jQuery community under the same non-restrictive licensing terms as the jQuery JavaScript Library.

Official jQuery Plugins

Today, we’re very happy to announce that the following Microsoft-contributed plugins – the jQuery Templates plugin, the jQuery Data Link plugin, and the jQuery Globalization plugin – have been accepted as officially supported plugins of the jQuery project. As supported plugins, the jQuery community can feel confident that the plugins will continue to be enhanced and compatible with future versions of the jQuery and jQuery UI libraries.

The jQuery Templates and jQuery Datalink plugin will be managed by the jQuery Core team while the jQuery Globalization plugin will become part of the jQuery UI project, allowing for extended globalization functionality for our rich UI library. In addition, the functionality found in the jQuery Templates plugin will be directly integrated into the jQuery Core library starting with version 1.5.

Documentation and Tutorials

To help you immediately use these plugins, we’re providing API documentation and tutorials that will help you ramp up on these new technologies.

API Documentation

Tutorials

Available for Download

Source code for the new plugins can be found on Github and we encourage the community to evaluate & enhance the functionality. The new plugins are available immediate download and the code can be found here:

jQuery Templateshttp://github.com/jquery/jquery-tmpl
jQuery Datalinkhttp://github.com/jquery/jquery-datalink
jQuery Globalizationhttp://github.com/jquery/jquery-global

New Contribution Vehicle

We’d like to thank Microsoft for their commitment to helping the jQuery Project and providing new and exciting functionality for the jQuery libraries. This has been a rewarding experience for both teams, laying the foundation for future collaboration and creating a new path for meeting the needs of the jQuery community.

Please be sure to read Microsoft’s joint announcement outlining the history of the effort and the importance of these contributions to Microsoft and the jQuery community:

jQuery Templates, Data Link, and Globalization Accepted as Official jQuery Plugins – Scott Guthrie, Corporate Vice President in the Microsoft Developer Division

jQuery Templates is now an Official jQuery Plugin – Boris Moore, Microsoft

jQuery Templating in the wild – James Senior, Microsoft

Web Camps TV #5 – Microsoft Commits Code to jQuery!
– Channel 9 Video

31 thoughts on “New Official jQuery Plugins Provide Templating, Data Linking and Globalization

  1. Incredible news!!

    Who would have thought about Microsoft working closely and successfully with an open source project a few years ago?

    Scott Gu and his team are revolutionizing the corporation from the inside!

  2. Scott Moore on said:

    Why are you guys rolling templating into core? Is jQuery moving away from modularity?

  3. Georgiy Ivankin on said:

    I just don’t get how it became 4 times larger (yes that’s right: 18.8 vs 4.5 kb!) than John’s initial demo port of his micro templating?!

    There’s not so much new functionality provided.

  4. Looks very interesting, I have a few questions, that I can’t seem to find any answers to:

    1. Why is the jQuery Templates plugin scheduled to become part of jQuery Core?

    2. While sharing the source on GitHub is nice, where are the test cases? Are they kept in some secret underground bunker, far from the prying eyes of the open source community? Or do they not exist? Which is scarier?

  5. @Scott, Morgan: Templating and dependency management have been on the jQuery roadmap for jQuery 1.5 for a long time now. We’ve been collaborating with some of the Microsoft devs on a plugin implementation that works well and meets our requirements for a good templating solution.

    @Georgiy: This implementation is dramatically better than my original micro-templating solution. Far less prone to bugs and much more extensible. It makes things like data binding actually possible – which is excellent.

    @Morgan: It’s my understanding that there are no automated unit tests for the plugin yet – just functional tests (as seen in the demos). Naturally before any code is committed to core we require a full suite of unit tests.

  6. @Scott Moore:
    As I have read, jquery is moving towards modularity and they are willing to bring us option to load modules as we need.
    If you need to use animation, you can load just this module and things will be lighter.
    Let’s hope they continue this great work!

  7. @Resig:

    Thank you for elaborating on the questions :-)

    It would be nice to see community contribution to these plugins so they could gain some traction, but without unit tests, it’d be very hard for newcomers to contribute without breaking parts of the code that they don’t understand.

    Do you know if any unit tests exist for the three different plugins? Is there perhaps someone we can nudge to commit the tests?

  8. Paul T. on said:

    Excellent news… I’m glad to see these modules being added to the jQuery project officially and to see Microsoft embrace the open source jQuery project with such a significant contribution.

  9. The current production version of jquery does not work with these plugins. You must use the ones included with the downloads. However, this version breaks Jquery UI.

    Can anyone else confirm this?

  10. Scott Moore on said:

    I get that it’s been on the roadmap, but why is this a part of core and not staying as a plugin? What is the reasoning to make the core larger? Is it because an overwhelming number of people use this stuff so it makes sense? Is it because there are some internal functions that will leverage it going forward so it can’t elegantly be removed?

  11. @Ivan: Your are talking about the Data Link plugin, right? It does depend on jQuery 1.4.3. Since 1.4.3 is not released yet, the version included in the repository is a build of a recent daily. If it breaks jQuery UI, then there may be some other issue…? Do you have specifics on how it breaks?

  12. While I’m looking forward to the Boston Conference, I think it would be a great idea for the MS jQuery team to put on a presentation on the new plugins at the NY office!

  13. Hello Boris, thanks for replying. Yes, I am talking about the Data Link plugin. Sorry for not being specific in my first post.

    After installing the 1.4.3 build included in the download, I noticed it breaks the accordion widget in Jquery UI.

    Also, I wrote a data grid plugin myself that uses $.ajax calls to update the grid. That too breaks. I get the following error.

    jQuery.ajax.triggerGlobal is not a function
    [Break on this error] jQuery.ajax.triggerGlobal( s, “ajaxSend”, [xhr, s] );

    Please point me to a support forum for this plugin so I can post in detail what breaks and what not.

    Thanks.

  14. Stephen Gaunt on said:

    Is it possible to have external templates instead of having them all in a single html page?

  15. @Ivan: Sounds like an issue with some changes around ajax triggers that breaks on jQueryUI. You need to bring it up on jQueryUI forums or the jQuery Dev forum, or post a ticket on jQuery. Try to repro the problem with that build of jQuery but without using Data Link.

    @Stephen: Yes it is not difficult to use remote templates. Get the markup for the template as a string using any AJAX call you want, or simply use a static script block pointing to a js file which defines the string. Then you can pass the string to jQuery.tmpl, or better, use jQuery.template to compile a named template first, and then pass the name to jQuery.tmpl, to render.

  16. Daniel Dotsenko on said:

    Just ran performance tests for latest $.tmpl (from Git repo) against other templating plug ins and rather seriously disappointed in $.tmpl performance.

    I used the benchmark set distributed with jQote and see its rendering engine outperforms $.tmpl by 4600% (not 46%. 4600%, or 46 times faster.)

    I like the meta language used by $.tmpl. It’s a breeze to use, but I’d take the speed over “pretty” templating meta-language any time.

    In light of promised inclusion of $.tmpl into jQuery 1.5, makes me wonder, why include dog-slow engine in top-notch JS lib?

  17. raymond on said:

    Ive noticed that there’s not licensing information inside the data link plugin file.

    Will the data-link it be licensed under MIT/GPL?

  18. Syranide on said:

    @Daniel Dotsenko: you’re compiling your templates before using tmpl right? If you did, then yes, this is rather disappointing.

  19. redsquare on said:

    @Daniel Dotsenko

    Feel free to put up your tests at jsfiddle or jsbin for us all to see.
    Do not just flame without any proper facts + demo, it helps nobody.

  20. @Daniel Dotsenko:
    Your figures don’t correspond at all to my tests. One thing you may have done is compared string concatenation API calls in jQote with calls to .tmpl() which just create unparented Document Fragments. Take a look at this analysis jQuery Templates vs jQote 2: A Followup from Riley Dutton, in which he corrects an earlier analysis he did.

  21. I wish you had some captcha or other spam blocker in your forums.
    The last 5 comments are just timewasters for everyone.

  22. Donovan on said:

    If this plugin is now official why does the jQuery documentation website list it as deprecated and indicate that it will no longer be supported?