Skip to content

2.0.0 Beta 2

Pre-release
Pre-release
Compare
Choose a tag to compare
@ralfstx ralfstx released this 17 Mar 08:14
· 1189 commits to master since this release

Event listener API

We've redesigned the API for event listeners. All event listeners now receive a single event object instead of separate parameters. This change requires adjustments to all existing applications, however, it will allow us to add new event properties over time without introducing any more breaking changes.

All event objects have a target property that references the object that received the event. All change listeners (change:property) include a property value that contains the new value of the changed property. Other properties are specific to the event type.

For example, an event listener for a checkbox would now look like this:

checkbox.on('select', (event) => {
  event.target // the checkbox that received the event
  event.checked // the checked state
});

Please refer to the documentation for the properties available on the respective events. You may also want to look at the updated snippets.

Renamed properties

On all stateful button widgets, that is CheckBox, RadioButton, ToggleButton, and Switch, the property selection has been renamed to checked. The select event also contains a parameter checked that reflects the new state.

On touch events, the properties pageX and pageY have been renamed to absoluteX and absoluteY, respectively. These properties reflect the position relative to the content view (ui.contentView).

Animations

The events animationstart and animationend have been removed in favour of the new Promise API. Those events were hard to consume as they could fire before the listener was even attached and they weren't specific to a certain animation. With the Promise returned by the animate() method, it has become much easier to perform actions on completion. Example:

widget.animate({opacity: 0}, {duration: 300, easing: 'ease-out'}).then(() => widget.dispose());

Windows support

Tabris.js can now create Windows 10 Store apps for desktop, tablet and phone. Not all APIs will be supported on the launch of Tabris.js 2.0, so keep an eye on the Windows 10 support article of the Tabris.js documentation. For now Tabris Connect can build appxbundle files suitable for sideloading, appxupload files for store deployment will be available at launch.

Local builds with the CLI

The latest version of tabris-cli supports building apps on your local machine by calling

tabris build [android|ios|windows]

Custom widgets

The interface for custom widgets has changed. If you've developed a native custom widget, please refer to the custom widget documentation for the new API.

Migration Guide

To facilitate the migration of existing apps, we've created a migration guide.