Skip to content

Instantly share code, notes, and snippets.

@TomoyaShibata
Last active August 29, 2015 14:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TomoyaShibata/9fa26d2e147f4212f9e9 to your computer and use it in GitHub Desktop.
Save TomoyaShibata/9fa26d2e147f4212f9e9 to your computer and use it in GitHub Desktop.
Backbone.js 1.2.0 変更履歴 スーパー粗訳

2015年5月13日、Backbone.js 1.2.0 がリリースされました。 👏
以下、Google 翻訳に頼りまくりなスーパー粗訳をしています。 恐縮ながら数々の誤訳だらけかと思いますので、お気付きの点などございましたら、ご指摘頂けますと幸いです。

翻訳変更履歴

2015/05/23

chorolis さんの指摘を反映
https://gist.github.com/tomoyashibata/9fa26d2e147f4212f9e9#comment-1458758

変更履歴 Backbone.js 1.2.0 2015年5月13日

http://backbonejs.org/#changelog

Added new hooks to Views to allow them to work without jQuery. See the wiki page for more info.

jQeruy への依存を完全撤廃しました。その代わりに新しいフックを作りました。詳しくは Wiki を参照してください。 https://github.com/jashkenas/backbone/wiki/Using-Backbone-without-jQuery

As a neat side effect, Backbone.History no longer uses jQuery's event methods for pushState and hashChange listeners. We're native all the way.

Backbone.History は pushState、及び hashChange リスナー に jQuery のイベントメソッドを使いません。我々は全てにおいてネイティブの方法を取ります。

Also on the subject of jQuery, if you're using Backbone with CommonJS (node, browserify, webpack) Backbone will automatically try to load jQuery for you.

Backbone.js を CommonJS (node や browserify, webpackが提供する) と一緒に使う場合、 Backbone.js は自動的に jQuery の読み込みを試みます。

Added an "update" event that triggers after any amount of models are added or removed from a collection. Handy to re-render lists of things without debouncing.

update イベントを追加しました。Collection に対して、任意の量の Model の追加または削除後に呼び出されます。チラつき防止処理を施すこと無くリストを再描画する手軽な方法です。

Added modelId to Collection for generating unique ids on polymorphic collections. Handy for cases when your model ids would otherwise collide.

Collection に ModelID を追加しました。多用な Collection にユニークな ID の生成ができ、 Model の ID が衝突するようなときに便利です。

Added an overridable _isModel for more advanced control of what's considered a model by your Collection.

オーバーライド可能な Collection._isModel メソッド を追加しました。 Model と考えられるオブジェクトに対してより高度な制御が行えます。

The success callback passed to Model#destroy is always called asynchronously now.

Model.destroy メソッド に渡される success コールバックは常に非同期に呼び出されます。

Router#execute passes back the route name as its third argument.

Router.execute メソッド は第3引数としてルート名を受け取ります。
http://backbonejs.org/docs/backbone.html#section-192

Cancel the current Router transition by returning false in Router#execute. Great for checking logged-in status or other prerequisites.

Router.execute で false を返却すると、ルーティングをキャンセルすることができます。ログインや、その前提条件をチェックする方法に最適でしょう。

Added getSearch and getPath methods to Backbone.History as cross-browser and overridable ways of slicing up the URL.

Backbone.History に getSearch メソッドgetPath メソッド を追加しました。クロスブラウザと URL スライスにオーバーライド可能な方法です。

Added delegate and undelegate as finer-grained versions of delegateEvents and undelegateEvents. Useful for plugin authors to use a consistent events interface in Backbone.

delegateEventsundelegateEvents にきめ細かいバージョンとして delegeteundelegate が追加されました。 Backbone の一貫性のあるイベントインタフェースを使用するプラグイン作者たちには便利なものです。

A collection will only fire a "sort" event if its order was actually updated, not on every set.

実際には無い順序で更新されたとき、 Collection は sort イベントを発火します。 (かなり怪しい翻訳)

Any passed options.attrs are now respected when saving a model with patch: true.

Model が patch: true で save されたとき、 どのような options.attrs でも尊重されます。
(かなり怪しい翻訳)

Collection#clone now sets the model and comparator functions of the cloned collection to the new one.

Collection.clone メソッド は、新しくクローンされた Collection に model と comparator 関数をセットします。

Adding models to your Collection when specifying an at position now sends the actual position of your model in the add event, not just the one you've passed in.

Model を Collection へ追加する際に位置を指定すると、 add イベントだけでなく、実際の追加位置を送信します。

Collection#remove will now only return a list of models that have actually been removed from the collection.

Collection.remove メソッド は、 Collection から削除された Model のリストを返却します。

Fixed loading Backbone.js in strict ES6 module loaders.

strict mode の ES6 の モジュール読み込みについて、 Backbone.js の読み込みを修正しました。

@chrolis
Copy link

chrolis commented May 22, 2015

気になったところをコメントしてみます。


新機能の説明は、
はじめに機能名を明示してから説明したほうが理解しやすい事が多いです。
(そのまま日本語にすると文の後ろの方に来てしまうので
何の説明なのか読み終わるまでわからない)

e.g.:

Added an "update" event that triggers after any amount of models are added or removed from a collection. Handy to re-render lists of things without debouncing.

update イベントの追加。このイベントは Collection に対して、任意の量の Model の追加または削除後に呼び出されます。チラつき防止処理を施すこと無くリストを再描画する手軽な方法です。


以降、英訳としておかしいと思ったところ:

overridable _isModel

オーバーライドとして ではなく オーバーライド可能な ですね。
同様に

overridable ways of

オーバーライド可能な方法として


Router#execute passes back the route name as its third argument.

Router#execute は第3引数としてルート名を受け取ります。
(利用例をつけておくと理解しやすそう: http://backbonejs.org/docs/backbone.html#section-192)


Cancel the current Router transition by returning false in Router#execute. Great for checking logged-in status or other prerequisites.

Great for 〜 は 〜に最適 とか 〜にもってこい のほうが great ✨


Any passed options.attrs are now respected when saving a model with patch: true.

たぶん jashkenas/backbone#3232 のことだけどよく読んでない

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment