Skip to content

v0.3.0

Compare
Choose a tag to compare
@DmitrySharabin DmitrySharabin released this 27 Oct 18:57
· 12 commits to main since this release

We have some very exciting plans for Mavo going forwards, but the first step was to make a new, long overdue, release.

Breaking changes

  • A new way to define collections (mv-list/mv-list-item). You can use both to define a collection or mv-item-list or mv-list on their own, and the other one will be auto-added for you. mv-multiple is now deprecated but still works fine and just gets rewritten to mv-list/mv-list-item markup, so this is only a breaking change because you may have CSS that depends on the previous markup structure (e.g. child selectors).
  • The previously deprecated mv-like attribute has now been removed.
  • Property queries in get() (i.e. get(object, "key=value")) are not supported anymore. Use where or filter() for this.
  • The Dropbox backend is moved to a separate plugin to make Mavo lighter. Use mv-plugins="dropbox" anywhere to re-add support.
  • The CTRL/CMD + Backspace shortcut to delete a list entry is not supported anymore.
  • url() now does case insensitive matching by default—you can opt in to case sensitive matching via case_sensitive: true.

New Features

  • 🆕 mv-options attribute: limit properties to predefined options without having to create a <select>
  • 🆕 mv-item-bar attribute to customize list item controls (remove controls, add custom ones).
  • 🆕 mv-edit-as attribute: Teach Mavo how to edit new elements, e.g. web components.
  • 🆕 mv-attr-* family of attributes—a way for attributes to contain expressions without triggering browser errors or false loading.
  • You can now specify a plugin version in mv-plugins.
  • GitHub backend improvements:
    • When performing raw API calls, there is now a way to fetch more than one page, by adding a max_pages parameter.
    • When saving to a repo that doesn't yet exist, it is now possible to create a private repo (via the private storage attribute).
  • Local storage backend: 🆕 mv-storage-key attribute to override the localStorage key used.
  • You can now use mv-mode="edit" on mv-value elements to make dynamic collections editable.

MavoScript Changes

New functions

  • intersection()—to get a list of items that two lists have in common.
  • readable_datetime()—to get a date or date/time value as human-readable text (e.g., 13 Jun 1986 16:45).
  • pluralize()—to get the correct plural form of a word corresponding to the given number.
  • sort()—for locale-aware sorting of lists.
  • datetime()—Combine a date and (optionally) a time into a single date/time value in ISO format (e.g., 1986-06-13T16:45) that can be used as input for other date/time functions.
  • map()—Get properties from list items.

Function improvements

  • get() can accept multiple keys, e.g., get(group("foo": group("bar": "baz")), "foo", "bar") will return baz.
  • duration() now allows units to be specified explicitly, e.g., duration(ms, "days"). Negative inputs to duration() now produce negative time outputs.
  • url() now supports options to control case sensitivity, what is matched, what URL is used, and whether multiple results are returned.
  • Functions with 2-word names—groupby(), fromlast(), and tofirst()—renamed to group_by(), from_last(), and to_first() respectively to be consistent with other functions and better readability. Old functions still work but are deprecated and will be removed in the next release.

Special property improvements

  • $all.$previous/$all.$next to get all collection items before/after the current one.

Bugfixes and other improvements

  • Order of relative button ids in the mv-bar attribute is now preserved.
  • When changing the storage location of a Mavo app via the URL (e.g. via a ?myapp-storage=... URL), app id is now case insensitive.
  • Expressions now work properly with on* attributes.
  • The boolean disabled attribute works correctly with expressions on all supported elements, including <optgroup>, <option>, and <fieldset>.
  • And 130 more bugfixes and smaller improvements!

Plugins

New plugins

  • 🆕 List Separator plugin—Store and read lists of simple properties as a single text value. Useful in conjunction with the Google Sheets plugin to store multiple values in a single cell.
  • 🆕 Share plugin—Share data via system clipboard, email, contacts or messaging applications, and Bluetooth or Wi-Fi channels.
  • 🆕 Google Calendar Backend plugin—Integrate Google calendars into your Mavo apps.
  • 🆕 Autoload plugin—Let Mavo load all the needed plugins for you automatically.
  • 🆕 Spanish Locale plugin—Translates all Mavo UI to Spanish.

Notable improvements to existing plugins

  • TinyMCE: Added a CMD/CTRL + E shortcut to mark up code blocks.

For developers of custom backends

  • Mavo#load() now accepts a data parameter for overriding the data loaded.
  • New Mavo#push() for backend pushes.
  • New mv-remotedatachange event on Mavo.Backend to signify that data changed remotely.

New Contributors