我在一个基于Java的大型web应用程序上工作,它是在过去5年左右建立起来的--用户界面需要进行一次彻底的修改/大量重写。我们正在研究要使用的可用UI工具/库/框架,并将dust.js作为模板处理的一种选择。
的问题:,我想听听dust.js的用户是怎么想的:
一些背景:
- [Leaving JSPs in the dust: moving LinkedIn to dust.js client-side templates](http://engineering.linkedin.com/frontend/leaving-jsps-dust-moving-linkedin-dustjs-client-side-templates)
- [The client-side templating throwdown: mustache, handlebars, dust.js, and more](http://engineering.linkedin.com/frontend/client-side-templating-throwdown-mustache-handlebars-dustjs-and-more) --这两篇文章中的第二篇--很好地回答了问题5,但除了LinkedIn之外,很少有来自谷歌详细介绍模板系统的结果,或者暗示它是一种流行的选择。此外,这篇文章还提到,他们已经扩展了功能,并希望有一天能为最初的项目做出贡献。我担心,在他们这么做之前,我们可能还需要扩展功能。
话虽如此,LinkedIn最初对模板系统的要求与我们的非常接近(见下文),他们在选择之前已经做了一些非常彻底的调查。
1. [DRY](http://en.wikipedia.org/wiki/Don%27t_repeat_yourself): We ideally want to use the templating system on the server (Java based) and client-side, or just client-side if we opt for LinkedIn's complete approach; _`Instead of using a JSP, GSP, or ERB to assemble a page server side and send back HTML, we have the server send back just the dynamic data as JSON and have the page assembled in the browser using a static client-side template served from a CDN"`_
2. Fully internationalised
3. Good community support
4. Sufficiency easy to use / pick up
5. Works happily with [jQuery](http://jquery.com/) and [Backbone.js](http://documentcloud.github.com/backbone/)
6. Well documented
发布于 2012-04-17 16:25:14
Dust.js是一个很好的选择。它比其他一些模板框架更好,因为它不限制数据应该在文件或字符串中,等等。
此外,它还在积极维护https://github.com/linkedin/dustjs。
希望这能有所帮助。
发布于 2013-03-03 10:09:02
性能方面的一件事是,您可以使用“完整”版本开发您的应用程序,然后编译您的模板以供生产(例如使用node.js + dust.js npm模块--在这里可以很有用),以便与“核心”版本一起使用。在这种情况下,您可以大大提高现实世界的性能-将所有的模板放在一起并缩小它们将使客户端浏览器在每次需要时从服务器获取模板。“完整”和“核心”并不是关于商业/免费的-核心版本只是没有模板编译器,将与预编译模板一起使用。
https://stackoverflow.com/questions/10194921
复制相似问题