7 ms·
New Official jQuery Plugins Provide Templating, Data Linking and Globalization
- billybob 16y agoNotably, contributed by Microsoft. I... I have nothing bad to say about that. Hmmm.
- WesleyJohnson 16y agoI was kind of surprised by this. Has Microsoft done this before (contributed to an Open Source project not of their own making) or is this new for them?
- contextfree 16y agoIIRC they've contributed a few bits and pieces to Apache and the Linux kernel (drivers), though I think they've just been for interop with other MSFT stuff.
- deleted 16y ago[deleted]
- skbohra123 16y agoFeasting on hundreds of mice the cat embarks on a pilgrimage.
- richardw 16y agoMy fear is that it would be an opportunity for an old trick of theirs: embrace and extend. If so, we'd be in the 'embrace' phase. I'm hoping not. They've been getting more open-sourcey in the last couple years. One alternative is that they just saw a great model and have no need to reinvent the wheel. It means an easier .net onramp for developers who already know jQuery.
- code_duck 16y agoThat certainly comes to mind. The question is, how could they take jQuery in an incompatible direction, tying developers into their version, thus gaining control over the project? I can't really see a way it could happen here. Pulling a classic 'embrace and extend' would mean rather than contributing to the original product, they'd make their own subtly incompatible version.
- Griever 16y agoThis is interesting. Just the other day I saw a flash ad on Reddit touting all the new features in Visual Studio 2010. I was surprised to see that one of the slides mentioned "Support for including the jQuery Framework". Glad to see that riding the jQuery train rather than making their own or something along those lines.
- evo_9 16y agoNo kidding, now if MS would just give up the whole Silverlight waste of time (no we do not need another flash-like proprietary format).
- pufuwozu 16y agoMicrosoft is supporting the development of Moonlight (an open-source implementation). The only part that Microsoft won't license is DRM. It can't be compared Flash - Adobe has shown NO interest in helping open-source implementations.
- evo_9 16y agoIrregardless of MS's support of Moonlight, I question the entire effort. Wouldn't those talented programmer be put to better use on something with a higher chance of actually being used? I actually really dig mono and in my mind those resources would serve the community better focused on Mono, MonoDevelop, MonoTouch and MonoDroid. I just don't see wide-scale adoption of Silverlight/Moonlight whether it's available on *nix or not, with or with MS's blessing.
- pufuwozu 16y agoMoonlight isn't useless. There was a goal (a while back) of getting Moonlight embedded in Firefox (on all platforms). The goal hasn't come true but think about that. A general purpose VM embedded right in the browser! I have no doubt that Moonlight would be used if it was embedded within the browser. CIL is an open-specification, we already have many compilers that target it. We could run C#, Scala, Java, Python, Ruby, Haskell, etc on the client side. But all we're stuck with is a JavaScript VM to use.
- eclark 16y agoThe Globalization sounds like a good idea. However the template library scares me. There are so many different template use cases in JS that having one ordained jquery one seems like it might have to be too many things to too many people.
- dstein 16y agoJavaScript templating may sound scary, but if done properly they can be so ridiculously powerful that at this point I think it's inevitable that server-side generation of HTML will eventually be obsolete. Imagine being able to throw away all the hideous and incompatible JSP, eRuby, PHP (smarty etc), and Django templates with a universal template language.
- jdunck 16y agoWith respect, I think it's naive to think that the lastest templating language will be the "universal" one. No, this is just one more JS templating language. http://yehudakatz.com/2010/09/09/announcing-handlebars-js/ http://yehudakatz.com/2010/09/09/announcing-handlebars-js/ http://code.google.com/p/trimpath/wiki/JavaScriptTemplates http://code.google.com/p/trimpath/wiki/JavaScriptTemplates http://code.google.com/p/jstal/ http://code.google.com/p/jstal/ http://github.com/janl/mustache.js http://github.com/janl/mustache.js
- pornel 16y agoTechnically there's nothing preventing universal server-side templating language (e.g. XSLT & TAL are available for all languages you've mentioned). It's just a matter of everyone agreeing on syntax — and that's the hard part.
- deleted 16y ago[deleted]
- ARolek 16y agoData binding! Finally. That is one of my favorite features of the Flex framework. I remember reading about Microsoft working on this with jQuery, but never knew when to expect it. Great news.
- chunkyslink 16y agoHow does using javascript templating effect the SEO of my pages? If I'm pulling the content in as json and using jquery to place it on the page. Will Google understand this or see my pages as content-less?
- eddieplan9 16y agoIf this gets popular enough, maybe we should standardize a new <link> element to point to the JSON data file that search engines should index. Maybe even a standard schema for it!
- WesleyJohnson 16y agoYes, if you load in all your content through AJAX/AJAH or some other form of client side process, google won't get that content when crawling your page. The best way to see what search engines will see is to load the page in a browser and then use "View Source". There are ways to help search engines find your dynamic content, however, which typically involve creating static versions of the content in addition to your more user-friendly AJAX versions. Google outlines some methods for doing this using specially formatted hash tags here: http://code.google.com/web/ajaxcrawling/index.html http://code.google.com/web/ajaxcrawling/index.html
- andreyf 16y agoYuk. Why does it introduce a new global namespace for "named templates"? In other words, why: $.template("foo", ...); When what I mean is: foo = $.template(...);
- pornel 16y agoI'm disappointed that template syntax uses own {{if}} tags: {{if cond}}<li>...</li>{{/if}} TAL and Genshi have IMHO much nicer solution for that: <li py:if="cond">...</li> Use of attributes on existing elements also ensures that you can't create ill-formed structures like {{if}}<li>{{/if}}</li>.
- dstik 16y agoUnderscore.js (http://documentcloud.github.com/underscore/ http://documentcloud.github.com/underscore/) provides great Templating support and the ability to customize your templates through the use of _.templateSettings. This would allow you to use <% %>, [% %], or pretty much any symbol combination you prefer.
- saurabh 16y agoCheck out jstal http://code.google.com/p/jstal/ http://code.google.com/p/jstal/
- jeresig 16y agoWe opted not to use this particular technique for two reasons: 1) It's not nearly as versatile. You can use the if statements on elements, attributes, text - anything you wish - there is no restriction on its contents or location. 2) In order to actually use something like that we'd have to serialize the DOM tree first, traverse it, and then manipulate the nodes into the proper shape. This is slow slow slow and absolutely must be avoided at any cost.
- detst 16y agoA little off topic but I expect this to go well with jQuery Mobile. Can we expect any updates there? Been a bit disappointed by the relative quiet since the announcement (not that you owe me anything). Also, is there any publicly available code to check out? Thanks!
- jeresig 16y agoOnly quiet because we're working so hard. We're releasing the alpha on October 16th (at the jQuery conference in Boston) so we're a bit frantic at the moment. Either way we're hoping to get a blog post up this week.
- yatsyk 16y agoI'm little confused: Yehuda Katz who is a member of jQuery team announced Handlebars.js (templating engine with similar syntax) less then month ago... Would someone clarify differences between these libraries?
- jeresig 16y agoThe jQuery project has been working on this this particular plugin for a while now. Based upon what Yehuda wrote up in his original Handlebars.js blog post: http://yehudakatz.com/2010/09/09/announcing-handlebars-js/ http://yehudakatz.com/2010/09/09/announcing-handlebars-js/ He also recommends the official jQuery templating plugin. As is the case with most templating plugins there are minor syntax differences - although it does appear as the two plugins tackle the underlying problem in very similar manners (leading to fast execution time). I've pinged Yehuda so that he can comment here, as well.
- yatsyk 16y agoJohn, thank you for clarification!
- Groxx 16y agoInteresting technique... I wonder how long until someone sets up a Haml clone in a similar vein, however. Less[1] is already moving in that direction, the next step is to do HTML in a similarly-friendly way. I'd use that; this is a pretty hideous, clearly-MS-influenced Enterprisey implementation. [1]: http://lesscss.org/ http://lesscss.org/