Meteor 1.6 will ship with Node 8, which has native support for virtually every standard ECMAScript feature, including async/await (but notably excluding import/export, which we will continue to compile using Reify).
This pull request makes it simpler to get default options with Babel plugins appropriate for Node 8 (and later) by calling
require("meteor-babel").getDefaultOptions({
nodeMajorVersion: 8 // or 9, 10, ...
});
Note that this API is backwards-compatible with older versions of meteor-babel, because they will simply ignore the features.nodeMajorVersion property and continue returning options appropriate for Node 4.
Since these new options contain many fewer Babel plugins, we hope compilation times will be faster for server code (even though there is constant overhead from parsing &c. that hasn't changed), or at least that the generated code is easier to read and debug.
It was tempting to use babel-preset-env to help with this, but the fact that Meteor ships with one version of Node, together with the need for custom plugins, made that somewhat less appealing. I'm still open to it, though, if it really simplifies things.
Meteor 1.6 will ship with Node 8, which has native support for virtually every standard ECMAScript feature, including
async
/await
(but notably excludingimport
/export
, which we will continue to compile using Reify).This pull request makes it simpler to get default options with Babel plugins appropriate for Node 8 (and later) by calling
Note that this API is backwards-compatible with older versions of
meteor-babel
, because they will simply ignore thefeatures.nodeMajorVersion
property and continue returning options appropriate for Node 4.Since these new options contain many fewer Babel plugins, we hope compilation times will be faster for server code (even though there is constant overhead from parsing &c. that hasn't changed), or at least that the generated code is easier to read and debug.
It was tempting to use
babel-preset-env
to help with this, but the fact that Meteor ships with one version of Node, together with the need for custom plugins, made that somewhat less appealing. I'm still open to it, though, if it really simplifies things.