@meteorjs/babel 7.16.0-beta.7 → 7.17.0-beta.2
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 +5 -7
- package/package.json +2 -2
- package/runtime.js +12 -14
package/options.js
CHANGED
|
@@ -185,13 +185,11 @@ function getDefaultsForNode8(features) {
|
|
|
185
185
|
|
|
186
186
|
// Ensure that async functions run in a Fiber, while also taking
|
|
187
187
|
// full advantage of native async/await support in Node 8.
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
}]);
|
|
194
|
-
}
|
|
188
|
+
combined.plugins.push([require("./plugins/async-await.js"), {
|
|
189
|
+
// Do not transform `await x` to `Promise.await(x)`, since Node
|
|
190
|
+
// 8 has native support for await expressions.
|
|
191
|
+
useNativeAsyncAwait: false
|
|
192
|
+
}]);
|
|
195
193
|
|
|
196
194
|
// Enable async generator functions proposal.
|
|
197
195
|
combined.plugins.push(require("@babel/plugin-proposal-async-generator-functions"));
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meteorjs/babel",
|
|
3
3
|
"author": "Meteor <dev@meteor.com>",
|
|
4
|
-
"version": "7.
|
|
4
|
+
"version": "7.17.0-beta.2",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Babel wrapper package for use with Meteor",
|
|
7
7
|
"keywords": [
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@babel/plugin-transform-modules-commonjs": "^7.16.8",
|
|
38
38
|
"@babel/plugin-transform-runtime": "^7.17.0",
|
|
39
39
|
"@babel/preset-react": "^7.16.7",
|
|
40
|
-
"@babel/runtime": "7.17.2",
|
|
40
|
+
"@babel/runtime": "^7.17.2",
|
|
41
41
|
"@babel/template": "^7.16.7",
|
|
42
42
|
"@babel/traverse": "^7.17.0",
|
|
43
43
|
"@babel/types": "^7.17.0",
|
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
|
-
|
|
20
|
-
|
|
14
|
+
require("meteor-promise").makeCompatible(
|
|
15
|
+
global.PromiseFiber = global.PromiseFiber ||
|
|
16
|
+
require("promise/lib/es6-extensions"),
|
|
17
|
+
require("fibers")
|
|
18
|
+
);
|
|
19
|
+
console.log('global.PromiseFiber', global.PromiseFiber);
|
|
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 global.PromiseFiber.asyncApply === "function") {
|
|
24
|
+
var regeneratorRuntime = require("@babel/runtime/regenerator");
|
|
25
|
+
var realAsync = regeneratorRuntime.async;
|
|
26
|
+
regeneratorRuntime.async = function (innerFn) {
|
|
27
|
+
return global.PromiseFiber.asyncApply(realAsync, regeneratorRuntime, arguments);
|
|
28
|
+
};
|
|
31
29
|
}
|