Yeoman Generator 0.17.0 prerelease 1

Allo’ allo’ here’s Simon for the Yeoman team.

After about a month without release of the core system, we’re really happy to announce yeoman-generator version 0.17.0-pre. Our release cycle have been delayed because this is a fairly big release!

First of all, we published 0.17.0-pre on NPM as a pre-release. Make sure to install it with npm install yeoman-generator --tag pre.

Follow through for an overview of the major changes.

Composability

As stated on our 2014 roadmap, composability is our next major core feature.

Composability will allow us to write smaller base generators for common needs, and enable generator authors to build higher-level generators which reuse them. That’ll make for more centralized works and improvements. For example, we’ll only need a single CSS or Bootstrap generator. Every other generator will be able to concentrate on their domain problems and rely on base generators to handle the rest.

With 0.17, we bring two major improvements to ease composability issues: a run loop and the composeWith method.

Run loop

With Yeoman each methods on a generator’s prototype is a task and run in a synchronous serie. In the current state, a generator will run all its methods; and then call another generator who’ll only run then.

To allow generators to really run side by side, we needed to allow them to run together instead of one after the other.

To make this happen, we implemented a run loop that registers task with particular priorities. Higher priorities will run first, and lower priorities would run at the end.

You can read the full documentation about the run loop inside our new documentation. This documentation is still WIP and will be released with 0.17.0 complete.

composeWith()

This new method is almost like the previous invoke method. The only difference being it’ll add the composed generator to the run loop.

You can read more about composeWith in our new documentation.

Enjoy testing your Generators

Unit testing a generator can be daunting. To ease the pain, this release include new tests helpers. These helpers creates a RunContext object who take care of setting and running a generator for you.

Read the documentation to learn more about it!

And then?

As you can see, this is a pretty major release. The run loop is not exactly a breaking change, but it could cause issues if name “conflict” with a priority.

We launch this pre-release to allow you to test it and bring as much feedback as we can before carving 0.17 features into stone. Please update your generators and tell us how it’s been!

Until next time!


« View More Posts