<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Django Template Language in JavaScript</title>
	<atom:link href="http://ajaxian.com/archives/django-template-language-in-javascript/feed" rel="self" type="application/rss+xml" />
	<link>http://ajaxian.com/archives/django-template-language-in-javascript</link>
	<description>Cleaning up the web with Ajax</description>
	<lastBuildDate>Thu, 17 May 2012 07:43:39 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: weissinicht</title>
		<link>http://ajaxian.com/archives/django-template-language-in-javascript/comment-page-1#comment-285192</link>
		<dc:creator>weissinicht</dc:creator>
		<pubDate>Wed, 15 Sep 2010 21:33:12 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/django-template-language-in-javascript#comment-285192</guid>
		<description>This is very similar to what the Yz javascript django template compiler is trying to do: http://github.com/comolongo/Yz-Javascript-Django-Template-Compiler. (Disclaimer: I am the main contributer to this project) Except instead of parsing the template on the clientside on each pageload, the yz javascript template compiler just compiles the template on the serverside once during the build process into an optimized javascript function. With all of the heavy lifting done, the compiled function just does basic concatenation of the template strings and variables so it has much better performance and responsiveness . Another benefit is that the compiled functions are in pure javascript so there are no external dependencies; people who use jQuery, YUI, mootools, etc. could all use this solution without any problem. This JS perfs test shows that it is around 10x faster than several other templating solutions, including John Resig&#039;s simple templates: http://jsperf.com/javascript-templating/2.

