@parcel/workers 2.12.0 → 2.13.1
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/Handle.js +2 -3
- package/lib/Worker.js +1 -1
- package/lib/WorkerFarm.js +2 -2
- package/lib/bus.js +1 -1
- package/lib/child.js +3 -4
- package/lib/cpuCount.js +1 -1
- package/lib/index.js +2 -2
- package/lib/process/ProcessChild.js +1 -1
- package/lib/process/ProcessWorker.js +1 -1
- package/lib/threads/ThreadsChild.js +1 -1
- package/lib/threads/ThreadsWorker.js +1 -1
- package/package.json +9 -9
- package/src/Worker.js +1 -1
- package/src/WorkerFarm.js +1 -1
- package/src/child.js +1 -1
- package/src/index.js +1 -1
- package/src/types.js +1 -1
package/lib/Handle.js
CHANGED
@@ -12,7 +12,7 @@ function _core() {
|
|
12
12
|
return data;
|
13
13
|
}
|
14
14
|
var _package = _interopRequireDefault(require("../package.json"));
|
15
|
-
function _interopRequireDefault(
|
15
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
16
16
|
// $FlowFixMe
|
17
17
|
let HANDLE_ID = 0;
|
18
18
|
// $FlowFixMe
|
@@ -20,8 +20,7 @@ let HANDLE_ID = 0;
|
|
20
20
|
const handleById = new Map();
|
21
21
|
class Handle {
|
22
22
|
constructor(opts) {
|
23
|
-
|
24
|
-
this.id = (_opts$id = opts.id) !== null && _opts$id !== void 0 ? _opts$id : ++HANDLE_ID;
|
23
|
+
this.id = opts.id ?? ++HANDLE_ID;
|
25
24
|
this.fn = opts.fn;
|
26
25
|
this.childId = opts.childId;
|
27
26
|
handleById.set(this.id, this);
|
package/lib/Worker.js
CHANGED
@@ -26,7 +26,7 @@ function _diagnostic() {
|
|
26
26
|
return data;
|
27
27
|
}
|
28
28
|
var _backend = require("./backend");
|
29
|
-
function _interopRequireDefault(
|
29
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
30
30
|
let WORKER_ID = 0;
|
31
31
|
class Worker extends _events().default {
|
32
32
|
id = WORKER_ID++;
|
package/lib/WorkerFarm.js
CHANGED
@@ -73,9 +73,9 @@ function _logger() {
|
|
73
73
|
};
|
74
74
|
return data;
|
75
75
|
}
|
76
|
-
function _interopRequireDefault(
|
76
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
77
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 &&
|
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 && {}.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
@@ -12,7 +12,7 @@ function _events() {
|
|
12
12
|
return data;
|
13
13
|
}
|
14
14
|
var _childState = require("./childState");
|
15
|
-
function _interopRequireDefault(
|
15
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
16
16
|
class Bus extends _events().default {
|
17
17
|
emit(event, ...args) {
|
18
18
|
if (_childState.child) {
|
package/lib/child.js
CHANGED
@@ -49,9 +49,9 @@ function _profiler() {
|
|
49
49
|
return data;
|
50
50
|
}
|
51
51
|
var _Handle2 = _interopRequireDefault(require("./Handle"));
|
52
|
-
function _interopRequireDefault(
|
52
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
53
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 &&
|
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 && {}.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 {
|
@@ -232,7 +232,6 @@ class Child {
|
|
232
232
|
|
233
233
|
// Keep in mind to make sure responses to these calls are JSON.Stringify safe
|
234
234
|
addCall(request, awaitResponse = true) {
|
235
|
-
var _promise;
|
236
235
|
// $FlowFixMe
|
237
236
|
let call = {
|
238
237
|
...request,
|
@@ -252,7 +251,7 @@ class Child {
|
|
252
251
|
}
|
253
252
|
this.callQueue.push(call);
|
254
253
|
this.processQueue();
|
255
|
-
return
|
254
|
+
return promise ?? Promise.resolve();
|
256
255
|
}
|
257
256
|
sendRequest(call) {
|
258
257
|
let idx;
|
package/lib/cpuCount.js
CHANGED
@@ -19,7 +19,7 @@ function _child_process() {
|
|
19
19
|
};
|
20
20
|
return data;
|
21
21
|
}
|
22
|
-
function _interopRequireDefault(
|
22
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
23
23
|
const exec = command => {
|
24
24
|
try {
|
25
25
|
let stdout = (0, _child_process().execSync)(command, {
|
package/lib/index.js
CHANGED
@@ -40,8 +40,8 @@ function _profiler() {
|
|
40
40
|
return data;
|
41
41
|
}
|
42
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 &&
|
44
|
-
function _interopRequireDefault(
|
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 && {}.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
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
45
45
|
if (!_WorkerFarm.default.isWorker()) {
|
46
46
|
// Forward all logger events originating from workers into the main process
|
47
47
|
_bus.default.on('logEvent', e => {
|
@@ -20,7 +20,7 @@ function _core() {
|
|
20
20
|
};
|
21
21
|
return data;
|
22
22
|
}
|
23
|
-
function _interopRequireDefault(
|
23
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
24
24
|
class ProcessChild {
|
25
25
|
constructor(onMessage, onExit) {
|
26
26
|
if (!process.send) {
|
@@ -25,7 +25,7 @@ function _core() {
|
|
25
25
|
};
|
26
26
|
return data;
|
27
27
|
}
|
28
|
-
function _interopRequireDefault(
|
28
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
29
29
|
const WORKER_PATH = _path().default.join(__dirname, 'ProcessChild.js');
|
30
30
|
class ProcessWorker {
|
31
31
|
processQueue = true;
|
@@ -27,7 +27,7 @@ function _core() {
|
|
27
27
|
};
|
28
28
|
return data;
|
29
29
|
}
|
30
|
-
function _interopRequireDefault(
|
30
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
31
31
|
class ThreadsChild {
|
32
32
|
constructor(onMessage, onExit) {
|
33
33
|
if (_worker_threads().isMainThread || !_worker_threads().parentPort) {
|
@@ -25,7 +25,7 @@ function _core() {
|
|
25
25
|
};
|
26
26
|
return data;
|
27
27
|
}
|
28
|
-
function _interopRequireDefault(
|
28
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
29
29
|
const WORKER_PATH = _path().default.join(__dirname, 'ThreadsChild.js');
|
30
30
|
class ThreadsWorker {
|
31
31
|
constructor(execArgv, onMessage, onError, onExit) {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@parcel/workers",
|
3
|
-
"version": "2.
|
3
|
+
"version": "2.13.1",
|
4
4
|
"description": "Blazing fast, zero configuration web application bundler",
|
5
5
|
"license": "MIT",
|
6
6
|
"publishConfig": {
|
@@ -18,23 +18,23 @@
|
|
18
18
|
"source": "src/index.js",
|
19
19
|
"types": "index.d.ts",
|
20
20
|
"engines": {
|
21
|
-
"node": ">=
|
21
|
+
"node": ">= 16.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.13.1",
|
25
|
+
"@parcel/logger": "2.13.1",
|
26
|
+
"@parcel/profiler": "2.13.1",
|
27
|
+
"@parcel/types-internal": "2.13.1",
|
28
|
+
"@parcel/utils": "2.13.1",
|
29
29
|
"nullthrows": "^1.1.1"
|
30
30
|
},
|
31
31
|
"peerDependencies": {
|
32
|
-
"@parcel/core": "^2.
|
32
|
+
"@parcel/core": "^2.13.1"
|
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": "4a297f79db3eec74437f4c5133127c98bf303703"
|
40
40
|
}
|
package/src/Worker.js
CHANGED
package/src/WorkerFarm.js
CHANGED
package/src/child.js
CHANGED
@@ -9,7 +9,7 @@ import type {
|
|
9
9
|
WorkerResponse,
|
10
10
|
ChildImpl,
|
11
11
|
} from './types';
|
12
|
-
import type {Async, IDisposable} from '@parcel/types';
|
12
|
+
import type {Async, IDisposable} from '@parcel/types-internal';
|
13
13
|
import type {SharedReference} from './WorkerFarm';
|
14
14
|
|
15
15
|
import * as coreWorker from './core-worker';
|
package/src/index.js
CHANGED