Version 3.4.0
Developer experience
New developer toolbar
The existing developer console has been replaced by new development tools. The main element is a persistent toolbar akin to a browser URL bar, sitting atop the screen and above the application UI. It provides quick access to essential development utilities. Most importantly it informs you where the application code is loaded from, allows to insert a different URL (also scannable via qr-code on Android), lets you reload the app and open the console logs.
As with the previous developer console, the new developer tools are only available when your app is build with the EnableDeveloperConsole
flag. The developer tools can also be explicitly hidden when not required. This can be done via its the developer tools menu entry or by using the new devTools
service API.
New and improved debugger support on Android
Tabris.js now supports the V8 inspector protocol on Android platforms. This means you have a fully-featured step-by-step debugger available to use in your favorite IDE. Source maps are applied automatically (when sideloading the code), meaning you'll see your TypeScript or JSX code when debugging and not the JavaScript output.
Project templates updated
When generating a new Tabris.js project via tabris init
it can now be pre-configured for debugging via Visual Studio Code. The tslint configuration also has been replaced with similar eslint configurations, complete with TypeScript and JSX support. The questionnaire itself has been trimmed down a bit, with the option to generate Tabris.js 2.x apps no longer being available.
CLI "serve" updates
The serve
command has received various improvements:
- The new
--qrcode-renderer
option allows to choose a different formatting for the QR code. The default isutf8
, but some terminals may not display these characters as expected. In this case setting the option toterminal
will produce a larger-but-safer version of the code. - The colors and formatting of the printed output has been tweaked for readability.
- The stability of the debug-connection (handling logging and auto-reload) has been improved significantly.
- You can now have a variety of key shortcuts available to interact with the running app, such as CTRL+R for reload and CTRL+U for printing a UI tree. It is also possible to backup and restore the localStorage content.
API
Extended file system API
The fs
object has some new methods, mostly for handling directories:
createDir(path)
creates a new directory at the given pathremoveDir(path)
removes an empty directoryremove(path)
removes any file or directory, empty or notisFile(path)
checks if the given path points to a fileisDir(path)
checks if the given path points to a directoryappendToFile(path, data)
adds data to a new or existing file
On Android, paths to external storage are made available via the externalFileDirs
and externalCacheDirs
properties.
Data binding in JavaScript/JSX
The data binding capabilities of Tabris.js rely on the TypeScript compiler (tsc
) to transform non-standard syntax and include type information in the compiled code. So far this meant that only .ts
and .tsx
files could use data binding. This has been changed so that .js
and .jsx
files are also supported, as long as they are still processed by tsc
. Due to the missing type information an "unsafe binding" warning will be logged in certain cases, which can be fixed by adding some type
data in code.
In future releases it may be possible to suppress these warnings entirely, as well as using the API entirely without the TypeScript compiler, i.e. in "vanilla" JS.