@utoo/web 1.0.1 → 1.0.2
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/esm/internalProject.js
CHANGED
|
@@ -20,9 +20,10 @@ const createOrScalePool = async (binding, loadersImportMap) => {
|
|
|
20
20
|
try {
|
|
21
21
|
let poolOptions = await recvPoolRequest();
|
|
22
22
|
const { filename: entrypoint, maxConcurrency } = poolOptions;
|
|
23
|
+
const concurrency = Math.max(maxConcurrency, navigator.hardwareConcurrency);
|
|
23
24
|
const workers = loaderWorkers[entrypoint] || (loaderWorkers[entrypoint] = []);
|
|
24
|
-
if (workers.length <
|
|
25
|
-
for (let i = workers.length; i <
|
|
25
|
+
if (workers.length < concurrency) {
|
|
26
|
+
for (let i = workers.length; i < concurrency; i++) {
|
|
26
27
|
nextWorkerId += 1;
|
|
27
28
|
const turbopackLoaderAssets = await getTurbopackLoaderAssets();
|
|
28
29
|
const blob = new Blob([webpackLoadersCode], {
|
|
@@ -51,8 +52,8 @@ const createOrScalePool = async (binding, loadersImportMap) => {
|
|
|
51
52
|
workers.push(worker);
|
|
52
53
|
}
|
|
53
54
|
}
|
|
54
|
-
else if (workers.length >
|
|
55
|
-
const workersToStop = workers.splice(0, workers.length -
|
|
55
|
+
else if (workers.length > concurrency) {
|
|
56
|
+
const workersToStop = workers.splice(0, workers.length - concurrency);
|
|
56
57
|
workersToStop.forEach((worker) => worker.terminate());
|
|
57
58
|
}
|
|
58
59
|
}
|
package/esm/utoo/index.js
CHANGED
|
@@ -315,15 +315,12 @@ function passArray8ToWasm0(arg, malloc) {
|
|
|
315
315
|
export function wasm_thread_entry_point(ptr) {
|
|
316
316
|
wasm.wasm_thread_entry_point(ptr);
|
|
317
317
|
}
|
|
318
|
-
function
|
|
318
|
+
function __wbg_adapter_10(arg0, arg1, arg2) {
|
|
319
319
|
wasm.__wbindgen_export_6(arg0, arg1, addHeapObject(arg2));
|
|
320
320
|
}
|
|
321
|
-
function
|
|
321
|
+
function __wbg_adapter_13(arg0, arg1, arg2) {
|
|
322
322
|
wasm.__wbindgen_export_7(arg0, arg1, addHeapObject(arg2));
|
|
323
323
|
}
|
|
324
|
-
function __wbg_adapter_12(arg0, arg1) {
|
|
325
|
-
wasm.__wbindgen_export_8(arg0, arg1);
|
|
326
|
-
}
|
|
327
324
|
let stack_pointer = 128;
|
|
328
325
|
function addBorrowedObject(obj) {
|
|
329
326
|
if (stack_pointer == 1)
|
|
@@ -331,14 +328,17 @@ function addBorrowedObject(obj) {
|
|
|
331
328
|
heap[--stack_pointer] = obj;
|
|
332
329
|
return stack_pointer;
|
|
333
330
|
}
|
|
334
|
-
function
|
|
331
|
+
function __wbg_adapter_22(arg0, arg1, arg2) {
|
|
335
332
|
try {
|
|
336
|
-
wasm.
|
|
333
|
+
wasm.__wbindgen_export_8(arg0, arg1, addBorrowedObject(arg2));
|
|
337
334
|
}
|
|
338
335
|
finally {
|
|
339
336
|
heap[stack_pointer++] = undefined;
|
|
340
337
|
}
|
|
341
338
|
}
|
|
339
|
+
function __wbg_adapter_25(arg0, arg1) {
|
|
340
|
+
wasm.__wbindgen_export_9(arg0, arg1);
|
|
341
|
+
}
|
|
342
342
|
function __wbg_adapter_94(arg0, arg1, arg2, arg3) {
|
|
343
343
|
wasm.__wbindgen_export_10(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
344
344
|
}
|
|
@@ -1627,12 +1627,12 @@ function __wbg_get_imports() {
|
|
|
1627
1627
|
};
|
|
1628
1628
|
imports.wbg.__wbindgen_cast_2aafe3a70f74f3e0 = function (arg0, arg1) {
|
|
1629
1629
|
// Cast intrinsic for `Closure(Closure { dtor_idx: 8681, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 8682, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1630
|
-
const ret = makeMutClosure(arg0, arg1, 8681,
|
|
1630
|
+
const ret = makeMutClosure(arg0, arg1, 8681, __wbg_adapter_13);
|
|
1631
1631
|
return addHeapObject(ret);
|
|
1632
1632
|
};
|
|
1633
1633
|
imports.wbg.__wbindgen_cast_3bfef9a8628dc119 = function (arg0, arg1) {
|
|
1634
1634
|
// Cast intrinsic for `Closure(Closure { dtor_idx: 8688, function: Function { arguments: [], shim_idx: 600, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1635
|
-
const ret = makeMutClosure(arg0, arg1, 8688,
|
|
1635
|
+
const ret = makeMutClosure(arg0, arg1, 8688, __wbg_adapter_25);
|
|
1636
1636
|
return addHeapObject(ret);
|
|
1637
1637
|
};
|
|
1638
1638
|
imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function (arg0) {
|
|
@@ -1642,12 +1642,12 @@ function __wbg_get_imports() {
|
|
|
1642
1642
|
};
|
|
1643
1643
|
imports.wbg.__wbindgen_cast_4c807b347a3d0cbf = function (arg0, arg1) {
|
|
1644
1644
|
// Cast intrinsic for `Closure(Closure { dtor_idx: 599, function: Function { arguments: [], shim_idx: 600, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1645
|
-
const ret = makeMutClosure(arg0, arg1, 599,
|
|
1645
|
+
const ret = makeMutClosure(arg0, arg1, 599, __wbg_adapter_25);
|
|
1646
1646
|
return addHeapObject(ret);
|
|
1647
1647
|
};
|
|
1648
1648
|
imports.wbg.__wbindgen_cast_5cc12922bca91779 = function (arg0, arg1) {
|
|
1649
1649
|
// Cast intrinsic for `Closure(Closure { dtor_idx: 8681, function: Function { arguments: [Externref], shim_idx: 8682, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1650
|
-
const ret = makeMutClosure(arg0, arg1, 8681,
|
|
1650
|
+
const ret = makeMutClosure(arg0, arg1, 8681, __wbg_adapter_13);
|
|
1651
1651
|
return addHeapObject(ret);
|
|
1652
1652
|
};
|
|
1653
1653
|
imports.wbg.__wbindgen_cast_76322aab70622876 = function (arg0, arg1) {
|
|
@@ -1671,12 +1671,12 @@ function __wbg_get_imports() {
|
|
|
1671
1671
|
};
|
|
1672
1672
|
imports.wbg.__wbindgen_cast_9b1d89ef740b288c = function (arg0, arg1) {
|
|
1673
1673
|
// Cast intrinsic for `Closure(Closure { dtor_idx: 8662, function: Function { arguments: [Ref(NamedExternref("MessageEvent"))], shim_idx: 8686, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1674
|
-
const ret = makeMutClosure(arg0, arg1, 8662,
|
|
1674
|
+
const ret = makeMutClosure(arg0, arg1, 8662, __wbg_adapter_22);
|
|
1675
1675
|
return addHeapObject(ret);
|
|
1676
1676
|
};
|
|
1677
1677
|
imports.wbg.__wbindgen_cast_9c5a3d861803a5de = function (arg0, arg1) {
|
|
1678
1678
|
// Cast intrinsic for `Closure(Closure { dtor_idx: 8662, function: Function { arguments: [NamedExternref("Array<any>")], shim_idx: 8663, ret: Unit, inner_ret: Some(Unit) }, mutable: false }) -> Externref`.
|
|
1679
|
-
const ret = makeClosure(arg0, arg1, 8662,
|
|
1679
|
+
const ret = makeClosure(arg0, arg1, 8662, __wbg_adapter_10);
|
|
1680
1680
|
return addHeapObject(ret);
|
|
1681
1681
|
};
|
|
1682
1682
|
imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function (arg0) {
|
package/esm/utoo/index_bg.wasm
CHANGED
|
Binary file
|