@rspack/core 1.2.8 → 1.3.0-beta.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.
Files changed (91) hide show
  1. package/dist/ChunkGraph.d.ts +4 -5
  2. package/dist/ChunkGroup.d.ts +1 -1
  3. package/dist/Compilation.d.ts +2 -2
  4. package/dist/ConcatenatedModule.d.ts +1 -0
  5. package/dist/ContextModule.d.ts +1 -0
  6. package/dist/ExternalModule.d.ts +1 -0
  7. package/dist/Module.d.ts +15 -51
  8. package/dist/ModuleGraph.d.ts +1 -1
  9. package/dist/ModuleGraphConnection.d.ts +1 -1
  10. package/dist/NormalModule.d.ts +10 -7
  11. package/dist/Resolver.d.ts +2 -0
  12. package/dist/Watching.d.ts +1 -1
  13. package/dist/builtin-plugin/APIPlugin.d.ts +1 -1
  14. package/dist/builtin-plugin/ArrayPushCallbackChunkFormatPlugin.d.ts +1 -1
  15. package/dist/builtin-plugin/AssetModulesPlugin.d.ts +1 -1
  16. package/dist/builtin-plugin/AsyncWebAssemblyModulesPlugin.d.ts +1 -1
  17. package/dist/builtin-plugin/BannerPlugin.d.ts +1 -1
  18. package/dist/builtin-plugin/BundlerInfoRspackPlugin.d.ts +1 -1
  19. package/dist/builtin-plugin/ChunkPrefetchPreloadPlugin.d.ts +1 -1
  20. package/dist/builtin-plugin/CircularDependencyRspackPlugin.d.ts +59 -0
  21. package/dist/builtin-plugin/CommonJsChunkFormatPlugin.d.ts +1 -1
  22. package/dist/builtin-plugin/ContextReplacementPlugin.d.ts +1 -1
  23. package/dist/builtin-plugin/CopyRspackPlugin.d.ts +1 -1
  24. package/dist/builtin-plugin/CssModulesPlugin.d.ts +1 -1
  25. package/dist/builtin-plugin/DataUriPlugin.d.ts +1 -1
  26. package/dist/builtin-plugin/DefinePlugin.d.ts +1 -1
  27. package/dist/builtin-plugin/DllEntryPlugin.d.ts +1 -1
  28. package/dist/builtin-plugin/DllReferenceAgencyPlugin.d.ts +1 -1
  29. package/dist/builtin-plugin/ElectronTargetPlugin.d.ts +1 -1
  30. package/dist/builtin-plugin/EnableChunkLoadingPlugin.d.ts +1 -1
  31. package/dist/builtin-plugin/EnableWasmLoadingPlugin.d.ts +1 -1
  32. package/dist/builtin-plugin/EnsureChunkConditionsPlugin.d.ts +1 -1
  33. package/dist/builtin-plugin/EntryPlugin.d.ts +1 -1
  34. package/dist/builtin-plugin/EvalDevToolModulePlugin.d.ts +1 -1
  35. package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.d.ts +1 -1
  36. package/dist/builtin-plugin/FetchCompileAsyncWasmPlugin.d.ts +1 -1
  37. package/dist/builtin-plugin/FileUriPlugin.d.ts +1 -1
  38. package/dist/builtin-plugin/FlagAllModulesAsUsedPlugin.d.ts +1 -1
  39. package/dist/builtin-plugin/FlagDependencyExportsPlugin.d.ts +1 -1
  40. package/dist/builtin-plugin/HttpExternalsRspackPlugin.d.ts +1 -1
  41. package/dist/builtin-plugin/IgnorePlugin.d.ts +1 -1
  42. package/dist/builtin-plugin/InferAsyncModulesPlugin.d.ts +1 -1
  43. package/dist/builtin-plugin/JsLoaderRspackPlugin.d.ts +1 -1
  44. package/dist/builtin-plugin/JsonModulesPlugin.d.ts +1 -1
  45. package/dist/builtin-plugin/LibManifestPlugin.d.ts +1 -1
  46. package/dist/builtin-plugin/LightningCssMinimizerRspackPlugin.d.ts +1 -1
  47. package/dist/builtin-plugin/LimitChunkCountPlugin.d.ts +1 -1
  48. package/dist/builtin-plugin/MergeDuplicateChunksPlugin.d.ts +1 -1
  49. package/dist/builtin-plugin/ModuleChunkFormatPlugin.d.ts +1 -1
  50. package/dist/builtin-plugin/ModuleInfoHeaderPlugin.d.ts +1 -1
  51. package/dist/builtin-plugin/NamedChunkIdsPlugin.d.ts +1 -1
  52. package/dist/builtin-plugin/NamedModuleIdsPlugin.d.ts +1 -1
  53. package/dist/builtin-plugin/NoEmitOnErrorsPlugin.d.ts +1 -1
  54. package/dist/builtin-plugin/NodeTargetPlugin.d.ts +1 -1
  55. package/dist/builtin-plugin/OccurrenceChunkIdsPlugin.d.ts +1 -1
  56. package/dist/builtin-plugin/ProgressPlugin.d.ts +1 -1
  57. package/dist/builtin-plugin/ProvidePlugin.d.ts +1 -1
  58. package/dist/builtin-plugin/RealContentHashPlugin.d.ts +1 -1
  59. package/dist/builtin-plugin/RemoveDuplicateModulesPlugin.d.ts +1 -1
  60. package/dist/builtin-plugin/RemoveEmptyChunksPlugin.d.ts +1 -1
  61. package/dist/builtin-plugin/RsdoctorPlugin.d.ts +1 -1
  62. package/dist/builtin-plugin/RuntimeChunkPlugin.d.ts +1 -1
  63. package/dist/builtin-plugin/RuntimePlugin.d.ts +1 -1
  64. package/dist/builtin-plugin/SideEffectsFlagPlugin.d.ts +1 -1
  65. package/dist/builtin-plugin/SizeLimitsPlugin.d.ts +1 -1
  66. package/dist/builtin-plugin/SourceMapDevToolPlugin.d.ts +1 -1
  67. package/dist/builtin-plugin/SubresourceIntegrityPlugin.d.ts +1 -1
  68. package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +1 -1
  69. package/dist/builtin-plugin/WarnCaseSensitiveModulesPlugin.d.ts +1 -1
  70. package/dist/builtin-plugin/base.d.ts +1 -1
  71. package/dist/builtin-plugin/html-plugin/plugin.d.ts +1 -1
  72. package/dist/builtin-plugin/index.d.ts +2 -1
  73. package/dist/builtin-plugin/lazy-compilation/lazyCompilation.d.ts +5 -4
  74. package/dist/builtin-plugin/lazy-compilation/middleware.d.ts +4 -0
  75. package/dist/config/adapterRuleUse.d.ts +1 -1
  76. package/dist/config/index.d.ts +0 -1
  77. package/dist/config/types.d.ts +25 -6
  78. package/dist/config/zod.d.ts +373 -482
  79. package/dist/container/ModuleFederationPluginV1.d.ts +1 -1
  80. package/dist/container/ModuleFederationRuntimePlugin.d.ts +1 -1
  81. package/dist/cssExtractLoader.js +1 -1
  82. package/dist/exports.d.ts +8 -2
  83. package/dist/index.js +2093 -2267
  84. package/dist/stats/statsFactoryUtils.d.ts +8 -8
  85. package/dist/util/MergeCaller.d.ts +1 -0
  86. package/hot/lazy-compilation-node.js +5 -1
  87. package/hot/lazy-compilation-web.js +6 -10
  88. package/package.json +7 -7
  89. package/dist/DependenciesBlock.d.ts +0 -9
  90. package/dist/builtin-plugin/lazy-compilation/backend.d.ts +0 -52
  91. package/dist/builtin-plugin/lazy-compilation/plugin.d.ts +0 -13
