v.1.7.0
Mithril 2.x
Polythene is now compatible with the recent release of Mithril 2.x. Mithril 2 offers better stability and performance and is recommended for Polythene apps with Mithril.
Mithril's API change may have some implications for code written with Polythene:
-
Link building. The
m.route.link
function has been removed in favor of them.route.Link
component. This leads to a small code change for Polythene component optionurl
:Mithril 1.x code:
h(Button, { label: "Update", element: "a", // this is the default, so can be omitted url: { href: route.path, oncreate: m.route.link } })
Mithril 2.x code:
h(Button, { label: "Update", element: h.route.Link, // Note the capital L url: { selector: "a", // this is the default, so can be omitted href: route.path, } })
-
Mithril 2.x is much stricter when to use keys in arrays; when a mix of keyed and unkeyed fragments are encountered, the program will bail with an error. Mithril has an elaborate page on keys that helps to solve issues.
Other changes related to Mithril code can be found in the Mithril release notes.
Regular updates
Bug fixes:
- Card: Images did not load properly in some cases. This is now fixed.
Documentation:
- The TextField documentation contained some examples that set the field value programmatically. This led to unexpected behavior in Safari (where the cursor jumps to the end with each change). The documentation was a bit misleading - it is not required to pass the value back to the component. Documentation and demos have been updated.