@rspack-debug/browser 2.0.0-rc.3 → 2.0.1
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.
|
@@ -31,7 +31,7 @@ export declare class BrowserRequirePlugin {
|
|
|
31
31
|
* This is an unsafe way to execute code in the browser using `new Function`.
|
|
32
32
|
* It is your responsibility to ensure that your application is not vulnerable to attacks due to this function.
|
|
33
33
|
*/
|
|
34
|
-
static unsafeExecute: (code: string, runtime: CommonJsRuntime) => void;
|
|
34
|
+
static unsafeExecute: ((code: string, runtime: CommonJsRuntime) => void) | undefined;
|
|
35
35
|
constructor(options: BrowserRequirePluginOptions);
|
|
36
36
|
apply(compiler: Compiler): void;
|
|
37
37
|
}
|
package/dist/index.js
CHANGED
|
@@ -14616,9 +14616,9 @@ __webpack_require__.add({
|
|
|
14616
14616
|
}
|
|
14617
14617
|
utils.intFromLE = intFromLE;
|
|
14618
14618
|
},
|
|
14619
|
-
"../../node_modules/.pnpm/enhanced-resolve@5.
|
|
14619
|
+
"../../node_modules/.pnpm/enhanced-resolve@5.21.0/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
14620
14620
|
var Buffer = __webpack_require__("./src/browser/buffer.ts")["Buffer"];
|
|
14621
|
-
const { nextTick } = __webpack_require__("../../node_modules/.pnpm/enhanced-resolve@5.
|
|
14621
|
+
const { nextTick } = __webpack_require__("../../node_modules/.pnpm/enhanced-resolve@5.21.0/node_modules/enhanced-resolve/lib/util/process-browser.js");
|
|
14622
14622
|
const dirname = (path)=>{
|
|
14623
14623
|
let idx = path.length - 1;
|
|
14624
14624
|
while(idx >= 0){
|
|
@@ -14685,7 +14685,7 @@ __webpack_require__.add({
|
|
|
14685
14685
|
this._data = new Map();
|
|
14686
14686
|
this._levels = [];
|
|
14687
14687
|
for(let i = 0; i < 10; i++)this._levels.push(new Set());
|
|
14688
|
-
for(let i = 5000; i < duration; i += 500)this._levels.push(new Set());
|
|
14688
|
+
if (duration !== 1 / 0) for(let i = 5000; i < duration; i += 500)this._levels.push(new Set());
|
|
14689
14689
|
this._currentLevel = 0;
|
|
14690
14690
|
this._tickInterval = Math.floor(duration / this._levels.length);
|
|
14691
14691
|
this._mode = STORAGE_MODE_IDLE;
|
|
@@ -14823,6 +14823,7 @@ __webpack_require__.add({
|
|
|
14823
14823
|
break;
|
|
14824
14824
|
}
|
|
14825
14825
|
this._mode = STORAGE_MODE_ASYNC;
|
|
14826
|
+
if (this._duration === 1 / 0) return;
|
|
14826
14827
|
const ref = setTimeout(()=>{
|
|
14827
14828
|
this._mode = STORAGE_MODE_SYNC;
|
|
14828
14829
|
this._runDecays();
|
|
@@ -14912,7 +14913,7 @@ __webpack_require__.add({
|
|
|
14912
14913
|
}
|
|
14913
14914
|
};
|
|
14914
14915
|
},
|
|
14915
|
-
"../../node_modules/.pnpm/enhanced-resolve@5.
|
|
14916
|
+
"../../node_modules/.pnpm/enhanced-resolve@5.21.0/node_modules/enhanced-resolve/lib/util/process-browser.js" (module) {
|
|
14916
14917
|
module.exports = {
|
|
14917
14918
|
versions: {},
|
|
14918
14919
|
nextTick (fn) {
|
|
@@ -19501,51 +19502,10 @@ __webpack_require__.add({
|
|
|
19501
19502
|
};
|
|
19502
19503
|
},
|
|
19503
19504
|
"../../node_modules/.pnpm/os-browserify@0.3.0/node_modules/os-browserify/browser.js" (__unused_rspack_module, exports) {
|
|
19504
|
-
exports.
|
|
19505
|
-
return 'LE';
|
|
19506
|
-
};
|
|
19507
|
-
exports.hostname = function() {
|
|
19508
|
-
if ("u" > typeof location) return location.hostname;
|
|
19509
|
-
return '';
|
|
19510
|
-
};
|
|
19511
|
-
exports.loadavg = function() {
|
|
19512
|
-
return [];
|
|
19513
|
-
};
|
|
19514
|
-
exports.uptime = function() {
|
|
19515
|
-
return 0;
|
|
19516
|
-
};
|
|
19517
|
-
exports.freemem = function() {
|
|
19518
|
-
return Number.MAX_VALUE;
|
|
19519
|
-
};
|
|
19520
|
-
exports.totalmem = function() {
|
|
19521
|
-
return Number.MAX_VALUE;
|
|
19522
|
-
};
|
|
19523
|
-
exports.cpus = function() {
|
|
19524
|
-
return [];
|
|
19525
|
-
};
|
|
19526
|
-
exports.type = function() {
|
|
19527
|
-
return 'Browser';
|
|
19528
|
-
};
|
|
19529
|
-
exports.release = function() {
|
|
19530
|
-
if ("u" > typeof navigator) return navigator.appVersion;
|
|
19531
|
-
return '';
|
|
19532
|
-
};
|
|
19533
|
-
exports.networkInterfaces = exports.getNetworkInterfaces = function() {
|
|
19534
|
-
return {};
|
|
19535
|
-
};
|
|
19536
|
-
exports.arch = function() {
|
|
19537
|
-
return "javascript";
|
|
19538
|
-
};
|
|
19539
|
-
exports.platform = function() {
|
|
19505
|
+
exports.iD = function() {
|
|
19540
19506
|
return 'browser';
|
|
19541
19507
|
};
|
|
19542
|
-
|
|
19543
|
-
return '/tmp';
|
|
19544
|
-
};
|
|
19545
|
-
exports.EOL = '\n';
|
|
19546
|
-
exports.homedir = function() {
|
|
19547
|
-
return '/';
|
|
19548
|
-
};
|
|
19508
|
+
'\n';
|
|
19549
19509
|
},
|
|
19550
19510
|
"../../node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/utils/common.js" (__unused_rspack_module, exports) {
|
|
19551
19511
|
var TYPED_OK = "u" > typeof Uint8Array && "u" > typeof Uint16Array && "u" > typeof Int32Array;
|
|
@@ -24762,8 +24722,9 @@ __webpack_require__.add({
|
|
|
24762
24722
|
};
|
|
24763
24723
|
},
|
|
24764
24724
|
"../../node_modules/.pnpm/querystring-es3@0.2.1/node_modules/querystring-es3/index.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
24765
|
-
|
|
24766
|
-
|
|
24725
|
+
var __webpack_unused_export__;
|
|
24726
|
+
__webpack_unused_export__ = exports.qg = __webpack_require__("../../node_modules/.pnpm/querystring-es3@0.2.1/node_modules/querystring-es3/decode.js");
|
|
24727
|
+
__webpack_unused_export__ = __webpack_require__("../../node_modules/.pnpm/querystring-es3@0.2.1/node_modules/querystring-es3/encode.js");
|
|
24767
24728
|
},
|
|
24768
24729
|
"../../node_modules/.pnpm/randombytes@2.1.0/node_modules/randombytes/browser.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
24769
24730
|
var process = __webpack_require__("../../node_modules/.pnpm/process@0.11.10/node_modules/process/browser.js");
|
|
@@ -32069,8 +32030,8 @@ __webpack_require__.add({
|
|
|
32069
32030
|
const watchEventSource = __webpack_require__("../../node_modules/.pnpm/watchpack@2.4.4/node_modules/watchpack/lib/watchEventSource.js");
|
|
32070
32031
|
const EXISTANCE_ONLY_TIME_ENTRY = Object.freeze({});
|
|
32071
32032
|
let FS_ACCURACY = 2000;
|
|
32072
|
-
const IS_OSX = "darwin" === __webpack_require__("../../node_modules/.pnpm/os-browserify@0.3.0/node_modules/os-browserify/browser.js").
|
|
32073
|
-
const IS_WIN = "win32" === __webpack_require__("../../node_modules/.pnpm/os-browserify@0.3.0/node_modules/os-browserify/browser.js").
|
|
32033
|
+
const IS_OSX = "darwin" === __webpack_require__("../../node_modules/.pnpm/os-browserify@0.3.0/node_modules/os-browserify/browser.js").iD();
|
|
32034
|
+
const IS_WIN = "win32" === __webpack_require__("../../node_modules/.pnpm/os-browserify@0.3.0/node_modules/os-browserify/browser.js").iD();
|
|
32074
32035
|
const WATCHPACK_POLLING = process.env.WATCHPACK_POLLING;
|
|
32075
32036
|
const FORCE_POLLING = `${+WATCHPACK_POLLING}` === WATCHPACK_POLLING ? +WATCHPACK_POLLING : !!WATCHPACK_POLLING && "false" !== WATCHPACK_POLLING;
|
|
32076
32037
|
function withoutCase(str) {
|
|
@@ -32749,8 +32710,8 @@ __webpack_require__.add({
|
|
|
32749
32710
|
const path = __webpack_require__("../../node_modules/.pnpm/path-browserify@1.0.1/node_modules/path-browserify/index.js");
|
|
32750
32711
|
const { EventEmitter } = __webpack_require__("../../node_modules/.pnpm/events@3.3.0/node_modules/events/events.js");
|
|
32751
32712
|
const reducePlan = __webpack_require__("../../node_modules/.pnpm/watchpack@2.4.4/node_modules/watchpack/lib/reducePlan.js");
|
|
32752
|
-
const IS_OSX = "darwin" === __webpack_require__("../../node_modules/.pnpm/os-browserify@0.3.0/node_modules/os-browserify/browser.js").
|
|
32753
|
-
const IS_WIN = "win32" === __webpack_require__("../../node_modules/.pnpm/os-browserify@0.3.0/node_modules/os-browserify/browser.js").
|
|
32713
|
+
const IS_OSX = "darwin" === __webpack_require__("../../node_modules/.pnpm/os-browserify@0.3.0/node_modules/os-browserify/browser.js").iD();
|
|
32714
|
+
const IS_WIN = "win32" === __webpack_require__("../../node_modules/.pnpm/os-browserify@0.3.0/node_modules/os-browserify/browser.js").iD();
|
|
32754
32715
|
const SUPPORTS_RECURSIVE_WATCHING = IS_OSX || IS_WIN;
|
|
32755
32716
|
const watcherLimit = +process.env.WATCHPACK_WATCHER_LIMIT || (IS_OSX ? 20 : 10000);
|
|
32756
32717
|
const recursiveWatcherLogging = !!process.env.WATCHPACK_RECURSIVE_WATCHER_LOGGING;
|
|
@@ -32983,9 +32944,6 @@ __webpack_require__.add({
|
|
|
32983
32944
|
execute();
|
|
32984
32945
|
}
|
|
32985
32946
|
};
|
|
32986
|
-
exports.getNumberOfWatchers = ()=>watcherCount;
|
|
32987
|
-
exports.createHandleChangeEvent = createHandleChangeEvent;
|
|
32988
|
-
exports.watcherLimit = watcherLimit;
|
|
32989
32947
|
},
|
|
32990
32948
|
"../../node_modules/.pnpm/watchpack@2.4.4/node_modules/watchpack/lib/watchpack.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
32991
32949
|
const getWatcherManager = __webpack_require__("../../node_modules/.pnpm/watchpack@2.4.4/node_modules/watchpack/lib/getWatcherManager.js");
|
|
@@ -35359,7 +35317,7 @@ __webpack_require__.add({
|
|
|
35359
35317
|
__webpack_require__.d(__webpack_exports__, {
|
|
35360
35318
|
Buffer: ()=>_napi_rs_wasm_runtime_fs__rspack_import_0.hp
|
|
35361
35319
|
});
|
|
35362
|
-
var _napi_rs_wasm_runtime_fs__rspack_import_0 = __webpack_require__("../../node_modules/.pnpm/@napi-rs+wasm-runtime@1.1.
|
|
35320
|
+
var _napi_rs_wasm_runtime_fs__rspack_import_0 = __webpack_require__("../../node_modules/.pnpm/@napi-rs+wasm-runtime@1.1.4_@emnapi+core@1.10.0_@emnapi+runtime@1.10.0/node_modules/@napi-rs/wasm-runtime/dist/fs.js");
|
|
35363
35321
|
},
|
|
35364
35322
|
"./src/browser/fs.ts" (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
35365
35323
|
__webpack_require__.r(__webpack_exports__);
|
|
@@ -35375,15 +35333,15 @@ __webpack_require__.add({
|
|
|
35375
35333
|
volume: ()=>volume,
|
|
35376
35334
|
watch: ()=>watch
|
|
35377
35335
|
});
|
|
35378
|
-
var _napi_rs_wasm_runtime_fs__rspack_import_0 = __webpack_require__("../../node_modules/.pnpm/@napi-rs+wasm-runtime@1.1.
|
|
35379
|
-
var _rspack_binding__rspack_import_1 = __webpack_require__("@rspack/binding?
|
|
35336
|
+
var _napi_rs_wasm_runtime_fs__rspack_import_0 = __webpack_require__("../../node_modules/.pnpm/@napi-rs+wasm-runtime@1.1.4_@emnapi+core@1.10.0_@emnapi+runtime@1.10.0/node_modules/@napi-rs/wasm-runtime/dist/fs.js");
|
|
35337
|
+
var _rspack_binding__rspack_import_1 = __webpack_require__("@rspack/binding?2041");
|
|
35380
35338
|
const fs = _rspack_binding__rspack_import_1.__fs;
|
|
35381
35339
|
const volume = _rspack_binding__rspack_import_1.__volume;
|
|
35382
35340
|
const memfs = _napi_rs_wasm_runtime_fs__rspack_import_0.tO;
|
|
35383
35341
|
const { readFileSync, readdirSync, lstat, existsSync, readdir, watch } = fs;
|
|
35384
35342
|
const __rspack_default_export = fs;
|
|
35385
35343
|
},
|
|
35386
|
-
"@rspack/binding?
|
|
35344
|
+
"@rspack/binding?2041" (module) {
|
|
35387
35345
|
module.exports = __rspack_external__rspack_wasi_browser_js_bd433424;
|
|
35388
35346
|
},
|
|
35389
35347
|
"?7763" () {},
|
|
@@ -35403,7 +35361,7 @@ __webpack_require__.add({
|
|
|
35403
35361
|
return out;
|
|
35404
35362
|
};
|
|
35405
35363
|
},
|
|
35406
|
-
"../../node_modules/.pnpm/@napi-rs+wasm-runtime@1.1.
|
|
35364
|
+
"../../node_modules/.pnpm/@napi-rs+wasm-runtime@1.1.4_@emnapi+core@1.10.0_@emnapi+runtime@1.10.0/node_modules/@napi-rs/wasm-runtime/dist/fs.js" (__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
35407
35365
|
__webpack_require__.d(__webpack_exports__, {
|
|
35408
35366
|
hp: ()=>Buffer,
|
|
35409
35367
|
tO: ()=>memfs
|
|
@@ -55380,7 +55338,6 @@ function createDiagnosticArray(adm) {
|
|
|
55380
55338
|
return adm.get(index);
|
|
55381
55339
|
},
|
|
55382
55340
|
concat (...items) {
|
|
55383
|
-
[].includes;
|
|
55384
55341
|
return adm.values().concat(...items);
|
|
55385
55342
|
},
|
|
55386
55343
|
flat () {
|
|
@@ -58157,7 +58114,7 @@ async function runLoaders(compiler, context) {
|
|
|
58157
58114
|
} catch (e) {
|
|
58158
58115
|
throw new Error(`JSON parsing failed for loader's string options: ${e.message}`);
|
|
58159
58116
|
}
|
|
58160
|
-
else options = querystring_es3.
|
|
58117
|
+
else options = querystring_es3.qg(options);
|
|
58161
58118
|
if (null == options) options = {};
|
|
58162
58119
|
return options;
|
|
58163
58120
|
};
|
|
@@ -61882,7 +61839,7 @@ const applyOutputDefaults = (options, { context, targetProperties: tp, isAffecte
|
|
|
61882
61839
|
});
|
|
61883
61840
|
D(output, 'bundlerInfo', {});
|
|
61884
61841
|
if ('object' == typeof output.bundlerInfo) {
|
|
61885
|
-
D(output.bundlerInfo, 'version', "2.0.
|
|
61842
|
+
D(output.bundlerInfo, 'version', "2.0.1");
|
|
61886
61843
|
D(output.bundlerInfo, 'bundler', 'rspack');
|
|
61887
61844
|
D(output.bundlerInfo, 'force', false);
|
|
61888
61845
|
}
|
|
@@ -63540,7 +63497,7 @@ class MultiStats {
|
|
|
63540
63497
|
return obj;
|
|
63541
63498
|
});
|
|
63542
63499
|
if (childOptions.version) {
|
|
63543
|
-
obj.rspackVersion = "2.0.
|
|
63500
|
+
obj.rspackVersion = "2.0.1";
|
|
63544
63501
|
obj.version = "5.75.0";
|
|
63545
63502
|
}
|
|
63546
63503
|
if (childOptions.hash) obj.hash = obj.children.map((j)=>j.hash).join('');
|
|
@@ -64417,7 +64374,7 @@ function nodeConsole({ colors, appendOnly, stream }) {
|
|
|
64417
64374
|
}
|
|
64418
64375
|
};
|
|
64419
64376
|
}
|
|
64420
|
-
const CachedInputFileSystem = __webpack_require__("../../node_modules/.pnpm/enhanced-resolve@5.
|
|
64377
|
+
const CachedInputFileSystem = __webpack_require__("../../node_modules/.pnpm/enhanced-resolve@5.21.0/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js");
|
|
64421
64378
|
var CachedInputFileSystem_default = /*#__PURE__*/ __webpack_require__.n(CachedInputFileSystem);
|
|
64422
64379
|
class NodeEnvironmentPlugin {
|
|
64423
64380
|
options;
|
|
@@ -65243,7 +65200,7 @@ const SIMPLE_EXTRACTORS = {
|
|
|
65243
65200
|
},
|
|
65244
65201
|
version: (object)=>{
|
|
65245
65202
|
object.version = "5.75.0";
|
|
65246
|
-
object.rspackVersion = "2.0.
|
|
65203
|
+
object.rspackVersion = "2.0.1";
|
|
65247
65204
|
},
|
|
65248
65205
|
env: (object, _compilation, _context, { _env })=>{
|
|
65249
65206
|
object.env = _env;
|
|
@@ -68482,7 +68439,7 @@ class Compiler {
|
|
|
68482
68439
|
const rawOptions = getRawOptions(options, this);
|
|
68483
68440
|
rawOptions.__references = Object.fromEntries(this.#ruleSet.builtinReferences.entries());
|
|
68484
68441
|
rawOptions.__virtual_files = VirtualModulesPlugin.__internal__take_virtual_files(this);
|
|
68485
|
-
const instanceBinding = __webpack_require__("@rspack/binding?
|
|
68442
|
+
const instanceBinding = __webpack_require__("@rspack/binding?2041");
|
|
68486
68443
|
this.#registers = this.#createHooksRegisters();
|
|
68487
68444
|
const inputFileSystem = this.inputFileSystem && ThreadsafeInputNodeFS.needsBinding(options.experiments.useInputFileSystem) ? ThreadsafeInputNodeFS.__to_binding(this.inputFileSystem) : void 0;
|
|
68488
68445
|
try {
|
|
@@ -69686,7 +69643,7 @@ class IndependentSharedPlugin {
|
|
|
69686
69643
|
reject(err || new Error(`${target} Compile failed`));
|
|
69687
69644
|
return;
|
|
69688
69645
|
}
|
|
69689
|
-
currentShare
|
|
69646
|
+
if (currentShare) console.log(`${currentShare.shareName} Compile success`);
|
|
69690
69647
|
resolve(extraPlugin.getData());
|
|
69691
69648
|
});
|
|
69692
69649
|
});
|
|
@@ -70072,7 +70029,7 @@ function transformSync(source, options) {
|
|
|
70072
70029
|
const _options = JSON.stringify(options || {});
|
|
70073
70030
|
return rspack_wasi_browser.transformSync(source, _options);
|
|
70074
70031
|
}
|
|
70075
|
-
const exports_rspackVersion = "2.0.
|
|
70032
|
+
const exports_rspackVersion = "2.0.1";
|
|
70076
70033
|
const exports_version = "5.75.0";
|
|
70077
70034
|
const exports_WebpackError = Error;
|
|
70078
70035
|
const exports_config = {
|
|
@@ -58,10 +58,6 @@ const {
|
|
|
58
58
|
...importObject.napi,
|
|
59
59
|
...importObject.emnapi,
|
|
60
60
|
memory: __sharedMemory,
|
|
61
|
-
// Override emnapi's napi_adjust_external_memory to a no-op.
|
|
62
|
-
// emnapi implements this by calling memory.grow, but we've disabled memory.grow
|
|
63
|
-
// (initial == maximum).
|
|
64
|
-
napi_adjust_external_memory() { return 0 },
|
|
65
61
|
}
|
|
66
62
|
return importObject
|
|
67
63
|
},
|
|
@@ -1234,11 +1234,13 @@
|
|
|
1234
1234
|
}
|
|
1235
1235
|
function _emnapi_worker_ref(pthreadPtr) {
|
|
1236
1236
|
if (ENVIRONMENT_IS_PTHREAD) return;
|
|
1237
|
+
pthreadPtr >>>= 0;
|
|
1237
1238
|
var worker = emnapiGetWorkerByPthreadPtr(pthreadPtr);
|
|
1238
1239
|
if (worker && 'function' == typeof worker.ref) worker.ref();
|
|
1239
1240
|
}
|
|
1240
1241
|
function _emnapi_worker_unref(pthreadPtr) {
|
|
1241
1242
|
if (ENVIRONMENT_IS_PTHREAD) return;
|
|
1243
|
+
pthreadPtr >>>= 0;
|
|
1242
1244
|
var worker = emnapiGetWorkerByPthreadPtr(pthreadPtr);
|
|
1243
1245
|
if (worker && 'function' == typeof worker.unref) worker.unref();
|
|
1244
1246
|
}
|
|
@@ -1324,17 +1326,12 @@
|
|
|
1324
1326
|
if (!env) return 1;
|
|
1325
1327
|
var envObject = emnapiCtx.envStore.get(env);
|
|
1326
1328
|
if (!adjusted_value) return envObject.setLastError(1);
|
|
1327
|
-
var
|
|
1328
|
-
if (change_in_bytes_number < 0) return envObject.setLastError(1);
|
|
1329
|
-
var old_size = wasmMemory.buffer.byteLength;
|
|
1330
|
-
var new_size = old_size + change_in_bytes_number;
|
|
1331
|
-
new_size += (65536 - new_size % 65536) % 65536;
|
|
1332
|
-
if (-1 === wasmMemory.grow(new_size - old_size + 65535 >> 16)) return envObject.setLastError(9);
|
|
1329
|
+
var adjusted_memory = emnapiCtx.adjustAmountOfExternalAllocatedMemory(change_in_bytes);
|
|
1333
1330
|
adjusted_value >>>= 0;
|
|
1334
1331
|
if (emnapiCtx.feature.supportBigInt) {
|
|
1335
1332
|
var HEAP_DATA_VIEW = new DataView(wasmMemory.buffer);
|
|
1336
|
-
HEAP_DATA_VIEW.setBigInt64(adjusted_value, BigInt(
|
|
1337
|
-
} else $emnapiSetValueI64(adjusted_value,
|
|
1333
|
+
HEAP_DATA_VIEW.setBigInt64(adjusted_value, BigInt(adjusted_memory), true);
|
|
1334
|
+
} else $emnapiSetValueI64(adjusted_value, Number(adjusted_memory));
|
|
1338
1335
|
return envObject.clearLastError();
|
|
1339
1336
|
}
|
|
1340
1337
|
var memoryMod = /*#__PURE__*/ Object.freeze({
|
|
@@ -1614,6 +1611,7 @@
|
|
|
1614
1611
|
napi_open_callback_scope: napi_open_callback_scope
|
|
1615
1612
|
});
|
|
1616
1613
|
var emnapiTSFN = {
|
|
1614
|
+
_liveSet: {},
|
|
1617
1615
|
offset: {
|
|
1618
1616
|
__size__: 0,
|
|
1619
1617
|
resource: 0,
|
|
@@ -1622,6 +1620,8 @@
|
|
|
1622
1620
|
queue_size: 0,
|
|
1623
1621
|
is_some: 0,
|
|
1624
1622
|
queue: 0,
|
|
1623
|
+
async_pending: 0,
|
|
1624
|
+
async_u_fd: 0,
|
|
1625
1625
|
thread_count: 0,
|
|
1626
1626
|
state: 0,
|
|
1627
1627
|
dispatch_state: 0,
|
|
@@ -1638,6 +1638,7 @@
|
|
|
1638
1638
|
cond: 0
|
|
1639
1639
|
},
|
|
1640
1640
|
init: function() {
|
|
1641
|
+
emnapiTSFN._liveSet = new Set();
|
|
1641
1642
|
emnapiTSFN.offset.__size__ = 184;
|
|
1642
1643
|
emnapiTSFN.offset.resource = 0;
|
|
1643
1644
|
emnapiTSFN.offset.async_id = 8;
|
|
@@ -1645,6 +1646,8 @@
|
|
|
1645
1646
|
emnapiTSFN.offset.queue_size = 60;
|
|
1646
1647
|
emnapiTSFN.offset.is_some = 24;
|
|
1647
1648
|
emnapiTSFN.offset.queue = 64;
|
|
1649
|
+
emnapiTSFN.offset.async_pending = 132;
|
|
1650
|
+
emnapiTSFN.offset.async_u_fd = 96;
|
|
1648
1651
|
emnapiTSFN.offset.thread_count = 136;
|
|
1649
1652
|
emnapiTSFN.offset.state = 140;
|
|
1650
1653
|
emnapiTSFN.offset.dispatch_state = 144;
|
|
@@ -1680,7 +1683,10 @@
|
|
|
1680
1683
|
if (__emnapi__) {
|
|
1681
1684
|
var type = __emnapi__.type;
|
|
1682
1685
|
var payload = __emnapi__.payload;
|
|
1683
|
-
if ('tsfn-send' === type)
|
|
1686
|
+
if ('tsfn-send' === type) {
|
|
1687
|
+
var pendng = payload.tsfn + emnapiTSFN.offset.async_pending;
|
|
1688
|
+
if (0 !== Atomics.load(new Int32Array(wasmMemory.buffer), pendng >>> 2)) emnapiTSFN.enqueue(payload.tsfn);
|
|
1689
|
+
}
|
|
1684
1690
|
}
|
|
1685
1691
|
};
|
|
1686
1692
|
var dispose = function() {
|
|
@@ -1707,7 +1713,15 @@
|
|
|
1707
1713
|
},
|
|
1708
1714
|
destroyQueue: function(func) {
|
|
1709
1715
|
var queue = emnapiTSFN.loadSizeTypeValue(func + emnapiTSFN.offset.queue, false);
|
|
1710
|
-
if (queue)
|
|
1716
|
+
if (queue) {
|
|
1717
|
+
var node = emnapiTSFN.loadSizeTypeValue(queue, false);
|
|
1718
|
+
while(0 !== node){
|
|
1719
|
+
var next = emnapiTSFN.loadSizeTypeValue(node + 4, false);
|
|
1720
|
+
_free(node);
|
|
1721
|
+
node = next;
|
|
1722
|
+
}
|
|
1723
|
+
_free(queue);
|
|
1724
|
+
}
|
|
1711
1725
|
},
|
|
1712
1726
|
pushQueue: function(func, data) {
|
|
1713
1727
|
var queue = emnapiTSFN.loadSizeTypeValue(func + emnapiTSFN.offset.queue, false);
|
|
@@ -1947,6 +1961,7 @@
|
|
|
1947
1961
|
}
|
|
1948
1962
|
},
|
|
1949
1963
|
destroy: function(func) {
|
|
1964
|
+
emnapiTSFN._liveSet.delete(func);
|
|
1950
1965
|
emnapiTSFN.destroyQueue(func);
|
|
1951
1966
|
emnapiTSFN.releaseResources(func);
|
|
1952
1967
|
_free(func);
|
|
@@ -2015,6 +2030,7 @@
|
|
|
2015
2030
|
});
|
|
2016
2031
|
if (emnapiTSFN.getHandlesClosing(func)) return;
|
|
2017
2032
|
emnapiTSFN.setHandlesClosing(func, 1);
|
|
2033
|
+
Atomics.store(new Int32Array(wasmMemory.buffer), func + emnapiTSFN.offset.async_pending >>> 2, 1);
|
|
2018
2034
|
emnapiCtx.feature.setImmediate(function() {
|
|
2019
2035
|
emnapiTSFN.finalize(func);
|
|
2020
2036
|
});
|
|
@@ -2094,10 +2110,34 @@
|
|
|
2094
2110
|
}
|
|
2095
2111
|
if (has_more) emnapiTSFN.send(func);
|
|
2096
2112
|
},
|
|
2113
|
+
enqueue: function(func) {
|
|
2114
|
+
var pending = func + emnapiTSFN.offset.async_pending;
|
|
2115
|
+
var scheduled = func + emnapiTSFN.offset.async_u_fd;
|
|
2116
|
+
var i32a = new Int32Array(wasmMemory.buffer);
|
|
2117
|
+
if (0 !== Atomics.exchange(i32a, scheduled >>> 2, 1)) return;
|
|
2118
|
+
emnapiCtx.feature.setImmediate(function() {
|
|
2119
|
+
if (!emnapiTSFN._liveSet.has(func)) return;
|
|
2120
|
+
if (0 === Atomics.load(i32a, pending >>> 2)) return void Atomics.store(i32a, scheduled >>> 2, 0);
|
|
2121
|
+
emnapiCtx.feature.setImmediate(function() {
|
|
2122
|
+
try {
|
|
2123
|
+
if (0 === Atomics.exchange(i32a, pending >>> 2, 0)) return;
|
|
2124
|
+
if (!emnapiTSFN._liveSet.has(func)) return;
|
|
2125
|
+
emnapiTSFN.dispatch(func);
|
|
2126
|
+
} finally{
|
|
2127
|
+
if (emnapiTSFN._liveSet.has(func)) {
|
|
2128
|
+
Atomics.store(i32a, scheduled >>> 2, 0);
|
|
2129
|
+
if (0 !== Atomics.load(i32a, pending >>> 2)) emnapiTSFN.enqueue(func);
|
|
2130
|
+
}
|
|
2131
|
+
}
|
|
2132
|
+
});
|
|
2133
|
+
});
|
|
2134
|
+
},
|
|
2097
2135
|
send: function(func) {
|
|
2098
2136
|
var current_state = Atomics.or(new Uint32Array(wasmMemory.buffer), func + emnapiTSFN.offset.dispatch_state >>> 2, 2);
|
|
2099
2137
|
if ((1 & current_state) === 1) return;
|
|
2100
|
-
|
|
2138
|
+
var pendng = func + emnapiTSFN.offset.async_pending;
|
|
2139
|
+
if (0 !== Atomics.load(new Int32Array(wasmMemory.buffer), pendng >>> 2)) return;
|
|
2140
|
+
if (0 === Atomics.exchange(new Int32Array(wasmMemory.buffer), pendng >>> 2, 1)) if (void 0 !== ENVIRONMENT_IS_PTHREAD && ENVIRONMENT_IS_PTHREAD) postMessage({
|
|
2101
2141
|
__emnapi__: {
|
|
2102
2142
|
type: 'tsfn-send',
|
|
2103
2143
|
payload: {
|
|
@@ -2105,9 +2145,7 @@
|
|
|
2105
2145
|
}
|
|
2106
2146
|
}
|
|
2107
2147
|
});
|
|
2108
|
-
else
|
|
2109
|
-
emnapiTSFN.dispatch(func);
|
|
2110
|
-
});
|
|
2148
|
+
else emnapiTSFN.enqueue(func);
|
|
2111
2149
|
}
|
|
2112
2150
|
};
|
|
2113
2151
|
function napi_create_threadsafe_function(env, func, async_resource, async_resource_name, max_queue_size, initial_thread_count, thread_finalize_data, thread_finalize_cb, context, call_js_cb, result) {
|
|
@@ -2169,6 +2207,7 @@
|
|
|
2169
2207
|
HEAP_DATA_VIEW.setUint32(tsfn + emnapiTSFN.offset.finalize_cb, thread_finalize_cb, true);
|
|
2170
2208
|
HEAP_DATA_VIEW.setUint32(tsfn + emnapiTSFN.offset.call_js_cb, call_js_cb, true);
|
|
2171
2209
|
emnapiCtx.addCleanupHook(envObject, emnapiTSFN.cleanup, tsfn);
|
|
2210
|
+
emnapiTSFN._liveSet.add(tsfn);
|
|
2172
2211
|
envObject.ref();
|
|
2173
2212
|
emnapiCtx.increaseWaitingRequestCounter();
|
|
2174
2213
|
HEAP_DATA_VIEW.setUint32(tsfn + emnapiTSFN.offset.async_ref, 1, true);
|
|
@@ -2821,7 +2860,7 @@
|
|
|
2821
2860
|
});
|
|
2822
2861
|
return view;
|
|
2823
2862
|
}
|
|
2824
|
-
var maybeOldWasmMemory = emnapiExternalMemory.isDetachedArrayBuffer(view.buffer) ||
|
|
2863
|
+
var maybeOldWasmMemory = emnapiExternalMemory.isDetachedArrayBuffer(view.buffer) || emnapiExternalMemory.isSharedArrayBuffer(view.buffer);
|
|
2825
2864
|
if (maybeOldWasmMemory && emnapiExternalMemory.wasmMemoryViewTable.has(view)) {
|
|
2826
2865
|
var info = emnapiExternalMemory.wasmMemoryViewTable.get(view);
|
|
2827
2866
|
var Ctor = info.Ctor;
|
|
@@ -3209,13 +3248,12 @@
|
|
|
3209
3248
|
}
|
|
3210
3249
|
HEAP_DATA_VIEW.setInt32(type, t, true);
|
|
3211
3250
|
}
|
|
3251
|
+
v = emnapiExternalMemory.getOrUpdateMemoryView(v);
|
|
3212
3252
|
if (length) {
|
|
3213
3253
|
length >>>= 0;
|
|
3214
3254
|
HEAP_DATA_VIEW.setUint32(length, v.length, true);
|
|
3215
3255
|
}
|
|
3216
|
-
var buffer;
|
|
3217
3256
|
if (data || arraybuffer) {
|
|
3218
|
-
buffer = v.buffer;
|
|
3219
3257
|
if (data) {
|
|
3220
3258
|
data >>>= 0;
|
|
3221
3259
|
var p = emnapiExternalMemory.getViewPointer(v, true).address;
|
|
@@ -3223,7 +3261,7 @@
|
|
|
3223
3261
|
}
|
|
3224
3262
|
if (arraybuffer) {
|
|
3225
3263
|
arraybuffer >>>= 0;
|
|
3226
|
-
var ab = envObject.ensureHandleId(buffer);
|
|
3264
|
+
var ab = envObject.ensureHandleId(v.buffer);
|
|
3227
3265
|
HEAP_DATA_VIEW.setUint32(arraybuffer, ab, true);
|
|
3228
3266
|
}
|
|
3229
3267
|
}
|
|
@@ -3250,15 +3288,13 @@
|
|
|
3250
3288
|
if (!dataview) return envObject.setLastError(1);
|
|
3251
3289
|
var handle = emnapiCtx.handleStore.get(dataview);
|
|
3252
3290
|
if (!handle.isDataView()) return envObject.setLastError(1);
|
|
3253
|
-
var v = handle.value;
|
|
3291
|
+
var v = emnapiExternalMemory.getOrUpdateMemoryView(handle.value);
|
|
3254
3292
|
var HEAP_DATA_VIEW = new DataView(wasmMemory.buffer);
|
|
3255
3293
|
if (byte_length) {
|
|
3256
3294
|
byte_length >>>= 0;
|
|
3257
3295
|
HEAP_DATA_VIEW.setUint32(byte_length, v.byteLength, true);
|
|
3258
3296
|
}
|
|
3259
|
-
var buffer;
|
|
3260
3297
|
if (data || arraybuffer) {
|
|
3261
|
-
buffer = v.buffer;
|
|
3262
3298
|
if (data) {
|
|
3263
3299
|
data >>>= 0;
|
|
3264
3300
|
var p = emnapiExternalMemory.getViewPointer(v, true).address;
|
|
@@ -3266,7 +3302,7 @@
|
|
|
3266
3302
|
}
|
|
3267
3303
|
if (arraybuffer) {
|
|
3268
3304
|
arraybuffer >>>= 0;
|
|
3269
|
-
var ab = envObject.ensureHandleId(buffer);
|
|
3305
|
+
var ab = envObject.ensureHandleId(v.buffer);
|
|
3270
3306
|
HEAP_DATA_VIEW.setUint32(arraybuffer, ab, true);
|
|
3271
3307
|
}
|
|
3272
3308
|
}
|
|
@@ -9141,6 +9177,9 @@
|
|
|
9141
9177
|
this[kExitCode] = rval;
|
|
9142
9178
|
throw kExitCode;
|
|
9143
9179
|
}
|
|
9180
|
+
const RESPONSE_HEADER_SIZE = 16;
|
|
9181
|
+
const RESPONSE_PAYLOAD_SIZE = 10240;
|
|
9182
|
+
const RESPONSE_BUFFER_SIZE = RESPONSE_HEADER_SIZE + RESPONSE_PAYLOAD_SIZE;
|
|
9144
9183
|
const decodeValue = (memfs, payload, type)=>{
|
|
9145
9184
|
if (0 === type) return;
|
|
9146
9185
|
if (1 === type) return null;
|
|
@@ -9189,13 +9228,13 @@
|
|
|
9189
9228
|
}
|
|
9190
9229
|
return obj;
|
|
9191
9230
|
}
|
|
9192
|
-
if (9 === type) return new
|
|
9231
|
+
if (9 === type) return BigInt(new TextDecoder().decode(payload.slice()));
|
|
9193
9232
|
throw new Error('unsupported data');
|
|
9194
9233
|
};
|
|
9195
9234
|
const createFsProxy = (memfs)=>new Proxy({}, {
|
|
9196
9235
|
get (_target, p, _receiver) {
|
|
9197
9236
|
return function(...args) {
|
|
9198
|
-
const sab = new SharedArrayBuffer(
|
|
9237
|
+
const sab = new SharedArrayBuffer(RESPONSE_BUFFER_SIZE);
|
|
9199
9238
|
const i32arr = new Int32Array(sab);
|
|
9200
9239
|
Atomics.store(i32arr, 0, 21);
|
|
9201
9240
|
postMessage({
|
|
@@ -9209,7 +9248,7 @@
|
|
|
9209
9248
|
const status = Atomics.load(i32arr, 0);
|
|
9210
9249
|
const type = Atomics.load(i32arr, 1);
|
|
9211
9250
|
const size = Atomics.load(i32arr, 2);
|
|
9212
|
-
const content = new Uint8Array(sab,
|
|
9251
|
+
const content = new Uint8Array(sab, RESPONSE_HEADER_SIZE, size);
|
|
9213
9252
|
const value = decodeValue(memfs, content, type);
|
|
9214
9253
|
if (1 === status) throw value;
|
|
9215
9254
|
return value;
|
|
@@ -27819,10 +27858,7 @@
|
|
|
27819
27858
|
...importObject.env,
|
|
27820
27859
|
...importObject.napi,
|
|
27821
27860
|
...importObject.emnapi,
|
|
27822
|
-
memory: wasmMemory
|
|
27823
|
-
napi_adjust_external_memory () {
|
|
27824
|
-
return 0;
|
|
27825
|
-
}
|
|
27861
|
+
memory: wasmMemory
|
|
27826
27862
|
};
|
|
27827
27863
|
}
|
|
27828
27864
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspack-debug/browser",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"webpackVersion": "5.75.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Rspack for running in the browser. This is still in early stage and may not follow the semver.",
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"directory": "packages/rspack-browser"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@emnapi/core": "1.
|
|
33
|
-
"@emnapi/runtime": "1.
|
|
34
|
-
"@napi-rs/wasm-runtime": "1.1.
|
|
32
|
+
"@emnapi/core": "1.10.0",
|
|
33
|
+
"@emnapi/runtime": "1.10.0",
|
|
34
|
+
"@napi-rs/wasm-runtime": "1.1.4",
|
|
35
35
|
"@rspack/lite-tapable": "1.1.0",
|
|
36
36
|
"@swc/types": "0.1.26",
|
|
37
37
|
"@types/watchpack": "^2.4.5",
|