@@ -107,8 +107,8 @@ export type KnownStatsModule = {
107
107
  cached: boolean;
108
108
  optional?: boolean;
109
109
  orphan?: boolean;
110
- id?: string;
111
- issuerId?: string;
110
+ id?: string | number | null;
111
+ issuerId?: string | number | null;
112
112
  chunks?: string[];
113
113
  assets?: string[];
114
114
  dependent?: boolean;
@@ -138,7 +138,7 @@ export type StatsModule = KnownStatsModule & Record<string, any>;
138
138
  export type KnownStatsModuleIssuer = {
139
139
  identifier?: string;
140
140
  name?: string;
141
- id?: string | number;
141
+ id?: string | number | null;
142
142
  };
143
143
  export type StatsModuleIssuer = KnownStatsModuleIssuer & Record<string, any>;
144
144
  export type KnownStatsError = {
@@ -151,7 +151,7 @@ export type KnownStatsError = {
151
151
  moduleName?: string;
152
152
  loc?: string;
153
153
  chunkId?: string | number;
154
- moduleId?: string | number;
154
+ moduleId?: string | number | null;
155
155
  moduleTrace?: StatsModuleTraceItem[];
156
156
  details?: any;
157
157
  stack?: string;
@@ -162,8 +162,8 @@ export type StatsModuleTraceItem = {
162
162
  originName?: string;
163
163
  moduleIdentifier?: string;
164
164
  moduleName?: string;
165
- originId?: string;
166
- moduleId?: string;
165
+ originId?: string | number | null;
166
+ moduleId?: string | number | null;
167
167
  dependencies?: StatsModuleTraceDependency[];
168
168
  };
169
169
  export type StatsModuleTraceDependency = KnownStatsModuleTraceDependency & Record<string, any>;
@@ -181,7 +181,7 @@ export type KnownStatsModuleReason = {
181
181
  explanation?: string;
182
182
  userRequest?: string;
183
183
  loc?: string;
184
- moduleId?: string | null;
184
+ moduleId?: string | number | null;
185
185
  resolvedModuleId?: string | number | null;
186
186
  };
187
187
  export type StatsModuleReason = KnownStatsModuleReason & Record<string, any>;
@@ -191,7 +191,7 @@ export type KnownStatsChunkOrigin = {
191
191
  moduleName: string;
192
192
  loc: string;
193
193
  request: string;
194
- moduleId?: string;
194
+ moduleId?: string | number | null;
195
195
  };
196
196
  export type StatsChunkOrigin = KnownStatsChunkOrigin & Record<string, any>;
197
197
  export type KnownStatsCompilation = {
@@ -4,6 +4,7 @@ export default class MergeCaller<D> {
4
4
  private callFn;
5
5
  constructor(fn: CallFn<D>);
6
6
  private finalCall;
7
+ pendingData(): D[];
7
8
  push(...data: D[]): void;
8
9
  }
9
10
  export {};
@@ -39,7 +39,11 @@ exports.keepAlive = function (options) {
39
39
  */
40
40
  function errorHandler(err) {
41
41
  err.message =
42
- "Problem communicating active modules to the server: " + err.message;
42
+ "Problem communicating active modules to the server" +
43
+ (err.message ? ": " + err.message : "") +
44
+ "\nRequest: " +
45
+ urlBase +
46
+ data;
43
47
  onError(err);
44
48
  }
45
49
  request.on("error", errorHandler);
@@ -28,16 +28,12 @@ var updateEventSource = function updateEventSource() {
28
28
  errorHandlers.forEach(function (onError) {
29
29
  onError(
30
30
  new Error(
31
- "Problem communicating active modules to the server: " +
32
- event.message +
33
- " " +
34
- event.filename +
35
- ":" +
36
- event.lineno +
37
- ":" +
38
- event.colno +
39
- " " +
40
- event.error
31
+ "Problem communicating active modules to the server" +
32
+ (event.message ? `: ${event.message} ` : "") +
33
+ (event.filename ? `: ${event.filename} ` : "") +
34
+ (event.lineno ? `: ${event.lineno} ` : "") +
35
+ (event.colno ? `: ${event.colno} ` : "") +
36
+ (event.error ? `: ${event.error}` : "")
41
37
  )
42
38
  );
43
39
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/core",
3
- "version": "1.2.8",
3
+ "version": "1.3.0-beta.1",
4
4
  "webpackVersion": "5.75.0",
5
5
  "license": "MIT",
6
6
  "description": "The fast Rust-based web bundler with webpack-compatible API",
@@ -37,7 +37,7 @@
37
37
  "directory": "packages/rspack"
38
38
  },
39
39
  "devDependencies": {
40
- "@swc/core": "1.10.18",
40
+ "@swc/core": "1.11.11",
41
41
  "@swc/types": "0.1.19",
42
42
  "@types/graceful-fs": "4.1.9",
43
43
  "@types/watchpack": "^2.4.4",
@@ -53,17 +53,17 @@
53
53
  "tsx": "^4.19.3",
54
54
  "typescript": "^5.7.3",
55
55
  "watchpack": "^2.4.2",
56
- "webpack-dev-server": "5.0.4",
56
+ "webpack-dev-server": "5.2.0",
57
57
  "webpack-sources": "3.2.3",
58
58
  "zod": "^3.24.2",
59
59
  "zod-validation-error": "3.4.0",
60
- "@rspack/tracing": "1.2.8"
60
+ "@rspack/tracing": "1.3.0-beta.1"
61
61
  },
62
62
  "dependencies": {
63
- "@module-federation/runtime-tools": "0.8.4",
63
+ "@module-federation/runtime-tools": "0.11.1",
64
64
  "@rspack/lite-tapable": "1.0.1",
65
- "caniuse-lite": "^1.0.30001702",
66
- "@rspack/binding": "1.2.8"
65
+ "caniuse-lite": "^1.0.30001706",
66
+ "@rspack/binding": "1.3.0-beta.1"
67
67
  },
68
68
  "peerDependencies": {
69
69
  "@rspack/tracing": "^1.x",
@@ -1,9 +0,0 @@
1
- import type { Dependency, JsDependenciesBlock } from "@rspack/binding";
2
- export declare class DependenciesBlock {
3
- #private;
4
- readonly dependencies: Dependency[];
5
- readonly blocks: DependenciesBlock[];
6
- static __from_binding(binding: JsDependenciesBlock): DependenciesBlock;
7
- static __to_binding(block: DependenciesBlock): JsDependenciesBlock;
8
- private constructor();
9
- }
@@ -1,52 +0,0 @@
1
- import type { IncomingMessage, ServerOptions as ServerOptionsImport, ServerResponse } from "node:http";
2
- import type { AddressInfo, ListenOptions, Socket } from "node:net";
3
- import type { SecureContextOptions, TlsOptions } from "node:tls";
4
- import type { Compiler } from "../..";
5
- interface Server {
6
- on(event: "request", callback: (req: IncomingMessage, res: ServerResponse) => void): void;
7
- on(event: "connection", callback: (socket: Socket) => void): void;
8
- on(event: "listening", callback: (err?: Error) => void): void;
9
- off(event: "request", callback: (req: IncomingMessage, res: ServerResponse) => void): void;
10
- address(): AddressInfo;
11
- close(callback: (err?: any) => void): void;
12
- listen(listenOptions?: number | ListenOptions): void;
13
- }
14
- export interface LazyCompilationDefaultBackendOptions {
15
- /**
16
- * A custom client script path.
17
- */
18
- client?: string;
19
- /**
20
- * Specifies where to listen to from the server.
21
- */
22
- listen?: number | ListenOptions | ((server: Server) => void);
23
- /**
24
- * Specifies the protocol the client should use to connect to the server.
25
- */
26
- protocol?: "http" | "https";
27
- /**
28
- * Specifies how to create the server handling the EventSource requests.
29
- */
30
- server?: ServerOptionsImport<typeof IncomingMessage> | ServerOptionsHttps<typeof IncomingMessage, typeof ServerResponse> | (() => Server);
31
- }
32
- export type ServerOptionsHttps<Request extends typeof IncomingMessage = typeof IncomingMessage, Response extends typeof ServerResponse = typeof ServerResponse> = SecureContextOptions & TlsOptions & ServerOptionsImport<Request, Response>;
33
- declare const getBackend: (options: Omit<LazyCompilationDefaultBackendOptions, "client"> & {
34
- client: NonNullable<LazyCompilationDefaultBackendOptions["client"]>;
35
- }) => {
36
- state: {
37
- module: any;
38
- dispose: any;
39
- };
40
- backend: (compiler: Compiler, callback: (err: Error | null, obj?: {
41
- dispose: (callback: (err: any) => void) => void;
42
- module: (args: {
43
- module: string;
44
- path: string;
45
- }) => {
46
- data: string;
47
- client: string;
48
- active: boolean;
49
- };
50
- }) => void) => void;
51
- };
52
- export default getBackend;
@@ -1,13 +0,0 @@
1
- import type { JsModule } from "@rspack/binding";
2
- import type { Compiler } from "../..";
3
- import { type LazyCompilationDefaultBackendOptions } from "./backend";
4
- export default class LazyCompilationPlugin {
5
- cacheable: boolean;
6
- entries: boolean;
7
- imports: boolean;
8
- test?: RegExp | ((m: JsModule) => boolean);
9
- backend?: LazyCompilationDefaultBackendOptions;
10
- constructor(cacheable: boolean, entries: boolean, imports: boolean, test?: RegExp | ((m: JsModule) => boolean), backend?: LazyCompilationDefaultBackendOptions);
11
- apply(compiler: Compiler): void;
12
- }
13
- export { LazyCompilationPlugin };