@parcel/workers 2.0.0-nightly.1452 → 2.0.0-nightly.1468

Sign up to get free protection for your applications and to get access to all the features.
package/lib/Worker.js CHANGED
@@ -77,13 +77,16 @@ class Worker extends _events().default {
77
77
  }
78
78
  }
79
79
  }
80
- let WorkerBackend = (0, _backend.getWorkerBackend)(this.options.backend);
81
- this.worker = new WorkerBackend(filteredArgs, data => this.receive(data), err => {
82
- this.emit('error', err);
83
- }, code => {
80
+ let onMessage = data => this.receive(data);
81
+ let onExit = code => {
84
82
  this.exitCode = code;
85
83
  this.emit('exit', code);
86
- });
84
+ };
85
+ let onError = err => {
86
+ this.emit('error', err);
87
+ };
88
+ let WorkerBackend = (0, _backend.getWorkerBackend)(this.options.backend);
89
+ this.worker = new WorkerBackend(filteredArgs, onMessage, onError, onExit);
87
90
  await this.worker.start();
88
91
  await new Promise((resolve, reject) => {
89
92
  this.call({
package/lib/WorkerFarm.js CHANGED
@@ -74,8 +74,8 @@ function _logger() {
74
74
  return data;
75
75
  }
76
76
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
77
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
78
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
77
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
78
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
79
79
  let referenceId = 1;
80
80
  const DEFAULT_MAX_CONCURRENT_CALLS = 30;
81
81
 
package/lib/bus.js CHANGED
@@ -28,5 +28,4 @@ class Bus extends _events().default {
28
28
  }
29
29
  }
30
30
  }
31
- var _default = new Bus();
32
- exports.default = _default;
31
+ var _default = exports.default = new Bus();
package/lib/child.js CHANGED
@@ -50,8 +50,8 @@ function _profiler() {
50
50
  }
51
51
  var _Handle2 = _interopRequireDefault(require("./Handle"));
52
52
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
53
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
54
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
53
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
54
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
55
55
  // The import of './Handle' should really be imported eagerly (with @babel/plugin-transform-modules-commonjs's lazy mode).
56
56
  const Handle = _Handle2.default;
57
57
  class Child {
package/lib/childState.js CHANGED
@@ -8,8 +8,7 @@ exports.setChild = setChild;
8
8
  // This file is imported by both the WorkerFarm and child implementation.
9
9
  // When a worker is inited, it sets the state in this file.
10
10
  // This way, WorkerFarm can access the state without directly importing the child code.
11
- let child = null;
12
- exports.child = child;
11
+ let child = exports.child = null;
13
12
  function setChild(c) {
14
13
  exports.child = child = c;
15
14
  }
package/lib/index.js CHANGED
@@ -39,8 +39,8 @@ function _profiler() {
39
39
  };
40
40
  return data;
41
41
  }
42
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
43
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
42
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
43
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
44
44
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
45
45
  if (!_WorkerFarm.default.isWorker()) {
46
46
  // Forward all logger events originating from workers into the main process
@@ -72,5 +72,4 @@ if (!_WorkerFarm.default.isWorker()) {
72
72
  _profiler().tracer.trace(e);
73
73
  });
74
74
  }
75
- var _default = _WorkerFarm.default;
76
- exports.default = _default;
75
+ var _default = exports.default = _WorkerFarm.default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parcel/workers",
3
- "version": "2.0.0-nightly.1452+3b798e045",
3
+ "version": "2.0.0-nightly.1468+ebe4e21db",
4
4
  "description": "Blazing fast, zero configuration web application bundler",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -21,20 +21,20 @@
21
21
  "node": ">= 12.0.0"
22
22
  },
23
23
  "dependencies": {
24
- "@parcel/diagnostic": "2.0.0-nightly.1452+3b798e045",
25
- "@parcel/logger": "2.0.0-nightly.1452+3b798e045",
26
- "@parcel/profiler": "2.10.4-nightly.3075+3b798e045",
27
- "@parcel/types": "2.0.0-nightly.1452+3b798e045",
28
- "@parcel/utils": "2.0.0-nightly.1452+3b798e045",
24
+ "@parcel/diagnostic": "2.0.0-nightly.1468+ebe4e21db",
25
+ "@parcel/logger": "2.0.0-nightly.1468+ebe4e21db",
26
+ "@parcel/profiler": "2.10.4-nightly.3091+ebe4e21db",
27
+ "@parcel/types": "2.0.0-nightly.1468+ebe4e21db",
28
+ "@parcel/utils": "2.0.0-nightly.1468+ebe4e21db",
29
29
  "nullthrows": "^1.1.1"
30
30
  },
31
31
  "peerDependencies": {
32
- "@parcel/core": "2.0.0-nightly.1450+3b798e045"
32
+ "@parcel/core": "2.0.0-nightly.1466+ebe4e21db"
33
33
  },
34
34
  "browser": {
35
35
  "./src/process/ProcessWorker.js": false,
36
36
  "./src/threads/ThreadsWorker.js": false,
37
37
  "./src/core-worker.js": "./src/core-worker.browser.js"
38
38
  },
39
- "gitHead": "3b798e0456bbef951c684d43f96fda1fea386f62"
39
+ "gitHead": "ebe4e21db1ef180a3d0bb6d54d07f1524e55006a"
40
40
  }