@rspack-canary/core 1.5.8-canary-e88f22dc-20250928174002 → 1.5.9-canary-61eba72c-20250930173821

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.
@@ -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;
@@ -11,8 +11,8 @@
11
11
  * @template T
12
12
  */
13
13
  declare class ArrayQueue<T> {
14
- _list: Array<T>;
15
- _listReversed: Array<T>;
14
+ _list: T[];
15
+ _listReversed: T[];
16
16
  constructor(items?: T[]);
17
17
  /**
18
18
  * Returns the number of elements in this queue.
@@ -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: Array<Comparator>) => Comparator;
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
- let match = this.stack.split("\n")[3].match(CURRENT_METHOD_REGEXP);
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
- let exports1 = instance.exports;
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 && (args1 = args, !(raw = !!currentLoaderObject.raw) && args1[0] instanceof Uint8Array ? args1[0] = function(buf) {
893
- let str = decoder.decode(buf.buffer instanceof SharedArrayBuffer ? Buffer.from(buf) : buf);
894
- return 0xfeff === str.charCodeAt(0) ? str.slice(1) : str;
895
- }(args1[0]) : raw && "string" == typeof args1[0] && (args1[0] = Buffer.from(args1[0], "utf-8")), raw && args1[0] instanceof Uint8Array && !Buffer.isBuffer(args1[0]) && (args1[0] = Buffer.from(args1[0].buffer)), args = await utils_runSyncOrAsync(fn, loaderContext, args) || []);
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 sendRequest1 = function(workerPort, workerSyncPort) {
921
- var workerSyncPort1;
922
- let sendRequest = (requestType, ...args)=>{
923
- let id = nextId++;
924
- workerPort.postMessage({
925
- type: "request",
926
- id,
927
- requestType,
928
- data: args
929
- });
930
- let result = new Promise((resolve, reject)=>{
931
- responseCallbacks[id] = (err, data)=>{
932
- if (err) return void reject(err);
933
- resolve(data);
934
- };
935
- });
936
- return result.wait = ()=>sendRequest.sync("WaitForPendingRequest", id), result.id = id, result;
937
- };
938
- return sendRequest.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
- }), 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, sendRequest1, waitFor).then(async (data)=>{
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.8-canary-e88f22dc-20250928174002",
3
+ "version": "1.5.9-canary-61eba72c-20250930173821",
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.13.2",
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",
@@ -58,9 +58,9 @@
58
58
  "zod-validation-error": "3.5.3"
59
59
  },
60
60
  "dependencies": {
61
- "@module-federation/runtime-tools": "0.18.0",
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.8-canary-e88f22dc-20250928174002"
63
+ "@rspack/binding": "npm:@rspack-canary/binding@1.5.9-canary-61eba72c-20250930173821"
64
64
  },
65
65
  "peerDependencies": {
66
66
  "@swc/helpers": ">=0.5.1"