Skip to content

0.9 M6

Pre-release
Pre-release
Compare
Choose a tag to compare
@ralfstx ralfstx released this 07 Jan 21:48
· 2297 commits to master since this release

Module system

We've implemented a Node.js / CommonJS compatible module API. To start with the most drastic change, instead of an index.json file, Tabris.js applications must now contain a package.json file. This is the standard manifest file that describes a module. This file must contain a field main that points to the main JavaScript file. You can also use this file to declare dependencies and install them from npm.

If your application consists of multiple files, the main file must include other modules using the require() function. Modules can export variables using the exports or module.exports object. For details, please refer to the Node.js description or have a look at our examples.

Cordova integration

We've integrated support for Cordova plug-ins to access device functions. The developer clients have a number of built-in modules. Please have a look at our cordova example. We plan to make it possible to include custom Cordova plug-ins in a Tabris.js application.

In order to support Cordova, we've also improved DOM compatibility by providing common Web API such as the global navigator object.

Widget API changes

  • The Widget property visibility has been renamed to visible.
  • The image property has been removed from CheckBox and RadioButton.
  • The ScrollComposite property scroll has been renamed to direction.
  • The Action property placementPriority accepts only the lower case values (low, high, and normal)

New API

  • A basic Video widget has been added. See the video snippet for an example.
  • The TabFolder widget has a new property tabBarLocation to set the position of the tab bar. Supported values are top, bottom, and auto.
  • The WebView widgets supports a new property html that accepts an entire HTML document.
  • Composite now supports the events addchild and removechild that are fired whenever a new child is added to/removed from a Composite.
  • Device information is provided by a global object device with the properties model, platform, and version.
  • The Text widget supports a new event change:text that is fired on text modification (i.e. while typing).
  • Images are now also accepted as a plain strings. This is a shortcut for {url: string}.
  • Colors now support the keyword transparent as value. Just like in CSS, this is a synonym for rgba(0, 0, 0, 0).
  • The Widget method children() accepts a new optional parameter selector to filter the returned elements (currently only by type).
    The method now returns an array-like collection with the methods first() and last() to access the first/last element.
    The methods toArray(), forEach(), and indexOf() are also available.

Non-functional changes

We've added checks for property names and values. In case of a misspelled property names or an illegal property value, you should now see a warning in the developer console in most cases.