@meteorjs/babel 7.17.0-beta.2 → 7.17.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.
Files changed (3) hide show
  1. package/options.js +12 -6
  2. package/package.json +3 -3
  3. package/runtime.js +14 -12
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(require("@babel/preset-react"));
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,11 +189,13 @@ 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
- 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
- }]);
192
+ if (!process.env.DISABLE_FIBERS) {
193
+ combined.plugins.push([require("./plugins/async-await.js"), {
194
+ // Do not transform `await x` to `Promise.await(x)`, since Node
195
+ // 8 has native support for await expressions.
196
+ useNativeAsyncAwait: false
197
+ }]);
198
+ }
193
199
 
194
200
  // Enable async generator functions proposal.
195
201
  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.17.0-beta.2",
4
+ "version": "7.17.1-beta.0",
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",
@@ -47,7 +47,7 @@
47
47
  "convert-source-map": "^1.6.0",
48
48
  "lodash": "^4.17.21",
49
49
  "meteor-babel-helpers": "0.0.3",
50
- "typescript": "^4.5.4"
50
+ "typescript": "~4.6.4"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@babel/plugin-proposal-decorators": "7.14.5",
package/runtime.js CHANGED
@@ -11,19 +11,21 @@ Module.prototype.resolve = function (id) {
11
11
 
12
12
  require("@meteorjs/reify/lib/runtime").enable(Module.prototype);
13
13
 
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);
14
+ if (!process.env.DISABLE_FIBERS) {
15
+ require("meteor-promise").makeCompatible(
16
+ global.Promise = global.Promise ||
17
+ require("promise/lib/es6-extensions"),
18
+ require("fibers")
19
+ );
20
+
20
21
  // If Promise.asyncApply is defined, use it to wrap calls to
21
22
  // regeneratorRuntime.async so that the entire async function will run in
22
23
  // its own Fiber, not just the code that comes after the first await.
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
- };
24
+ if (typeof Promise.asyncApply === "function") {
25
+ var regeneratorRuntime = require("@babel/runtime/regenerator");
26
+ var realAsync = regeneratorRuntime.async;
27
+ regeneratorRuntime.async = function (innerFn) {
28
+ return Promise.asyncApply(realAsync, regeneratorRuntime, arguments);
29
+ };
30
+ }
29
31
  }