Skip to content

Commit 3ce5178

Browse files
author
Vlad Balin
committed
Merge remote-tracking branch 'refs/remotes/origin/master' into develop
2 parents a04a113 + c98d59e commit 3ce5178

File tree

3 files changed

+19
-20
lines changed

3 files changed

+19
-20
lines changed

README.md

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,6 @@ in state of the art model frameworks through lightweight and declarative attribu
5050

5151
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.
5252

53-
### Safety
54-
55-
NestedTypes check types on every model update and perform dynamic type casts to ensure that attributes will always hold values of proper type.
56-
57-
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 fix an error and warn you with a messages in the console.
58-
59-
### Performance
60-
NestedTypes uses attribute type information for sophisticated optimizations targeting modern JS JIT engines.
61-
62-
Compared to backbonejs, model updates are up to 40 times faster in Chrome/nodejs, and at least 4 times faster in other browsers.
63-
![Backbone vs NestedTypes](docs/performance.jpg)
64-
65-
### How it looks like
66-
It looks and feels in much like statically typed language.
67-
6853
```javascript
6954
var User = Nested.Model.extend({
7055
urlRoot : '/api/users',
@@ -95,7 +80,12 @@ collection.fetch().done( function(){
9580
console.log( user.roles.first().name );
9681
});
9782
```
98-
> Types are being checked in run-time on assignment, but instead of throwing exceptions it tries to cast values to defined types.
83+
84+
### Safety
85+
86+
NestedTypes check types on every model update and perform dynamic type casts to ensure that attributes will always hold values of proper type.
87+
88+
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 fix an error and warn you with a messages in the console.
9989

10090
```javascript
10191
user.login = 1;
@@ -110,6 +100,13 @@ collection.fetch().done( function(){
110100
user.settings = { timeZone : 180 }; // same as user.settings.set({ timeZone : 180 })
111101
console.assert( user.settings instanceof Settings );
112102
```
103+
104+
### Performance
105+
NestedTypes uses attribute type information for sophisticated optimizations targeting modern JS JIT engines.
106+
107+
Compared to backbonejs, model updates are up to 40 times faster in Chrome/nodejs, and at least 4 times faster in other browsers.
108+
![Backbone vs NestedTypes](docs/performance.jpg)
109+
113110
## Installation & Requirements
114111
> CommonJS (node.js, browserify):
115112
@@ -138,13 +135,13 @@ NestedTypes requires modern JS environment with support for native properties.
138135
It's tested in `IE 9+`, `Chrome`, `Safari`, `Firefox`, which currently gives you about 95%
139136
of all browsers being used for accessing the web.
140137

141-
`node.js` and `io.js` are also supported.
138+
`node.js` is also supported.
142139

143140
### Packaging and dependencies
144141

145142
NestedTypes itself is packaged as UMD (Universal Module Definition) module, and should load dependencies properly in any environment.
146143

147-
NestedTypes require `underscore` and `backbone` libraries. They either must be included globally with `<script>`tag or, if `CommonJS`/`AMD` loaders are used, be accessible by their standard module names.
144+
NestedTypes requires `underscore` and `jquery` libraries. They either must be included globally with `<script>`tag or, if `CommonJS`/`AMD` loaders are used, be accessible by their standard module names.
148145

149146
### bower
150147

nestedtypes.js

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,6 @@ function linkToProp( name ){
5555
// allow sync and jQuery override
5656
Object.defineProperties( exports, {
5757
'sync' : linkToProp( 'sync' ),
58-
'$' : linkToProp( '$' )
58+
'$' : linkToProp( '$' ),
59+
'ajax' : linkToProp( 'ajax' )
5960
});

0 commit comments

Comments
 (0)