diff --git a/docs/change-log.md b/docs/change-log.md index 5a9b75a3..ca5e695c 100644 --- a/docs/change-log.md +++ b/docs/change-log.md @@ -1,18 +1,18 @@ # Change log -- [v1.0.2](#v101) +- [v1.1.0](#v110) - [v1.0.1](#v101) - [Migrating from v0.2.x](#migrating-from-v02x) - [Older docs](http://mithril.js.org/archive/v0.2.5/index.html) --- -### v1.0.2 +### v1.1.0 #### News - support for ES6 class components -- updated typescript definitions +- support for closure components #### Bug fixes diff --git a/docs/components.md b/docs/components.md index 01721857..3d958aad 100644 --- a/docs/components.md +++ b/docs/components.md @@ -276,44 +276,6 @@ Be aware that when using ES5 functions, the value of `this` in nested anonymous --- -### ES6 classes - -Components can also be written using ES6 class syntax: - -```javascript -class ES6ClassComponent { - view() { - return m("div", "Hello from an ES6 class") - } -} -``` - -They can be consumed in the same way regular components can. - -```javascript -// EXAMPLE: via m.render -m.render(document.body, m(ES6ClassComponent)) - -// EXAMPLE: via m.mount -m.mount(document.body, ES6ClassComponent) - -// EXAMPLE: via m.route -m.route(document.body, "/", { - "/": ES6ClassComponent -}) - -// EXAMPLE: component composition -class AnotherES6ClassComponent { - view() { - return m("main", [ - m(ES6ClassComponent) - ]) - } -} -``` - ---- - ### Avoid anti-patterns Although Mithril is flexible, some code patterns are discouraged: diff --git a/docs/vnodes.md b/docs/vnodes.md index 62330333..cff0ebe4 100644 --- a/docs/vnodes.md +++ b/docs/vnodes.md @@ -79,6 +79,7 @@ Property | Type | Description `instance` | `Object?` | For components, a storage location for the value returned by the `view`. This property is only used internally by Mithril, do not use or modify it. `skip` | `Boolean` | This property is only used internally by Mithril when diffing keyed lists, do not use or modify it. + --- ### Vnode types @@ -88,7 +89,7 @@ The `tag` property of a vnode determines its type. There are five vnode types: Vnode type | Example | Description ------------ | ------------------------------ | --- Element | `{tag: "div"}` | Represents a DOM element. -Fragment | `{tag: "[", children: []}` | Represents a list of DOM elements whose parent DOM element may also contain other elements that are not in the fragment. When using the [`m()`](hyperscript.md) helper function, fragment vnodes can only be created by nesting arrays into the `children` parameter of `m()`. `m("[")` does not create a valid vnode. +Fragment | `{tag: "[", children: []}` | Represents a list of DOM elements whose parent DOM element may also contain other elements that are not in the fragment. When using the [`m()`](hyperscript.md) helper function, fragment vnodes can only be created by nesting arrays into the `children` parameter of `m()`. `m("[")` does not create a valid vnode. Text | `{tag: "#", children: ""}` | Represents a DOM text node. Trusted HTML | `{tag: "<", children: "
"}` | Represents a list of DOM elements from an HTML string. Component | `{tag: ExampleComponent}` | If `tag` is a Javascript object with a `view` method, the vnode represents the DOM generated by rendering the component.