@rspack/core 1.3.14 → 1.4.0-beta.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.
Files changed (53) hide show
  1. package/compiled/@swc/types/index.d.ts +18 -2
  2. package/compiled/@swc/types/package.json +1 -1
  3. package/compiled/tinypool/README.md +4 -196
  4. package/compiled/tinypool/dist/common-Qw-RoVFD.js +28 -0
  5. package/compiled/tinypool/dist/entry/process.d.ts +1 -2
  6. package/compiled/tinypool/dist/entry/process.js +63 -83
  7. package/compiled/tinypool/dist/entry/utils.d.ts +3 -1
  8. package/compiled/tinypool/dist/entry/utils.js +3 -9
  9. package/compiled/tinypool/dist/entry/worker.d.ts +1 -2
  10. package/compiled/tinypool/dist/entry/worker.js +66 -94
  11. package/compiled/tinypool/dist/index.d.ts +132 -125
  12. package/compiled/tinypool/dist/index.js +771 -1035
  13. package/compiled/tinypool/dist/utils-B--2TaWv.js +38 -0
  14. package/compiled/tinypool/dist/utils-De75vAgL.js +10 -0
  15. package/compiled/tinypool/package.json +6 -22
  16. package/compiled/webpack-sources/index.js +112 -132
  17. package/compiled/webpack-sources/package.json +1 -1
  18. package/compiled/webpack-sources/types.d.ts +8 -6
  19. package/compiled/zod/dist/types/v4/classic/schemas.d.ts +19 -14
  20. package/compiled/zod/dist/types/v4/core/api.d.ts +5 -4
  21. package/compiled/zod/dist/types/v4/core/checks.d.ts +1 -1
  22. package/compiled/zod/dist/types/v4/core/core.d.ts +1 -1
  23. package/compiled/zod/dist/types/v4/core/registries.d.ts +3 -1
  24. package/compiled/zod/dist/types/v4/core/schemas.d.ts +33 -39
  25. package/compiled/zod/dist/types/v4/core/to-json-schema.d.ts +2 -2
  26. package/compiled/zod/dist/types/v4/core/util.d.ts +1 -1
  27. package/compiled/zod/dist/types/v4/locales/index.d.ts +1 -0
  28. package/compiled/zod/dist/types/v4/locales/ps.d.ts +4 -0
  29. package/compiled/zod/dist/types/v4/mini/schemas.d.ts +77 -125
  30. package/compiled/zod/index.js +33 -33
  31. package/compiled/zod/package.json +1 -1
  32. package/dist/BuildInfo.d.ts +17 -0
  33. package/dist/FileSystem.d.ts +26 -3
  34. package/dist/Module.d.ts +1 -13
  35. package/dist/Resolver.d.ts +2 -1
  36. package/dist/builtin-loader/swc/types.d.ts +255 -255
  37. package/dist/config/devServer.d.ts +10 -10
  38. package/dist/config/normalization.d.ts +1 -0
  39. package/dist/config/types.d.ts +10 -1
  40. package/dist/config/utils.d.ts +1 -0
  41. package/dist/config/zod.d.ts +1638 -1068
  42. package/dist/cssExtractLoader.js +5 -5
  43. package/dist/exports.d.ts +2 -1
  44. package/dist/index.js +550 -473
  45. package/dist/loader-runner/index.d.ts +0 -9
  46. package/dist/trace/index.d.ts +16 -18
  47. package/dist/worker.js +2 -2
  48. package/module.d.ts +1 -1
  49. package/package.json +9 -9
  50. package/compiled/tinypool/dist/chunk-6LX4VMOV.js +0 -31
  51. package/compiled/tinypool/dist/chunk-ACQHDOFQ.js +0 -12
  52. package/compiled/tinypool/dist/chunk-E2J7JLFN.js +0 -53
  53. package/compiled/tinypool/dist/chunk-UBWFVGJX.js +0 -38
@@ -1,12 +1,3 @@
1
- /**
2
- * The following code is modified based on
3
- * https://github.com/webpack/loader-runner
4
- *
5
- * MIT Licensed
6
- * Author Tobias Koppers @sokra
7
- * Copyright (c) JS Foundation and other contributors
8
- * https://github.com/webpack/loader-runner/blob/main/LICENSE
9
- */
10
1
  import { type JsLoaderContext, type JsLoaderItem } from "@rspack/binding";
11
2
  import type { Compiler } from "../Compiler";
