@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 +8 -5
- package/lib/WorkerFarm.js +2 -2
- package/lib/bus.js +1 -2
- package/lib/child.js +2 -2
- package/lib/childState.js +1 -2
- package/lib/index.js +3 -4
- package/package.json +8 -8
package/lib/Worker.js
CHANGED
@@ -77,13 +77,16 @@ class Worker extends _events().default {
|
|
77
77
|
}
|
78
78
|
}
|
79
79
|
}
|
80
|
-
let
|
81
|
-
|
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(
|
78
|
-
function _interopRequireWildcard(
|
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
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(
|
54
|
-
function _interopRequireWildcard(
|
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(
|
43
|
-
function _interopRequireWildcard(
|
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.
|
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.
|
25
|
-
"@parcel/logger": "2.0.0-nightly.
|
26
|
-
"@parcel/profiler": "2.10.4-nightly.
|
27
|
-
"@parcel/types": "2.0.0-nightly.
|
28
|
-
"@parcel/utils": "2.0.0-nightly.
|
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.
|
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": "
|
39
|
+
"gitHead": "ebe4e21db1ef180a3d0bb6d54d07f1524e55006a"
|
40
40
|
}
|