@meteorjs/babel 7.18.0-beta.3 → 7.18.0-beta.4

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 CHANGED
@@ -185,15 +185,16 @@ 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
- const isFiberDisabled = process.env.DISABLE_FIBERS || false;
189
- combined.plugins.push([require("./plugins/async-await.js"), {
190
- // Do not transform `await x` to `Promise.await(x)`, since Node
191
- // 8 has native support for await expressions.
192
- useNativeAsyncAwait: !isFiberDisabled,
193
- isFiberDisabled: isFiberDisabled,
194
- overwriteFiberExit: process.env.OVERWRITE_FIBERS_EXIT === '1',
195
- }]);
196
-
188
+ const isFiberDisabled = process.env.DISABLE_FIBERS === '1';
189
+ const ignoreAsyncPlugin = process.env.IGNORE_ASYNC_PLUGIN === '1';
190
+
191
+ if (!ignoreAsyncPlugin) {
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: isFiberDisabled,
196
+ }]);
197
+ }
197
198
  // Enable async generator functions proposal.
198
199
  combined.plugins.push(require("@babel/plugin-proposal-async-generator-functions"));
199
200
  }
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.18.0-beta.3",
4
+ "version": "7.18.0-beta.4",
5
5
  "license": "MIT",
6
6
  "description": "Babel wrapper package for use with Meteor",
7
7
  "keywords": [
@@ -13,6 +13,10 @@ module.exports = function (babel) {
13
13
  return;
14
14
  }
15
15
 
16
+ // The original function becomes a non-async function that
17
+ // returns a Promise.
18
+ node.async = false;
19
+
16
20
  // The inner function should inherit lexical environment items
17
21
  // like `this`, `super`, and `arguments` from the outer
18
22
  // function, and arrow functions provide exactly that behavior.
@@ -26,17 +30,6 @@ module.exports = function (babel) {
26
30
  !! this.opts.useNativeAsyncAwait
27
31
  );
28
32
 
29
- if (this.opts.isFiberDisabled && this.opts.overwriteFiberExit) {
30
- if (node.type === "ArrowFunctionExpression") {
31
- node.body = innerFn;
32
- }
33
- return;
34
- }
35
-
36
- // The original function becomes a non-async function that
37
- // returns a Promise.
38
- node.async = false;
39
-
40
33
  const promiseResultExpression = t.callExpression(
41
34
  t.memberExpression(
42
35
  t.identifier("Promise"),