Jovo Framework v2 is Out and Better Than Ever!



The most popular development framework for Alexa skills and Actions on Google Assistant is back again with a brand new version 2 beta release!

I’ve been using the Jovo Framework to develop cross-platform Voice apps for Alexa and Google Assistant for almost 10 months now, and I couldn’t have been more excited for when Jan König announced he had a big update coming for Jovo!

With this being said, I’d like to cover my favorite changes to the Jovo Framework in v2!

1. Modular Design/Plugins

With v2, the jovo-framework npm package no longer contains all the features. Each plugin and integration is imported, configured, and initialized individually.

const {App} = require('jovo-framework');
const {Alexa} = require('jovo-platform-alexa');
const {GoogleAssistant} = require('jovo-platform-googleassistant');
const {JovoDebugger} = require('jovo-plugin-debugger');
const {FileDb} = require('jovo-db-filedb');

const app = new App();

app.use(
    new Alexa(),
    new GoogleAssistant(),
    new JovoDebugger(),
    new FileDb()
);

You can read more about the new modular structure and plugin changes here!

This makes it much easier to have control over what is included in your build, and what is not! If you only want to develop for Alexa and not Google Assistant, you can easily remove that plugin!

2. Google Sheets CMS Layer

With the new Google Sheets CMS, you can easily manage all of your app’s content in a simple Google Spreadsheet. They have really abstracted away much of the heavy lifting behind the scenes so you can work on the app logic and data, and worry less about setup and configuration!

With all the benefits that Google Sheets has to offer with collaboration, ease of use, and robustness, you will definitely want to check this one out!

Google Sheets CMS

With the CMS layer, this opens new opportunities for other CMS integrations in the future, so be on the lookout for more to come!

You can read more about the Jovo Google Sheets CMS Layer Here!

3. ES6 Syntax

Jovo v2 has fully embraced ES6 method syntax! Before, I had to define methods with the corresponding intent string names, but now it is much cleaner with the new syntax:

// old
app.setHandler({
    'LAUNCH': function() {

    },
    'HelloWorldState': {
        'HelloWorldIntent': function() {

        }
    },
    'AUDIOPLAYER': {
        'AudioPlayer.PlaybackStarted': function() {

        },
    }
});

// new
app.setHandler({
    LAUNCH() {

    },
    HelloWorldState: {
        HelloWorldIntent() {

        }
    },
    AUDIOPLAYER: {
        'AlexaSkill.PlaybackStarted'() {

        },
    }

})

You can read more about syntax changes here

While this is optional, it does provide a much cleaner code reading and writing experience!

4. Staging Layers

With the new folder layout and structure comes config.js! You can now easily create different staging layers for all of your app’s needs. Having a development, testing, and production environment because more critical as your apps scales as you want to make sure that you have thoroughly tested your app before its release!

As an example, you could have the following:
config.dev.js
config.test.js
config.prod.js

In each stage, you could disable or enable certain features for different environments. As an example, you could change your database from local to dynamo in config.dev.js

module.exports = {
   db: {
        FileDb: {
            pathToFile: '../db/db.json',
        }
    },
};

to config.prod.js:

module.exports = {
   db: {
        DynamoDb: {
            tableName: 'TableName',
        }
    },
};

You can read more about how to use config.js here

5. Unit Testing

Jovo changed their testing framework from mocha and chai to Jest which provides a much cleaner and rubust experience with async and await

You can read more about integrating Jest unit testing here

If you would like to see Jan explain some of the version 2 changes, watch Jovo’s recent video!

Read about the full changes to Jovo version 2