<a href="https://www.olark.com/site/4735-692-10-7155/contact" title="Contact us" target="_blank">Questions? Feedback? powered by <a href="http://www.olark.com?welcome" title="Olark live chat software">Olark live chat software

Introducing the Blaze live templating engine and Meteor 0.8.0

March 27, 2014 By Matt DeBergalis
Vote on Hacker News

Today we are delighted to release Blaze, our next-generation live templating engine. Many production Meteor apps are already running on it, and with 0.8.0, we're now ready to complete the transition. So that we can focus our energy on Blaze, we encourage everyone to take the 0.8.0 update as soon as you can with meteor update. If you're new to Meteor, visit www.meteor.com to get started.

Blaze turns HTML templates into live updating DOM elements. When a user changes data or new data arrives over the network that a template depends on, Blaze updates your screen automatically. Previous releases of Meteor used an earlier engine we wrote called Spark; Blaze uses a different architecture from Spark that improves on it in several ways.

Here are the highlights. You can learn much more on the Blaze wiki.

  • Easy to use. Like everything else in Meteor, we designed Blaze to be developer-friendly. You just write normal looking HTML templates and helpers. You don't have to declare any dependencies or write code to manage how the screen updates: it's all automatic.

  • High performance. When your data changes, Blaze makes the smallest possible update to just the piece of the DOM that needs to change or move and batches those updates to minimize page reflows. Since most apps only update a few pieces of data at a time, this approach is more efficient than our older diffing solution.

  • Works well with others. We figured out how to make a reactive template engine be compatible with jQuery plugins and other code that also manipulates the DOM -- even the same elements defined by your templates. For example, you might use Blaze to render a changing list of items, and then a traditional library to reorder the list or manage an extra CSS class on each item.

  • Designed for today's web. Blaze is equally at home rendering SVG as it is with HTML. You can write reactive SVG right alongside your HTML, even in the same template. Or use a tool like Inkscape or Illustrator to generate SVG, and then make it dynamic by defining a handful of template helpers.

Blaze comes in two parts. A build-time compiler transforms your templates into JavaScript code: an intermediate representation of those templates. We ship a Handlebars-style compiler with Meteor core; if you prefer Jade, use the jade package on Atmosphere. The other half of Blaze is a runtime API that renders elements, keeps track of their dependencies, and updates them through their complete lifecycle as those dependencies change. The two halves work separately, so if you like, you can skip templates and write code that directly targets the runtime API.

If you've already written a Meteor app, you'll be happy to know the transition to Blaze is simple and straightforward. Blaze is the only new feature in 0.8.0, so when you're upgrading from 0.7.2 you won't have to worry about any server-side changes. Most templates and client code will also work on 0.8.0 unchanged. If you've been using some of the lower-level Spark features, though, you'll want to read through our detailed list of differences in the Blaze wiki.

Just one more big item to go before 1.0 now!

The Meteor blog

Long-range performance metrics in Galaxy
Angular Meteor 1.2.0 Released
Scaling CodeFights with Galaxy
Meteor 1.2.1 Released
A Recap of AngularConnect 2015 in London
Get started with ES2015 (ES6) and Meteor