miyabihitoの日記

個人的な技術メモ

JavaScript ライブラリ・フレームワーク

commonJSとは:http://www.commonjs.org/
後で見る:http://html5boilerplate.com/
http://requirejs.org/
http://cjohansen.no/en/ruby/juicer_a_css_and_javascript_packaging_tool
http://robertwhurst.github.com/KeyboardJS/
http://www.createjs.com/#!/EaselJS
http://memo.yomukaku.net/entries/8nZdDFu
http://www.publickey1.jp/blog/12/javascript_mvc.html
http://lab.hakim.se/reveal-js/#/

ライブラリ集:http://www.jsdb.io/

http://jsfiddle.net/
http://jsdo.it/

■テンプレートエンジン

・Mustache
http://mustache.github.com/
Logic-lessなテンプレートシステム(ifやforといった制御構造がない)
多言語で、実装されている。
The MIT License
テンプレート文字列とそこに埋め込むデータのJSONを使用。
var html = Mustache.render(template, json-data)
テンプレートのタグ:{{tag}}
デフォルトで、htmlエスケープされる
ループや分岐は、Sectionsを使用 タグ:{{#tag}}
キーtagの値が配列の場合は、ループし
その他の場合は、真偽値へのキャストに応じて実行可否が判断される。

jQuery等のプラグイン化も簡単
/wrappers/jqueryのpreと本体のファイル、postを連結したファイルを作成すればよい

・Hogan.js
http://twitter.github.com/hogan.js/
Twitter社が公開しているテンプレートエンジン
the Apache License, Version 2.0
タグは、Mustacheと同じ
特徴は、「速さ」だそう。サーバー側で、テンプレートを事前にコンパイルしておく事もできるそう。

・Handlebars.js
http://handlebarsjs.com/
テンプレートは、Mustache互換

ヘルパー: テンプレート中で使用できる関数を定義し、拡張できる。
ビルトインで ifやeachといった制御構造用のものが用意されている。
Mustacheでは、分岐で「〜以上の時」というような記述が出来ないので、
それを実装することも可能。

・Underscore.js
http://underscorejs.org/
JavaScriptのユーティリティライブラリ
the MIT license

配列やオブジェクト操作のメソッドが提供されている。
Backbone.jsから依存されている。
templateというメソッドを持っている。

jQuery.EJS
http://javascriptmvc.com/docs.html#!jQuery.EJS

jQuery templates
https://github.com/jquery/jquery-tmpl/
jQueryのコアに取り込まれるという話もあったが、
開発停止に。。

・JTemplates
http://jtemplates.tpython.com/
jQueryプラグイン

飽きたので、ここで調査一旦停止

・JsRender
・JsTemplate
google
・PURE
・doT.js
・Transparency
http://blog.asial.co.jp/1136
・Jarty
Smartyの移植


■モバイル
http://justspamjustin.github.com/junior/