TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Twitter releases new JS template engine: hogan.js

155 点作者 tednaleid超过 13 年前

16 条评论

decklin超过 13 年前
<p><pre><code> &#60;script src="//goo.gl/OCK7V"&#62;&#60;/script&#62; </code></pre> Really?
评论 #3382669 未加载
评论 #3383463 未加载
评论 #3384840 未加载
评论 #3382277 未加载
评论 #3382577 未加载
评论 #3383938 未加载
krmmalik超过 13 年前
I was dubious when Twitter released Bootstrap.css, but i have to say, not being a UI expert i found it quite easy to work with. Concisely documented and the right set of tools that i need, for the most part at least. Some more on typography would have been nice.<p>I have yet to understand how templating engines work, and what advantages they provide, but knowing this comes from twitter piques my interest for the future.
评论 #3382353 未加载
equark超过 13 年前
I'm surprised that no JS template engines ever implement binding. It seems like everybody just ports some server-side ideas, even though there's a lot more that is possible client-side. Why do I need to rerender the entire template when my data changes?<p>Sproutcore2 is an example of this, but it's pitched as a full framework rather than a binding aware template engine.
评论 #3382366 未加载
评论 #3382948 未加载
评论 #3382224 未加载
评论 #3383107 未加载
评论 #3382738 未加载
stdbrouw超过 13 年前
Compiling is nice. Not a big fan of Mustache though, the tags look like Brainfuck to me.
评论 #3384375 未加载
评论 #3392118 未加载
micheljansen超过 13 年前
Currently using Underscore, but I would almost switch to Hogan for the name. I am assuming Mr. Hogan's mustache was used for inspiration?
评论 #3382455 未加载
donbronson超过 13 年前
Nice to see Twitter has a sense of humor. "Lovingly crafted by bros" in the footer is a nice touch.
评论 #3384866 未加载
评论 #3382292 未加载
saturdayplace超过 13 年前
Could someone perhaps help me out re: the difference between Compiling and Rendering JS templates? What it feels like is this:<p>Compiling a JS template on the server gives you a template object that has a render() method. On the client side, you create an instance of the object and pass its render() method a context? Am I missing anything?<p>If anything, this looks like what I've been looking for to get my templates off my page and into a separate JS file. Makes things cleaner. And <i>apparently</i> faster?
评论 #3382314 未加载
Void_超过 13 年前
My biggest question is: Is rendering faster too?<p>Because rendering is pretty much just string concatenation. So my guess is it's not. Is it?<p>If rendering is not faster then this is no use to me, since I'm a very happy user of haml-coffee (<a href="https://github.com/9elements/haml-coffee" rel="nofollow">https://github.com/9elements/haml-coffee</a>).
评论 #3382586 未加载
asktell超过 13 年前
Nice to see that the hogan.js site itself is using Skeleton ( <a href="http://getskeleton.com/" rel="nofollow">http://getskeleton.com/</a> ) for its responsive layout. I've been enjoying using it quite a bit.
turtle4超过 13 年前
Resembles handlebars.js. Can someone point out the difference?
评论 #3382461 未加载
评论 #3382305 未加载
dmix超过 13 年前
This looks just like Dust.js: <a href="http://akdubya.github.com/dustjs/" rel="nofollow">http://akdubya.github.com/dustjs/</a>
Lazare超过 13 年前
So let's recap: This is a new Javascript template engine that uses Mustache syntax and allows you to pre-compile template syntax. Sound's good...<p>But...why didn't they just use Handlebars? Or if you aren't wedded to Mustache syntax, one of the twenty other template engines out there that support pre-compiling?
评论 #3383491 未加载
nbclark超过 13 年前
Looks a lot like jquery tmpl -- the syntax at least
评论 #3383282 未加载
drewblaisdell超过 13 年前
<p><pre><code> npm ERR! 404 'hogan' is not in the npm registry.</code></pre>
ascendant超过 13 年前
Oh sweet. I was just saying to my coworkers that what we REALLY need is another javascript templating engine.
评论 #3382117 未加载
评论 #3382294 未加载
评论 #3384857 未加载
wavephorm超过 13 年前
I have yet to see a template engine that has any practical advantages over conventional &#60;%= stuff %&#62; scriptlet style. Moving format logic out of your template into your controller always results an unmaintainable mess.
评论 #3382518 未加载
评论 #3382553 未加载
评论 #3382599 未加载