@rspack-debug/browser 2.0.0-rc.2 → 2.0.0
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/dist/browser/BrowserRequirePlugin.d.ts +1 -1
- package/dist/builtin-plugin/index.d.ts +0 -1
- package/dist/builtin-plugin/rsc/RscServerPlugin.d.ts +1 -0
- package/dist/config/devServer.d.ts +2 -2
- package/dist/config/types.d.ts +9 -9
- package/dist/exports.d.ts +3 -1
- package/dist/index.js +49 -83
- package/dist/napi-binding.d.ts +0 -1
- package/dist/rspack.wasi-browser.js +0 -4
- package/dist/wasi-worker-browser.mjs +65 -29
- package/dist/web/JsonpTemplatePlugin.d.ts +13 -0
- package/dist/webworker/WebWorkerTemplatePlugin.d.ts +13 -0
- package/package.json +4 -4
- package/dist/builtin-plugin/WebWorkerTemplatePlugin.d.ts +0 -7
|
@@ -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
|
}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
import type { ReadStream } from 'node:fs';
|
|
11
11
|
import type { IncomingMessage, ServerResponse } from 'node:http';
|
|
12
12
|
import type { ServerOptions } from 'node:https';
|
|
13
|
-
import type {
|
|
13
|
+
import type { NextFunction } from 'connect-next';
|
|
14
14
|
import type { Filter as ProxyFilter, Options as ProxyOptions } from 'http-proxy-middleware';
|
|
15
15
|
import type { Options as OpenOptions } from 'open';
|
|
16
16
|
import type { Compiler, Configuration, LiteralUnion, MultiCompiler, MultiStats, Stats, Watching } from '..';
|
|
@@ -153,7 +153,7 @@ export type DevServerClient = {
|
|
|
153
153
|
webSocketTransport?: LiteralUnion<'ws', string>;
|
|
154
154
|
webSocketURL?: string | DevServerWebSocketURL;
|
|
155
155
|
};
|
|
156
|
-
export type DevServerOptions<A extends BasicApplication =
|
|
156
|
+
export type DevServerOptions<A extends BasicApplication = BasicApplication, S extends BasicServer = BasicServer> = {
|
|
157
157
|
ipc?: string | boolean;
|
|
158
158
|
host?: DevServerHost;
|
|
159
159
|
port?: Port;
|
package/dist/config/types.d.ts
CHANGED
|
@@ -153,7 +153,7 @@ export type EntryStatic = EntryObject | EntryUnnamed;
|
|
|
153
153
|
export type EntryDynamic = () => EntryStatic | Promise<EntryStatic>;
|
|
154
154
|
/** The entry options for building */
|
|
155
155
|
export type Entry = EntryStatic | EntryDynamic;
|
|
156
|
-
/** The output directory
|
|
156
|
+
/** The output directory. Relative paths are resolved against `context`. */
|
|
157
157
|
export type Path = string;
|
|
158
158
|
/** Tells Rspack to include comments in bundles with information about the contained modules. */
|
|
159
159
|
export type Pathinfo = boolean | 'verbose';
|
|
@@ -210,7 +210,7 @@ export type WorkerPublicPath = string;
|
|
|
210
210
|
/** Controls [Trusted Types](https://web.dev/articles/trusted-types) compatibility. */
|
|
211
211
|
export type TrustedTypes = {
|
|
212
212
|
/**
|
|
213
|
-
* The name of the Trusted Types policy created by
|
|
213
|
+
* The name of the Trusted Types policy created by Rspack to serve bundle chunks.
|
|
214
214
|
*/
|
|
215
215
|
policyName?: string;
|
|
216
216
|
/**
|
|
@@ -288,7 +288,7 @@ export type Environment = {
|
|
|
288
288
|
module?: boolean;
|
|
289
289
|
/**
|
|
290
290
|
* Determines if the node: prefix is generated for core module imports in environments that support it.
|
|
291
|
-
* This is only applicable to
|
|
291
|
+
* This is only applicable to Rspack runtime code.
|
|
292
292
|
* */
|
|
293
293
|
nodePrefixForCoreModules?: boolean;
|
|
294
294
|
/** The environment supports optional chaining ('obj?.a' or 'obj?.()'). */
|
|
@@ -298,7 +298,7 @@ export type Environment = {
|
|
|
298
298
|
};
|
|
299
299
|
export type Output = {
|
|
300
300
|
/**
|
|
301
|
-
* The output directory
|
|
301
|
+
* The output directory. Relative paths are resolved against `context`.
|
|
302
302
|
* @default path.resolve(process.cwd(), 'dist')
|
|
303
303
|
* */
|
|
304
304
|
path?: Path;
|
|
@@ -2241,13 +2241,13 @@ export type Watch = boolean;
|
|
|
2241
2241
|
export type WatchOptions = {
|
|
2242
2242
|
/**
|
|
2243
2243
|
* Add a delay before rebuilding once the first file changed.
|
|
2244
|
-
* This allows
|
|
2244
|
+
* This allows Rspack to aggregate any other changes made during this time period into one rebuild.
|
|
2245
2245
|
* @default 5
|
|
2246
2246
|
*/
|
|
2247
2247
|
aggregateTimeout?: number;
|
|
2248
2248
|
/**
|
|
2249
2249
|
* Follow symlinks while looking for files.
|
|
2250
|
-
* This is usually not needed as
|
|
2250
|
+
* This is usually not needed as Rspack already resolves symlinks ('resolve.symlinks' and 'resolve.alias').
|
|
2251
2251
|
*/
|
|
2252
2252
|
followSymlinks?: boolean;
|
|
2253
2253
|
/**
|
|
@@ -2306,13 +2306,13 @@ export type Performance = false | {
|
|
|
2306
2306
|
*/
|
|
2307
2307
|
hints?: false | 'warning' | 'error';
|
|
2308
2308
|
/**
|
|
2309
|
-
* File size limit (in bytes) when exceeded,
|
|
2310
|
-
* @default
|
|
2309
|
+
* File size limit (in bytes) when exceeded, Rspack will provide performance hints.
|
|
2310
|
+
* @default 307200 (300 KiB)
|
|
2311
2311
|
*/
|
|
2312
2312
|
maxAssetSize?: number;
|
|
2313
2313
|
/**
|
|
2314
2314
|
* Total size of an entry point (in bytes).
|
|
2315
|
-
* @default
|
|
2315
|
+
* @default 512000 (500 KiB)
|
|
2316
2316
|
*/
|
|
2317
2317
|
maxEntrypointSize?: number;
|
|
2318
2318
|
};
|
package/dist/exports.d.ts
CHANGED
|
@@ -57,9 +57,11 @@ export { LoaderOptionsPlugin } from './lib/LoaderOptionsPlugin';
|
|
|
57
57
|
export { LoaderTargetPlugin } from './lib/LoaderTargetPlugin';
|
|
58
58
|
export type { OutputFileSystem, WatchFileSystem } from './util/fs';
|
|
59
59
|
import { FetchCompileAsyncWasmPlugin, lazyCompilationMiddleware, rsc, SubresourceIntegrityPlugin } from './builtin-plugin';
|
|
60
|
+
import JsonpTemplatePlugin from './web/JsonpTemplatePlugin';
|
|
60
61
|
export { SubresourceIntegrityPlugin };
|
|
61
62
|
interface Web {
|
|
62
63
|
FetchCompileAsyncWasmPlugin: typeof FetchCompileAsyncWasmPlugin;
|
|
64
|
+
JsonpTemplatePlugin: typeof JsonpTemplatePlugin;
|
|
63
65
|
}
|
|
64
66
|
export declare const web: Web;
|
|
65
67
|
import { NodeTargetPlugin } from './builtin-plugin';
|
|
@@ -98,7 +100,7 @@ interface JavaScript {
|
|
|
98
100
|
JavascriptModulesPlugin: typeof JavascriptModulesPlugin;
|
|
99
101
|
}
|
|
100
102
|
export declare const javascript: JavaScript;
|
|
101
|
-
import
|
|
103
|
+
import WebWorkerTemplatePlugin from './webworker/WebWorkerTemplatePlugin';
|
|
102
104
|
interface Webworker {
|
|
103
105
|
WebWorkerTemplatePlugin: typeof WebWorkerTemplatePlugin;
|
|
104
106
|
}
|
package/dist/index.js
CHANGED
|
@@ -19501,51 +19501,10 @@ __webpack_require__.add({
|
|
|
19501
19501
|
};
|
|
19502
19502
|
},
|
|
19503
19503
|
"../../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() {
|
|
19504
|
+
exports.iD = function() {
|
|
19540
19505
|
return 'browser';
|
|
19541
19506
|
};
|
|
19542
|
-
|
|
19543
|
-
return '/tmp';
|
|
19544
|
-
};
|
|
19545
|
-
exports.EOL = '\n';
|
|
19546
|
-
exports.homedir = function() {
|
|
19547
|
-
return '/';
|
|
19548
|
-
};
|
|
19507
|
+
'\n';
|
|
19549
19508
|
},
|
|
19550
19509
|
"../../node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/utils/common.js" (__unused_rspack_module, exports) {
|
|
19551
19510
|
var TYPED_OK = "u" > typeof Uint8Array && "u" > typeof Uint16Array && "u" > typeof Int32Array;
|
|
@@ -24762,8 +24721,9 @@ __webpack_require__.add({
|
|
|
24762
24721
|
};
|
|
24763
24722
|
},
|
|
24764
24723
|
"../../node_modules/.pnpm/querystring-es3@0.2.1/node_modules/querystring-es3/index.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
24765
|
-
|
|
24766
|
-
|
|
24724
|
+
var __webpack_unused_export__;
|
|
24725
|
+
__webpack_unused_export__ = exports.qg = __webpack_require__("../../node_modules/.pnpm/querystring-es3@0.2.1/node_modules/querystring-es3/decode.js");
|
|
24726
|
+
__webpack_unused_export__ = __webpack_require__("../../node_modules/.pnpm/querystring-es3@0.2.1/node_modules/querystring-es3/encode.js");
|
|
24767
24727
|
},
|
|
24768
24728
|
"../../node_modules/.pnpm/randombytes@2.1.0/node_modules/randombytes/browser.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
24769
24729
|
var process = __webpack_require__("../../node_modules/.pnpm/process@0.11.10/node_modules/process/browser.js");
|
|
@@ -32069,8 +32029,8 @@ __webpack_require__.add({
|
|
|
32069
32029
|
const watchEventSource = __webpack_require__("../../node_modules/.pnpm/watchpack@2.4.4/node_modules/watchpack/lib/watchEventSource.js");
|
|
32070
32030
|
const EXISTANCE_ONLY_TIME_ENTRY = Object.freeze({});
|
|
32071
32031
|
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").
|
|
32032
|
+
const IS_OSX = "darwin" === __webpack_require__("../../node_modules/.pnpm/os-browserify@0.3.0/node_modules/os-browserify/browser.js").iD();
|
|
32033
|
+
const IS_WIN = "win32" === __webpack_require__("../../node_modules/.pnpm/os-browserify@0.3.0/node_modules/os-browserify/browser.js").iD();
|
|
32074
32034
|
const WATCHPACK_POLLING = process.env.WATCHPACK_POLLING;
|
|
32075
32035
|
const FORCE_POLLING = `${+WATCHPACK_POLLING}` === WATCHPACK_POLLING ? +WATCHPACK_POLLING : !!WATCHPACK_POLLING && "false" !== WATCHPACK_POLLING;
|
|
32076
32036
|
function withoutCase(str) {
|
|
@@ -32749,8 +32709,8 @@ __webpack_require__.add({
|
|
|
32749
32709
|
const path = __webpack_require__("../../node_modules/.pnpm/path-browserify@1.0.1/node_modules/path-browserify/index.js");
|
|
32750
32710
|
const { EventEmitter } = __webpack_require__("../../node_modules/.pnpm/events@3.3.0/node_modules/events/events.js");
|
|
32751
32711
|
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").
|
|
32712
|
+
const IS_OSX = "darwin" === __webpack_require__("../../node_modules/.pnpm/os-browserify@0.3.0/node_modules/os-browserify/browser.js").iD();
|
|
32713
|
+
const IS_WIN = "win32" === __webpack_require__("../../node_modules/.pnpm/os-browserify@0.3.0/node_modules/os-browserify/browser.js").iD();
|
|
32754
32714
|
const SUPPORTS_RECURSIVE_WATCHING = IS_OSX || IS_WIN;
|
|
32755
32715
|
const watcherLimit = +process.env.WATCHPACK_WATCHER_LIMIT || (IS_OSX ? 20 : 10000);
|
|
32756
32716
|
const recursiveWatcherLogging = !!process.env.WATCHPACK_RECURSIVE_WATCHER_LOGGING;
|
|
@@ -32983,9 +32943,6 @@ __webpack_require__.add({
|
|
|
32983
32943
|
execute();
|
|
32984
32944
|
}
|
|
32985
32945
|
};
|
|
32986
|
-
exports.getNumberOfWatchers = ()=>watcherCount;
|
|
32987
|
-
exports.createHandleChangeEvent = createHandleChangeEvent;
|
|
32988
|
-
exports.watcherLimit = watcherLimit;
|
|
32989
32946
|
},
|
|
32990
32947
|
"../../node_modules/.pnpm/watchpack@2.4.4/node_modules/watchpack/lib/watchpack.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
32991
32948
|
const getWatcherManager = __webpack_require__("../../node_modules/.pnpm/watchpack@2.4.4/node_modules/watchpack/lib/getWatcherManager.js");
|
|
@@ -35359,7 +35316,7 @@ __webpack_require__.add({
|
|
|
35359
35316
|
__webpack_require__.d(__webpack_exports__, {
|
|
35360
35317
|
Buffer: ()=>_napi_rs_wasm_runtime_fs__rspack_import_0.hp
|
|
35361
35318
|
});
|
|
35362
|
-
var _napi_rs_wasm_runtime_fs__rspack_import_0 = __webpack_require__("../../node_modules/.pnpm/@napi-rs+wasm-runtime@1.1.
|
|
35319
|
+
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
35320
|
},
|
|
35364
35321
|
"./src/browser/fs.ts" (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
35365
35322
|
__webpack_require__.r(__webpack_exports__);
|
|
@@ -35375,15 +35332,15 @@ __webpack_require__.add({
|
|
|
35375
35332
|
volume: ()=>volume,
|
|
35376
35333
|
watch: ()=>watch
|
|
35377
35334
|
});
|
|
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?
|
|
35335
|
+
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");
|
|
35336
|
+
var _rspack_binding__rspack_import_1 = __webpack_require__("@rspack/binding?5bb0");
|
|
35380
35337
|
const fs = _rspack_binding__rspack_import_1.__fs;
|
|
35381
35338
|
const volume = _rspack_binding__rspack_import_1.__volume;
|
|
35382
35339
|
const memfs = _napi_rs_wasm_runtime_fs__rspack_import_0.tO;
|
|
35383
35340
|
const { readFileSync, readdirSync, lstat, existsSync, readdir, watch } = fs;
|
|
35384
35341
|
const __rspack_default_export = fs;
|
|
35385
35342
|
},
|
|
35386
|
-
"@rspack/binding?
|
|
35343
|
+
"@rspack/binding?5bb0" (module) {
|
|
35387
35344
|
module.exports = __rspack_external__rspack_wasi_browser_js_bd433424;
|
|
35388
35345
|
},
|
|
35389
35346
|
"?7763" () {},
|
|
@@ -35403,7 +35360,7 @@ __webpack_require__.add({
|
|
|
35403
35360
|
return out;
|
|
35404
35361
|
};
|
|
35405
35362
|
},
|
|
35406
|
-
"../../node_modules/.pnpm/@napi-rs+wasm-runtime@1.1.
|
|
35363
|
+
"../../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
35364
|
__webpack_require__.d(__webpack_exports__, {
|
|
35408
35365
|
hp: ()=>Buffer,
|
|
35409
35366
|
tO: ()=>memfs
|
|
@@ -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
|
};
|
|
@@ -60032,13 +59989,6 @@ const SwcJsMinimizerRspackPlugin = base_create(external_rspack_wasi_browser_js_B
|
|
|
60032
59989
|
};
|
|
60033
59990
|
}, 'compilation');
|
|
60034
59991
|
const URLPlugin = base_create(external_rspack_wasi_browser_js_BuiltinPluginName.URLPlugin, ()=>{}, 'compilation');
|
|
60035
|
-
class WebWorkerTemplatePlugin extends RspackBuiltinPlugin {
|
|
60036
|
-
name = external_rspack_wasi_browser_js_BuiltinPluginName.WebWorkerTemplatePlugin;
|
|
60037
|
-
raw(compiler) {
|
|
60038
|
-
compiler.options.output.chunkLoading = "import-scripts";
|
|
60039
|
-
return createBuiltinPlugin(this.name, void 0);
|
|
60040
|
-
}
|
|
60041
|
-
}
|
|
60042
59992
|
class WorkerPlugin extends RspackBuiltinPlugin {
|
|
60043
59993
|
chunkLoading;
|
|
60044
59994
|
wasmLoading;
|
|
@@ -61363,6 +61313,7 @@ const mergeTargetProperties = (targetProperties)=>{
|
|
|
61363
61313
|
};
|
|
61364
61314
|
const getTargetsProperties = (targets, context)=>mergeTargetProperties(targets.map((t)=>getTargetProperties(t, context)));
|
|
61365
61315
|
var defaults_process = __webpack_require__("../../node_modules/.pnpm/process@0.11.10/node_modules/process/browser.js");
|
|
61316
|
+
const ERROR_PREFIX = 'Invalid Rspack configuration:';
|
|
61366
61317
|
const applyRspackOptionsDefaults = (options)=>{
|
|
61367
61318
|
F(options, 'context', ()=>defaults_process.cwd());
|
|
61368
61319
|
F(options, 'target', ()=>getDefaultTarget(options.context));
|
|
@@ -61774,6 +61725,10 @@ const applyOutputDefaults = (options, { context, targetProperties: tp, isAffecte
|
|
|
61774
61725
|
D(output, 'assetModuleFilename', '[hash][ext][query]');
|
|
61775
61726
|
D(output, 'webassemblyModuleFilename', '[hash].module.wasm');
|
|
61776
61727
|
D(output, 'compareBeforeEmit', true);
|
|
61728
|
+
if (output.path && !path_browserify_default().isAbsolute(output.path)) {
|
|
61729
|
+
if (!context) throw new Error(`${ERROR_PREFIX} "context" must be a non-empty absolute path when "output.path" is relative, get "${context ?? ''}".`);
|
|
61730
|
+
output.path = path_browserify_default().resolve(context, output.path);
|
|
61731
|
+
}
|
|
61777
61732
|
F(output, 'path', ()=>path_browserify_default().join(defaults_process.cwd(), 'dist'));
|
|
61778
61733
|
F(output, 'pathinfo', ()=>false);
|
|
61779
61734
|
D(output, 'publicPath', tp && (tp.document || tp.importScripts) ? 'auto' : '');
|
|
@@ -61884,7 +61839,7 @@ const applyOutputDefaults = (options, { context, targetProperties: tp, isAffecte
|
|
|
61884
61839
|
});
|
|
61885
61840
|
D(output, 'bundlerInfo', {});
|
|
61886
61841
|
if ('object' == typeof output.bundlerInfo) {
|
|
61887
|
-
D(output.bundlerInfo, 'version', "2.0.0
|
|
61842
|
+
D(output.bundlerInfo, 'version', "2.0.0");
|
|
61888
61843
|
D(output.bundlerInfo, 'bundler', 'rspack');
|
|
61889
61844
|
D(output.bundlerInfo, 'force', false);
|
|
61890
61845
|
}
|
|
@@ -61932,8 +61887,8 @@ const applyNodeDefaults = (node, { outputModule, targetProperties })=>{
|
|
|
61932
61887
|
};
|
|
61933
61888
|
const applyPerformanceDefaults = (performance, { production })=>{
|
|
61934
61889
|
if (false === performance) return;
|
|
61935
|
-
D(performance, 'maxAssetSize',
|
|
61936
|
-
D(performance, 'maxEntrypointSize',
|
|
61890
|
+
D(performance, 'maxAssetSize', 307200);
|
|
61891
|
+
D(performance, 'maxEntrypointSize', 512000);
|
|
61937
61892
|
F(performance, 'hints', ()=>production ? 'warning' : false);
|
|
61938
61893
|
};
|
|
61939
61894
|
const applyOptimizationDefaults = (optimization, { production, development })=>{
|
|
@@ -63542,7 +63497,7 @@ class MultiStats {
|
|
|
63542
63497
|
return obj;
|
|
63543
63498
|
});
|
|
63544
63499
|
if (childOptions.version) {
|
|
63545
|
-
obj.rspackVersion = "2.0.0
|
|
63500
|
+
obj.rspackVersion = "2.0.0";
|
|
63546
63501
|
obj.version = "5.75.0";
|
|
63547
63502
|
}
|
|
63548
63503
|
if (childOptions.hash) obj.hash = obj.children.map((j)=>j.hash).join('');
|
|
@@ -65245,7 +65200,7 @@ const SIMPLE_EXTRACTORS = {
|
|
|
65245
65200
|
},
|
|
65246
65201
|
version: (object)=>{
|
|
65247
65202
|
object.version = "5.75.0";
|
|
65248
|
-
object.rspackVersion = "2.0.0
|
|
65203
|
+
object.rspackVersion = "2.0.0";
|
|
65249
65204
|
},
|
|
65250
65205
|
env: (object, _compilation, _context, { _env })=>{
|
|
65251
65206
|
object.env = _env;
|
|
@@ -66909,17 +66864,14 @@ class RspackOptionsApply {
|
|
|
66909
66864
|
compiler.hooks.afterResolvers.call(compiler);
|
|
66910
66865
|
}
|
|
66911
66866
|
}
|
|
66912
|
-
const
|
|
66867
|
+
const validateConfig_ERROR_PREFIX = 'Invalid Rspack configuration:';
|
|
66913
66868
|
const validateContext = ({ context })=>{
|
|
66914
|
-
if (context && !(0, path_browserify.isAbsolute)(context)) throw new Error(`${
|
|
66915
|
-
};
|
|
66916
|
-
const validateOutputPath = ({ output })=>{
|
|
66917
|
-
if (output?.path && !(0, path_browserify.isAbsolute)(output.path)) throw new Error(`${ERROR_PREFIX} "output.path" must be an absolute path, get "${output.path}".`);
|
|
66869
|
+
if (context && !(0, path_browserify.isAbsolute)(context)) throw new Error(`${validateConfig_ERROR_PREFIX} "context" must be an absolute path, get "${context}".`);
|
|
66918
66870
|
};
|
|
66919
66871
|
const validateSplitChunks = ({ optimization })=>{
|
|
66920
66872
|
if (optimization?.splitChunks) {
|
|
66921
66873
|
const { minChunks } = optimization.splitChunks;
|
|
66922
|
-
if (void 0 !== minChunks && minChunks < 1) throw new Error(`${
|
|
66874
|
+
if (void 0 !== minChunks && minChunks < 1) throw new Error(`${validateConfig_ERROR_PREFIX} "optimization.splitChunks.minChunks" must be greater than or equal to 1, get \`${minChunks}\`.`);
|
|
66923
66875
|
}
|
|
66924
66876
|
};
|
|
66925
66877
|
const validateExternalUmd = ({ output, externals, externalsType })=>{
|
|
@@ -66938,14 +66890,13 @@ const validateExternalUmd = ({ output, externals, externalsType })=>{
|
|
|
66938
66890
|
'commonjs2',
|
|
66939
66891
|
'amd'
|
|
66940
66892
|
];
|
|
66941
|
-
if (requiredKeys.some((key)=>void 0 === value[key])) throw new Error(`${
|
|
66893
|
+
if (requiredKeys.some((key)=>void 0 === value[key])) throw new Error(`${validateConfig_ERROR_PREFIX} External object must have "root", "commonjs", "commonjs2", "amd" properties when "libraryType" or "externalsType" is "umd", get: ${JSON.stringify(value, null, 2)}.`);
|
|
66942
66894
|
};
|
|
66943
66895
|
if (Array.isArray(externals)) externals.forEach((external)=>checkExternalItem(external));
|
|
66944
66896
|
else checkExternalItem(externals);
|
|
66945
66897
|
};
|
|
66946
66898
|
function validateRspackConfig(config) {
|
|
66947
66899
|
validateContext(config);
|
|
66948
|
-
validateOutputPath(config);
|
|
66949
66900
|
validateSplitChunks(config);
|
|
66950
66901
|
validateExternalUmd(config);
|
|
66951
66902
|
}
|
|
@@ -68488,7 +68439,7 @@ class Compiler {
|
|
|
68488
68439
|
const rawOptions = getRawOptions(options, this);
|
|
68489
68440
|
rawOptions.__references = Object.fromEntries(this.#ruleSet.builtinReferences.entries());
|
|
68490
68441
|
rawOptions.__virtual_files = VirtualModulesPlugin.__internal__take_virtual_files(this);
|
|
68491
|
-
const instanceBinding = __webpack_require__("@rspack/binding?
|
|
68442
|
+
const instanceBinding = __webpack_require__("@rspack/binding?5bb0");
|
|
68492
68443
|
this.#registers = this.#createHooksRegisters();
|
|
68493
68444
|
const inputFileSystem = this.inputFileSystem && ThreadsafeInputNodeFS.needsBinding(options.experiments.useInputFileSystem) ? ThreadsafeInputNodeFS.__to_binding(this.inputFileSystem) : void 0;
|
|
68494
68445
|
try {
|
|
@@ -68874,6 +68825,13 @@ class LoaderTargetPlugin {
|
|
|
68874
68825
|
});
|
|
68875
68826
|
}
|
|
68876
68827
|
}
|
|
68828
|
+
class JsonpTemplatePlugin {
|
|
68829
|
+
apply(compiler) {
|
|
68830
|
+
compiler.options.output.chunkLoading = 'jsonp';
|
|
68831
|
+
new ArrayPushCallbackChunkFormatPlugin().apply(compiler);
|
|
68832
|
+
new EnableChunkLoadingPlugin('jsonp').apply(compiler);
|
|
68833
|
+
}
|
|
68834
|
+
}
|
|
68877
68835
|
class NodeTemplatePlugin {
|
|
68878
68836
|
_options;
|
|
68879
68837
|
constructor(_options = {}){
|
|
@@ -68886,6 +68844,13 @@ class NodeTemplatePlugin {
|
|
|
68886
68844
|
new EnableChunkLoadingPlugin(chunkLoading).apply(compiler);
|
|
68887
68845
|
}
|
|
68888
68846
|
}
|
|
68847
|
+
class WebWorkerTemplatePlugin {
|
|
68848
|
+
apply(compiler) {
|
|
68849
|
+
compiler.options.output.chunkLoading = "import-scripts";
|
|
68850
|
+
new ArrayPushCallbackChunkFormatPlugin().apply(compiler);
|
|
68851
|
+
new EnableChunkLoadingPlugin("import-scripts").apply(compiler);
|
|
68852
|
+
}
|
|
68853
|
+
}
|
|
68889
68854
|
const options_process = (options, normalizeSimple, normalizeOptions, fn)=>{
|
|
68890
68855
|
const array = (items)=>{
|
|
68891
68856
|
for (const item of items)if ('string' == typeof item) fn(item, normalizeSimple(item, item));
|
|
@@ -69732,7 +69697,7 @@ class ModuleFederationPlugin {
|
|
|
69732
69697
|
this._options = _options;
|
|
69733
69698
|
}
|
|
69734
69699
|
apply(compiler) {
|
|
69735
|
-
const {
|
|
69700
|
+
const { rspack } = compiler;
|
|
69736
69701
|
const paths = getPaths(this._options, compiler);
|
|
69737
69702
|
compiler.options.resolve.alias = {
|
|
69738
69703
|
'@module-federation/runtime-tools': paths.runtimeTools,
|
|
@@ -69789,7 +69754,7 @@ class ModuleFederationPlugin {
|
|
|
69789
69754
|
shared: this._options.shared,
|
|
69790
69755
|
enhanced: true
|
|
69791
69756
|
};
|
|
69792
|
-
new
|
|
69757
|
+
new rspack.container.ModuleFederationPluginV1(v1Options).apply(compiler);
|
|
69793
69758
|
if (this._options.manifest) new ModuleFederationManifestPlugin(this._options).apply(compiler);
|
|
69794
69759
|
}
|
|
69795
69760
|
}
|
|
@@ -70064,7 +70029,7 @@ function transformSync(source, options) {
|
|
|
70064
70029
|
const _options = JSON.stringify(options || {});
|
|
70065
70030
|
return rspack_wasi_browser.transformSync(source, _options);
|
|
70066
70031
|
}
|
|
70067
|
-
const exports_rspackVersion = "2.0.0
|
|
70032
|
+
const exports_rspackVersion = "2.0.0";
|
|
70068
70033
|
const exports_version = "5.75.0";
|
|
70069
70034
|
const exports_WebpackError = Error;
|
|
70070
70035
|
const exports_config = {
|
|
@@ -70078,7 +70043,8 @@ const util = {
|
|
|
70078
70043
|
cleverMerge: cachedCleverMerge
|
|
70079
70044
|
};
|
|
70080
70045
|
const web = {
|
|
70081
|
-
FetchCompileAsyncWasmPlugin: FetchCompileAsyncWasmPlugin
|
|
70046
|
+
FetchCompileAsyncWasmPlugin: FetchCompileAsyncWasmPlugin,
|
|
70047
|
+
JsonpTemplatePlugin: JsonpTemplatePlugin
|
|
70082
70048
|
};
|
|
70083
70049
|
const exports_node = {
|
|
70084
70050
|
NodeTargetPlugin: NodeTargetPlugin,
|
package/dist/napi-binding.d.ts
CHANGED
|
@@ -549,7 +549,6 @@ export declare enum BuiltinPluginName {
|
|
|
549
549
|
HotModuleReplacementPlugin = 'HotModuleReplacementPlugin',
|
|
550
550
|
LimitChunkCountPlugin = 'LimitChunkCountPlugin',
|
|
551
551
|
WorkerPlugin = 'WorkerPlugin',
|
|
552
|
-
WebWorkerTemplatePlugin = 'WebWorkerTemplatePlugin',
|
|
553
552
|
MergeDuplicateChunksPlugin = 'MergeDuplicateChunksPlugin',
|
|
554
553
|
SplitChunksPlugin = 'SplitChunksPlugin',
|
|
555
554
|
RemoveDuplicateModulesPlugin = 'RemoveDuplicateModulesPlugin',
|
|
@@ -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
|
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The following code is modified based on
|
|
3
|
+
* https://github.com/webpack/webpack/blob/4b4ca3b/lib/web/JsonpTemplatePlugin.js
|
|
4
|
+
*
|
|
5
|
+
* MIT Licensed
|
|
6
|
+
* Author Tobias Koppers @sokra
|
|
7
|
+
* Copyright (c) JS Foundation and other contributors
|
|
8
|
+
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
|
+
*/
|
|
10
|
+
import type { Compiler } from '../Compiler';
|
|
11
|
+
export default class JsonpTemplatePlugin {
|
|
12
|
+
apply(compiler: Compiler): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The following code is modified based on
|
|
3
|
+
* https://github.com/webpack/webpack/blob/4b4ca3b/lib/webworker/WebWorkerTemplatePlugin.js
|
|
4
|
+
*
|
|
5
|
+
* MIT Licensed
|
|
6
|
+
* Author Tobias Koppers @sokra
|
|
7
|
+
* Copyright (c) JS Foundation and other contributors
|
|
8
|
+
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
|
+
*/
|
|
10
|
+
import type { Compiler } from '../Compiler';
|
|
11
|
+
export default class WebWorkerTemplatePlugin {
|
|
12
|
+
apply(compiler: Compiler): void;
|
|
13
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspack-debug/browser",
|
|
3
|
-
"version": "2.0.0
|
|
3
|
+
"version": "2.0.0",
|
|
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",
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type BuiltinPlugin, BuiltinPluginName } from '../binding';
|
|
2
|
-
import type { Compiler } from '../Compiler';
|
|
3
|
-
import { RspackBuiltinPlugin } from './base';
|
|
4
|
-
export declare class WebWorkerTemplatePlugin extends RspackBuiltinPlugin {
|
|
5
|
-
name: BuiltinPluginName;
|
|
6
|
-
raw(compiler: Compiler): BuiltinPlugin | undefined;
|
|
7
|
-
}
|