|
1 | 1 | # Getting Started |
| 2 | + |
| 3 | +[](https://travis-ci.org/Volicon/backbone.nestedTypes) |
| 4 | +[](https://travis-ci.org/Volicon/backbone.nestedTypes) |
| 5 | + |
| 6 | +Version 1.0.0 is here. Highlights: |
| 7 | + |
| 8 | +- New .has type specs syntax |
| 9 | +- Huge performance improvement over vanilla backbonejs. Model updates are 4x faster in most browsers (20x faster in Chrome and nodejs). |
| 10 | + |
2 | 11 | ## What it is |
| 12 | + |
| 13 | +NestedTypes is state-of-the-art backbonejs-compatible model framework. |
| 14 | + |
| 15 | +### Complex attribute types |
| 16 | + |
| 17 | +* Cross-browser handling of Date. |
| 18 | +* Nested models and collections. |
| 19 | +* One-to-many and many-to-many model relationships. |
| 20 | + |
| 21 | +It's achieved using attribute type annotations, which feels in much like statically typed programming language. Yet, this annotations are vanilla JavaScript, no transpiler step is required. |
| 22 | + |
| 23 | +### Safety |
| 24 | + |
| 25 | +NestedTypes check types on every model update and perform dynamic type casts to ensure that attributes will always hold values of proper type. |
| 26 | + |
| 27 | +As result, NestedTypes models are extremely reliable. It's impossible to break client-server protocol with inaccurate attribute assignment. If something will go really wrong, it will warn you with a messages in the console. |
| 28 | + |
| 29 | +### Performance |
| 30 | +NestedTypes uses attribute type information for sophisticated optimizations targeting modern JS JIT engines. |
| 31 | + |
| 32 | +Compared to backbonejs, model updates are about 20 times faster in Chrome/nodejs, and 4 times faster in other browsers. |
| 33 | + |
| 34 | +### Easy to use and learn |
| 35 | +NestedTypes was originally designed with an idea to make backbonejs more friendly for newbiews. |
| 36 | + |
| 37 | +What we do, is taking intuitive newbie approach to backbonejs, and turn it from the mistake to legal way of doing things. |
| 38 | + |
3 | 39 | ```javascript |
4 | 40 | var User = Nested.Model.extend({ |
5 | 41 | urlRoot : '/api/users', |
@@ -45,36 +81,6 @@ collection.fetch().done( function(){ |
45 | 81 | user.settings = { timeZone : 180 }; // same as user.settings.set({ timeZone : 180 }) |
46 | 82 | console.assert( user.settings instanceof Settings ); |
47 | 83 | ``` |
48 | | - |
49 | | -[](https://travis-ci.org/Volicon/backbone.nestedTypes) |
50 | | -[](https://travis-ci.org/Volicon/backbone.nestedTypes) |
51 | | - |
52 | | -NestedTypes is state-of-the-art backbonejs-compatible model framework. |
53 | | - |
54 | | -### Complex attribute types |
55 | | - |
56 | | -* Cross-browser handling of Date. |
57 | | -* Nested models and collections. |
58 | | -* One-to-many and many-to-many model relationships. |
59 | | - |
60 | | -It's achieved using attribute type annotations, which feels in much like statically typed programming language. Yet, this annotations are vanilla JavaScript, no transpiler step is required. |
61 | | - |
62 | | -### Safety |
63 | | - |
64 | | -NestedTypes check types on every model update and perform dynamic type casts to ensure that attributes will always hold values of proper type. |
65 | | - |
66 | | -As result, NestedTypes models are extremely reliable. It's impossible to break client-server protocol with inaccurate attribute assignment. If something will go really wrong, it will warn you with a messages in the console. |
67 | | - |
68 | | -### Performance |
69 | | -NestedTypes uses attribute type information for sophisticated optimizations targeting modern JS JIT engines. |
70 | | - |
71 | | -Compared to backbonejs, model updates are about 30 times faster in Chrome/nodejs, and 4 times faster in other browsers. |
72 | | - |
73 | | -### Easy to u se and learn |
74 | | -NestedTypes was originally designed with an idea to make backbonejs more friendly for newbiews. |
75 | | - |
76 | | -What we do, is taking intuitive newbie approach to backbonejs, and turn it from the mistake to legal way of doing things. |
77 | | - |
78 | 84 | ## Installation & Requirements |
79 | 85 | > CommonJS (node.js, browserify): |
80 | 86 |
|
|
0 commit comments