@parcel/workers 2.10.3 → 2.11.0

Sign up to get free protection for your applications and to get access to all the features.
package/lib/Worker.js CHANGED
@@ -44,7 +44,7 @@ class Worker extends _events().default {
44
44
  async fork(forkModule) {
45
45
  let filteredArgs = [];
46
46
  if (process.execArgv) {
47
- filteredArgs = process.execArgv.filter(v => !/^--(debug|inspect|no-opt|max-old-space-size=)/.test(v));
47
+ filteredArgs = process.execArgv.filter(v => !/^--(debug|inspect|no-opt|max-old-space-size=|max-semi-space-size=|expose-gc)/.test(v));
48
48
  for (let i = 0; i < filteredArgs.length; i++) {
49
49
  let arg = filteredArgs[i];
50
50
  let isArgWithParam = (arg === '-r' || arg === '--require') && filteredArgs[i + 1] === '@parcel/register' || arg === '--title';
@@ -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.10.3",
3
+ "version": "2.11.0",
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.10.3",
25
- "@parcel/logger": "2.10.3",
26
- "@parcel/profiler": "2.10.3",
27
- "@parcel/types": "2.10.3",
28
- "@parcel/utils": "2.10.3",
24
+ "@parcel/diagnostic": "2.11.0",
25
+ "@parcel/logger": "2.11.0",
26
+ "@parcel/profiler": "2.11.0",
27
+ "@parcel/types": "2.11.0",
28
+ "@parcel/utils": "2.11.0",
29
29
  "nullthrows": "^1.1.1"
30
30
  },
31
31
  "peerDependencies": {
32
- "@parcel/core": "^2.10.3"
32
+ "@parcel/core": "^2.11.0"
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": "65d42a955db665a04817fa9be55df16f588593d4"
39
+ "gitHead": "f8076f1644cabc944695b5ec82602c8ae32bcf21"
40
40
  }
package/src/Worker.js CHANGED
@@ -51,7 +51,10 @@ export default class Worker extends EventEmitter {
51
51
  let filteredArgs = [];
52
52
  if (process.execArgv) {
53
53
  filteredArgs = process.execArgv.filter(
54
- v => !/^--(debug|inspect|no-opt|max-old-space-size=)/.test(v),
54
+ v =>
55
+ !/^--(debug|inspect|no-opt|max-old-space-size=|max-semi-space-size=|expose-gc)/.test(
56
+ v,
57
+ ),
55
58
  );
56
59
 
57
60
  for (let i = 0; i < filteredArgs.length; i++) {