@meteorjs/babel 7.16.0-beta.6 → 7.16.1-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/options.js +10 -8
- package/package.json +1 -1
- package/runtime.js +11 -13
package/options.js
CHANGED
|
@@ -80,7 +80,11 @@ exports.getDefaults = function getDefaults(features) {
|
|
|
80
80
|
|
|
81
81
|
function maybeAddReactPlugins(features, options) {
|
|
82
82
|
if (features && features.react) {
|
|
83
|
-
options.presets.push(
|
|
83
|
+
options.presets.push(
|
|
84
|
+
[require("@babel/preset-react"), {
|
|
85
|
+
runtime: "automatic"
|
|
86
|
+
}]
|
|
87
|
+
);
|
|
84
88
|
options.plugins.push(
|
|
85
89
|
[require("@babel/plugin-proposal-class-properties"), {
|
|
86
90
|
loose: true
|
|
@@ -185,13 +189,11 @@ function getDefaultsForNode8(features) {
|
|
|
185
189
|
|
|
186
190
|
// Ensure that async functions run in a Fiber, while also taking
|
|
187
191
|
// full advantage of native async/await support in Node 8.
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
}]);
|
|
194
|
-
}
|
|
192
|
+
combined.plugins.push([require("./plugins/async-await.js"), {
|
|
193
|
+
// Do not transform `await x` to `Promise.await(x)`, since Node
|
|
194
|
+
// 8 has native support for await expressions.
|
|
195
|
+
useNativeAsyncAwait: false
|
|
196
|
+
}]);
|
|
195
197
|
|
|
196
198
|
// Enable async generator functions proposal.
|
|
197
199
|
combined.plugins.push(require("@babel/plugin-proposal-async-generator-functions"));
|
package/package.json
CHANGED
package/runtime.js
CHANGED
|
@@ -11,21 +11,19 @@ Module.prototype.resolve = function (id) {
|
|
|
11
11
|
|
|
12
12
|
require("@meteorjs/reify/lib/runtime").enable(Module.prototype);
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
);
|
|
14
|
+
require("meteor-promise").makeCompatible(
|
|
15
|
+
global.Promise = global.Promise ||
|
|
16
|
+
require("promise/lib/es6-extensions"),
|
|
17
|
+
require("fibers")
|
|
18
|
+
);
|
|
20
19
|
|
|
21
20
|
// If Promise.asyncApply is defined, use it to wrap calls to
|
|
22
21
|
// regeneratorRuntime.async so that the entire async function will run in
|
|
23
22
|
// its own Fiber, not just the code that comes after the first await.
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
23
|
+
if (typeof Promise.asyncApply === "function") {
|
|
24
|
+
var regeneratorRuntime = require("@babel/runtime/regenerator");
|
|
25
|
+
var realAsync = regeneratorRuntime.async;
|
|
26
|
+
regeneratorRuntime.async = function (innerFn) {
|
|
27
|
+
return Promise.asyncApply(realAsync, regeneratorRuntime, arguments);
|
|
28
|
+
};
|
|
31
29
|
}
|