12
3
  export declare class LoaderObject {
@@ -1,27 +1,26 @@
1
1
  export interface ChromeEvent {
2
2
  name: string;
3
- ph?: string;
4
- cat?: string;
5
- ts?: number;
6
- pid?: number | string;
7
- tid?: number | string;
8
- id?: number | string;
3
+ trackName?: string;
4
+ ph: "b" | "e" | "X" | "P";
5
+ processName?: string;
6
+ categories?: string[];
7
+ uuid: number;
8
+ ts: bigint;
9
9
  args?: {
10
10
  [key: string]: any;
11
11
  };
12
- id2?: {
13
- local?: string;
14
- global?: string;
15
- };
16
12
  }
13
+ type MakeOptional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
14
+ type PartialChromeEvent = MakeOptional<ChromeEvent, "ts" | "ph">;
17
15
  export declare class JavaScriptTracer {
18
- static startTime: number;
16
+ static startTime: bigint;
19
17
  static events: ChromeEvent[];
20
18
  static layer: string;
21
19
  static output: string;
22
20
  static session: import("node:inspector").Session;
23
- static counter: number;
21
+ private static counter;
24
22
  static initJavaScriptTrace(layer: string, output: string): Promise<void>;
23
+ static uuid(): number;
25
24
  static initCpuProfiler(): void;
26
25
  /**
27
26
  *
@@ -29,14 +28,13 @@ export declare class JavaScriptTracer {
29
28
  * @returns
30
29
  */
31
30
  static cleanupJavaScriptTrace(): Promise<void>;
32
- static getTs(): number;
31
+ static getTs(): bigint;
33
32
  static getCommonEv(): {
34
- tid: number;
35
- pid: number;
36
- ts: number;
33
+ ts: bigint;
37
34
  cat: string;
38
35
  };
39
36
  static pushEvent(event: ChromeEvent): void;
40
- static startAsync(events: ChromeEvent): void;
41
- static endAsync(events: ChromeEvent): void;
37
+ static startAsync(events: PartialChromeEvent): void;
38
+ static endAsync(events: PartialChromeEvent): void;
42
39
  }
40
+ export {};
package/dist/worker.js CHANGED
@@ -186,7 +186,7 @@ var __webpack_modules__ = {
186
186
  let external_node_crypto_namespaceObject = require("node:crypto");
187
187
  var _computedKey, external_node_crypto_default = __webpack_require__.n(external_node_crypto_namespaceObject);
188
188
  _computedKey = __webpack_require__("node:util").inspect.custom;
189
- let WebpackError = class extends Error {
189
+ let lib_WebpackError = class extends Error {
190
190
  loc;
191
191
  file;
192
192
  chunk;
@@ -207,7 +207,7 @@ var __webpack_modules__ = {
207
207
  this.message = match?.[1] ? createMessage(match[1]) : createMessage();
208
208
  }
209
209
  }
210
- class AbstractMethodError extends WebpackError {
210
+ class AbstractMethodError extends lib_WebpackError {
211
211
  constructor(){
212
212
  super(new Message().message), this.name = "AbstractMethodError";
213
213
  }
package/module.d.ts CHANGED
@@ -211,7 +211,7 @@ declare namespace Rspack {
211
211
  interface Process {
212
212
  env: {
213
213
  [key: string]: any;
214
- NODE_ENV: 'development' | 'production' | (string & {});
214
+ NODE_ENV: "development" | "production" | (string & {});
215
215
  };
216
216
  }
217
217
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/core",
3
- "version": "1.3.14",
3
+ "version": "1.4.0-beta.0",
4
4
  "webpackVersion": "5.75.0",
5
5
  "license": "MIT",
6
6
  "description": "The fast Rust-based web bundler with webpack-compatible API",
@@ -37,27 +37,27 @@
37
37
  "directory": "packages/rspack"
38
38
  },
39
39
  "devDependencies": {
40
- "@rslib/core": "0.9.1",
41
- "@swc/core": "1.11.29",
42
- "@swc/types": "0.1.21",
40
+ "@rslib/core": "0.9.2",
41
+ "@swc/core": "1.12.0",
42
+ "@swc/types": "0.1.22",
43
43
  "@types/graceful-fs": "4.1.9",
44
44
  "@types/watchpack": "^2.4.4",
45
45
  "browserslist-load-config": "^1.0.0",
46
46
  "enhanced-resolve": "5.18.1",
47
47
  "graceful-fs": "^4.2.11",
48
48
  "prebundle": "^1.3.3",
49
- "tinypool": "^1.0.2",
49
+ "tinypool": "^1.1.0",
50
50
  "tsx": "^4.19.4",
51
51
  "typescript": "^5.8.3",
52
52
  "watchpack": "^2.4.4",
53
- "webpack-sources": "3.3.0",
54
- "zod": "^3.25.50",
53
+ "webpack-sources": "3.3.2",
54
+ "zod": "^3.25.58",
55
55
  "zod-validation-error": "3.4.1"
56
56
  },
57
57
  "dependencies": {
58
- "@module-federation/runtime-tools": "0.14.3",
58
+ "@module-federation/runtime-tools": "0.15.0",
59
59
  "@rspack/lite-tapable": "1.0.1",
60
- "@rspack/binding": "1.3.14"
60
+ "@rspack/binding": "1.4.0-beta.0"
61
61
  },
62
62
  "peerDependencies": {
63
63
  "@swc/helpers": ">=0.5.1"
@@ -1,31 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
- var __publicField = (obj, key, value) => {
4
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
- return value;
6
- };
7
- var __accessCheck = (obj, member, msg) => {
8
- if (!member.has(obj))
9
- throw TypeError("Cannot " + msg);
10
- };
11
- var __privateGet = (obj, member, getter) => {
12
- __accessCheck(obj, member, "read from private field");
13
- return getter ? getter.call(obj) : member.get(obj);
14
- };
15
- var __privateAdd = (obj, member, value) => {
16
- if (member.has(obj))
17
- throw TypeError("Cannot add the same private member more than once");
18
- member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
19
- };
20
- var __privateSet = (obj, member, value, setter) => {
21
- __accessCheck(obj, member, "write to private field");
22
- setter ? setter.call(obj, value) : member.set(obj, value);
23
- return value;
24
- };
25
-
26
- export {
27
- __publicField,
28
- __privateGet,
29
- __privateAdd,
30
- __privateSet
31
- };
@@ -1,12 +0,0 @@
1
- // src/utils.ts
2
- function stdout() {
3
- return console._stdout || process.stdout || void 0;
4
- }
5
- function stderr() {
6
- return console._stderr || process.stderr || void 0;
7
- }
8
-
9
- export {
10
- stdout,
11
- stderr
12
- };
@@ -1,53 +0,0 @@
1
- // src/entry/utils.ts
2
- import { pathToFileURL } from "url";
3
- var importESMCached;
4
- function getImportESM() {
5
- if (importESMCached === void 0) {
6
- importESMCached = new Function(
7
- "specifier",
8
- "return import(specifier)"
9
- );
10
- }
11
- return importESMCached;
12
- }
13
- var handlerCache = /* @__PURE__ */ new Map();
14
- async function getHandler(filename, name) {
15
- let handler = handlerCache.get(`${filename}/${name}`);
16
- if (handler !== void 0) {
17
- return handler;
18
- }
19
- try {
20
- const handlerModule = await import(filename);
21
- handler = typeof handlerModule.default !== "function" && handlerModule.default || handlerModule;
22
- if (typeof handler !== "function") {
23
- handler = await handler[name];
24
- }
25
- } catch {
26
- }
27
- if (typeof handler !== "function") {
28
- handler = await getImportESM()(pathToFileURL(filename).href);
29
- if (typeof handler !== "function") {
30
- handler = await handler[name];
31
- }
32
- }
33
- if (typeof handler !== "function") {
34
- return null;
35
- }
36
- if (handlerCache.size > 1e3) {
37
- const [handler2] = handlerCache;
38
- const key = handler2[0];
39
- handlerCache.delete(key);
40
- }
41
- handlerCache.set(`${filename}/${name}`, handler);
42
- return handler;
43
- }
44
- function throwInNextTick(error) {
45
- process.nextTick(() => {
46
- throw error;
47
- });
48
- }
49
-
50
- export {
51
- getHandler,
52
- throwInNextTick
53
- };
@@ -1,38 +0,0 @@
1
- // src/common.ts
2
- var kMovable = Symbol("Tinypool.kMovable");
3
- var kTransferable = Symbol.for("Tinypool.transferable");
4
- var kValue = Symbol.for("Tinypool.valueOf");
5
- var kQueueOptions = Symbol.for("Tinypool.queueOptions");
6
- function isTransferable(value) {
7
- return value != null && typeof value === "object" && kTransferable in value && kValue in value;
8
- }
9
- function isMovable(value) {
10
- return isTransferable(value) && value[kMovable] === true;
11
- }
12
- function markMovable(value) {
13
- Object.defineProperty(value, kMovable, {
14
- enumerable: false,
15
- configurable: true,
16
- writable: true,
17
- value: true
18
- });
19
- }
20
- function isTaskQueue(value) {
21
- return typeof value === "object" && value !== null && "size" in value && typeof value.shift === "function" && typeof value.remove === "function" && typeof value.push === "function";
22
- }
23
- var kRequestCountField = 0;
24
- var kResponseCountField = 1;
25
- var kFieldCount = 2;
26
-
27
- export {
28
- kTransferable,
29
- kValue,
30
- kQueueOptions,
31
- isTransferable,
32
- isMovable,
33
- markMovable,
34
- isTaskQueue,
35
- kRequestCountField,
36
- kResponseCountField,
37
- kFieldCount
38
- };