New Meteor.js 2.13, Node.js 14.21.4 security patch and Blaze 2.7.1 release

Gabriel Grubba
Meteor Blog
Published in
3 min readAug 1, 2023

--

Meteor has released a new version, 2.13, with some updates and improvements. Here are some of the key features of this release:

Introducing Node.js v14.21.4 with security update, new Blaze.js release and quality of life updates and much more!
Introducing Node.js v14.21.4 with security updates,
new Blaze.js release and quality of life updates, and much more!

Node.js 14.21.4

As you have seen in this post in the forums by our CEO Fred Maia and in the previous release blog post, we are making security updates for Node.js. The PR which added the security updates is here. Here is a link to a Dockerfile where you can use the Node with the security updates.

If you have any concerns or doubts about this matter, please ping us with your question.

Blaze 2.7.1

In this minor update, we received a long-wanted feature, the possibility of handling async values in templates. You can check the docs for it here. This feature was possible due to the hard work of @radekmie in #412 and #413.

Here are some snippets on how to use async in Blaze now:

Simple values

<template name="foo">
{{#let name=getName}}
{{#if @pending 'name'}}
We are fetching your name...
{{/if}}
{{#if @rejected 'name'}}
Sorry, an error occured!
{{/if}}
{{#if @resolved 'name'}}
Hi, {{name}}!
{{/if}}
{{/let}}
</template>

<script>
Template.foo.helpers({
getName: async () => {
const sleep = ms => new Promise(r => setTimeout(r, ms));
await sleep(1000);
return 'john'
},
});
</script>

This will render while getting the name for 1000ms, We are fetching your name..., then it will render the string john

Async lists

In Meteor.js v2.8, it was addedMeteor.callAsync, meaning that doing a Meteor.callAsync("someMethod") will result in a promise of the result of that call. In many cases, you want to return a list. For such cases, we have this snippet where you can iterate over an async list:

<template name="links">
{{#let links=getLinksFromDB}}
{{#if @pending}}
We are fetching your list...
{{/if}}
{{#if @rejected}}
Sorry, an error occured!
{{/if}}
{{#if @resolved }}
{{#each link in links}}
{{link}}
{{/each}}
{{/if}}
{{/let}}
</template>

<script>
/// in server
Meteor.methods({
getLinks() {
return ['foo','bar','baz'];
},
});
/// in client
Template.links.helpers({
getLinksFromDB: async () => {
const links = await Meteor.callAsync('getLinks');
const sleep = ms => new Promise(r => setTimeout(r, ms));
await sleep(1000);
return links;
},
});
</script>

If you want to test this new feature, be sure to be at least in v2.7.0 in blazejs version.

Quality of life updates:

While this Meteor.js release has not introduced any new feature, here is a list of changes that certainly will make our life easier by solving a bug or just making a skeleton more idiomatic.

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.13 to take advantage of these new features and improvements.
For more information about Meteor.js, please visit the Meteor.js website.

Happy coding!

--

--