documentation fixes

This commit is contained in:
Leo Horie 2016-05-26 15:21:30 -04:00
parent e35fc79f09
commit 0ed3d20c4c
3 changed files with 8 additions and 4 deletions

View file

@ -6,18 +6,22 @@ This rewrite aims to fix longstanding API design issues, significantly improve p
## Early Preview
You can install this via NPN using this command:
You can install this via NPM using this command:
```
npm install lhorie/mithril.js#rewrite
```
Examples run out of the box. Just open the HTML files.
## Status
Code still is in flux. Most notably, there's no promise polyfill yet and there are several use cases that still need to be polished. DO NOT USE IN PRODUCTION YET!
Some examples of usage can be found in the [examples](examples) folder. [ThreadItJS](http://cdn.rawgit.com/lhorie/mithril.js/rewrite/examples/threaditjs/index.html) has the largest API surface coverage and comments indicating pending issues in framework usability. Note that the APIs those examples use may not become the final public API points in v1.0.
Partial documentation can be found in the `/docs` directory
## Performance
Mithril's virtual DOM engine is less than 500 lines of well organized code and it implements a modern search space reduction diff algorithm and a DOM recycling mechanism, which translate to top-of-class performance. See the [dbmon implementation (non-optimized)](http://cdn.rawgit.com/lhorie/mithril.js/rewrite/examples/dbmonster/mithril/index.html) (for comparison, here are optimized dbmon implementations for [React v15.0.2](http://cdn.rawgit.com/lhorie/mithril.js/rewrite/examples/dbmonster/react/index.html), [Angular v2.0.0-beta.17](http://cdn.rawgit.com/lhorie/mithril.js/rewrite/examples/dbmonster/angular/index.html) and [Mithril 0.2.x](http://cdn.rawgit.com/lhorie/mithril.js/rewrite/examples/dbmonster/mithril-0.2.x/index.html)).
@ -34,7 +38,7 @@ Mithril's `config` method is now replaced by several lifecycle methods to improv
## Robustness
There are over 2200 assertions in the test suite, and tests cover even difficult-to-test things like `location.href`, `element.innerHTML` and `XMLHttpRequest` usage.
There are over 2300 assertions in the test suite, and tests cover even difficult-to-test things like `location.href`, `element.innerHTML` and `XMLHttpRequest` usage.
## Modularity

View file

@ -125,7 +125,7 @@ State can also be accessed via the `this` keyword, which is available to all lif
```javascript
var ComponentUsingThis = {
oninit: function() {
oninit: function(vnode) {
this.data = vnode.attrs.text
},
view: function(vnode) {

View file

@ -106,7 +106,7 @@ You should not modify model data synchronously from this method. Since `oncreate
### onupdate
The `oncreate(vnode)` hook is called after a DOM element is updated, while attached to the document. `onupdate` is guaranteed to run at the end of the render cycle, so it is safe to read layout values such as `vnode.dom.offsetHeight` and `vnode.dom.getBoundingClientRect()` from this method.
The `onupdate(vnode)` hook is called after a DOM element is updated, while attached to the document. `onupdate` is guaranteed to run at the end of the render cycle, so it is safe to read layout values such as `vnode.dom.offsetHeight` and `vnode.dom.getBoundingClientRect()` from this method.
This hook is only called if the element existed in the previous render cycle. It is not called when an element is created or when it is recycled.