选择合适的UI模板工具 - dust.js? [英] Choosing the right UI templating tool - dust.js?

查看:125
本文介绍了选择合适的UI模板工具 - dust.js?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一个大的基于Java的Web应用程序的工作,它已经建立起来,在过去5年左右 - 的UI需要检修/在很大程度上改写。我们正在研究现有的UI工具/库/框架的使用和所遇到的 dust.js 作为模板的选项。

的问题:
我很感兴趣,听了的 dust.js 用户认为它:


  1. 它是否取得了成功?

  2. 是否容易使用?

  3. 是否足以证明?

  4. 是社区支持好? (仅6 ST标记'dust.js'!)

  5. 相比其他模板等工具的下划线模板,的什么是利弊= https://developers.google.com/closure/templates/\">Google Closure模板把手并的Mustache
  6. 是否有使用它与MV *结构框架的任何问题,如 Backbone.js的(的在线图书

一些背景资料:


  • 为什么我们感兴趣的dust.js:的以下 LinkedIn 的博客文章第一画我们注意的:


    • Leaving JSP页面中的灰尘:移动LinkedIn到dust.js客户端模板

    • <一个href=\"http://engineering.linkedin.com/frontend/client-side-templating-throwdown-mustache-handlebars-dustjs-and-more\">The客户端模板throwdown:小胡子,车把,dust.js,多

      这两个职位的第二个非常漂亮,回答了5个问题,但是从LinkedIn,谷歌从细节很少结果模板系统或旁白意味着它是一个受欢迎的选择。此外,帖子中提到,他们已经扩展的功能,希望有一天能有助于原始项目。我担心,直到他们做到这一点,我们可能还需要扩展功能。

      话虽如此,LinkedIn的一个模板系统原来的要求是非常接近我们的(见下文),他们在选择之前已经明确做了一些非常彻底的调查。



  • 我们的要求:


    1. DRY :在理想情况下,我们要使用的模板系统在服务器上(基于Java)和客户端,或者只是客户端,如果我们选择LinkedIn的完整的方法;的 而不是使用JSP,GSP,或ERB来组装一个页面服务器端发回的HTML,我们有服务器JSON发回只是动态数据,并在浏览器里组装页面使用从CDN提供的静态客户端模板

    2. 完全国际

    3. 好社会各界的支持

    4. 充足使用方便/拿起

    5. 作品愉快地 jQuery的 Backbone.js的

    6. 有据可查



解决方案

Dust.js是一个不错的选择。它比其他一些模板框架更好,因为它并不限制该数据应是在一个文件中,或者在一个字符串等

此外,它正在积极维护 https://github.com/linkedin/dustjs


  1. 它是否取得了成功?

    是的,我知道至少LinkedIn在用它,也有助于改善/补丁等。


  2. 是否容易使用?

    我一直在使用它试图与它是作为小胡子或Handlebars.js一样容易。


  3. 是不是足够的记录?

    http://akdubya.github.com/dustjs 。


  4. 是社区支持好? (仅6 ST标记的问题'dust.js'!)

    如果你是比较胡子或Handlebars.js,dust.js没有尽可能多的用户,但我相信,如果你有一个问题,并张贴在LinkedIn回购,他们肯定会作出回应。我也因为我看着它: - )


  5. 什么是利弊相对于其他模板工具如下划线的模板,谷歌Closure模板,把手和小胡子。

    至于利弊,您可以检查时,你应该考虑在这里 HTTPS使用dust.js:// github上。 COM / LinkedIn / dustjs#自述

    至于利弊,没有足够的用户提供比较流行的像胡子或Handlebars.js dust.js。也就是说,像谷歌关闭其他图书馆遭受了同样的问题。

    但就像我之前提到的,dust.js设计得非常好相对于其他框架,恕我直言。


  6. 有没有使用它与MV *结构框架的任何问题,例如Backbone.js的(网上书店)?

    我还没有与其他MVC框架中使用它,但我不认为它应该是一个问题都没有。


希望有所帮助。

I work on a large Java based web application, it has been built up over the past 5 or so years - the UI needs an overhaul / to be largely re-written. We are investigating the available UI tools/libraries/frameworks to use and have come across dust.js as an option for templating.

The questions: I'm interested in hearing what users of dust.js think of it:

  1. Has it been successful?
  2. Is it easy to use?
  3. Is it sufficiently documented?
  4. Is community support good? (only 6 questions on ST tagged 'dust.js'!)
  5. What are the pros and cons when compared to other templating tools such as Underscore's templating, Google Closure Templates, Handlebars and Mustache.
  6. Are there any problems using it with an MV* structure framework, e.g Backbone.js (online book)?

Some background:

  • Why are we interested in dust.js: The following LinkedIn blog posts first drew our attention to it:

  • Our requirements:

    1. DRY: 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 and Backbone.js
    6. Well documented

解决方案

Dust.js is a good option. It is better than some of the other templating frameworks because it does not constrain that the data should be in a file, or in a string, etc.

Also it is being actively maintained https://github.com/linkedin/dustjs.

  1. Has it been successful?

    Yes, I know at least LinkedIn is using it and also contributing improvements/patches, etc.

  2. Is it easy to use?

    I have tried using it and it is as easy as Mustache or Handlebars.js.

  3. Is it sufficiently documented?

    Yes http://akdubya.github.com/dustjs.

  4. Is community support good? (only 6 questions on ST tagged 'dust.js'!)

    If you are comparing Mustache or Handlebars.js, dust.js does not have as many users, but I believe if you have an issue and post it on the LinkedIn repo they would definitely respond. I will too since I'm watching it :-)

  5. What are the pros and cons when compared to other templating tools such as Underscore's templating, Google Closure Templates, Handlebars and Mustache.

    As for pros, you can check when you should consider using dust.js here https://github.com/linkedin/dustjs#readme.

    As for cons, there aren't enough users for dust.js compared to popular ones like Mustache or Handlebars.js. That said, the other libraries like Google Closure suffer the same problem.

    But like I mentioned before, dust.js is designed very well compared to other frameworks IMHO.

  6. Are there any problems using it with an MV* structure framework, e.g Backbone.js (online book)?

    I have not used it with other MVC frameworks, but I don't think it should be a problem at all.

Hope that helps.

这篇关于选择合适的UI模板工具 - dust.js?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