DEV Community

Cover image for New Meteor.js 2.14, updates to CLI and Tracker changes
Gabriel Grubba for Meteor

Posted on • Edited on

New Meteor.js 2.14, updates to CLI and Tracker changes

2.14 banner

Meteor.js has released version 2.14, which includes several updates and improvements. Here are some of the key features of this release:

Meteor CLI is being modernized

In this release, we have added two new features to the CLI. You can now open your browser directly by adding --open to your run or test command. Starting from v2.14, your meteor CLI can also help you through the creation of your project, giving you options and projects from which you can choose to start using it. Ensure your meteor tool is in 2.14 and run meteor create in your terminal.
We have made a demo video for these features:

Note that this is a feature on top of what we currently have in the meteor create command.

Addition of firstRunPromise

For some scenarios, it is necessary to await the completion of an invocation of a Tracker.autorun, meaning that before this feature with many of our codes becoming async, this test would fail:


Tinytest.addAsync('tracker - async function - synchronize', async test => {
  let counter = 0;

  Tracker.autorun(async () => {
    test.equal(counter, 0);
    counter += 1;
    test.equal(counter, 1);
    await Promise.resolve();
    test.equal(counter, 1);
    counter *= 2;
    test.equal(counter, 2);
  });

   Tracker.autorun(async () => {
    test.equal(counter, 2);
    counter += 1;
    test.equal(counter, 3);
    await Promise.resolve();
    test.equal(counter, 3);
    counter *= 2;
    test.equal(counter, 6);
  });
});

Enter fullscreen mode Exit fullscreen mode

Now, with this new feature, we can rewrite our test so that it can pass now:

Tinytest.addAsync('tracker - async function - synchronize', async test => {
  let counter = 0;

  await Tracker.autorun(async () => {
    test.equal(counter, 0);
    counter += 1;
    test.equal(counter, 1);
    await Promise.resolve();
    test.equal(counter, 1);
    counter *= 2;
    test.equal(counter, 2);
  }).firstRunPromise;

  await Tracker.autorun(async () => {
    test.equal(counter, 2);
    counter += 1;
    test.equal(counter, 3);
    await Promise.resolve();
    test.equal(counter, 3);
    counter *= 2;
    test.equal(counter, 6);
  });
});

Enter fullscreen mode Exit fullscreen mode

You can choose between awaiting the .firstRunPromise property or just await for the Tracker.autorun. Both options have the same output.

Dependencies updates

You can check all changes in the changelog

In this release, we updated some dependencies. The most notable ones are:

  • MongoDB driver to v4.17.2;
  • Typescript to v4.9.5;
  • Cordova v12.0.1 for Android and v7.0.1 for iOS;

For Cordova users, check our Migration Guide. There is a breaking change that needs action.

Special note about Meteor v3

We are in Meteor v3.0-alpha.19. To see what is missing for our beta and official release, you can check this GitHub discussion here.

For those who want to see an app running in Meteor v3, we have successfully migrated the SimpleTasks app to be running in the 3.0-alpha.19. You can check it running in galaxy and the migration PR here

Special thanks

We want to extend special thanks to the following contributors for their contributions to this release:

Thank you for your hard work and dedication to the Meteor.js community!
We encourage all users to update to Meteor.js 2.14 to take advantage of these new features and improvements.
For more information about Meteor.js, please visit the Meteor.js website.

Happy coding!

Top comments (0)