@rspack-canary/core 1.5.9-canary-740cd963-20250929173807 → 1.5.9-canary-61eba72c-20251001174057
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/Compilation.d.ts +2 -2
- package/dist/MultiCompiler.d.ts +1 -1
- package/dist/builtin-loader/swc/pluginImport.d.ts +2 -2
- package/dist/builtin-plugin/CircularDependencyRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DefinePlugin.d.ts +1 -1
- package/dist/builtin-plugin/RsdoctorPlugin.d.ts +2 -2
- package/dist/builtin-plugin/html-plugin/plugin.d.ts +1 -1
- package/dist/config/adapterRuleUse.d.ts +4 -1
- package/dist/config/devServer.d.ts +4 -4
- package/dist/config/normalization.d.ts +3 -3
- package/dist/config/types.d.ts +31 -5
- package/dist/cssExtractHmr.js +7 -8
- package/dist/cssExtractLoader.js +4 -5
- package/dist/index.js +617 -637
- package/dist/stats/statsFactoryUtils.d.ts +17 -0
- package/dist/util/ArrayQueue.d.ts +2 -2
- package/dist/util/comparators.d.ts +1 -1
- package/dist/worker.js +44 -45
- package/package.json +3 -3
|
@@ -169,8 +169,25 @@ export type KnownStatsError = {
|
|
|
169
169
|
chunkName?: string;
|
|
170
170
|
chunkEntry?: boolean;
|
|
171
171
|
chunkInitial?: boolean;
|
|
172
|
+
/**
|
|
173
|
+
* A custom filename associated with this error/warning.
|
|
174
|
+
*/
|
|
172
175
|
file?: string;
|
|
176
|
+
/**
|
|
177
|
+
* The identifier of the module related to this error/warning.
|
|
178
|
+
* Usually an absolute path, may include inline loader requests.
|
|
179
|
+
* @example
|
|
180
|
+
* - `/path/to/project/src/index.js`
|
|
181
|
+
* - `!builtin:react-refresh-loader!/path/to/project/src/index.css`
|
|
182
|
+
*/
|
|
173
183
|
moduleIdentifier?: string;
|
|
184
|
+
/**
|
|
185
|
+
* The readable name of the module related to this error/warning.
|
|
186
|
+
* Usually a relative path, no inline loader requests.
|
|
187
|
+
* @example
|
|
188
|
+
* - `"./src/index.js"`
|
|
189
|
+
* - `"./src/index.css"`
|
|
190
|
+
*/
|
|
174
191
|
moduleName?: string;
|
|
175
192
|
loc?: string;
|
|
176
193
|
chunkId?: string | number;
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
export type Comparator = <T>(arg0: T, arg1: T) => -1 | 0 | 1;
|
|
11
11
|
type Selector<A, B> = (input: A) => B;
|
|
12
|
-
export declare const concatComparators: (...comps:
|
|
12
|
+
export declare const concatComparators: (...comps: Comparator[]) => Comparator;
|
|
13
13
|
export declare const compareIds: <T = string | number>(a: T, b: T) => -1 | 0 | 1;
|
|
14
14
|
export declare const compareSelect: <T, R>(getter: Selector<T, R>, comparator: Comparator) => Comparator;
|
|
15
15
|
export declare const compareNumbers: (a: number, b: number) => 0 | 1 | -1;
|
package/dist/worker.js
CHANGED
|
@@ -232,7 +232,7 @@ var __webpack_modules__ = {
|
|
|
232
232
|
class Message extends Error {
|
|
233
233
|
constructor(){
|
|
234
234
|
super(), this.stack = void 0, Error.captureStackTrace(this);
|
|
235
|
-
|
|
235
|
+
const match = this.stack.split("\n")[3].match(CURRENT_METHOD_REGEXP);
|
|
236
236
|
this.message = match?.[1] ? createMessage(match[1]) : createMessage();
|
|
237
237
|
}
|
|
238
238
|
}
|
|
@@ -258,7 +258,7 @@ var __webpack_modules__ = {
|
|
|
258
258
|
chunkSize;
|
|
259
259
|
digestSize;
|
|
260
260
|
constructor(instance, instancesPool, chunkSize, digestSize){
|
|
261
|
-
|
|
261
|
+
const exports1 = instance.exports;
|
|
262
262
|
exports1.init(), this.exports = exports1, this.mem = Buffer.from(exports1.memory.buffer, 0, 65536), this.buffered = 0, this.instancesPool = instancesPool, this.chunkSize = chunkSize, this.digestSize = digestSize;
|
|
263
263
|
}
|
|
264
264
|
reset() {
|
|
@@ -878,9 +878,9 @@ for(var __webpack_i__ in (()=>{
|
|
|
878
878
|
currentLoaderObject.loaderItem.data
|
|
879
879
|
]) || []).some((value)=>void 0 !== value)) break;
|
|
880
880
|
}
|
|
881
|
+
break;
|
|
881
882
|
case binding_.JsLoaderState.Normal:
|
|
882
883
|
for(; loaderContext.loaderIndex >= 0;){
|
|
883
|
-
var args1, raw;
|
|
884
884
|
let currentLoaderObject = loaderContext.loaders[loaderContext.loaderIndex];
|
|
885
885
|
if (shouldYieldToMainThread(currentLoaderObject)) break;
|
|
886
886
|
if (currentLoaderObject.normalExecuted) {
|
|
@@ -889,10 +889,14 @@ for(var __webpack_i__ in (()=>{
|
|
|
889
889
|
}
|
|
890
890
|
await loadLoaderAsync(currentLoaderObject, loaderContext._compiler);
|
|
891
891
|
let fn = currentLoaderObject.normal;
|
|
892
|
-
currentLoaderObject.normalExecuted = !0, fn && (
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
892
|
+
currentLoaderObject.normalExecuted = !0, fn && (!function(args, raw) {
|
|
893
|
+
if (!raw && args[0] instanceof Uint8Array) {
|
|
894
|
+
var buf;
|
|
895
|
+
let str;
|
|
896
|
+
args[0] = (buf = args[0], 0xfeff === (str = decoder.decode(buf.buffer instanceof SharedArrayBuffer ? Buffer.from(buf) : buf)).charCodeAt(0) ? str.slice(1) : str);
|
|
897
|
+
} else raw && "string" == typeof args[0] && (args[0] = Buffer.from(args[0], "utf-8"));
|
|
898
|
+
raw && args[0] instanceof Uint8Array && !Buffer.isBuffer(args[0]) && (args[0] = Buffer.from(args[0].buffer));
|
|
899
|
+
}(args, !!currentLoaderObject.raw), args = await utils_runSyncOrAsync(fn, loaderContext, args) || []);
|
|
896
900
|
}
|
|
897
901
|
}
|
|
898
902
|
return sendRequest("UpdateLoaderObjects", loaderContext.loaders.map((item)=>({
|
|
@@ -914,47 +918,42 @@ for(var __webpack_i__ in (()=>{
|
|
|
914
918
|
}
|
|
915
919
|
}
|
|
916
920
|
let loader_runner_worker = function(workerOptions) {
|
|
917
|
-
var sendRequest;
|
|
918
|
-
let workerData = workerOptions.workerData;
|
|
921
|
+
var workerPort, workerSyncPort, sendRequest, workerSyncPort1;
|
|
922
|
+
let sendRequest1, workerData = workerOptions.workerData;
|
|
919
923
|
delete workerOptions.workerData, workerData.workerPort.on("message", handleIncomingResponses);
|
|
920
|
-
let
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
if (id !== message.id) throw Error(`Unexpected response id: ${message.id}, expected: ${id}`);
|
|
951
|
-
if (isWorkerResponseMessage(message)) return message.data;
|
|
952
|
-
throw message.error;
|
|
953
|
-
}), sendRequest;
|
|
954
|
-
}(workerData.workerPort, workerData.workerSyncPort), waitFor = (sendRequest = sendRequest1, (requests)=>sendRequest.sync("WaitForPendingRequest", (Array.isArray(requests) ? requests : [
|
|
924
|
+
let sendRequest2 = (workerPort = workerData.workerPort, workerSyncPort = workerData.workerSyncPort, (sendRequest1 = (requestType, ...args)=>{
|
|
925
|
+
let id = nextId++;
|
|
926
|
+
workerPort.postMessage({
|
|
927
|
+
type: "request",
|
|
928
|
+
id,
|
|
929
|
+
requestType,
|
|
930
|
+
data: args
|
|
931
|
+
});
|
|
932
|
+
let result = new Promise((resolve, reject)=>{
|
|
933
|
+
responseCallbacks[id] = (err, data)=>{
|
|
934
|
+
err ? reject(err) : resolve(data);
|
|
935
|
+
};
|
|
936
|
+
});
|
|
937
|
+
return result.wait = ()=>sendRequest1.sync("WaitForPendingRequest", id), result.id = id, result;
|
|
938
|
+
}).sync = (workerSyncPort1 = workerSyncPort, (requestType, ...args)=>{
|
|
939
|
+
let id = nextId++, sharedBuffer = new SharedArrayBuffer(8), sharedBufferView = new Int32Array(sharedBuffer);
|
|
940
|
+
workerSyncPort1.postMessage({
|
|
941
|
+
type: "request-sync",
|
|
942
|
+
id,
|
|
943
|
+
requestType,
|
|
944
|
+
data: args,
|
|
945
|
+
sharedBuffer
|
|
946
|
+
});
|
|
947
|
+
let status = Atomics.wait(sharedBufferView, 0, 0);
|
|
948
|
+
if ("ok" !== status && "not-equal" !== status) throw Error(`Internal error: Atomics.wait() failed: ${status}`);
|
|
949
|
+
let { message } = (0, external_node_worker_threads_namespaceObject.receiveMessageOnPort)(workerSyncPort1);
|
|
950
|
+
if (id !== message.id) throw Error(`Unexpected response id: ${message.id}, expected: ${id}`);
|
|
951
|
+
if (isWorkerResponseMessage(message)) return message.data;
|
|
952
|
+
throw message.error;
|
|
953
|
+
}), sendRequest1), waitFor = (sendRequest = sendRequest2, (requests)=>sendRequest.sync("WaitForPendingRequest", (Array.isArray(requests) ? requests : [
|
|
955
954
|
requests
|
|
956
955
|
]).map((request)=>request.id)));
|
|
957
|
-
loaderImpl(workerOptions,
|
|
956
|
+
loaderImpl(workerOptions, sendRequest2, waitFor).then(async (data)=>{
|
|
958
957
|
workerData.workerPort.postMessage({
|
|
959
958
|
type: "done",
|
|
960
959
|
data
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspack-canary/core",
|
|
3
|
-
"version": "1.5.9-canary-
|
|
3
|
+
"version": "1.5.9-canary-61eba72c-20251001174057",
|
|
4
4
|
"webpackVersion": "5.75.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "The fast Rust-based web bundler with webpack-compatible API",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@ast-grep/napi": "^0.39.5",
|
|
41
41
|
"@rsbuild/plugin-node-polyfill": "^1.4.2",
|
|
42
|
-
"@rslib/core": "0.
|
|
42
|
+
"@rslib/core": "0.15.0",
|
|
43
43
|
"@swc/types": "0.1.25",
|
|
44
44
|
"@types/graceful-fs": "4.1.9",
|
|
45
45
|
"@types/watchpack": "^2.4.4",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"dependencies": {
|
|
61
61
|
"@module-federation/runtime-tools": "0.19.1",
|
|
62
62
|
"@rspack/lite-tapable": "1.0.1",
|
|
63
|
-
"@rspack/binding": "npm:@rspack-canary/binding@1.5.9-canary-
|
|
63
|
+
"@rspack/binding": "npm:@rspack-canary/binding@1.5.9-canary-61eba72c-20251001174057"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
66
|
"@swc/helpers": ">=0.5.1"
|