The yz javascript django compiler is still in heavy development, currently it has support for only basic tags and filters, e.g. if tag, for loop tag, default filter, add filter, etc. 
Here is a simple demo of some of its features: http://yz-demos.appspot.com/yz_djs_demo/</description>
		<content:encoded><![CDATA[<p>This is very similar to what the Yz javascript django template compiler is trying to do: <a href="http://github.com/comolongo/Yz-Javascript-Django-Template-Compiler" rel="nofollow">http://github.com/comolongo/Yz-Javascript-Django-Template-Compiler</a>. (Disclaimer: I am the main contributer to this project) Except instead of parsing the template on the clientside on each pageload, the yz javascript template compiler just compiles the template on the serverside once during the build process into an optimized javascript function. With all of the heavy lifting done, the compiled function just does basic concatenation of the template strings and variables so it has much better performance and responsiveness . Another benefit is that the compiled functions are in pure javascript so there are no external dependencies; people who use jQuery, YUI, mootools, etc. could all use this solution without any problem. This JS perfs test shows that it is around 10x faster than several other templating solutions, including John Resig&#8217;s simple templates: <a href="http://jsperf.com/javascript-templating/2" rel="nofollow">http://jsperf.com/javascript-templating/2</a>.</p>
<p>The yz javascript django compiler is still in heavy development, currently it has support for only basic tags and filters, e.g. if tag, for loop tag, default filter, add filter, etc.<br />
Here is a simple demo of some of its features: <a href="http://yz-demos.appspot.com/yz_djs_demo/" rel="nofollow">http://yz-demos.appspot.com/yz_djs_demo/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: slightlyoff</title>
		<link>http://ajaxian.com/archives/django-template-language-in-javascript/comment-page-1#comment-261270</link>
		<dc:creator>slightlyoff</dc:creator>
		<pubDate>Mon, 11 Feb 2008 09:06:29 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/django-template-language-in-javascript#comment-261270</guid>
		<description>hey Justin,

So Dojo&#039;s DTL implementation has a lot of the features you mention, but there is at least one large philosophical difference, namely that Django&#039;s templating language keeps code out of templates, and so Dojo&#039;s implementation follows suit. As with Dojo&#039;s existing templating system, the goal is to allow developers and designers to iterate on templates independent of each other and given how successful folks have been with the existing system, this seems to have been a good choice although I totally get that reasonable people can disagree on this one. Templating is hard, and hard to satisfy everyone with.

As for the features you list, I think all of them are available in Dojo in some way, although the syntax may not be as terse for some, and because the design of Dojo is layered, not everything comes through a single object. I&#039;ll send you mail.

Regards</description>
		<content:encoded><![CDATA[<p>hey Justin,</p>
<p>So Dojo&#8217;s DTL implementation has a lot of the features you mention, but there is at least one large philosophical difference, namely that Django&#8217;s templating language keeps code out of templates, and so Dojo&#8217;s implementation follows suit. As with Dojo&#8217;s existing templating system, the goal is to allow developers and designers to iterate on templates independent of each other and given how successful folks have been with the existing system, this seems to have been a good choice although I totally get that reasonable people can disagree on this one. Templating is hard, and hard to satisfy everyone with.</p>
<p>As for the features you list, I think all of them are available in Dojo in some way, although the syntax may not be as terse for some, and because the design of Dojo is layered, not everything comes through a single object. I&#8217;ll send you mail.</p>
<p>Regards</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JustinMeyer</title>
		<link>http://ajaxian.com/archives/django-template-language-in-javascript/comment-page-1#comment-261243</link>
		<dc:creator>JustinMeyer</dc:creator>
		<pubDate>Sat, 09 Feb 2008 07:46:38 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/django-template-language-in-javascript#comment-261243</guid>
		<description>Slightlyoff,
  I&#039;m slightly confused by your example.  I think it puts &quot;anything you want&quot; in a ul object.  Is this correct?

In the spirit of cooperation, I&#039;ll cautiously list a few nice things about EJS.  I&#039;m not trying to be competitive.  I hope that dojo can include a few of these (if it doesn&#039;t already) in its toolkit.

EJS gives you a few options on where the template comes from:

Text: new EJS({text: &#039;&#039;})
Element: new EJS({element: document.getElementById(&#039;template&#039;)})
File: new EJS({url: &#039;/template.ejs&#039;})

EJS templates can use 2 different magic tags  or ${}.
EJS caches templates.
EJS can use JSLint for Debugging.
EJS has rails-like view helpers.

EJS also has many options for rendering:

Render and get back text: txt = new EJS({text: &#039;&#039;}).render({objectvalue: &#039;anything you want&#039;})

Update an element (I&#039;m using prototype selector):
new EJS({text: &#039;&#039;}).update($$(&#039;div span.thinger ul&#039;),{objectvalue: &#039;anything you want&#039;})

Update an element with the results from a JSON ajax request:
new EJS({url:&#039;/todo.ejs&#039;}).update(&#039;todo&#039;,&#039;/todo.json&#039;)

I find debugging and loading from a file to be the most helpful features of EJS.

There&#039;s also jMVC (http://blog.codeville.net/category/jmvc/) which is syntactically like EJS, but w/ less functionality.  BUT, it allows continuations.  If you have any other thoughts:  j u s t i n at j u p i t e r dot c o m.</description>
		<content:encoded><![CDATA[<p>Slightlyoff,<br />
  I&#8217;m slightly confused by your example.  I think it puts &#8220;anything you want&#8221; in a ul object.  Is this correct?</p>
<p>In the spirit of cooperation, I&#8217;ll cautiously list a few nice things about EJS.  I&#8217;m not trying to be competitive.  I hope that dojo can include a few of these (if it doesn&#8217;t already) in its toolkit.</p>
<p>EJS gives you a few options on where the template comes from:</p>
<p>Text: new EJS({text: &#8221;})<br />
Element: new EJS({element: document.getElementById(&#8216;template&#8217;)})<br />
File: new EJS({url: &#8216;/template.ejs&#8217;})</p>
<p>EJS templates can use 2 different magic tags  or ${}.<br />
EJS caches templates.<br />
EJS can use JSLint for Debugging.<br />
EJS has rails-like view helpers.</p>
<p>EJS also has many options for rendering:</p>
<p>Render and get back text: txt = new EJS({text: &#8221;}).render({objectvalue: &#8216;anything you want&#8217;})</p>
<p>Update an element (I&#8217;m using prototype selector):<br />
new EJS({text: &#8221;}).update($$(&#8216;div span.thinger ul&#8217;),{objectvalue: &#8216;anything you want&#8217;})</p>
<p>Update an element with the results from a JSON ajax request:<br />
new EJS({url:&#8217;/todo.ejs&#8217;}).update(&#8216;todo&#8217;,'/todo.json&#8217;)</p>
<p>I find debugging and loading from a file to be the most helpful features of EJS.</p>
<p>There&#8217;s also jMVC (<a href="http://blog.codeville.net/category/jmvc/" rel="nofollow">http://blog.codeville.net/category/jmvc/</a>) which is syntactically like EJS, but w/ less functionality.  BUT, it allows continuations.  If you have any other thoughts:  j u s t i n at j u p i t e r dot c o m.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: slightlyoff</title>
		<link>http://ajaxian.com/archives/django-template-language-in-javascript/comment-page-1#comment-261208</link>
		<dc:creator>slightlyoff</dc:creator>
		<pubDate>Fri, 08 Feb 2008 15:25:17 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/django-template-language-in-javascript#comment-261208</guid>
		<description>Justin:

This templating language only needs you to dojo.require(&quot;dojox.dtl&quot;), at which point you can use it irrespective of the Dojo Widget System (aka: Dijit). Since (like all things in Dojo), it&#039;s a layered design, you can use this templating anywhere, including in dojo.query() results. Check it out:

dojo.require(&quot;dojox.dtl.ext-dojo.NodeList&quot;);
dojo.query(&quot;div &gt; span.thinger &gt; ul&quot;).dtl(
  &quot;{{ objectvalue }}&quot;,
  { objectvalue: &#039;anything you want&#039; }
);</description>
		<content:encoded><![CDATA[<p>Justin:</p>
<p>This templating language only needs you to dojo.require(&#8220;dojox.dtl&#8221;), at which point you can use it irrespective of the Dojo Widget System (aka: Dijit). Since (like all things in Dojo), it&#8217;s a layered design, you can use this templating anywhere, including in dojo.query() results. Check it out:</p>
<p>dojo.require(&#8220;dojox.dtl.ext-dojo.NodeList&#8221;);<br />
dojo.query(&#8220;div &gt; span.thinger &gt; ul&#8221;).dtl(<br />
  &#8220;{{ objectvalue }}&#8221;,<br />
  { objectvalue: &#8216;anything you want&#8217; }<br />
);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peter svensson</title>
		<link>http://ajaxian.com/archives/django-template-language-in-javascript/comment-page-1#comment-261201</link>
		<dc:creator>peter svensson</dc:creator>
		<pubDate>Fri, 08 Feb 2008 13:28:54 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/django-template-language-in-javascript#comment-261201</guid>
		<description>@mundizzle. Have you looked at the online Dojo book the last year? It&#039;s chock-full of goodies right now, and getting bigger every month. Try the chapter on Layout, for instance;

http://dojotoolkit.org/book/dojo-book-0-9/part-2-dijit/layout

Cheers,
PS (Biased fanboy, but what the hey :)</description>
		<content:encoded><![CDATA[<p>@mundizzle. Have you looked at the online Dojo book the last year? It&#8217;s chock-full of goodies right now, and getting bigger every month. Try the chapter on Layout, for instance;</p>
<p><a href="http://dojotoolkit.org/book/dojo-book-0-9/part-2-dijit/layout" rel="nofollow">http://dojotoolkit.org/book/dojo-book-0-9/part-2-dijit/layout</a></p>
<p>Cheers,<br />
PS (Biased fanboy, but what the hey :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JustinMeyer</title>
		<link>http://ajaxian.com/archives/django-template-language-in-javascript/comment-page-1#comment-261194</link>
		<dc:creator>JustinMeyer</dc:creator>
		<pubDate>Fri, 08 Feb 2008 03:23:35 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/django-template-language-in-javascript#comment-261194</guid>
		<description>There&#039;s a lightweight templating library that is in my very biased opinion, easier to use: &lt;a href=&quot;http://embeddedjs.com&quot; title=&quot;EJS&quot; rel=&quot;nofollow&quot;&gt;Embedded JavaScript&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>There&#8217;s a lightweight templating library that is in my very biased opinion, easier to use: <a href="http://embeddedjs.com" title="EJS" rel="nofollow">Embedded JavaScript</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom Trenka</title>
		<link>http://ajaxian.com/archives/django-template-language-in-javascript/comment-page-1#comment-261192</link>
		<dc:creator>Tom Trenka</dc:creator>
		<pubDate>Fri, 08 Feb 2008 01:06:36 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/django-template-language-in-javascript#comment-261192</guid>
		<description>You&#039;re missing the point: the point is an implementation of Django Template Language in JS, regardless of what the opinions that the author of that script has in the context of a blog post.</description>
		<content:encoded><![CDATA[<p>You&#8217;re missing the point: the point is an implementation of Django Template Language in JS, regardless of what the opinions that the author of that script has in the context of a blog post.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mundizzle</title>
		<link>http://ajaxian.com/archives/django-template-language-in-javascript/comment-page-1#comment-261191</link>
		<dc:creator>mundizzle</dc:creator>
		<pubDate>Fri, 08 Feb 2008 00:11:08 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/django-template-language-in-javascript#comment-261191</guid>
		<description>i was put off my that comment too. as a &quot;professional&quot; web developer, i&#039;ve used dojo and jquery on client projects. (not at the same time of course). i found jQuery to be easy to learn and well documented.  i could not say the same for dojo. maybe things would have been more pleasant if dojo&#039;s documentation was more &quot;professional&quot;.</description>
		<content:encoded><![CDATA[<p>i was put off my that comment too. as a &#8220;professional&#8221; web developer, i&#8217;ve used dojo and jquery on client projects. (not at the same time of course). i found jQuery to be easy to learn and well documented.  i could not say the same for dojo. maybe things would have been more pleasant if dojo&#8217;s documentation was more &#8220;professional&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: slightlyoff</title>
		<link>http://ajaxian.com/archives/django-template-language-in-javascript/comment-page-1#comment-261190</link>
		<dc:creator>slightlyoff</dc:creator>
		<pubDate>Thu, 07 Feb 2008 23:36:26 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/django-template-language-in-javascript#comment-261190</guid>
		<description>&quot;Dojo&#039;s bloat&quot;?

dojo.js is 23K. The new template system is 6K (gzipped), and both dojo.js and the dtl system are optimized to the hilt. Not only is Dojo not bloated, it&#039;s downright tiny for the amazing features you get...and we give you serious optimization tools to keep your app light and fast.

Regards</description>
		<content:encoded><![CDATA[<p>&#8220;Dojo&#8217;s bloat&#8221;?</p>
<p>dojo.js is 23K. The new template system is 6K (gzipped), and both dojo.js and the dtl system are optimized to the hilt. Not only is Dojo not bloated, it&#8217;s downright tiny for the amazing features you get&#8230;and we give you serious optimization tools to keep your app light and fast.</p>
<p>Regards</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: naterkane</title>
		<link>http://ajaxian.com/archives/django-template-language-in-javascript/comment-page-1#comment-261189</link>
		<dc:creator>naterkane</dc:creator>
		<pubDate>Thu, 07 Feb 2008 23:06:39 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/django-template-language-in-javascript#comment-261189</guid>
		<description>&lt;blockquote cite=&quot;http://someclosure.com/text/&quot;&gt;It is why understanding the gap between professional tools (YUI/Dojo) and hobbyist tools (Prototype/jQuery) is so hard for people on either side of the equation. &lt;/blockquote&gt;

Prototype / jQuery hobbyist tools? hahahaha. 
Again people are mixing up the difference between a library and a toolkit. I must be pretty unprofessional to not want to weigh down my apps with YUI&#039;s or Dojo&#039;s bloat.</description>
		<content:encoded><![CDATA[<blockquote cite="http://someclosure.com/text/"><p>It is why understanding the gap between professional tools (YUI/Dojo) and hobbyist tools (Prototype/jQuery) is so hard for people on either side of the equation. </p></blockquote>
<p>Prototype / jQuery hobbyist tools? hahahaha.<br />
Again people are mixing up the difference between a library and a toolkit. I must be pretty unprofessional to not want to weigh down my apps with YUI&#8217;s or Dojo&#8217;s bloat.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

