From 0ed3d20c4cf858da9f26322cc730b51cf2352e39 Mon Sep 17 00:00:00 2001 From: Leo Horie Date: Thu, 26 May 2016 15:21:30 -0400 Subject: [PATCH] documentation fixes --- README.md | 8 ++++++-- docs/components.md | 2 +- docs/lifecycle-methods.md | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1dcc001c..8177db24 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/docs/components.md b/docs/components.md index ed5ee692..7a2555c6 100644 --- a/docs/components.md +++ b/docs/components.md @@ -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) { diff --git a/docs/lifecycle-methods.md b/docs/lifecycle-methods.md index f08fe66f..5fe4bd8a 100644 --- a/docs/lifecycle-methods.md +++ b/docs/lifecycle-methods.md @@ -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.