@rspack-canary/core 1.7.0-canary-e20de023-20251223174329 → 1.7.0-canary-4941195f-20251224083309

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.
@@ -16,7 +16,6 @@ import type { CompilationParams } from "./Compilation";
16
16
  import { Compilation } from "./Compilation";
17
17
  import { ContextModuleFactory } from "./ContextModuleFactory";
18
18
  import type { EntryNormalized, OutputNormalized, RspackOptionsNormalized, RspackPluginInstance } from "./config";
19
- import type { PlatformTargetProperties } from "./config/target";
20
19
  import type { FileSystemInfoEntry } from "./FileSystemInfo";
21
20
  import { rspack } from "./index";
22
21
  import Cache from "./lib/Cache";
@@ -79,6 +78,7 @@ export type CompilerHooks = {
79
78
  entryOption: liteTapable.SyncBailHook<[string, EntryNormalized], any>;
80
79
  additionalPass: liteTapable.AsyncSeriesHook<[]>;
81
80
  };
81
+ export declare const GET_COMPILER_ID: unique symbol;
82
82
  declare class Compiler {
83
83
  #private;
84
84
  hooks: CompilerHooks;
@@ -127,8 +127,6 @@ declare class Compiler {
127
127
  get managedPaths(): never;
128
128
  get immutablePaths(): never;
129
129
  get _lastCompilation(): Compilation | undefined;
130
- get platform(): PlatformTargetProperties;
131
- set platform(platform: PlatformTargetProperties);
132
130
  /**
133
131
  * Note: This is not a webpack public API, maybe removed in future.
134
132
  * @internal
@@ -10,11 +10,6 @@ export type SwcLoaderTsParserConfig = TsParserConfig;
10
10
  export type SwcLoaderTransformConfig = TransformConfig;
11
11
  export type SwcLoaderOptions = Config & {
12
12
  isModule?: boolean | "unknown";
13
- /**
14
- * Collects information from TypeScript's AST for consumption by subsequent Rspack processes,
15
- * providing better TypeScript development experience and smaller output bundle size.
16
- */
17
- collectTypeScriptInfo?: CollectTypeScriptInfoOptions;
18
13
  /**
19
14
  * Experimental features provided by Rspack.
20
15
  * @experimental
@@ -22,11 +17,14 @@ export type SwcLoaderOptions = Config & {
22
17
  rspackExperiments?: {
23
18
  import?: PluginImportOptions;
24
19
  /**
25
- * @deprecated Use top-level `collectTypeScriptInfo` instead.
26
20
  * Collects information from TypeScript's AST for consumption by subsequent Rspack processes,
27
21
  * providing better TypeScript development experience and smaller output bundle size.
28
22
  */
29
23
  collectTypeScriptInfo?: CollectTypeScriptInfoOptions;
24
+ /**
25
+ * Enable React Server Components support.
26
+ */
27
+ reactServerComponents?: boolean;
30
28
  };
31
29
  };
