jQuery Templates are deprecated?
Asked Answered
B

4

35

I see that per the jQuery plugin template page that jQuery plugins have gone from beta to deprecated without passing a real release. I can't find any info on jquery.com or their related sites about why. Or when a replacement might be available. Maybe 1.8?

This is very frustrating because my project has made a big investment in jQuery templates. Now it looks like a bad investment and we're looking for something else that is jQuery-based, including JavascriptMVC.

Any better suggestions? I'll be happy to take rationale or other information in the comments, but I'd prefer suggestions as answers.

Broadwater answered 27/10, 2011 at 4:32 Comment(0)
G
30

jQuery Templates are not dead, they just aren't going in as an official template language of the project. The maintainer of that project will likely still make some updates (and has plans to redo quite a bit of it in the future).

JavaScriptMVC is quite a bit more complex than just templates and you can use just about any templating language that you want with it.

Some of the more popular templating languages these days are Mustache/Handlebars, Dust.js, Haml, Embedded JavaScript, and a few others. The first three are actually pretty similar syntax to the jQuery templates with the exception that they don't natively create jQuery object for your element. That's easy to add though.

Gloxinia answered 27/10, 2011 at 4:39 Comment(3)
Can you add some links to the projects you suggested looking into?Scotticism
@AlexSexton - Do you use any of the ones you listed? Do you have a preference?Broadwater
I use handlebars most of the time. It's a lot like mustache, which is a classic, but the parser is faster, and it has better support for a few things like helpers. More differences are listed on the site. I created a require.js plugin for it in sproutcore as well: github.com/slexaxton/sc-handlebars - I used to use Dust.js alot as well. It's very strict, which can be good, but I had a bit of a hard time integrating it into my require.js projects and wanted to see new people, so I tried handlebars.Gloxinia
W
9

I think this post can give you some insight and possibly some food for thought. http://www.borismoore.com/2011/10/jquery-templates-and-jsviews-roadmap.html

Winter answered 27/10, 2011 at 4:36 Comment(0)
C
6

Yes, a lot of people are pissed off about the abandonment of jQuery Templates (among other things). On the bright side, some sort of templating will be implemented in the new jQuery UI (not sure if this is out yet or not). Your best bet is to look for an alternative templating engine.

A comparison table is provided on the jQuery wiki.

Courtund answered 27/10, 2011 at 4:37 Comment(5)
I have a little beef with the fact that the comparison table was written by Boris, who has a large stake in the success of JsRender/JsViews. That direction is unclear, and jQuery UI's direction feels very vague.Broadwater
@Broadwater - That comparison table was initially authored by Boris but has been worked on extensively by the leads of the jQuery UI team, including myself, Scott González, and Jörn Zaefferer. It is also editable by anyone with the url, and we invite the world to add to it. The five rows underneath the section marked Core are the features so far the jQuery UI team has agreed should be in our core jQuery UI template engine. The only other big direction decision we've made at this point is we'll fully support one engine (which we'll build and ship) but people can swap in their engine of choice.Projection
... The way we plan to do that is to have a simple contract, something like "a template engine is a function that accepts two arguments, a template string, and a data object; and returns a string"Projection
@Projection - Thanks very much for responding. As a developer, I don't want to invest one line of code in a technology that is deprecated. I also don't want to invest in a technology, like JsViews, that bluntly advertises as 'not yet beta' with no published draft schedule of when it will be stable. This is not a good place to be with a shipping product.Broadwater
I understand your sentiment, however, when it comes to templates, they are somewhat finite. If you can get everything working in the current version of whatever you're using, then the only thing updates will bring you is speed, new-features, and new incompatibilities. If you're happy with how jqTemplates already works, it would not be crazy to use it in a project.Gloxinia
A
0

I have used both jQuery template as well as handlebars. IMHO, handlebars is way better than jquery template in terms of usage, clarity of code and speed. Handlebars pre-compiled templates load really fast on various browsers comparatively. Check out this link for comparison of different templating engines: http://jsperf.com/jquery-template-table-performance/134

Absorbance answered 17/5, 2014 at 13:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.