A long overdue update of the Microsoft Teams Apps Yeoman generator – we’re now up to version 2.5.0! It’s a fairly substantial update both in the generator and in the generated code – this update will make future updates a lot smoother and will allow for enabling more features going forward. Thanks to all who provided feedback and input and has tested the generator over the last few months. generator-teams-2.5.0

You can get the latest generator by running

npm install generator-teams@latest –global

Generator updates

The actual Yeoman generator has been refactored and changed so that it used TypeScript AST (abstract syntax tree) to dynamically generate some of the TypeScript files. This will open up for adding new artifacts to existing projects without having to do weird string and text file parsing. We’ve also refactored some generated files out to separate npm packages, so that those files and controls can be updated without you having to manually update files or generate new solutions – more about this below.

Solution updates

In order to improve the generated app we have moved some of the generated files, controls and base classes into separate npm packages. This allows you to get the latest and greatest in these packages with just a simple npm command – and not having to manually copy and paste.

The generated solution is hosted in a node.js Express server and the new generated solutions will dynamically discover what components and extensions you have in your solution and automatically register the different routes. All this is done by using TypeScript decorators and Express routes that are defined in the express-msteams-host npm package. Previous versions of the generator had a quite complex server implementation and since it was scaffolded by the generator it was close to impossible to update with new features or fixes. Now all you have to do is decorate your bots, connectors and outgoing webhooks with these decorators and their routes will automatically be picked up and registered. For more information, see the documentation.

A similar approach has been taken to the clients side of the generated solution. A few releases ago the UX was moved to leverage the Microsoft Teams React controls, and with this version we’ve moved the base page class (previously generated by the generator) into a separate npm package called msteams-react-base-component. Similar story here, this will make it way easier for everyone to consume updates to this component without running the generator again.

Of course there are plenty of more stuff that has been fixed or refactored such as; the build pipeline that has been upgraded to Gulp 4 and Webpack 4 and improved logging in the generated solution using the debug module – and you can read about the other changes in the change log.

What next?

It’s exciting times in Microsoft Teams Apps land! We now have a corporate store for Teams Apps, we’ve seen that the SharePoint and Microsoft Teams product groups are having secret meetings to improve the integration between (my favorite) two services. I’m of course looking into this and will share some exciting updates when we close in on more public reveals of features – Microsoft Ignite mayhaps. Oh, if you’re at Microsoft Ignite, try to find me somewhere in a Theater session or lurking in the SharePoint and Microsoft Teams booths if you want to discuss the generator.

#yoteams