32
30
  export interface TerserCompressOptions {
@@ -1,4 +1,4 @@
1
- export declare const CaseSensitivePlugin: {
1
+ export declare const WarnCaseSensitiveModulesPlugin: {
2
2
  new (): {
3
3
  name: string;
4
4
  _args: [];
@@ -5,7 +5,6 @@ export * from "./AsyncWebAssemblyModulesPlugin";
5
5
  export * from "./BannerPlugin";
6
6
  export * from "./BundlerInfoRspackPlugin";
7
7
  export { createNativePlugin, RspackBuiltinPlugin } from "./base";
8
- export * from "./CaseSensitivePlugin";
9
8
  export * from "./ChunkPrefetchPreloadPlugin";
10
9
  export * from "./CircularDependencyRspackPlugin";
11
10
  export * from "./CommonJsChunkFormatPlugin";
@@ -73,6 +72,10 @@ export * from "./RslibPlugin";
73
72
  export * from "./RstestPlugin";
74
73
  export * from "./RuntimeChunkPlugin";
75
74
  export * from "./RuntimePlugin";
75
+ export { createRscPlugins, RSC_LAYERS_NAMES } from "./rsc";
76
+ export * from "./rsc/Coordinator";
77
+ export * from "./rsc/RscClientPlugin";
78
+ export * from "./rsc/RscServerPlugin";
76
79
  export * from "./SideEffectsFlagPlugin";
77
80
  export * from "./SizeLimitsPlugin";
78
81
  export * from "./SourceMapDevToolPlugin";
@@ -80,5 +83,6 @@ export * from "./SplitChunksPlugin";
80
83
  export * from "./SubresourceIntegrityPlugin";
81
84
  export * from "./SwcJsMinimizerPlugin";
82
85
  export * from "./URLPlugin";
86
+ export * from "./WarnCaseSensitiveModulesPlugin";
83
87
  export * from "./WebWorkerTemplatePlugin";
84
88
  export * from "./WorkerPlugin";
@@ -0,0 +1,8 @@
1
+ import { type Compiler } from "../../Compiler";
2
+ export declare const GET_OR_INIT_BINDING: unique symbol;
3
+ export declare class Coordinator {
4
+ #private;
5
+ constructor();
6
+ applyServerCompiler(serverCompiler: Compiler): void;
7
+ applyClientCompiler(clientCompiler: Compiler): void;
8
+ }
@@ -0,0 +1,10 @@
1
+ import type binding from "@rspack/binding";
2
+ import type { Compiler } from "../..";
3
+ import { RspackBuiltinPlugin } from "../base";
4
+ import { type Coordinator } from "./Coordinator";
5
+ export declare class RscClientPlugin extends RspackBuiltinPlugin {
6
+ #private;
7
+ name: string;
8
+ constructor(coordinator: Coordinator);
9
+ raw(compiler: Compiler): binding.BuiltinPlugin;
10
+ }
@@ -0,0 +1,10 @@
1
+ import type binding from "@rspack/binding";
2
+ import type { Compiler } from "../..";
3
+ import { RspackBuiltinPlugin } from "../base";
4
+ import { type Coordinator } from "./Coordinator";
5
+ export declare class RscServerPlugin extends RspackBuiltinPlugin {
6
+ #private;
7
+ name: string;
8
+ constructor(coordinator: Coordinator);
9
+ raw(compiler: Compiler): binding.BuiltinPlugin;
10
+ }
@@ -0,0 +1,19 @@
1
+ import type { RspackPluginInstance } from "../..";
2
+ export declare function createRscPlugins(): {
3
+ ServerPlugin: RspackPluginInstance;
4
+ ClientPlugin: RspackPluginInstance;
5
+ };
6
+ export declare const RSC_LAYERS_NAMES: {
7
+ /**
8
+ * The layer for server-only runtime and picking up `react-server` export conditions.
9
+ */
10
+ REACT_SERVER_COMPONENTS: string;
11
+ /**
12
+ * Server Side Rendering layer for app.
13
+ */
14
+ SERVER_SIDE_RENDERING: string;
15
+ /**
16
+ * The browser client bundle layer for actions.
17
+ */
18
+ ACTION_BROWSER: string;
19
+ };
@@ -1,13 +1,4 @@
1
1
  import type { RspackOptionsNormalized } from "./normalization";
2
- export declare const applyRspackOptionsDefaults: (options: RspackOptionsNormalized) => {
3
- platform: false | {
4
- web: boolean | null | undefined;
5
- browser: boolean | null | undefined;
6
- webworker: boolean | null | undefined;
7
- node: boolean | null | undefined;
8
- nwjs: boolean | null | undefined;
9
- electron: boolean | null | undefined;
10
- };
11
- };
2
+ export declare const applyRspackOptionsDefaults: (options: RspackOptionsNormalized) => void;
12
3
  export declare const applyRspackOptionsBaseDefaults: (options: RspackOptionsNormalized) => void;
13
4
  export declare const getPnpDefault: () => boolean;
@@ -5,17 +5,17 @@
5
5
  export declare const getDefaultTarget: (context: string) => "browserslist" | "web";
6
6
  export type PlatformTargetProperties = {
7
7
  /** web platform, importing of http(s) and std: is available */
8
- web?: boolean | null;
8
+ web: boolean | null;
9
9
  /** browser platform, running in a normal web browser */
10
- browser?: boolean | null;
10
+ browser: boolean | null;
11
11
  /** (Web)Worker platform, running in a web/shared/service worker */
12
- webworker?: boolean | null;
12
+ webworker: boolean | null;
13
13
  /** node platform, require of node built-in modules is available */
14
- node?: boolean | null;
14
+ node: boolean | null;
15
15
  /** nwjs platform, require of legacy nw.gui is available */
16
- nwjs?: boolean | null;
16
+ nwjs: boolean | null;
17
17
  /** electron platform, require of some electron built-in modules is available */
18
- electron?: boolean | null;
18
+ electron: boolean | null;
19
19
  };
20
20
  export type ElectronContextTargetProperties = {
21
21
  /** in main context */
@@ -2103,7 +2103,6 @@ export type Experiments = {
2103
2103
  outputModule?: boolean;
2104
2104
  /**
2105
2105
  * Enable top-level await.
2106
- * @deprecated This option is deprecated, top-level await is enabled by default.
2107
2106
  * @default true
2108
2107
  */
2109
2108
  topLevelAwait?: boolean;
package/dist/exports.d.ts CHANGED
@@ -47,11 +47,7 @@ export declare const util: {
47
47
  cleverMerge: <First, Second>(first: First, second: Second) => First | Second | (First & Second);
48
48
  };
49
49
  export type { BannerPluginArgument, DefinePluginOptions, EntryOptions, ProgressPluginArgument, ProvidePluginOptions } from "./builtin-plugin";
50
- export { BannerPlugin, CaseSensitivePlugin,
51
- /**
52
- * @deprecated Use `rspack.CaseSensitivePlugin` instead
53
- */
54
- CaseSensitivePlugin as WarnCaseSensitiveModulesPlugin, DefinePlugin, DynamicEntryPlugin, EntryPlugin, ExternalsPlugin, HotModuleReplacementPlugin, IgnorePlugin, type IgnorePluginOptions, NoEmitOnErrorsPlugin, ProgressPlugin, ProvidePlugin, RuntimePlugin } from "./builtin-plugin";
50
+ export { BannerPlugin, DefinePlugin, DynamicEntryPlugin, EntryPlugin, ExternalsPlugin, HotModuleReplacementPlugin, IgnorePlugin, type IgnorePluginOptions, NoEmitOnErrorsPlugin, ProgressPlugin, ProvidePlugin, RuntimePlugin, WarnCaseSensitiveModulesPlugin } from "./builtin-plugin";
55
51
  export { DllPlugin, type DllPluginOptions } from "./lib/DllPlugin";
56
52
  export { DllReferencePlugin, type DllReferencePluginOptions, type DllReferencePluginOptionsContent, type DllReferencePluginOptionsManifest, type DllReferencePluginOptionsSourceType } from "./lib/DllReferencePlugin";
57
53
  export { default as EntryOptionPlugin } from "./lib/EntryOptionPlugin";
@@ -59,7 +55,7 @@ export { EnvironmentPlugin } from "./lib/EnvironmentPlugin";
59
55
  export { LoaderOptionsPlugin } from "./lib/LoaderOptionsPlugin";
60
56
  export { LoaderTargetPlugin } from "./lib/LoaderTargetPlugin";
61
57
  export type { OutputFileSystem, WatchFileSystem } from "./util/fs";
62
- import { EsmLibraryPlugin, FetchCompileAsyncWasmPlugin, lazyCompilationMiddleware, SubresourceIntegrityPlugin } from "./builtin-plugin";
58
+ import { createRscPlugins, EsmLibraryPlugin, FetchCompileAsyncWasmPlugin, lazyCompilationMiddleware, RSC_LAYERS_NAMES, SubresourceIntegrityPlugin } from "./builtin-plugin";
63
59
  export { SubresourceIntegrityPlugin };
64
60
  interface Web {
65
61
  FetchCompileAsyncWasmPlugin: typeof FetchCompileAsyncWasmPlugin;
@@ -136,7 +132,7 @@ export declare const sharing: {
136
132
  export type { FeatureOptions as LightningcssFeatureOptions, LoaderOptions as LightningcssLoaderOptions } from "./builtin-loader/lightningcss/index";
137
133
  export type { SwcLoaderEnvConfig, SwcLoaderEsParserConfig, SwcLoaderJscConfig, SwcLoaderModuleConfig, SwcLoaderOptions, SwcLoaderParserConfig, SwcLoaderTransformConfig, SwcLoaderTsParserConfig } from "./builtin-loader/swc/index";
138
134
  export type { CircularDependencyRspackPluginOptions, CopyRspackPluginOptions, CssExtractRspackLoaderOptions, CssExtractRspackPluginOptions, EvalDevToolModulePluginOptions, HtmlRspackPluginOptions, LightningCssMinimizerRspackPluginOptions, RsdoctorPluginData, RsdoctorPluginHooks, SourceMapDevToolPluginOptions, SubresourceIntegrityPluginOptions, SwcJsMinimizerRspackPluginOptions } from "./builtin-plugin";
139
- export { CircularDependencyRspackPlugin, ContextReplacementPlugin, CopyRspackPlugin, CssExtractRspackPlugin, EvalDevToolModulePlugin, EvalSourceMapDevToolPlugin, HtmlRspackPlugin, LightningCssMinimizerRspackPlugin, NormalModuleReplacementPlugin, SourceMapDevToolPlugin, SwcJsMinimizerRspackPlugin } from "./builtin-plugin";
135
+ export { CircularDependencyRspackPlugin, ContextReplacementPlugin, Coordinator, CopyRspackPlugin, CssExtractRspackPlugin, EvalDevToolModulePlugin, EvalSourceMapDevToolPlugin, HtmlRspackPlugin, LightningCssMinimizerRspackPlugin, NormalModuleReplacementPlugin, RscClientPlugin, RscServerPlugin, SourceMapDevToolPlugin, SwcJsMinimizerRspackPlugin } from "./builtin-plugin";
140
136
  import { EnforceExtension, ResolverFactory, async as resolveAsync, sync as resolveSync } from "@rspack/binding";
141
137
  import { createNativePlugin } from "./builtin-plugin";
142
138
  import { minify, minifySync, transform, transformSync } from "./swc";
@@ -174,5 +170,7 @@ interface Experiments {
174
170
  CssChunkingPlugin: typeof CssChunkingPlugin;
175
171
  createNativePlugin: typeof createNativePlugin;
176
172
  VirtualModulesPlugin: typeof VirtualModulesPlugin;
173
+ createRscPlugins: typeof createRscPlugins;
174
+ RSC_LAYERS_NAMES: typeof RSC_LAYERS_NAMES;
177
175
  }
178
176
  export declare const experiments: Experiments;
package/dist/index.js CHANGED
@@ -288,8 +288,10 @@ for(var __rspack_i in (()=>{
288
288
  SwcJsMinimizerRspackPlugin: ()=>SwcJsMinimizerRspackPlugin,
289
289
  ContextModule: ()=>binding_.ContextModule,
290
290
  DllPlugin: ()=>DllPlugin,
291
- WarnCaseSensitiveModulesPlugin: ()=>CaseSensitivePlugin,
291
+ WarnCaseSensitiveModulesPlugin: ()=>WarnCaseSensitiveModulesPlugin,
292
+ Coordinator: ()=>Coordinator,
292
293
  ProvidePlugin: ()=>ProvidePlugin,
294
+ RscClientPlugin: ()=>RscClientPlugin,
293
295
  Template: ()=>Template,
294
296
  container: ()=>container,
295
297
  HtmlRspackPlugin: ()=>HtmlRspackPlugin,
@@ -301,6 +303,7 @@ for(var __rspack_i in (()=>{
301
303
  EnvironmentPlugin: ()=>EnvironmentPlugin,
302
304
  HotModuleReplacementPlugin: ()=>HotModuleReplacementPlugin,
303
305
  Compilation: ()=>Compilation,
306
+ RscServerPlugin: ()=>RscServerPlugin,
304
307
  experiments: ()=>exports_experiments,
305
308
  CircularDependencyRspackPlugin: ()=>CircularDependencyRspackPlugin,
306
309
  EvalSourceMapDevToolPlugin: ()=>EvalSourceMapDevToolPlugin,
@@ -330,10 +333,9 @@ for(var __rspack_i in (()=>{
330
333
  ModuleFilenameHelpers: ()=>ModuleFilenameHelpers_namespaceObject,
331
334
  MultiCompiler: ()=>MultiCompiler,
332
335
  SourceMapDevToolPlugin: ()=>SourceMapDevToolPlugin,
333
- CaseSensitivePlugin: ()=>CaseSensitivePlugin,
334
336
  SubresourceIntegrityPlugin: ()=>SubresourceIntegrityPlugin,
335
- RuntimeGlobals: ()=>DefaultRuntimeGlobals,
336
337
  library: ()=>exports_library,
338
+ RuntimeGlobals: ()=>DefaultRuntimeGlobals,
337
339
  node: ()=>exports_node,
338
340
  rspackVersion: ()=>exports_rspackVersion,
339
341
  util: ()=>util,
@@ -361,13 +363,13 @@ for(var __rspack_i in (()=>{
361
363
  __webpack_require__.r(exports_namespaceObject), __webpack_require__.d(exports_namespaceObject, {
362
364
  AsyncDependenciesBlock: ()=>binding_.AsyncDependenciesBlock,
363
365
  BannerPlugin: ()=>BannerPlugin,
364
- CaseSensitivePlugin: ()=>CaseSensitivePlugin,
365
366
  CircularDependencyRspackPlugin: ()=>CircularDependencyRspackPlugin,
366
367
  Compilation: ()=>Compilation,
367
368
  Compiler: ()=>Compiler,
368
369
  ConcatenatedModule: ()=>binding_.ConcatenatedModule,
369
370
  ContextModule: ()=>binding_.ContextModule,
370
371
  ContextReplacementPlugin: ()=>ContextReplacementPlugin,
372
+ Coordinator: ()=>Coordinator,
371
373
  CopyRspackPlugin: ()=>CopyRspackPlugin,
372
374
  CssExtractRspackPlugin: ()=>CssExtractRspackPlugin,
373
375
  DefinePlugin: ()=>DefinePlugin,
@@ -398,6 +400,8 @@ for(var __rspack_i in (()=>{
398
400
  NormalModuleReplacementPlugin: ()=>NormalModuleReplacementPlugin,
399
401
  ProgressPlugin: ()=>ProgressPlugin,
400
402
  ProvidePlugin: ()=>ProvidePlugin,
403
+ RscClientPlugin: ()=>RscClientPlugin,
404
+ RscServerPlugin: ()=>RscServerPlugin,
401
405
  RspackOptionsApply: ()=>RspackOptionsApply,
402
406
  RuntimeGlobals: ()=>DefaultRuntimeGlobals,
403
407
  RuntimeModule: ()=>RuntimeModule,
@@ -409,7 +413,7 @@ for(var __rspack_i in (()=>{
409
413
  SwcJsMinimizerRspackPlugin: ()=>SwcJsMinimizerRspackPlugin,
410
414
  Template: ()=>Template,
411
415
  ValidationError: ()=>ValidationError,
412
- WarnCaseSensitiveModulesPlugin: ()=>CaseSensitivePlugin,
416
+ WarnCaseSensitiveModulesPlugin: ()=>WarnCaseSensitiveModulesPlugin,
413
417
  WebpackError: ()=>exports_WebpackError,
414
418
  WebpackOptionsApply: ()=>RspackOptionsApply,
415
419
  config: ()=>exports_config,
@@ -2044,7 +2048,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
2044
2048
  version: options.version || "unknown",
2045
2049
  bundler: options.bundler || "rspack",
2046
2050
  force: options.force ?? !0
2047
- })), CaseSensitivePlugin = base_create(binding_.BuiltinPluginName.CaseSensitivePlugin, ()=>{}, "compilation"), ChunkPrefetchPreloadPlugin = base_create(binding_.BuiltinPluginName.ChunkPrefetchPreloadPlugin, ()=>{});
2051
+ })), ChunkPrefetchPreloadPlugin = base_create(binding_.BuiltinPluginName.ChunkPrefetchPreloadPlugin, ()=>{});
2048
2052
  class CircularDependencyRspackPlugin extends RspackBuiltinPlugin {
2049
2053
  name = binding_.BuiltinPluginName.CircularDependencyRspackPlugin;
2050
2054
  _options;
@@ -2337,13 +2341,9 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
2337
2341
  return o.path + o.query + o.fragment;
2338
2342
  }
2339
2343
  let unsupported = (name, issue)=>{
2340
- let s = `${name} is not supported by Rspack.`;
2341
- throw issue && (s += ` Refer to issue ${issue} for more information.`), Error(s);
2342
- }, warnedMessages = new Set();
2343
- function deprecate(message) {
2344
- warnedMessages.has(message) || (warnedMessages.add(message), console.warn(`[Rspack Deprecation] ${message}`));
2345
- }
2346
- let WINDOWS_ABS_PATH_REGEXP = /^[a-zA-Z]:[\\/]/, SEGMENTS_SPLIT_REGEXP = /([|!])/, WINDOWS_PATH_SEPARATOR_REGEXP = /\\/g, relativePathToRequest = (relativePath)=>"" === relativePath ? "./." : ".." === relativePath ? "../." : relativePath.startsWith("../") ? relativePath : `./${relativePath}`, absoluteToRequest = (context, maybeAbsolutePath)=>{
2344
+ let s = `${name} is not supported by rspack.`;
2345
+ throw issue && (s += ` Please refer to issue ${issue} for more information.`), Error(s);
2346
+ }, WINDOWS_ABS_PATH_REGEXP = /^[a-zA-Z]:[\\/]/, SEGMENTS_SPLIT_REGEXP = /([|!])/, WINDOWS_PATH_SEPARATOR_REGEXP = /\\/g, relativePathToRequest = (relativePath)=>"" === relativePath ? "./." : ".." === relativePath ? "../." : relativePath.startsWith("../") ? relativePath : `./${relativePath}`, absoluteToRequest = (context, maybeAbsolutePath)=>{
2347
2347
  if ("/" === maybeAbsolutePath[0]) {
2348
2348
  if (maybeAbsolutePath.length > 1 && "/" === maybeAbsolutePath[maybeAbsolutePath.length - 1]) return maybeAbsolutePath;
2349
2349
  let querySplitPos = maybeAbsolutePath.indexOf("?"), resource = -1 === querySplitPos ? maybeAbsolutePath : maybeAbsolutePath.slice(0, querySplitPos);
@@ -2427,12 +2427,6 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
2427
2427
  query: match[2] ? match[2].replace(/\u200b(.)/g, "$1") : ""
2428
2428
  };
2429
2429
  });
2430
- function resolveCollectTypeScriptInfo(options) {
2431
- return {
2432
- typeExports: options.typeExports,
2433
- exportedEnum: !0 === options.exportedEnum ? "all" : !1 === options.exportedEnum || void 0 === options.exportedEnum ? "none" : "const-only"
2434
- };
2435
- }
2436
2430
  function toFeatures(featureOptions) {
2437
2431
  let feature = 0;
2438
2432
  for (let key of Reflect.ownKeys(featureOptions))if (!0 === featureOptions[key]) switch(key){
@@ -3730,27 +3724,33 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
3730
3724
  let temp = function(identifier, o, options) {
3731
3725
  if (identifier.startsWith(`${BUILTIN_LOADER_PREFIX}swc-loader`)) return ((options, _)=>{
3732
3726
  if (options && "object" == typeof options) {
3733
- options.jsc ??= {}, options.jsc.experimental ??= {}, options.jsc.experimental.disableAllLints ??= !0, options.collectTypeScriptInfo && (options.collectTypeScriptInfo = resolveCollectTypeScriptInfo(options.collectTypeScriptInfo));
3727
+ options.jsc ??= {}, options.jsc.experimental ??= {}, options.jsc.experimental.disableAllLints ??= !0;
3734
3728
  let { rspackExperiments } = options;
3735
- rspackExperiments && ((rspackExperiments.import || rspackExperiments.pluginImport) && (rspackExperiments.import = function(pluginImport) {
3736
- if (pluginImport) return pluginImport.map((config)=>{
3737
- let rawConfig = {
3738
- ...config,
3739
- style: {}
3740
- };
3741
- if ("boolean" == typeof config.style) rawConfig.style.bool = config.style;
3742
- else if ("string" == typeof config.style) {
3743
- let isTpl = config.style.includes("{{");
3744
- rawConfig.style[isTpl ? "custom" : "css"] = config.style;
3745
- } else {
3746
- var val;
3747
- val = config.style, "[object Object]" === Object.prototype.toString.call(val) && (rawConfig.style = config.style);
3748
- }
3749
- return config.styleLibraryDirectory && (rawConfig.style = {
3750
- styleLibraryDirectory: config.styleLibraryDirectory
3751
- }), rawConfig;
3729
+ if (rspackExperiments) {
3730
+ var options1;
3731
+ (rspackExperiments.import || rspackExperiments.pluginImport) && (rspackExperiments.import = function(pluginImport) {
3732
+ if (pluginImport) return pluginImport.map((config)=>{
3733
+ let rawConfig = {
3734
+ ...config,
3735
+ style: {}
3736
+ };
3737
+ if ("boolean" == typeof config.style) rawConfig.style.bool = config.style;
3738
+ else if ("string" == typeof config.style) {
3739
+ let isTpl = config.style.includes("{{");
3740
+ rawConfig.style[isTpl ? "custom" : "css"] = config.style;
3741
+ } else {
3742
+ var val;
3743
+ val = config.style, "[object Object]" === Object.prototype.toString.call(val) && (rawConfig.style = config.style);
3744
+ }
3745
+ return config.styleLibraryDirectory && (rawConfig.style = {
3746
+ styleLibraryDirectory: config.styleLibraryDirectory
3747
+ }), rawConfig;
3748
+ });
3749
+ }(rspackExperiments.import || rspackExperiments.pluginImport)), rspackExperiments.collectTypeScriptInfo && (rspackExperiments.collectTypeScriptInfo = {
3750
+ typeExports: (options1 = rspackExperiments.collectTypeScriptInfo).typeExports,
3751
+ exportedEnum: !0 === options1.exportedEnum ? "all" : !1 === options1.exportedEnum || void 0 === options1.exportedEnum ? "none" : "const-only"
3752
3752
  });
3753
- }(rspackExperiments.import || rspackExperiments.pluginImport)), rspackExperiments.collectTypeScriptInfo && (deprecate("`rspackExperiments.collectTypeScriptInfo` is deprecated and will be removed in Rspack v2.0. Use top-level `collectTypeScriptInfo` instead."), options.collectTypeScriptInfo || (options.collectTypeScriptInfo = resolveCollectTypeScriptInfo(rspackExperiments.collectTypeScriptInfo)), delete rspackExperiments.collectTypeScriptInfo));
3753
+ }
3754
3754
  }
3755
3755
  return options;
3756
3756
  })(o, 0);
@@ -4468,9 +4468,9 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
4468
4468
  "function" == typeof next && next();
4469
4469
  }, DEPRECATED_LAZY_COMPILATION_OPTIONS_WARN = "The `experiments.lazyCompilation` option is deprecated, please use the configuration top level `lazyCompilation` instead.", REPEAT_LAZY_COMPILATION_OPTIONS_WARN = "Both top-level `lazyCompilation` and `experiments.lazyCompilation` options are set. The top-level `lazyCompilation` configuration will take precedence.", lazyCompilationMiddleware = (compiler)=>{
4470
4470
  if (compiler instanceof MultiCompiler) {
4471
- let middlewareByCompiler = new Map(), i = 0;
4471
+ let middlewareByCompiler = new Map(), i = 0, isReportDeprecatedWarned = !1, isReportRepeatWarned = !1;
4472
4472
  for (let c of compiler.compilers){
4473
- if (c.options.experiments.lazyCompilation && (c.name ? deprecate(`The 'experiments.lazyCompilation' option in compiler named '${c.name}' is deprecated, please use the Configuration top level 'lazyCompilation' instead.`) : deprecate(DEPRECATED_LAZY_COMPILATION_OPTIONS_WARN)), c.options.lazyCompilation && c.options.experiments.lazyCompilation && (c.name ? deprecate(`The top-level 'lazyCompilation' option in compiler named '${c.name}' will override the 'experiments.lazyCompilation' option.`) : deprecate(REPEAT_LAZY_COMPILATION_OPTIONS_WARN)), !c.options.lazyCompilation && !c.options.experiments.lazyCompilation) continue;
4473
+ if (c.options.experiments.lazyCompilation && (c.name ? console.warn(`The 'experiments.lazyCompilation' option in compiler named '${c.name}' is deprecated, please use the Configuration top level 'lazyCompilation' instead.`) : isReportDeprecatedWarned || (console.warn(DEPRECATED_LAZY_COMPILATION_OPTIONS_WARN), isReportDeprecatedWarned = !0)), c.options.lazyCompilation && c.options.experiments.lazyCompilation && (c.name ? console.warn(`The top-level 'lazyCompilation' option in compiler named '${c.name}' will override the 'experiments.lazyCompilation' option.`) : isReportRepeatWarned || (console.warn(REPEAT_LAZY_COMPILATION_OPTIONS_WARN), isReportRepeatWarned = !0)), !c.options.lazyCompilation && !c.options.experiments.lazyCompilation) continue;
4474
4474
  let options = {
4475
4475
  ...c.options.experiments.lazyCompilation,
4476
4476
  ...c.options.lazyCompilation
@@ -4489,7 +4489,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
4489
4489
  return middleware?.(req, res, next);
4490
4490
  };
4491
4491
  }
4492
- if (compiler.options.experiments.lazyCompilation && (deprecate(DEPRECATED_LAZY_COMPILATION_OPTIONS_WARN), compiler.options.lazyCompilation && deprecate(REPEAT_LAZY_COMPILATION_OPTIONS_WARN)), !compiler.options.lazyCompilation && !compiler.options.experiments.lazyCompilation) return noop;
4492
+ if (compiler.options.experiments.lazyCompilation && (console.warn(DEPRECATED_LAZY_COMPILATION_OPTIONS_WARN), compiler.options.lazyCompilation && console.warn(REPEAT_LAZY_COMPILATION_OPTIONS_WARN)), !compiler.options.lazyCompilation && !compiler.options.experiments.lazyCompilation) return noop;
4493
4493
  let activeModules = new Set(), options = {
4494
4494
  ...compiler.options.experiments.lazyCompilation,
4495
4495
  ...compiler.options.lazyCompilation
@@ -4622,6 +4622,64 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
4622
4622
  ])
4623
4623
  }, RuntimePlugin_compilationHooksMap.set(compilation, hooks)), hooks;
4624
4624
  };
4625
+ let Coordinator_PLUGIN_NAME = "RscPlugin", GET_OR_INIT_BINDING = Symbol("GET_OR_INIT_BINDING");
4626
+ class Coordinator {
4627
+ #serverCompiler;
4628
+ #clientCompiler;
4629
+ #clientLastCompilation;
4630
+ #binding;
4631
+ constructor(){
4632
+ Object.defineProperty(this, GET_OR_INIT_BINDING, {
4633
+ enumerable: !1,
4634
+ configurable: !1,
4635
+ writable: !1,
4636
+ value: ()=>(this.#binding || (this.#binding = new binding_.JsCoordinator(()=>{
4637
+ if (!this.#serverCompiler) throw Error("[RscPlugin] Coordinator.getOrInitBinding() called before the server compiler was attached. Call coordinator.applyServerCompiler(serverCompiler) first.");
4638
+ return this.#serverCompiler[GET_COMPILER_ID]();
4639
+ })), this.#binding)
4640
+ });
4641
+ }
4642
+ applyServerCompiler(serverCompiler) {
4643
+ this.#serverCompiler = serverCompiler, serverCompiler.hooks.done.tap(Coordinator_PLUGIN_NAME, (stats)=>{
4644
+ this.#clientLastCompilation && (stats.compilation.fileDependencies.addAll(this.#clientLastCompilation.fileDependencies), stats.compilation.contextDependencies.addAll(this.#clientLastCompilation.contextDependencies), stats.compilation.missingDependencies.addAll(this.#clientLastCompilation.missingDependencies));
4645
+ }), serverCompiler.hooks.watchRun.tap(Coordinator_PLUGIN_NAME, ()=>{
4646
+ this.#clientCompiler.watching.invalidateWithChangesAndRemovals(new Set(this.#serverCompiler.modifiedFiles), new Set(this.#serverCompiler.removedFiles));
4647
+ });
4648
+ }
4649
+ applyClientCompiler(clientCompiler) {
4650
+ this.#clientCompiler = clientCompiler;
4651
+ let originalWatch = clientCompiler.watch;
4652
+ clientCompiler.watch = function(watchOptions, handler) {
4653
+ return watchOptions.ignored = ()=>!0, originalWatch.call(this, watchOptions, handler);
4654
+ }, clientCompiler.hooks.done.tap(Coordinator_PLUGIN_NAME, (stats)=>{
4655
+ this.#clientLastCompilation = stats.compilation;
4656
+ });
4657
+ }
4658
+ }
4659
+ class RscClientPlugin extends RspackBuiltinPlugin {
4660
+ name = "RscClientPlugin";
4661
+ #coordinator;
4662
+ constructor(coordinator){
4663
+ super(), this.#coordinator = coordinator;
4664
+ }
4665
+ raw(compiler) {
4666
+ return this.#coordinator.applyClientCompiler(compiler), createBuiltinPlugin(this.name, this.#coordinator[GET_OR_INIT_BINDING]());
4667
+ }
4668
+ }
4669
+ class RscServerPlugin extends RspackBuiltinPlugin {
4670
+ name = "RscServerPlugin";
4671
+ #coordinator;
4672
+ constructor(coordinator){
4673
+ super(), this.#coordinator = coordinator;
4674
+ }
4675
+ #resolve(serverCompiler) {
4676
+ return this.#coordinator.applyServerCompiler(serverCompiler), this.#coordinator[GET_OR_INIT_BINDING]();
4677
+ }
4678
+ raw(compiler) {
4679
+ let bindingOptions = this.#resolve(compiler);
4680
+ return createBuiltinPlugin(this.name, bindingOptions);
4681
+ }
4682
+ }
4625
4683
  let SideEffectsFlagPlugin = base_create(binding_.BuiltinPluginName.SideEffectsFlagPlugin, ()=>{}, "compilation"), SizeLimitsPlugin = base_create(binding_.BuiltinPluginName.SizeLimitsPlugin, (options)=>{
4626
4684
  let hints = !1 === options.hints ? void 0 : options.hints;
4627
4685
  return {
@@ -4869,7 +4927,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
4869
4927
  module: options?.minimizerOptions?.module
4870
4928
  }
4871
4929
  };
4872
- }, "compilation"), URLPlugin = base_create(binding_.BuiltinPluginName.URLPlugin, ()=>{}, "compilation");
4930
+ }, "compilation"), URLPlugin = base_create(binding_.BuiltinPluginName.URLPlugin, ()=>{}, "compilation"), WarnCaseSensitiveModulesPlugin = base_create(binding_.BuiltinPluginName.WarnCaseSensitiveModulesPlugin, ()=>{}, "compilation");
4873
4931
  class WebWorkerTemplatePlugin extends RspackBuiltinPlugin {
4874
4932
  name = binding_.BuiltinPluginName.WebWorkerTemplatePlugin;
4875
4933
  raw(compiler) {
@@ -5788,7 +5846,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
5788
5846
  if ("function" != typeof options.entry) for (let key of Object.keys(options.entry))F(options.entry[key], "import", ()=>[
5789
5847
  "./src"
5790
5848
  ]);
5791
- return F(options, "devtool", ()=>!!development && "eval"), D(options, "watch", !1), D(options, "profile", !1), F(options, "lazyCompilation", ()=>!!targetProperties && !!targetProperties.web && !targetProperties.electron && !targetProperties.node && !targetProperties.nwjs && {
5849
+ F(options, "devtool", ()=>!!development && "eval"), D(options, "watch", !1), D(options, "profile", !1), F(options, "lazyCompilation", ()=>!!targetProperties && !!targetProperties.web && !targetProperties.electron && !targetProperties.node && !targetProperties.nwjs && {
5792
5850
  imports: !0,
5793
5851
  entries: !1
5794
5852
  }), D(options, "bail", !1), F(options, "cache", ()=>development), !1 === options.cache && (options.experiments.cache = !1), applyExperimentsDefaults(options.experiments, {
@@ -5830,16 +5888,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
5830
5888
  targetProperties,
5831
5889
  mode: options.mode,
5832
5890
  css: options.experiments.css
5833
- }), options.resolve), options.resolveLoader = cleverMerge(getResolveLoaderDefaults(), options.resolveLoader), {
5834
- platform: !1 === targetProperties ? targetProperties : {
5835
- web: targetProperties.web,
5836
- browser: targetProperties.browser,
5837
- webworker: targetProperties.webworker,
5838
- node: targetProperties.node,
5839
- nwjs: targetProperties.nwjs,
5840
- electron: targetProperties.electron
5841
- }
5842
- };
5891
+ }), options.resolve), options.resolveLoader = cleverMerge(getResolveLoaderDefaults(), options.resolveLoader);
5843
5892
  }, applyInfrastructureLoggingDefaults = (infrastructureLogging)=>{
5844
5893
  F(infrastructureLogging, "stream", ()=>process.stderr);
5845
5894
  let tty = infrastructureLogging.stream?.isTTY && "dumb" !== process.env.TERM;
@@ -5847,7 +5896,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
5847
5896
  }, applyExperimentsDefaults = (experiments, { development })=>{
5848
5897
  F(experiments, "cache", ()=>development), D(experiments, "futureDefaults", !1), D(experiments, "lazyCompilation", !1), D(experiments, "asyncWebAssembly", experiments.futureDefaults), D(experiments, "css", !!experiments.futureDefaults || void 0), D(experiments, "topLevelAwait", !0), D(experiments, "deferImport", !1), D(experiments, "buildHttp", void 0), experiments.buildHttp && "object" == typeof experiments.buildHttp && D(experiments.buildHttp, "upgrade", !1), D(experiments, "incremental", {}), "object" == typeof experiments.incremental && (D(experiments.incremental, "silent", !0), D(experiments.incremental, "make", !0), D(experiments.incremental, "inferAsyncModules", !0), D(experiments.incremental, "providedExports", !0), D(experiments.incremental, "dependenciesDiagnostics", !0), D(experiments.incremental, "sideEffects", !0), D(experiments.incremental, "buildChunkGraph", !1), D(experiments.incremental, "moduleIds", !0), D(experiments.incremental, "chunkIds", !0), D(experiments.incremental, "modulesHashes", !0), D(experiments.incremental, "modulesCodegen", !0), D(experiments.incremental, "modulesRuntimeRequirements", !0), D(experiments.incremental, "chunksRuntimeRequirements", !0), D(experiments.incremental, "chunksHashes", !0), D(experiments.incremental, "chunksRender", !0), D(experiments.incremental, "emitAssets", !0)), D(experiments, "rspackFuture", {}), D(experiments, "parallelLoader", !1), D(experiments, "useInputFileSystem", !1), D(experiments, "inlineConst", !0), D(experiments, "inlineEnum", !1), D(experiments, "typeReexportsPresence", !1), D(experiments, "lazyBarrel", !0);
5849
5898
  }, applybundlerInfoDefaults = (rspackFuture, library)=>{
5850
- "object" == typeof rspackFuture && (D(rspackFuture, "bundlerInfo", {}), "object" == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, "version", "1.7.0-canary-e20de023-20251223174329"), D(rspackFuture.bundlerInfo, "bundler", "rspack"), D(rspackFuture.bundlerInfo, "force", !library)));
5899
+ "object" == typeof rspackFuture && (D(rspackFuture, "bundlerInfo", {}), "object" == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, "version", "1.7.0-canary-4941195f-20251224083309"), D(rspackFuture.bundlerInfo, "bundler", "rspack"), D(rspackFuture.bundlerInfo, "force", !library)));
5851
5900
  }, applySnapshotDefaults = (_snapshot, _env)=>{}, applyModuleDefaults = (module1, { cache, asyncWebAssembly, css, targetProperties, mode, uniqueName, deferImport })=>{
5852
5901
  if (assertNotNill(module1.parser), assertNotNill(module1.generator), cache ? D(module1, "unsafeCache", /[\\/]node_modules[\\/]/) : D(module1, "unsafeCache", !1), F(module1.parser, "asset", ()=>({})), assertNotNill(module1.parser.asset), F(module1.parser.asset, "dataUrlCondition", ()=>({})), "object" == typeof module1.parser.asset.dataUrlCondition && D(module1.parser.asset.dataUrlCondition, "maxSize", 8096), F(module1.parser, "javascript", ()=>({})), assertNotNill(module1.parser.javascript), ((parserOptions, { deferImport })=>{
5853
5902
  D(parserOptions, "dynamicImportMode", "lazy"), D(parserOptions, "dynamicImportPrefetch", !1), D(parserOptions, "dynamicImportPreload", !1), D(parserOptions, "url", !0), D(parserOptions, "exprContextCritical", !0), D(parserOptions, "unknownContextCritical", !0), D(parserOptions, "wrappedContextCritical", !1), D(parserOptions, "wrappedContextRegExp", /.*/), D(parserOptions, "strictExportPresence", !1), D(parserOptions, "requireAsExpression", !0), D(parserOptions, "requireDynamic", !0), D(parserOptions, "requireResolve", !0), D(parserOptions, "commonjs", !0), D(parserOptions, "importDynamic", !0), D(parserOptions, "worker", [
@@ -6327,7 +6376,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
6327
6376
  main: {}
6328
6377
  } : "function" == typeof config.entry ? (fn = config.entry, ()=>Promise.resolve().then(fn).then(getNormalizedEntryStatic)) : getNormalizedEntryStatic(config.entry),
6329
6378
  output: nestedConfig(config.output, (output)=>{
6330
- "cssHeadDataCompression" in output && deprecate("cssHeadDataCompression is not used now, see https://github.com/web-infra-dev/rspack/pull/8534, this option could be removed in the future");
6379
+ "cssHeadDataCompression" in output && external_node_util_default().deprecate(()=>{}, "cssHeadDataCompression is not used now, see https://github.com/web-infra-dev/rspack/pull/8534, this option could be removed in the future")();
6331
6380
  let { library } = output, libraryBase = "object" == typeof library && library && !Array.isArray(library) && "type" in library ? library : library || output.libraryTarget ? {
6332
6381
  name: library
6333
6382
  } : void 0;
@@ -6466,7 +6515,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
6466
6515
  plugins: nestedArray(config.plugins, (p)=>[
6467
6516
  ...p
6468
6517
  ]),
6469
- experiments: nestedConfig(config.experiments, (experiments)=>(experiments.layers && deprecate("`experiments.layers` config is deprecated and will be removed in Rspack v2.0. Feature layers will always be enabled. Remove this option from your Rspack configuration."), !1 === experiments.topLevelAwait && deprecate("`experiments.topLevelAwait` config is deprecated and will be removed in Rspack v2.0. Top-level await will always be enabled. Remove this option from your Rspack configuration."), experiments.lazyBarrel && deprecate("`experiments.lazyBarrel` config is deprecated and will be removed in Rspack v2.0. Lazy barrel is already stable and enabled by default. Remove this option from your Rspack configuration."), experiments.inlineConst && deprecate("`experiments.inlineConst` config is deprecated and will be removed in Rspack v2.0. Inline Const is already stable and enabled by default. Remove this option from your Rspack configuration."), experiments.inlineEnum && deprecate("`experiments.inlineEnum` config is deprecated and will be removed in Rspack v2.0. Inline Enum is already stable. Remove this option from your Rspack configuration."), experiments.typeReexportsPresence && deprecate("`experiments.typeReexportsPresence` config is deprecated and will be removed in Rspack v2.0. typeReexportsPresence is already stable. Remove this option from your Rspack configuration."), {
6518
+ experiments: nestedConfig(config.experiments, (experiments)=>(experiments.layers && external_node_util_default().deprecate(()=>{}, "`experiments.layers` config has been deprecated and will be removed in Rspack v2.0. Feature layers will be always enabled. Please remove this option from your Rspack configuration.")(), !1 === experiments.topLevelAwait && external_node_util_default().deprecate(()=>{}, "`experiments.topLevelAwait` config has been deprecated and will be removed in Rspack v2.0. Top-level await will be always enabled. Please remove this option from your Rspack configuration.")(), experiments.lazyBarrel && external_node_util_default().deprecate(()=>{}, "`experiments.lazyBarrel` config has been deprecated and will be removed in Rspack v2.0. Lazy barrel is already stable and enabled by default. Please remove this option from your Rspack configuration.")(), experiments.inlineConst && external_node_util_default().deprecate(()=>{}, "`experiments.inlineConst` config has been deprecated and will be removed in Rspack v2.0. Inline Const is already stable and enabled by default. Please remove this option from your Rspack configuration.")(), experiments.inlineEnum && external_node_util_default().deprecate(()=>{}, "`experiments.inlineEnum` config has been deprecated and will be removed in Rspack v2.0. Inline Enum is already stable. Please remove this option from your Rspack configuration.")(), experiments.typeReexportsPresence && external_node_util_default().deprecate(()=>{}, "`experiments.typeReexportsPresence` config has been deprecated and will be removed in Rspack v2.0. typeReexportsPresence is already stable. Please remove this option from your Rspack configuration.")(), {
6470
6519
  ...experiments,
6471
6520
  cache: optionalNestedConfig(experiments.cache, (cache)=>{
6472
6521
  if ("boolean" == typeof cache || "memory" === cache.type) return cache;
@@ -7613,7 +7662,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
7613
7662
  });
7614
7663
  }
7615
7664
  }
7616
- let CORE_VERSION = "1.7.0-canary-e20de023-20251223174329", bindingVersionCheck_errorMessage = (coreVersion, expectedCoreVersion)=>process.env.RSPACK_BINDING ? `Unmatched version @rspack/core@${coreVersion} and binding version.
7665
+ let CORE_VERSION = "1.7.0-canary-4941195f-20251224083309", bindingVersionCheck_errorMessage = (coreVersion, expectedCoreVersion)=>process.env.RSPACK_BINDING ? `Unmatched version @rspack/core@${coreVersion} and binding version.
7617
7666
 
7618
7667
  Help:
7619
7668
  Looks like you are using a custom binding (via environment variable 'RSPACK_BINDING=${process.env.RSPACK_BINDING}').
@@ -7841,21 +7890,21 @@ Help:
7841
7890
  let startTime = this.startTime;
7842
7891
  this.startTime = void 0, compilation.startTime = startTime, compilation.endTime = Date.now();
7843
7892
  let cbs = this.callbacks;
7844
- this.callbacks = [];
7845
- let fileDependencies = new Set([
7846
- ...compilation.fileDependencies
7847
- ]);
7848
- fileDependencies.added = new Set(compilation.__internal__addedFileDependencies), fileDependencies.removed = new Set(compilation.__internal__removedFileDependencies);
7849
- let contextDependencies = new Set([
7850
- ...compilation.contextDependencies
7851
- ]);
7852
- contextDependencies.added = new Set(compilation.__internal__addedContextDependencies), contextDependencies.removed = new Set(compilation.__internal__removedContextDependencies);
7853
- let missingDependencies = new Set([
7854
- ...compilation.missingDependencies
7855
- ]);
7856
- missingDependencies.added = new Set(compilation.__internal__addedMissingDependencies), missingDependencies.removed = new Set(compilation.__internal__removedMissingDependencies), this.compiler.hooks.done.callAsync(stats, (err)=>{
7893
+ this.callbacks = [], this.compiler.hooks.done.callAsync(stats, (err)=>{
7857
7894
  if (err) return handleError(err, cbs);
7858
- for (let cb of (this.handler(null, stats), process.nextTick(()=>{
7895
+ this.handler(null, stats);
7896
+ let fileDependencies = new Set([
7897
+ ...compilation.fileDependencies
7898
+ ]);
7899
+ fileDependencies.added = new Set(compilation.__internal__addedFileDependencies), fileDependencies.removed = new Set(compilation.__internal__removedFileDependencies);
7900
+ let contextDependencies = new Set([
7901
+ ...compilation.contextDependencies
7902
+ ]);
7903
+ contextDependencies.added = new Set(compilation.__internal__addedContextDependencies), contextDependencies.removed = new Set(compilation.__internal__removedContextDependencies);
7904
+ let missingDependencies = new Set([
7905
+ ...compilation.missingDependencies
7906
+ ]);
7907
+ for (let cb of (missingDependencies.added = new Set(compilation.__internal__addedMissingDependencies), missingDependencies.removed = new Set(compilation.__internal__removedMissingDependencies), process.nextTick(()=>{
7859
7908
  this.#closed || this.watch(fileDependencies, contextDependencies, missingDependencies);
7860
7909
  }), cbs))cb(null);
7861
7910
  this.compiler.hooks.afterDone.call(stats);
@@ -7876,7 +7925,7 @@ Help:
7876
7925
  this.suspended && (this.suspended = !1, this.#invalidate());
7877
7926
  }
7878
7927
  }
7879
- let COMPILATION_WEAK_MAP = new WeakMap();
7928
+ let COMPILATION_WEAK_MAP = new WeakMap(), GET_COMPILER_ID = Symbol("getCompilerId");
7880
7929
  class Compiler {
7881
7930
  #instance;
7882
7931
  #initial;
@@ -7913,7 +7962,6 @@ Help:
7913
7962
  context;
7914
7963
  cache;
7915
7964
  compilerPath;
7916
- #platform;
7917
7965
  options;
7918
7966
  unsafeFastDrop = !1;
7919
7967
  __internal_browser_require;
@@ -8012,16 +8060,14 @@ Help:
8012
8060
  }, this.rspack = {
8013
8061
  ...src_rspack_0,
8014
8062
  RuntimeGlobals: compilerRuntimeGlobals
8015
- }, this.root = this, this.outputPath = "", this.inputFileSystem = null, this.intermediateFileSystem = null, this.outputFileSystem = null, this.watchFileSystem = null, this.records = {}, this.options = options, this.context = context, this.cache = new Cache(), this.compilerPath = "", this.running = !1, this.idle = !1, this.watchMode = !1, this.#platform = {
8016
- web: null,
8017
- browser: null,
8018
- webworker: null,
8019
- node: null,
8020
- nwjs: null,
8021
- electron: null
8022
- }, this.__internal_browser_require = ()=>{
8063
+ }, this.root = this, this.outputPath = "", this.inputFileSystem = null, this.intermediateFileSystem = null, this.outputFileSystem = null, this.watchFileSystem = null, this.records = {}, this.options = options, this.context = context, this.cache = new Cache(), this.compilerPath = "", this.running = !1, this.idle = !1, this.watchMode = !1, this.__internal_browser_require = ()=>{
8023
8064
  throw Error("Cannot execute user defined code in browser without `BrowserRequirePlugin`");
8024
- }, this.resolverFactory = new ResolverFactory(options.resolve.pnp ?? getPnpDefault(), options.resolve, options.resolveLoader), new JsLoaderRspackPlugin(this).apply(this), new ExecuteModulePlugin().apply(this), new TraceHookPlugin().apply(this);
8065
+ }, this.resolverFactory = new ResolverFactory(options.resolve.pnp ?? getPnpDefault(), options.resolve, options.resolveLoader), new JsLoaderRspackPlugin(this).apply(this), new ExecuteModulePlugin().apply(this), new TraceHookPlugin().apply(this), Object.defineProperty(this, GET_COMPILER_ID, {
8066
+ writable: !1,
8067
+ configurable: !1,
8068
+ enumerable: !1,
8069
+ value: ()=>this.#instance.getCompilerId()
8070
+ });
8025
8071
  }
8026
8072
  get recordsInputPath() {
8027
8073
  return unsupported("Compiler.recordsInputPath");
@@ -8038,12 +8084,6 @@ Help:
8038
8084
  get _lastCompilation() {
8039
8085
  return this.#compilation;
8040
8086
  }
8041
- get platform() {
8042
- return this.#platform;
8043
- }
8044
- set platform(platform) {
8045
- this.#platform = platform;
8046
- }
8047
8087
  get __internal__builtinPlugins() {
8048
8088
  return this.#builtinPlugins;
8049
8089
  }
@@ -8310,7 +8350,7 @@ Help:
8310
8350
  this.#registers = this.#createHooksRegisters();
8311
8351
  let inputFileSystem = this.inputFileSystem && ThreadsafeInputNodeFS.needsBinding(options1.experiments.useInputFileSystem) ? ThreadsafeInputNodeFS.__to_binding(this.inputFileSystem) : void 0;
8312
8352
  try {
8313
- this.#instance = new instanceBinding.JsCompiler(this.compilerPath, rawOptions, this.#builtinPlugins, this.#registers, ThreadsafeOutputNodeFS.__to_binding(this.outputFileSystem), this.intermediateFileSystem ? ThreadsafeIntermediateNodeFS.__to_binding(this.intermediateFileSystem) : void 0, inputFileSystem, ResolverFactory.__to_binding(this.resolverFactory), this.unsafeFastDrop, this.#platform), callback(null, this.#instance);
8353
+ this.#instance = new instanceBinding.JsCompiler(this.compilerPath, rawOptions, this.#builtinPlugins, this.#registers, ThreadsafeOutputNodeFS.__to_binding(this.outputFileSystem), this.intermediateFileSystem ? ThreadsafeIntermediateNodeFS.__to_binding(this.intermediateFileSystem) : void 0, inputFileSystem, ResolverFactory.__to_binding(this.resolverFactory), this.unsafeFastDrop), callback(null, this.#instance);
8314
8354
  } catch (err) {
8315
8355
  err instanceof Error && delete err.stack, callback(Error("Failed to create Rspack compiler instance, check the Rspack configuration.", {
8316
8356
  cause: err
@@ -8936,7 +8976,7 @@ Help:
8936
8976
  obj.children = this.stats.map((stat, idx)=>{
8937
8977
  let obj = stat.toJson(childOptions.children[idx]), compilationName = stat.compilation.name;
8938
8978
  return obj.name = compilationName && makePathsRelative(childOptions.context, compilationName, stat.compilation.compiler.root), obj;
8939
- }), childOptions.version && (obj.rspackVersion = "1.7.0-canary-e20de023-20251223174329", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(""));
8979
+ }), childOptions.version && (obj.rspackVersion = "1.7.0-canary-4941195f-20251224083309", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(""));
8940
8980
  let mapError = (j, obj)=>({
8941
8981
  ...obj,
8942
8982
  compilerPath: obj.compilerPath ? `${j.name}.${obj.compilerPath}` : j.name
@@ -9846,7 +9886,7 @@ Help:
9846
9886
  object.hash = context.getStatsCompilation(compilation).hash;
9847
9887
  },
9848
9888
  version: (object)=>{
9849
- object.version = "5.75.0", object.rspackVersion = "1.7.0-canary-e20de023-20251223174329";
9889
+ object.version = "5.75.0", object.rspackVersion = "1.7.0-canary-4941195f-20251224083309";
9850
9890
  },
9851
9891
  env: (object, _compilation, _context, { _env })=>{
9852
9892
  object.env = _env;
@@ -12065,7 +12105,7 @@ Help:
12065
12105
  let _options = JSON.stringify(options || {});
12066
12106
  return binding_default().transform(source, _options);
12067
12107
  }
12068
- let exports_rspackVersion = "1.7.0-canary-e20de023-20251223174329", exports_version = "5.75.0", exports_WebpackError = Error, sources = __webpack_require__("webpack-sources"), exports_config = {
12108
+ let exports_rspackVersion = "1.7.0-canary-4941195f-20251224083309", exports_version = "5.75.0", exports_WebpackError = Error, sources = __webpack_require__("webpack-sources"), exports_config = {
12069
12109
  getNormalizedRspackOptions: getNormalizedRspackOptions,
12070
12110
  applyRspackOptionsDefaults: applyRspackOptionsDefaults,
12071
12111
  getNormalizedWebpackOptions: getNormalizedRspackOptions,
@@ -12298,7 +12338,27 @@ Help:
12298
12338
  if (INTERNAL_PLUGIN_NAMES.includes(name)) throw Error(`Cannot register native plugin with name '${name}', it conflicts with internal plugin names.`);
12299
12339
  return base_create(name, resolve, affectedHooks);
12300
12340
  },
12301
- VirtualModulesPlugin: VirtualModulesPlugin
12341
+ VirtualModulesPlugin: VirtualModulesPlugin,
12342
+ createRscPlugins: function() {
12343
+ let coordinator = new Coordinator();
12344
+ return {
12345
+ ServerPlugin: class extends RscServerPlugin {
12346
+ constructor(){
12347
+ super(coordinator);
12348
+ }
12349
+ },
12350
+ ClientPlugin: class extends RscClientPlugin {
12351
+ constructor(){
12352
+ super(coordinator);
12353
+ }
12354
+ }
12355
+ };
12356
+ },
12357
+ RSC_LAYERS_NAMES: {
12358
+ REACT_SERVER_COMPONENTS: "react-server-components",
12359
+ SERVER_SIDE_RENDERING: "server-side-rendering",
12360
+ ACTION_BROWSER: "action-browser"
12361
+ }
12302
12362
  }, ERROR_PREFIX = "Invalid Rspack configuration:";
12303
12363
  function validateRspackConfig(config) {
12304
12364
  (({ context })=>{
@@ -12334,8 +12394,7 @@ Help:
12334
12394
  if (new NodeEnvironmentPlugin({
12335
12395
  infrastructureLogging: options1.infrastructureLogging
12336
12396
  }).apply(compiler), Array.isArray(options1.plugins)) for (let plugin of options1.plugins)"function" == typeof plugin ? plugin.call(compiler, compiler) : plugin && plugin.apply(compiler);
12337
- let { platform } = applyRspackOptionsDefaults(compiler.options);
12338
- return platform && (compiler.platform = platform), compiler.hooks.environment.call(), compiler.hooks.afterEnvironment.call(), new RspackOptionsApply().process(compiler.options, compiler), compiler.hooks.initialize.call(), compiler;
12397
+ return applyRspackOptionsDefaults(compiler.options), compiler.hooks.environment.call(), compiler.hooks.afterEnvironment.call(), new RspackOptionsApply().process(compiler.options, compiler), compiler.hooks.initialize.call(), compiler;
12339
12398
  }
12340
12399
  function isMultiRspackOptions(o) {
12341
12400
  return Array.isArray(o);
@@ -12380,21 +12439,21 @@ Help:
12380
12439
  }
12381
12440
  {
12382
12441
  let { compiler, watch } = create();
12383
- return watch && deprecate("A 'callback' argument needs to be provided to the 'rspack(options, callback)' function when the 'watch' option is set. There is no way to handle the 'watch' option without a callback."), compiler;
12442
+ return watch && external_node_util_default().deprecate(()=>{}, "A 'callback' argument needs to be provided to the 'rspack(options, callback)' function when the 'watch' option is set. There is no way to handle the 'watch' option without a callback.")(), compiler;
12384
12443
  }
12385
12444
  }, exports_namespaceObject);
12386
12445
  src_fn.rspack = src_fn, src_fn.webpack = src_fn;
12387
12446
  let src_rspack_0 = src_fn, src_0 = src_rspack_0;
12388
- })(), exports.AsyncDependenciesBlock = __webpack_exports__.AsyncDependenciesBlock, exports.BannerPlugin = __webpack_exports__.BannerPlugin, exports.CaseSensitivePlugin = __webpack_exports__.CaseSensitivePlugin, exports.CircularDependencyRspackPlugin = __webpack_exports__.CircularDependencyRspackPlugin, exports.Compilation = __webpack_exports__.Compilation, exports.Compiler = __webpack_exports__.Compiler, exports.ConcatenatedModule = __webpack_exports__.ConcatenatedModule, exports.ContextModule = __webpack_exports__.ContextModule, exports.ContextReplacementPlugin = __webpack_exports__.ContextReplacementPlugin, exports.CopyRspackPlugin = __webpack_exports__.CopyRspackPlugin, exports.CssExtractRspackPlugin = __webpack_exports__.CssExtractRspackPlugin, exports.DefinePlugin = __webpack_exports__.DefinePlugin, exports.Dependency = __webpack_exports__.Dependency, exports.DllPlugin = __webpack_exports__.DllPlugin, exports.DllReferencePlugin = __webpack_exports__.DllReferencePlugin, exports.DynamicEntryPlugin = __webpack_exports__.DynamicEntryPlugin, exports.EntryDependency = __webpack_exports__.EntryDependency, exports.EntryOptionPlugin = __webpack_exports__.EntryOptionPlugin, exports.EntryPlugin = __webpack_exports__.EntryPlugin, exports.EnvironmentPlugin = __webpack_exports__.EnvironmentPlugin, exports.EvalDevToolModulePlugin = __webpack_exports__.EvalDevToolModulePlugin, exports.EvalSourceMapDevToolPlugin = __webpack_exports__.EvalSourceMapDevToolPlugin, exports.ExternalModule = __webpack_exports__.ExternalModule, exports.ExternalsPlugin = __webpack_exports__.ExternalsPlugin, exports.HotModuleReplacementPlugin = __webpack_exports__.HotModuleReplacementPlugin, exports.HtmlRspackPlugin = __webpack_exports__.HtmlRspackPlugin, exports.IgnorePlugin = __webpack_exports__.IgnorePlugin, exports.LightningCssMinimizerRspackPlugin = __webpack_exports__.LightningCssMinimizerRspackPlugin, exports.LoaderOptionsPlugin = __webpack_exports__.LoaderOptionsPlugin, exports.LoaderTargetPlugin = __webpack_exports__.LoaderTargetPlugin, exports.Module = __webpack_exports__.Module, exports.ModuleFilenameHelpers = __webpack_exports__.ModuleFilenameHelpers, exports.MultiCompiler = __webpack_exports__.MultiCompiler, exports.MultiStats = __webpack_exports__.MultiStats, exports.NoEmitOnErrorsPlugin = __webpack_exports__.NoEmitOnErrorsPlugin, exports.NormalModule = __webpack_exports__.NormalModule, exports.NormalModuleReplacementPlugin = __webpack_exports__.NormalModuleReplacementPlugin, exports.ProgressPlugin = __webpack_exports__.ProgressPlugin, exports.ProvidePlugin = __webpack_exports__.ProvidePlugin, exports.RspackOptionsApply = __webpack_exports__.RspackOptionsApply, exports.RuntimeGlobals = __webpack_exports__.RuntimeGlobals, exports.RuntimeModule = __webpack_exports__.RuntimeModule, exports.RuntimePlugin = __webpack_exports__.RuntimePlugin, exports.SourceMapDevToolPlugin = __webpack_exports__.SourceMapDevToolPlugin, exports.Stats = __webpack_exports__.Stats, exports.StatsErrorCode = __webpack_exports__.StatsErrorCode, exports.SubresourceIntegrityPlugin = __webpack_exports__.SubresourceIntegrityPlugin, exports.SwcJsMinimizerRspackPlugin = __webpack_exports__.SwcJsMinimizerRspackPlugin, exports.Template = __webpack_exports__.Template, exports.ValidationError = __webpack_exports__.ValidationError, exports.WarnCaseSensitiveModulesPlugin = __webpack_exports__.WarnCaseSensitiveModulesPlugin, exports.WebpackError = __webpack_exports__.WebpackError, exports.WebpackOptionsApply = __webpack_exports__.WebpackOptionsApply, exports.config = __webpack_exports__.config, exports.container = __webpack_exports__.container, exports.default = __webpack_exports__.default, exports.electron = __webpack_exports__.electron, exports.experiments = __webpack_exports__.experiments, exports.javascript = __webpack_exports__.javascript, exports.lazyCompilationMiddleware = __webpack_exports__.lazyCompilationMiddleware, exports.library = __webpack_exports__.library, exports.node = __webpack_exports__.node, exports.optimize = __webpack_exports__.optimize, exports.rspack = __webpack_exports__.rspack, exports.rspackVersion = __webpack_exports__.rspackVersion, exports.sharing = __webpack_exports__.sharing, exports.sources = __webpack_exports__.sources, exports.util = __webpack_exports__.util, exports.version = __webpack_exports__.version, exports.wasm = __webpack_exports__.wasm, exports.web = __webpack_exports__.web, exports.webworker = __webpack_exports__.webworker, __webpack_exports__)-1 === [
12447
+ })(), exports.AsyncDependenciesBlock = __webpack_exports__.AsyncDependenciesBlock, exports.BannerPlugin = __webpack_exports__.BannerPlugin, exports.CircularDependencyRspackPlugin = __webpack_exports__.CircularDependencyRspackPlugin, exports.Compilation = __webpack_exports__.Compilation, exports.Compiler = __webpack_exports__.Compiler, exports.ConcatenatedModule = __webpack_exports__.ConcatenatedModule, exports.ContextModule = __webpack_exports__.ContextModule, exports.ContextReplacementPlugin = __webpack_exports__.ContextReplacementPlugin, exports.Coordinator = __webpack_exports__.Coordinator, exports.CopyRspackPlugin = __webpack_exports__.CopyRspackPlugin, exports.CssExtractRspackPlugin = __webpack_exports__.CssExtractRspackPlugin, exports.DefinePlugin = __webpack_exports__.DefinePlugin, exports.Dependency = __webpack_exports__.Dependency, exports.DllPlugin = __webpack_exports__.DllPlugin, exports.DllReferencePlugin = __webpack_exports__.DllReferencePlugin, exports.DynamicEntryPlugin = __webpack_exports__.DynamicEntryPlugin, exports.EntryDependency = __webpack_exports__.EntryDependency, exports.EntryOptionPlugin = __webpack_exports__.EntryOptionPlugin, exports.EntryPlugin = __webpack_exports__.EntryPlugin, exports.EnvironmentPlugin = __webpack_exports__.EnvironmentPlugin, exports.EvalDevToolModulePlugin = __webpack_exports__.EvalDevToolModulePlugin, exports.EvalSourceMapDevToolPlugin = __webpack_exports__.EvalSourceMapDevToolPlugin, exports.ExternalModule = __webpack_exports__.ExternalModule, exports.ExternalsPlugin = __webpack_exports__.ExternalsPlugin, exports.HotModuleReplacementPlugin = __webpack_exports__.HotModuleReplacementPlugin, exports.HtmlRspackPlugin = __webpack_exports__.HtmlRspackPlugin, exports.IgnorePlugin = __webpack_exports__.IgnorePlugin, exports.LightningCssMinimizerRspackPlugin = __webpack_exports__.LightningCssMinimizerRspackPlugin, exports.LoaderOptionsPlugin = __webpack_exports__.LoaderOptionsPlugin, exports.LoaderTargetPlugin = __webpack_exports__.LoaderTargetPlugin, exports.Module = __webpack_exports__.Module, exports.ModuleFilenameHelpers = __webpack_exports__.ModuleFilenameHelpers, exports.MultiCompiler = __webpack_exports__.MultiCompiler, exports.MultiStats = __webpack_exports__.MultiStats, exports.NoEmitOnErrorsPlugin = __webpack_exports__.NoEmitOnErrorsPlugin, exports.NormalModule = __webpack_exports__.NormalModule, exports.NormalModuleReplacementPlugin = __webpack_exports__.NormalModuleReplacementPlugin, exports.ProgressPlugin = __webpack_exports__.ProgressPlugin, exports.ProvidePlugin = __webpack_exports__.ProvidePlugin, exports.RscClientPlugin = __webpack_exports__.RscClientPlugin, exports.RscServerPlugin = __webpack_exports__.RscServerPlugin, exports.RspackOptionsApply = __webpack_exports__.RspackOptionsApply, exports.RuntimeGlobals = __webpack_exports__.RuntimeGlobals, exports.RuntimeModule = __webpack_exports__.RuntimeModule, exports.RuntimePlugin = __webpack_exports__.RuntimePlugin, exports.SourceMapDevToolPlugin = __webpack_exports__.SourceMapDevToolPlugin, exports.Stats = __webpack_exports__.Stats, exports.StatsErrorCode = __webpack_exports__.StatsErrorCode, exports.SubresourceIntegrityPlugin = __webpack_exports__.SubresourceIntegrityPlugin, exports.SwcJsMinimizerRspackPlugin = __webpack_exports__.SwcJsMinimizerRspackPlugin, exports.Template = __webpack_exports__.Template, exports.ValidationError = __webpack_exports__.ValidationError, exports.WarnCaseSensitiveModulesPlugin = __webpack_exports__.WarnCaseSensitiveModulesPlugin, exports.WebpackError = __webpack_exports__.WebpackError, exports.WebpackOptionsApply = __webpack_exports__.WebpackOptionsApply, exports.config = __webpack_exports__.config, exports.container = __webpack_exports__.container, exports.default = __webpack_exports__.default, exports.electron = __webpack_exports__.electron, exports.experiments = __webpack_exports__.experiments, exports.javascript = __webpack_exports__.javascript, exports.lazyCompilationMiddleware = __webpack_exports__.lazyCompilationMiddleware, exports.library = __webpack_exports__.library, exports.node = __webpack_exports__.node, exports.optimize = __webpack_exports__.optimize, exports.rspack = __webpack_exports__.rspack, exports.rspackVersion = __webpack_exports__.rspackVersion, exports.sharing = __webpack_exports__.sharing, exports.sources = __webpack_exports__.sources, exports.util = __webpack_exports__.util, exports.version = __webpack_exports__.version, exports.wasm = __webpack_exports__.wasm, exports.web = __webpack_exports__.web, exports.webworker = __webpack_exports__.webworker, __webpack_exports__)-1 === [
12389
12448
  "AsyncDependenciesBlock",
12390
12449
  "BannerPlugin",
12391
- "CaseSensitivePlugin",
12392
12450
  "CircularDependencyRspackPlugin",
12393
12451
  "Compilation",
12394
12452
  "Compiler",
12395
12453
  "ConcatenatedModule",
12396
12454
  "ContextModule",
12397
12455
  "ContextReplacementPlugin",
12456
+ "Coordinator",
12398
12457
  "CopyRspackPlugin",
12399
12458
  "CssExtractRspackPlugin",
12400
12459
  "DefinePlugin",
@@ -12425,6 +12484,8 @@ Help:
12425
12484
  "NormalModuleReplacementPlugin",
12426
12485
  "ProgressPlugin",
12427
12486
  "ProvidePlugin",
12487
+ "RscClientPlugin",
12488
+ "RscServerPlugin",
12428
12489
  "RspackOptionsApply",
12429
12490
  "RuntimeGlobals",
12430
12491
  "RuntimeModule",
package/dist/rspack.d.ts CHANGED
@@ -1,12 +1,3 @@
1
- /**
2
- * The following code is modified based on
3
- * https://github.com/webpack/webpack/blob/4b4ca3b/lib
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
1
  import type { Callback } from "@rspack/lite-tapable";
11
2
  import { Compiler } from "./Compiler";
12
3
  import { type RspackOptions } from "./config";
@@ -6,4 +6,3 @@ export declare function serializeObject(map: string | object | undefined | null)
6
6
  export declare function indent(str: string, prefix: string): string;
7
7
  export declare function stringifyLoaderObject(o: LoaderObject): string;
8
8
  export declare const unsupported: (name: string, issue?: string) => never;
9
- export declare function deprecate(message: string): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack-canary/core",
3
- "version": "1.7.0-canary-e20de023-20251223174329",
3
+ "version": "1.7.0-canary-4941195f-20251224083309",
4
4
  "webpackVersion": "5.75.0",
5
5
  "license": "MIT",
6
6
  "description": "The fast Rust-based web bundler with webpack-compatible API",
@@ -56,9 +56,9 @@
56
56
  "webpack-sources": "3.3.3"
57
57
  },
58
58
  "dependencies": {
59
- "@module-federation/runtime-tools": "0.22.0",
59
+ "@module-federation/runtime-tools": "0.21.6",
60
60
  "@rspack/lite-tapable": "1.1.0",
61
- "@rspack/binding": "npm:@rspack-canary/binding@1.7.0-canary-e20de023-20251223174329"
61
+ "@rspack/binding": "npm:@rspack-canary/binding@1.7.0-canary-4941195f-20251224083309"
62
62
  },
63
63
  "peerDependencies": {
64
64
  "@swc/helpers": ">=0.5.1"