@atlaspack/workers 2.14.1-dev.43 → 2.14.1-dev.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/lib/WorkerFarm.js +2 -5
- package/lib/backend.js +2 -6
- package/lib/bus.js +1 -1
- package/lib/process/ProcessWorker.js +1 -1
- package/lib/threads/ThreadsWorker.js +1 -1
- package/package.json +8 -8
- package/src/WorkerFarm.js +2 -5
- package/src/backend.js +3 -8
- package/src/bus.js +1 -3
- package/src/process/ProcessWorker.js +1 -4
- package/src/threads/ThreadsWorker.js +1 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaspack/workers
|
|
2
2
|
|
|
3
|
+
## 2.14.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#478](https://github.com/atlassian-labs/atlaspack/pull/478) [`570493b`](https://github.com/atlassian-labs/atlaspack/commit/570493beaf754e7985aebc7daaaf6dfcfa8fe56b) Thanks [@yamadapc](https://github.com/yamadapc)! - The first attempt at Version Packages didn't include the built artifacts.
|
|
8
|
+
This has hopefully been fixed, so this change will force those packages to re-release.
|
|
9
|
+
- Updated dependencies [[`ce13d5e`](https://github.com/atlassian-labs/atlaspack/commit/ce13d5e885d55518ee6318e7a72e3a6e4e5126f2), [`e1422ad`](https://github.com/atlassian-labs/atlaspack/commit/e1422ad0a801faaa4bc4f1023bed042ffe236e9b), [`570493b`](https://github.com/atlassian-labs/atlaspack/commit/570493beaf754e7985aebc7daaaf6dfcfa8fe56b)]:
|
|
10
|
+
- @atlaspack/utils@2.14.1
|
|
11
|
+
- @atlaspack/types-internal@2.14.1
|
|
12
|
+
- @atlaspack/diagnostic@2.14.1
|
|
13
|
+
- @atlaspack/logger@2.14.1
|
|
14
|
+
- @atlaspack/profiler@2.14.1
|
|
15
|
+
- @atlaspack/build-cache@2.13.3
|
|
16
|
+
|
|
3
17
|
## 2.14.0
|
|
4
18
|
|
|
5
19
|
### Minor Changes
|
package/lib/WorkerFarm.js
CHANGED
|
@@ -287,11 +287,8 @@ class WorkerFarm extends _events().default {
|
|
|
287
287
|
var _this$handles$get;
|
|
288
288
|
mod = (0, _nullthrows().default)((_this$handles$get = this.handles.get(handleId)) === null || _this$handles$get === void 0 ? void 0 : _this$handles$get.fn);
|
|
289
289
|
} else if (location) {
|
|
290
|
-
//
|
|
291
|
-
if (
|
|
292
|
-
mod = bus;
|
|
293
|
-
// $FlowFixMe
|
|
294
|
-
} else if (process.browser) {
|
|
290
|
+
// $FlowFixMe
|
|
291
|
+
if (process.browser) {
|
|
295
292
|
if (location === '@atlaspack/workers/bus') {
|
|
296
293
|
mod = bus;
|
|
297
294
|
} else {
|
package/lib/backend.js
CHANGED
|
@@ -14,6 +14,7 @@ function detectBackend() {
|
|
|
14
14
|
return process.env.ATLASPACK_WORKER_BACKEND;
|
|
15
15
|
}
|
|
16
16
|
try {
|
|
17
|
+
require('worker_threads');
|
|
17
18
|
return 'threads';
|
|
18
19
|
} catch (err) {
|
|
19
20
|
return 'process';
|
|
@@ -26,12 +27,7 @@ function getWorkerBackend(backend) {
|
|
|
26
27
|
case 'process':
|
|
27
28
|
return require('./process/ProcessWorker').default;
|
|
28
29
|
case 'web':
|
|
29
|
-
|
|
30
|
-
if (!!process.env.ATLASPACK_SUPER_BUILD) {
|
|
31
|
-
throw new Error('Web worker not supported');
|
|
32
|
-
} // return require('./web/WebWorker').default;
|
|
33
|
-
}
|
|
34
|
-
|
|
30
|
+
return require('./web/WebWorker').default;
|
|
35
31
|
default:
|
|
36
32
|
throw new Error(`Invalid backend: ${backend}`);
|
|
37
33
|
}
|
package/lib/bus.js
CHANGED
|
@@ -18,7 +18,7 @@ class Bus extends _events().default {
|
|
|
18
18
|
if (_childState.child) {
|
|
19
19
|
_childState.child.workerApi.callMaster({
|
|
20
20
|
// $FlowFixMe
|
|
21
|
-
location: process.browser ? '@atlaspack/workers/bus' :
|
|
21
|
+
location: process.browser ? '@atlaspack/workers/bus' : __filename,
|
|
22
22
|
method: 'emit',
|
|
23
23
|
args: [event, ...args]
|
|
24
24
|
}, false);
|
|
@@ -26,7 +26,7 @@ function _buildCache() {
|
|
|
26
26
|
return data;
|
|
27
27
|
}
|
|
28
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
|
-
const WORKER_PATH = _path().default.join(
|
|
29
|
+
const WORKER_PATH = _path().default.join(__dirname, './ProcessChild.js');
|
|
30
30
|
class ProcessWorker {
|
|
31
31
|
processQueue = true;
|
|
32
32
|
sendQueue = [];
|
|
@@ -26,7 +26,7 @@ function _buildCache() {
|
|
|
26
26
|
return data;
|
|
27
27
|
}
|
|
28
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
|
-
const WORKER_PATH = _path().default.join(
|
|
29
|
+
const WORKER_PATH = _path().default.join(__dirname, './ThreadsChild.js');
|
|
30
30
|
class ThreadsWorker {
|
|
31
31
|
constructor(execArgv, onMessage, onError, onExit) {
|
|
32
32
|
this.execArgv = execArgv;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaspack/workers",
|
|
3
|
-
"version": "2.14.1-dev.
|
|
3
|
+
"version": "2.14.1-dev.45+821233261",
|
|
4
4
|
"description": "Blazing fast, zero configuration web application bundler",
|
|
5
5
|
"license": "(MIT OR Apache-2.0)",
|
|
6
6
|
"publishConfig": {
|
|
@@ -24,12 +24,12 @@
|
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@atlaspack/build-cache": "2.13.3-dev.
|
|
28
|
-
"@atlaspack/diagnostic": "2.14.1-dev.
|
|
29
|
-
"@atlaspack/logger": "2.14.1-dev.
|
|
30
|
-
"@atlaspack/profiler": "2.14.1-dev.
|
|
31
|
-
"@atlaspack/types-internal": "2.14.1-dev.
|
|
32
|
-
"@atlaspack/utils": "2.14.1-dev.
|
|
27
|
+
"@atlaspack/build-cache": "2.13.3-dev.45+821233261",
|
|
28
|
+
"@atlaspack/diagnostic": "2.14.1-dev.45+821233261",
|
|
29
|
+
"@atlaspack/logger": "2.14.1-dev.45+821233261",
|
|
30
|
+
"@atlaspack/profiler": "2.14.1-dev.45+821233261",
|
|
31
|
+
"@atlaspack/types-internal": "2.14.1-dev.45+821233261",
|
|
32
|
+
"@atlaspack/utils": "2.14.1-dev.45+821233261",
|
|
33
33
|
"nullthrows": "^1.1.1"
|
|
34
34
|
},
|
|
35
35
|
"browser": {
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"./src/threads/ThreadsWorker.js": false
|
|
38
38
|
},
|
|
39
39
|
"type": "commonjs",
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "8212332616265d22454c2e0f0dabe9ab84be927a"
|
|
41
41
|
}
|
package/src/WorkerFarm.js
CHANGED
|
@@ -343,11 +343,8 @@ export default class WorkerFarm extends EventEmitter {
|
|
|
343
343
|
if (handleId != null) {
|
|
344
344
|
mod = nullthrows(this.handles.get(handleId)?.fn);
|
|
345
345
|
} else if (location) {
|
|
346
|
-
//
|
|
347
|
-
if (
|
|
348
|
-
mod = (bus: any);
|
|
349
|
-
// $FlowFixMe
|
|
350
|
-
} else if (process.browser) {
|
|
346
|
+
// $FlowFixMe
|
|
347
|
+
if (process.browser) {
|
|
351
348
|
if (location === '@atlaspack/workers/bus') {
|
|
352
349
|
mod = (bus: any);
|
|
353
350
|
} else {
|
package/src/backend.js
CHANGED
|
@@ -12,7 +12,7 @@ export function detectBackend(): BackendType {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
try {
|
|
15
|
-
|
|
15
|
+
require('worker_threads');
|
|
16
16
|
return 'threads';
|
|
17
17
|
} catch (err) {
|
|
18
18
|
return 'process';
|
|
@@ -25,13 +25,8 @@ export function getWorkerBackend(backend: BackendType): Class<WorkerImpl> {
|
|
|
25
25
|
return require('./threads/ThreadsWorker').default;
|
|
26
26
|
case 'process':
|
|
27
27
|
return require('./process/ProcessWorker').default;
|
|
28
|
-
case 'web':
|
|
29
|
-
|
|
30
|
-
// return require('./web/WebWorker').default;
|
|
31
|
-
} else {
|
|
32
|
-
throw new Error('Web worker not supported');
|
|
33
|
-
}
|
|
34
|
-
}
|
|
28
|
+
case 'web':
|
|
29
|
+
return require('./web/WebWorker').default;
|
|
35
30
|
default:
|
|
36
31
|
throw new Error(`Invalid backend: ${backend}`);
|
|
37
32
|
}
|
package/src/bus.js
CHANGED
|
@@ -8,9 +8,7 @@ class Bus extends EventEmitter {
|
|
|
8
8
|
child.workerApi.callMaster(
|
|
9
9
|
{
|
|
10
10
|
// $FlowFixMe
|
|
11
|
-
location: process.browser
|
|
12
|
-
? '@atlaspack/workers/bus'
|
|
13
|
-
: /*#__ATLASPACK_IGNORE__*/ __filename,
|
|
11
|
+
location: process.browser ? '@atlaspack/workers/bus' : __filename,
|
|
14
12
|
method: 'emit',
|
|
15
13
|
args: [event, ...args],
|
|
16
14
|
},
|
|
@@ -13,10 +13,7 @@ import path from 'path';
|
|
|
13
13
|
|
|
14
14
|
import {serialize, deserialize} from '@atlaspack/build-cache';
|
|
15
15
|
|
|
16
|
-
const WORKER_PATH = path.join(
|
|
17
|
-
/*#__ATLASPACK_IGNORE__*/ __dirname,
|
|
18
|
-
'./ProcessChild.js',
|
|
19
|
-
);
|
|
16
|
+
const WORKER_PATH = path.join(__dirname, './ProcessChild.js');
|
|
20
17
|
|
|
21
18
|
export default class ProcessWorker implements WorkerImpl {
|
|
22
19
|
execArgv: Object;
|
|
@@ -16,10 +16,7 @@ import {
|
|
|
16
16
|
restoreDeserializedObject,
|
|
17
17
|
} from '@atlaspack/build-cache';
|
|
18
18
|
|
|
19
|
-
const WORKER_PATH = path.join(
|
|
20
|
-
/*#__ATLASPACK_IGNORE__*/ __dirname,
|
|
21
|
-
'./ThreadsChild.js',
|
|
22
|
-
);
|
|
19
|
+
const WORKER_PATH = path.join(__dirname, './ThreadsChild.js');
|
|
23
20
|
|
|
24
21
|
export default class ThreadsWorker implements WorkerImpl {
|
|
25
22
|
execArgv: Object;
|