New Meteor.js 2.14, updates to CLI and Tracker changes
Tags: javascript, meteor, mongodb, node
Published: 2023-12-13 12:36:54


![2.14 banner](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/py587l5os2nl694mli7b.png)

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:


{% youtube https://youtu.be/Chs5zZra5Kc %}

> 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:

```js

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);
  });
});

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

```js
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);
  });
});

```

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](https://docs.meteor.com/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](https://guide.meteor.com/2.14-migration.html). 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](https://github.com/meteor/meteor/discussions/12865).

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](https://simpletasks.meteorapp.com/) in galaxy and the migration PR [here](https://github.com/fredmaiaarantes/simpletasks/pull/10/files)

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

- [@StorytellerCZ](https://github.com/sponsors/StorytellerCZ)
- [@Grubba27](https://github.com/sponsors/Grubba27)
- [@vit0rr](https://github.com/vit0rr)
- [@realyze](https://github.com/realyze)
- [@jamauro](https://github.com/jamauro)
- [@Torgen](https://github.com/Torgen)
- [@brucejo75](https://github.com/brucejo75)
- [@zodern](https://github.com/sponsors/zodern)
- [@alisnic](https://github.com/alisnic)
- [@ebroder](https://github.com/ebroder)
- [@BANSAL-NISHU](https://github.com/BANSAL-NISHU)
- [@salmanhasni](https://github.com/salmanhasni)
- [@jdgjsag67251](https://github.com/jdgjsag67251)
- [@guncebektas](https://github.com/guncebektas)
- [@harryadel](https://github.com/harryadel)
- [@dd137](https://github.com/dd137)
- [@matheusccastroo](https://github.com/matheusccastroo)
- [@mr-loop-1](https://github.com/mr-loop-1)

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!**