Skip to content

v0.2.2

Compare
Choose a tag to compare
@LeaVerou LeaVerou released this 01 Feb 19:16

This is not a huge release, but there are some breaking changes. Make sure to review before upgrading!
Note that anyone using get.mavo.io/stable/ or get.mavo.io/0.2/ will be automatically upgraded to this release. You can rollback to v0.2.1 by using get.mavo.io/0.2.1/ instead.

Breaking changes

  • JS syntax is not allowed in Mavo expressions anymore. This opens the way for many future improvements to how expressions are handled. Note that if you're using custom JS functions in your expressions, those will continue to work fine, since function calls are perfectly valid MavoScript. One example of something you may need to convert: if you were using {} to define key-value pairs in your expressions, you will now need to use group() instead.
  • This version drops support for IE11, Chrome 41, Microsoft Edge < 16 as their market share is fairly low at this point
  • The code that allowed people to send "edit suggestions" as Github pull requests has now been moved to a plugin: https://plugins.mavo.io/plugin/github-pr . Use mv-plugins="github-pr" on any apps of yours that depend on this functionality.

Other changes

  • duration() now accepts a second parameter for number of terms returned (e.g. "2 hours, 30 minutes").
  • duration() is now multi-valued, i.e. if used with a list of values, it will return a list of durations.
  • Github backend now works correctly when the default branch is main if no branch is specified. It will continue to work correctly for repos where the default branch is still master, but that will cost an extra HTTP request.
  • indeterminate is now correctly supported as a boolean attribute. This allows you to easily do checkboxes that follow the select/unselect all pattern a highly recommended UI enhancement for collections that contain checkboxes.
  • 12 bugfixes
  • Several more code improvements

For plugin authors and JS developers

  • For developers of custom backends: Authors can now pass arbitrary data to your backend via attributes. E.g. mv-storage-foo="1" will be converted to {foo: "1"} and passed to your backend as a second constructor argument. See how the awesome new Google Sheets plugin uses this for additional metadata like sheet and range. These attributes are "live" as well, and could contain expressions, opening up so many creative possibilities!
  • A new hook allows you to use JS to easily transform data before it's rendered (read more)
  • A new save-start hook allows you to intercept saving
  • There is now a Mavo#destroy() method

Additional credits:

  • @DmitrySharabin for his huge help with this release, both in terms of code, as well as issue triaging, assisting with debugging etc.
  • @parulsingh23 for the duration() enhancements