Skip to content
This repository has been archived by the owner on Oct 30, 2022. It is now read-only.

v.1.7.0

Compare
Choose a tag to compare
@ArthurClemens ArthurClemens released this 02 Aug 19:12
· 26 commits to master since this release

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:

  1. Link building. The m.route.link function has been removed in favor of the m.route.Link component. This leads to a small code change for Polythene component option url:

    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,
      }
    })
  2. 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.