CLI keyboard shortcuts to help with Tabris.js app development
In the latest release of Tabris.js, we introduced a new way to interact with an app served by the Tabris.js CLI: keyboard shortcuts. They complement the interactive console (flag -i
) that makes it possible to write JavaScript commands on your computer and execute them on the connected app.
A basic one is Ctrl+R – it enables you to reload the source code of a running app. This shortcut is particularly useful when serving an app without auto-reload option -a
enabled.
Tabris.js 3.4.0 introduced a more accessible development tools UI that is always visible and doesn’t require swiping from the edge. Ctrl+T hides the development tools when you don’t need them, so that the app can take up the whole screen, and brings them back when you do.
Since Tabris.js 3.0.0, it is possible to print an XML representation of the widget tree (or a part of it) that is useful for debugging by calling console.dirxml(tabris.contentView). Now, you can simply press Ctrl+U:
One of the easiest ways to persist your app data is to use localStorage
. The localStorage
contents can now be cleared by pressing Ctrl+X. When only using localStorage
to persist your app data, resetting your app is now as easy as pressing Ctrl+X and Ctrl+R.
Often, it is desired to test a particular state of an app. However, depending on the business logic of your app, reaching some internal states might require a long sequence of interactions with the app. We now offer a set of convenient shortcuts to manage the localStorage
contents, helping you reproduce an internal state of your app.
To save the contents of localStorage
to a JSON file, press Ctrl+S:
If you want to load a particular state of localStorage
you saved before, press Ctrl+L:
Both commands support tab-completion of the path to help you pick your saved storage files more easily.
Would you use some of these shortcuts when developing Tabris.js apps? Do you miss a shortcut you would often use during development? Let us know!
Feedback is welcome!
Want to join the discussion?Feel free to contribute!