Note: since Babel 7 is out of beta now, not all Babel-related packages
have been bumped to 7.1.0. In particular, the @babel/runtime package is
still at version 7.0.0. This is great news, because it means we're back to
genuine semantic versioning for all Babel packages!
Short-term fix for #10148.
Unfortunately, unlike most Meteor package and application code, which is
compiled after installation, Meteor compiler plugins are compiled before
they are published, so it's possible for a compiler plugin that uses the
ecmascript package to contain generated code that still uses the
module.watch API, instead of the new and improved module.link API.
A better long-term fix for this problem would be to compile compiler
plugins like any other Meteor code, using whatever version of the
ecmascript plugin the rest of the application is using.
Probably the most notable change in this update is that the Reify compiler
now generates
module.link("./child", { ...setters... });
instead of
module.watch(require("./child"), { ...setters... });
for import and export-from declarations.
This package is already importable because it's a dependency of request,
npm, and http-signature, but it's a good idea to depend on it explicitly
just in case those packages stop depending on it in the future.
This version no longer includes the cache directory in the computation of
the cache key, which allows repeated test runs to reuse compilation
results from previous runs.
Instead, the cache directory is provided as part of the third argument to
Babel.compile, which means we can set the cache directory per instance of
BabelCompiler in BabelCompiler#setCacheDir.
This became a problem because coffeescript was calling
the setCacheDir method of its own instance of BabelCompiler, which was
racing with the setCacheDir call for the ecmascript package:
f601ec9693/packages/non-core/coffeescript/compile-coffeescript.js (L27)
I tried removing babel-runtime from the dev bundle in a recent commit
(since @babel/runtime is what Babel 7 uses), but some tests failed.
Unfortunately Meteor packages like stylus that (1) register compiler
plugins and (2) were last published before Meteor 1.6.1 still need the
older version of the babel-runtime npm package. It's an extra 2MB of dev
bundle size (82MB vs. 80MB), so it's not the end of the world, but I would
like to figure out how to remove it permanently at some point.
cc @abernix @hwillson in case you have any quick thoughts