@parcel/workers 2.10.3 → 2.12.0
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/Worker.js +9 -6
- 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/src/Worker.js +4 -1
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
|
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
|
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.
|
3
|
+
"version": "2.12.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.
|
25
|
-
"@parcel/logger": "2.
|
26
|
-
"@parcel/profiler": "2.
|
27
|
-
"@parcel/types": "2.
|
28
|
-
"@parcel/utils": "2.
|
24
|
+
"@parcel/diagnostic": "2.12.0",
|
25
|
+
"@parcel/logger": "2.12.0",
|
26
|
+
"@parcel/profiler": "2.12.0",
|
27
|
+
"@parcel/types": "2.12.0",
|
28
|
+
"@parcel/utils": "2.12.0",
|
29
29
|
"nullthrows": "^1.1.1"
|
30
30
|
},
|
31
31
|
"peerDependencies": {
|
32
|
-
"@parcel/core": "^2.
|
32
|
+
"@parcel/core": "^2.12.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": "
|
39
|
+
"gitHead": "2059029ee91e5f03a273b0954d3e629d7375f986"
|
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 =>
|
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++) {
|