@rspack-debug/browser 2.0.0-canary.20260120 → 2.0.0-rc.2

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 (56) hide show
  1. package/dist/Compilation.d.ts +3 -0
  2. package/dist/Compiler.d.ts +1 -0
  3. package/dist/FileSystem.d.ts +1 -1
  4. package/dist/ModuleGraph.d.ts +3 -1
  5. package/dist/ModuleGraphConnection.d.ts +10 -0
  6. package/dist/NormalModule.d.ts +0 -1
  7. package/dist/RuntimeGlobals.d.ts +1 -1
  8. package/dist/browser/BrowserRequirePlugin.d.ts +1 -1
  9. package/dist/browser/fs.d.ts +1 -1
  10. package/dist/builtin-loader/swc/pluginImport.d.ts +1 -1
  11. package/dist/builtin-loader/swc/types.d.ts +36 -1
  12. package/dist/builtin-plugin/EsmLibraryPlugin.d.ts +4 -2
  13. package/dist/builtin-plugin/EsmNodeTargetPlugin.d.ts +9 -0
  14. package/dist/builtin-plugin/HashedModuleIdsPlugin.d.ts +10 -0
  15. package/dist/builtin-plugin/ProgressPlugin.d.ts +5 -4
  16. package/dist/builtin-plugin/RsdoctorPlugin.d.ts +2 -2
  17. package/dist/builtin-plugin/SideEffectsFlagPlugin.d.ts +9 -9
  18. package/dist/builtin-plugin/SplitChunksPlugin.d.ts +2 -1
  19. package/dist/builtin-plugin/WorkerPlugin.d.ts +1 -0
  20. package/dist/builtin-plugin/index.d.ts +3 -0
  21. package/dist/builtin-plugin/lazy-compilation/middleware.d.ts +3 -3
  22. package/dist/builtin-plugin/rsc/Coordinator.d.ts +8 -0
  23. package/dist/builtin-plugin/rsc/RscClientPlugin.d.ts +13 -0
  24. package/dist/builtin-plugin/rsc/RscServerPlugin.d.ts +39 -0
  25. package/dist/builtin-plugin/rsc/index.d.ts +24 -0
  26. package/dist/checkNodeVersion.d.ts +1 -0
  27. package/dist/config/adapterRuleUse.d.ts +1 -1
  28. package/dist/config/devServer.d.ts +102 -237
  29. package/dist/config/normalization.d.ts +4 -4
  30. package/dist/config/types.d.ts +184 -71
  31. package/dist/container/ContainerPlugin.d.ts +3 -2
  32. package/dist/container/ContainerReferencePlugin.d.ts +4 -3
  33. package/dist/container/ModuleFederationManifestPlugin.d.ts +10 -3
  34. package/dist/container/ModuleFederationPlugin.d.ts +20 -1
  35. package/dist/container/ModuleFederationPluginV1.d.ts +2 -2
  36. package/dist/container/ModuleFederationRuntimePlugin.d.ts +4 -0
  37. package/dist/exports.d.ts +16 -7
  38. package/dist/index.d.ts +2 -1
  39. package/dist/index.js +11541 -7053
  40. package/dist/napi-binding.d.ts +254 -94
  41. package/dist/rspack.wasi-browser.js +15 -3
  42. package/dist/sharing/CollectSharedEntryPlugin.d.ts +22 -0
  43. package/dist/sharing/ConsumeSharedPlugin.d.ts +16 -3
  44. package/dist/sharing/IndependentSharedPlugin.d.ts +35 -0
  45. package/dist/sharing/ProvideSharedPlugin.d.ts +22 -2
  46. package/dist/sharing/SharePlugin.d.ts +43 -5
  47. package/dist/sharing/SharedContainerPlugin.d.ts +23 -0
  48. package/dist/sharing/SharedUsedExportsOptimizerPlugin.d.ts +14 -0
  49. package/dist/sharing/TreeShakingSharedPlugin.d.ts +16 -0
  50. package/dist/sharing/utils.d.ts +1 -0
  51. package/dist/swc.d.ts +1 -1
  52. package/dist/util/createHash.d.ts +1 -1
  53. package/dist/util/supportsColor.d.ts +6 -0
  54. package/dist/wasi-worker-browser.mjs +10300 -6050
  55. package/package.json +6 -4
  56. package/dist/rslib-runtime.js +0 -68
@@ -162,6 +162,7 @@ export declare class Compilation {
162
162
  Iterable<Chunk>,
163
163
  Iterable<Module>
164
164
  ], void>;
165
+ beforeModuleIds: liteTapable.SyncHook<[Iterable<Module>]>;
165
166
  finishModules: liteTapable.AsyncSeriesHook<[Iterable<Module>], void>;
166
167
  chunkHash: liteTapable.SyncHook<[Chunk, Hash]>;
167
168
  chunkAsset: liteTapable.SyncHook<[Chunk, string]>;
@@ -432,6 +433,8 @@ export declare class Entries implements Map<string, EntryData> {
432
433
  has(key: string): boolean;
433
434
  set(key: string, value: EntryData): this;
434
435
  delete(key: string): boolean;
436
+ getOrInsert(key: string, defaultValue: EntryData): EntryData;
437
+ getOrInsertComputed(key: string, callback: (key: string) => EntryData): EntryData;
435
438
  get(key: string): EntryData | undefined;
436
439
  keys(): ReturnType<Map<string, EntryData>['keys']>;
437
440
  }
@@ -79,6 +79,7 @@ export type CompilerHooks = {
79
79
  entryOption: liteTapable.SyncBailHook<[string, EntryNormalized], any>;
80
80
  additionalPass: liteTapable.AsyncSeriesHook<[]>;
81
81
  };
82
+ export declare const GET_COMPILER_ID: unique symbol;
82
83
  declare class Compiler {
83
84
  #private;
84
85
  hooks: CompilerHooks;
@@ -51,4 +51,4 @@ declare class ThreadsafeIntermediateNodeFS extends ThreadsafeOutputNodeFS {
51
51
  constructor(fs?: IntermediateFileSystem);
52
52
  static __to_binding(fs?: IntermediateFileSystem): ThreadsafeIntermediateNodeFS;
53
53
  }
54
- export { ThreadsafeInputNodeFS, ThreadsafeOutputNodeFS, ThreadsafeIntermediateNodeFS, };
54
+ export { ThreadsafeInputNodeFS, ThreadsafeIntermediateNodeFS, ThreadsafeOutputNodeFS, };
@@ -1,5 +1,6 @@
1
- import type { Dependency, JsModuleGraph, ModuleGraphConnection } from './binding';
1
+ import type { Dependency, JsModuleGraph } from './binding';
2
2
  import { ExportsInfo } from './ExportsInfo';
3
+ import type { ModuleGraphConnection } from './ModuleGraphConnection';
3
4
  import type { Module } from './Module';
4
5
  export default class ModuleGraph {
5
6
  #private;
@@ -7,6 +8,7 @@ export default class ModuleGraph {
7
8
  constructor(binding: JsModuleGraph);
8
9
  getModule(dependency: Dependency): Module | null;
9
10
  getResolvedModule(dependency: Dependency): Module | null;
11
+ getUsedExports(module: Module, runtime: string | string[]): string[] | boolean | null;
10
12
  getParentModule(dependency: Dependency): Module | null;
11
13
  getIssuer(module: Module): Module | null;
12
14
  getExportsInfo(module: Module): ExportsInfo;
@@ -0,0 +1,10 @@
1
+ import binding, { ModuleGraphConnection as BindingModuleGraphConnection } from './binding';
2
+ type ModuleGraphConnectionConstructor = typeof BindingModuleGraphConnection & {
3
+ readonly TRANSITIVE_ONLY: typeof binding.TRANSITIVE_ONLY_SYMBOL;
4
+ readonly CIRCULAR_CONNECTION: typeof binding.CIRCULAR_CONNECTION_SYMBOL;
5
+ };
6
+ export interface ModuleGraphConnection extends BindingModuleGraphConnection {
7
+ }
8
+ export declare const ModuleGraphConnection: ModuleGraphConnectionConstructor;
9
+ export type ConnectionState = boolean | typeof ModuleGraphConnection.TRANSITIVE_ONLY | typeof ModuleGraphConnection.CIRCULAR_CONNECTION;
10
+ export {};
@@ -4,7 +4,6 @@ import type { LoaderContext } from './config';
4
4
  import type { Module } from './Module';
5
5
  export interface NormalModuleCompilationHooks {
6
6
  loader: liteTapable.SyncHook<[LoaderContext, Module]>;
7
- readResourceForScheme: any;
8
7
  readResource: liteTapable.HookMap<liteTapable.AsyncSeriesBailHook<[LoaderContext], string | Buffer>>;
9
8
  }
10
9
  declare module './binding' {
@@ -352,5 +352,5 @@ export declare enum RuntimeVariable {
352
352
  }
353
353
  export declare function renderRuntimeVariables(variable: RuntimeVariable, _compilerOptions?: RspackOptionsNormalized): string;
354
354
  export declare function createCompilerRuntimeGlobals(compilerOptions?: RspackOptionsNormalized): Record<keyof typeof RuntimeGlobals, string>;
355
- declare const DefaultRuntimeGlobals: Record<"publicPath" | "chunkName" | "moduleId" | "module" | "require" | "global" | "system" | "exports" | "requireScope" | "thisAsExports" | "returnExportsFromRuntime" | "moduleLoaded" | "entryModuleId" | "moduleCache" | "moduleFactories" | "moduleFactoriesAddOnly" | "ensureChunk" | "ensureChunkHandlers" | "ensureChunkIncludeEntries" | "prefetchChunk" | "prefetchChunkHandlers" | "preloadChunk" | "preloadChunkHandlers" | "definePropertyGetters" | "makeNamespaceObject" | "createFakeNamespaceObject" | "compatGetDefaultExport" | "harmonyModuleDecorator" | "nodeModuleDecorator" | "getFullHash" | "wasmInstances" | "instantiateWasm" | "uncaughtErrorHandler" | "scriptNonce" | "loadScript" | "createScript" | "createScriptUrl" | "getTrustedTypesPolicy" | "hasFetchPriority" | "runtimeId" | "getChunkScriptFilename" | "getChunkCssFilename" | "rspackVersion" | "hasCssModules" | "rspackUniqueId" | "getChunkUpdateScriptFilename" | "getChunkUpdateCssFilename" | "startup" | "startupNoDefault" | "startupOnlyAfter" | "startupOnlyBefore" | "chunkCallback" | "startupEntrypoint" | "startupChunkDependencies" | "onChunksLoaded" | "externalInstallChunk" | "interceptModuleExecution" | "shareScopeMap" | "initializeSharing" | "currentRemoteGetScope" | "getUpdateManifestFilename" | "hmrDownloadManifest" | "hmrDownloadUpdateHandlers" | "hmrModuleData" | "hmrInvalidateModuleHandlers" | "hmrRuntimeStatePrefix" | "amdDefine" | "amdOptions" | "hasOwnProperty" | "systemContext" | "baseURI" | "relativeUrl" | "asyncModule" | "asyncModuleExportSymbol" | "makeDeferredNamespaceObject" | "makeDeferredNamespaceObjectSymbol", string>;
355
+ declare const DefaultRuntimeGlobals: Record<"module" | "publicPath" | "chunkName" | "moduleId" | "exports" | "require" | "global" | "system" | "requireScope" | "thisAsExports" | "returnExportsFromRuntime" | "moduleLoaded" | "entryModuleId" | "moduleCache" | "moduleFactories" | "moduleFactoriesAddOnly" | "ensureChunk" | "ensureChunkHandlers" | "ensureChunkIncludeEntries" | "prefetchChunk" | "prefetchChunkHandlers" | "preloadChunk" | "preloadChunkHandlers" | "definePropertyGetters" | "makeNamespaceObject" | "createFakeNamespaceObject" | "compatGetDefaultExport" | "harmonyModuleDecorator" | "nodeModuleDecorator" | "getFullHash" | "wasmInstances" | "instantiateWasm" | "uncaughtErrorHandler" | "scriptNonce" | "loadScript" | "createScript" | "createScriptUrl" | "getTrustedTypesPolicy" | "hasFetchPriority" | "runtimeId" | "getChunkScriptFilename" | "getChunkCssFilename" | "rspackVersion" | "hasCssModules" | "rspackUniqueId" | "getChunkUpdateScriptFilename" | "getChunkUpdateCssFilename" | "startup" | "startupNoDefault" | "startupOnlyAfter" | "startupOnlyBefore" | "chunkCallback" | "startupEntrypoint" | "startupChunkDependencies" | "onChunksLoaded" | "externalInstallChunk" | "interceptModuleExecution" | "shareScopeMap" | "initializeSharing" | "currentRemoteGetScope" | "getUpdateManifestFilename" | "hmrDownloadManifest" | "hmrDownloadUpdateHandlers" | "hmrModuleData" | "hmrInvalidateModuleHandlers" | "hmrRuntimeStatePrefix" | "amdDefine" | "amdOptions" | "hasOwnProperty" | "systemContext" | "baseURI" | "relativeUrl" | "asyncModule" | "asyncModuleExportSymbol" | "makeDeferredNamespaceObject" | "makeDeferredNamespaceObjectSymbol", string>;
356
356
  export { DefaultRuntimeGlobals as RuntimeGlobals };
@@ -31,7 +31,7 @@ export declare class BrowserRequirePlugin {
31
31
  * This is an unsafe way to execute code in the browser using `new Function`.
32
32
  * It is your responsibility to ensure that your application is not vulnerable to attacks due to this function.
33
33
  */
34
- static unsafeExecute: ((code: string, runtime: CommonJsRuntime) => void) | undefined;
34
+ static unsafeExecute: (code: string, runtime: CommonJsRuntime) => void;
35
35
  constructor(options: BrowserRequirePluginOptions);
36
36
  apply(compiler: Compiler): void;
37
37
  }
@@ -10,4 +10,4 @@ declare const readFileSync: (file: import("memfs/lib/core").TFileId, options?: i
10
10
  (path: import("memfs/lib/node/types/misc").PathLike, options: import("memfs/lib/node/types/options").IReaddirOptions | string, callback: import("memfs/lib/node/types/misc").TCallback<import("memfs/lib/encoding").TDataOut[] | import("memfs/lib/node/Dirent").Dirent[]>): any;
11
11
  }, watch: (path: import("memfs/lib/node/types/misc").PathLike, options?: import("memfs/lib/node/volume").IWatchOptions | string, listener?: (eventType: string, filename: string) => void) => import("memfs/lib/node/volume").FSWatcher;
12
12
  export default fs;
13
- export { readFileSync, readdirSync, lstat, existsSync, readdir, watch };
13
+ export { existsSync, lstat, readdir, readdirSync, readFileSync, watch };
@@ -29,5 +29,5 @@ type PluginImportConfig = {
29
29
  };
30
30
  type PluginImportOptions = PluginImportConfig[];
31
31
  declare function resolvePluginImport(pluginImport: PluginImportOptions): RawPluginImportConfig[] | undefined;
32
- export { resolvePluginImport };
33
32
  export type { PluginImportOptions };
33
+ export { resolvePluginImport };
@@ -8,21 +8,55 @@ export type SwcLoaderParserConfig = ParserConfig;
8
8
  export type SwcLoaderEsParserConfig = EsParserConfig;
9
9
  export type SwcLoaderTsParserConfig = TsParserConfig;
10
10
  export type SwcLoaderTransformConfig = TransformConfig;
11
- export type SwcLoaderOptions = Config & {
11
+ type SwcLoaderCommonOptions = Omit<Config, 'jsc'> & {
12
12
  isModule?: boolean | 'unknown';
13
13
  /**
14
14
  * Collects information from TypeScript's AST for consumption by subsequent Rspack processes,
15
15
  * providing better TypeScript development experience and smaller output bundle size.
16
16
  */
17
17
  collectTypeScriptInfo?: CollectTypeScriptInfoOptions;
18
+ /**
19
+ * Ported from [babel-plugin-import](https://github.com/umijs/babel-plugin-import),
20
+ * used to transform imports for modular component libraries.
21
+ */
22
+ transformImport?: PluginImportOptions;
18
23
  /**
19
24
  * Experimental features provided by Rspack.
20
25
  * @experimental
21
26
  */
22
27
  rspackExperiments?: {
28
+ /**
29
+ * @deprecated Use top-level `transformImport` instead.
30
+ */
23
31
  import?: PluginImportOptions;
32
+ /**
33
+ * Enable React Server Components support.
34
+ */
35
+ reactServerComponents?: boolean | ReactServerComponentsOptions;
24
36
  };
25
37
  };
38
+ export type SwcLoaderOptions = (SwcLoaderCommonOptions & {
39
+ /**
40
+ * When set to `"auto"`, `builtin:swc-loader` infers `jsc.parser` from the resource extension.
41
+ * This is useful when one rule needs to handle mixed module types such as `.js`, `.jsx`, `.ts`, and `.tsx`.
42
+ * @default false
43
+ */
44
+ detectSyntax?: false;
45
+ jsc?: JscConfig;
46
+ }) | (SwcLoaderCommonOptions & {
47
+ detectSyntax: 'auto';
48
+ jsc?: Omit<JscConfig, 'parser'> & {
49
+ parser?: Partial<ParserConfig>;
50
+ };
51
+ });
52
+ export interface ReactServerComponentsOptions {
53
+ /**
54
+ * Whether to disable the compile-time check that reports errors when React
55
+ * client-only APIs (e.g. `useState`, `useEffect`) are imported in server
56
+ * components. Defaults to `false`.
57
+ */
58
+ disableClientApiChecks?: boolean;
59
+ }
26
60
  export interface TerserCompressOptions {
27
61
  arguments?: boolean;
28
62
  arrows?: boolean;
@@ -81,3 +115,4 @@ export interface TerserCompressOptions {
81
115
  const_to_let?: boolean;
82
116
  module?: boolean;
83
117
  }
118
+ export {};
@@ -1,13 +1,15 @@
1
1
  import type { Compiler } from '../Compiler';
2
- import type { RspackOptionsNormalized } from '../config';
2
+ import type { OptimizationSplitChunksOptions, RspackOptionsNormalized } from '../config';
3
3
  export declare function applyLimits(options: RspackOptionsNormalized): void;
4
4
  export declare class EsmLibraryPlugin {
5
5
  static PLUGIN_NAME: string;
6
- options?: {
6
+ options: {
7
7
  preserveModules?: string;
8
+ splitChunks?: OptimizationSplitChunksOptions | false;
8
9
  };
9
10
  constructor(options?: {
10
11
  preserveModules?: string;
12
+ splitChunks?: OptimizationSplitChunksOptions | false;
11
13
  });
12
14
  apply(compiler: Compiler): void;
13
15
  }
@@ -0,0 +1,9 @@
1
+ export declare const EsmNodeTargetPlugin: {
2
+ new (): {
3
+ name: string;
4
+ _args: [];
5
+ affectedHooks: keyof import("..").CompilerHooks | undefined;
6
+ raw(compiler: import("..").Compiler): import("../binding").BuiltinPlugin;
7
+ apply(compiler: import("..").Compiler): void;
8
+ };
9
+ };
@@ -0,0 +1,10 @@
1
+ import { type RawHashedModuleIdsPluginOptions } from '../binding';
2
+ export declare const HashedModuleIdsPlugin: {
3
+ new (options?: RawHashedModuleIdsPluginOptions | undefined): {
4
+ name: string;
5
+ _args: [options?: RawHashedModuleIdsPluginOptions | undefined];
6
+ affectedHooks: keyof import("..").CompilerHooks | undefined;
7
+ raw(compiler: import("..").Compiler): import("../binding").BuiltinPlugin;
8
+ apply(compiler: import("..").Compiler): void;
9
+ };
10
+ };
@@ -1,9 +1,10 @@
1
- import { type RawProgressPluginOptions } from '../binding';
2
- export type ProgressPluginArgument = Partial<Omit<RawProgressPluginOptions, 'handler'>> | ((percentage: number, msg: string, ...args: string[]) => void) | undefined;
1
+ import { type RawProgressPluginHandlerInfo, type RawProgressPluginOptions } from '../binding';
2
+ export type ProgressPluginOptions = Partial<Omit<RawProgressPluginOptions, 'handler'>> | ((percentage: number, msg: string, info: RawProgressPluginHandlerInfo) => void) | undefined;
3
+ export type ProgressPluginHandlerInfo = RawProgressPluginHandlerInfo;
3
4
  export declare const ProgressPlugin: {
4
- new (progress?: ProgressPluginArgument): {
5
+ new (progress?: ProgressPluginOptions): {
5
6
  name: string;
6
- _args: [progress?: ProgressPluginArgument];
7
+ _args: [progress?: ProgressPluginOptions];
7
8
  affectedHooks: keyof import("..").CompilerHooks | undefined;
8
9
  raw(compiler: import("..").Compiler): import("../binding").BuiltinPlugin;
9
10
  apply(compiler: import("..").Compiler): void;
@@ -1,10 +1,10 @@
1
- import { type JsRsdoctorAsset, type JsRsdoctorAssetPatch, type JsRsdoctorChunk, type JsRsdoctorChunkAssets, type JsRsdoctorChunkGraph, type JsRsdoctorChunkModules, type JsRsdoctorDependency, type JsRsdoctorEntrypoint, type JsRsdoctorEntrypointAssets, type JsRsdoctorExportInfo, type JsRsdoctorModule, type JsRsdoctorModuleGraph, type JsRsdoctorModuleGraphModule, type JsRsdoctorModuleIdsPatch, type JsRsdoctorModuleOriginalSource, type JsRsdoctorModuleSourcesPatch, type JsRsdoctorSideEffect, type JsRsdoctorSourcePosition, type JsRsdoctorSourceRange, type JsRsdoctorStatement, type JsRsdoctorVariable } from '../binding';
1
+ import { type JsRsdoctorAsset, type JsRsdoctorAssetPatch, type JsRsdoctorChunk, type JsRsdoctorChunkAssets, type JsRsdoctorChunkGraph, type JsRsdoctorChunkModules, type JsRsdoctorConnectionsOnlyImport, type JsRsdoctorConnectionsOnlyImportConnection, type JsRsdoctorDependency, type JsRsdoctorEntrypoint, type JsRsdoctorEntrypointAssets, type JsRsdoctorExportInfo, type JsRsdoctorModule, type JsRsdoctorModuleGraph, type JsRsdoctorModuleGraphModule, type JsRsdoctorModuleIdsPatch, type JsRsdoctorModuleOriginalSource, type JsRsdoctorModuleSourcesPatch, type JsRsdoctorSideEffect, type JsRsdoctorSourcePosition, type JsRsdoctorSourceRange, type JsRsdoctorStatement, type JsRsdoctorVariable } from '../binding';
2
2
  import * as liteTapable from '@rspack/lite-tapable';
3
3
  import { type Compilation } from '../Compilation';
4
4
  import type { Compiler } from '../Compiler';
5
5
  import type { CreatePartialRegisters } from '../taps/types';
6
6
  export declare namespace RsdoctorPluginData {
7
- export type { JsRsdoctorAsset as RsdoctorAsset, JsRsdoctorChunkGraph as RsdoctorChunkGraph, JsRsdoctorModuleGraph as RsdoctorModuleGraph, JsRsdoctorChunk as RsdoctorChunk, JsRsdoctorModule as RsdoctorModule, JsRsdoctorSideEffect as RsdoctorSideEffect, JsRsdoctorExportInfo as RsdoctorExportInfo, JsRsdoctorVariable as RsdoctorVariable, JsRsdoctorDependency as RsdoctorDependency, JsRsdoctorEntrypoint as RsdoctorEntrypoint, JsRsdoctorStatement as RsdoctorStatement, JsRsdoctorSourceRange as RsdoctorSourceRange, JsRsdoctorSourcePosition as RsdoctorSourcePosition, JsRsdoctorModuleGraphModule as RsdoctorModuleGraphModule, JsRsdoctorModuleIdsPatch as RsdoctorModuleIdsPatch, JsRsdoctorModuleOriginalSource as RsdoctorModuleOriginalSource, JsRsdoctorAssetPatch as RsdoctorAssetPatch, JsRsdoctorChunkAssets as RsdoctorChunkAssets, JsRsdoctorEntrypointAssets as RsdoctorEntrypointAssets, JsRsdoctorChunkModules as RsdoctorChunkModules, JsRsdoctorModuleSourcesPatch as RsdoctorModuleSourcesPatch, };
7
+ export type { JsRsdoctorAsset as RsdoctorAsset, JsRsdoctorChunkGraph as RsdoctorChunkGraph, JsRsdoctorModuleGraph as RsdoctorModuleGraph, JsRsdoctorChunk as RsdoctorChunk, JsRsdoctorModule as RsdoctorModule, JsRsdoctorSideEffect as RsdoctorSideEffect, JsRsdoctorExportInfo as RsdoctorExportInfo, JsRsdoctorVariable as RsdoctorVariable, JsRsdoctorConnectionsOnlyImport as RsdoctorConnectionsOnlyImport, JsRsdoctorConnectionsOnlyImportConnection as RsdoctorConnectionsOnlyImportConnection, JsRsdoctorDependency as RsdoctorDependency, JsRsdoctorEntrypoint as RsdoctorEntrypoint, JsRsdoctorStatement as RsdoctorStatement, JsRsdoctorSourceRange as RsdoctorSourceRange, JsRsdoctorSourcePosition as RsdoctorSourcePosition, JsRsdoctorModuleGraphModule as RsdoctorModuleGraphModule, JsRsdoctorModuleIdsPatch as RsdoctorModuleIdsPatch, JsRsdoctorModuleOriginalSource as RsdoctorModuleOriginalSource, JsRsdoctorAssetPatch as RsdoctorAssetPatch, JsRsdoctorChunkAssets as RsdoctorChunkAssets, JsRsdoctorEntrypointAssets as RsdoctorEntrypointAssets, JsRsdoctorChunkModules as RsdoctorChunkModules, JsRsdoctorModuleSourcesPatch as RsdoctorModuleSourcesPatch, };
8
8
  }
9
9
  export type RsdoctorPluginOptions = {
10
10
  moduleGraphFeatures?: boolean | ('graph' | 'ids' | 'sources')[];
@@ -1,9 +1,9 @@
1
- export declare const SideEffectsFlagPlugin: {
2
- new (): {
3
- name: string;
4
- _args: [];
5
- affectedHooks: keyof import("..").CompilerHooks | undefined;
6
- raw(compiler: import("..").Compiler): import("../binding").BuiltinPlugin;
7
- apply(compiler: import("..").Compiler): void;
8
- };
9
- };
1
+ import { type BuiltinPlugin, BuiltinPluginName } from '../binding';
2
+ import { RspackBuiltinPlugin } from './base';
3
+ export declare class SideEffectsFlagPlugin extends RspackBuiltinPlugin {
4
+ private analyzeSideEffectsFree;
5
+ name: BuiltinPluginName;
6
+ affectedHooks: "compilation";
7
+ constructor(analyzeSideEffectsFree?: boolean);
8
+ raw(): BuiltinPlugin;
9
+ }
@@ -1,4 +1,4 @@
1
- import { type BuiltinPlugin, BuiltinPluginName } from '../binding';
1
+ import { type BuiltinPlugin, BuiltinPluginName, type RawSplitChunksOptions } from '../binding';
2
2
  import type { Compiler } from '../Compiler';
3
3
  import type { OptimizationSplitChunksOptions } from '../config';
4
4
  import { RspackBuiltinPlugin } from './base';
@@ -9,3 +9,4 @@ export declare class SplitChunksPlugin extends RspackBuiltinPlugin {
9
9
  constructor(options: OptimizationSplitChunksOptions);
10
10
  raw(compiler: Compiler): BuiltinPlugin;
11
11
  }
12
+ export declare function toRawSplitChunksOptions(sc: false | OptimizationSplitChunksOptions, compiler: Compiler): RawSplitChunksOptions | undefined;
@@ -8,6 +8,7 @@ export declare class WorkerPlugin extends RspackBuiltinPlugin {
8
8
  private module;
9
9
  private workerPublicPath;
10
10
  name: BuiltinPluginName;
11
+ affectedHooks: "compilation";
11
12
  constructor(chunkLoading: ChunkLoading, wasmLoading: WasmLoading, module: OutputModule, workerPublicPath: WorkerPublicPath);
12
13
  raw(compiler: Compiler): BuiltinPlugin;
13
14
  }
@@ -28,6 +28,7 @@ export * from './EnableWasmLoadingPlugin';
28
28
  export * from './EnsureChunkConditionsPlugin';
29
29
  export * from './EntryPlugin';
30
30
  export * from './EsmLibraryPlugin';
31
+ export * from './EsmNodeTargetPlugin';
31
32
  export * from './EvalDevToolModulePlugin';
32
33
  export * from './EvalSourceMapDevToolPlugin';
33
34
  export * from './ExternalsPlugin';
@@ -35,6 +36,7 @@ export * from './FetchCompileAsyncWasmPlugin';
35
36
  export * from './FileUriPlugin';
36
37
  export * from './FlagDependencyExportsPlugin';
37
38
  export * from './FlagDependencyUsagePlugin';
39
+ export * from './HashedModuleIdsPlugin';
38
40
  export * from './HotModuleReplacementPlugin';
39
41
  export * from './HttpExternalsRspackPlugin';
40
42
  export * from './HttpUriPlugin';
@@ -73,6 +75,7 @@ export * from './RslibPlugin';
73
75
  export * from './RstestPlugin';
74
76
  export * from './RuntimeChunkPlugin';
75
77
  export * from './RuntimePlugin';
78
+ export { rsc } from './rsc';
76
79
  export * from './SideEffectsFlagPlugin';
77
80
  export * from './SizeLimitsPlugin';
78
81
  export * from './SourceMapDevToolPlugin';
@@ -1,6 +1,6 @@
1
1
  import { type Compiler, MultiCompiler } from '../..';
2
- import type { MiddlewareHandler } from '../../config/devServer';
3
- export declare const LAZY_COMPILATION_PREFIX = "/lazy-compilation-using-";
2
+ import type { DevServerMiddlewareHandler } from '../../config/devServer';
3
+ export declare const LAZY_COMPILATION_PREFIX = "/_rspack/lazy/trigger";
4
4
  /**
5
5
  * Create a middleware that handles lazy compilation requests from the client.
6
6
  * This function returns an Express-style middleware that listens for
@@ -9,4 +9,4 @@ export declare const LAZY_COMPILATION_PREFIX = "/lazy-compilation-using-";
9
9
  * Use this middleware when integrating lazy compilation into a
10
10
  * custom development server instead of relying on the built-in server.
11
11
  */
12
- export declare const lazyCompilationMiddleware: (compiler: Compiler | MultiCompiler) => MiddlewareHandler;
12
+ export declare const lazyCompilationMiddleware: (compiler: Compiler | MultiCompiler) => DevServerMiddlewareHandler;
@@ -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,13 @@
1
+ import type binding from '../../binding';
2
+ import type { Compiler } from '../..';
3
+ import { RspackBuiltinPlugin } from '../base';
4
+ import { type Coordinator } from './Coordinator';
5
+ export type RscClientPluginOptions = {
6
+ coordinator: Coordinator;
7
+ };
8
+ export declare class RscClientPlugin extends RspackBuiltinPlugin {
9
+ #private;
10
+ name: string;
11
+ constructor(options: RscClientPluginOptions);
12
+ raw(compiler: Compiler): binding.BuiltinPlugin;
13
+ }
@@ -0,0 +1,39 @@
1
+ import type binding from '../../binding';
2
+ import type { Compiler } from '../..';
3
+ import { RspackBuiltinPlugin } from '../base';
4
+ import { type Coordinator } from './Coordinator';
5
+ /** Manifest export entry (server/client actions, module refs). */
6
+ export interface RscManifestExport {
7
+ id: string;
8
+ name: string;
9
+ chunks: string[];
10
+ async?: boolean;
11
+ }
12
+ /** Map of export name to manifest export. */
13
+ export type RscManifestNode = Record<string, RscManifestExport>;
14
+ /** Module loading config (prefix, crossOrigin). */
15
+ export interface RscModuleLoading {
16
+ prefix: string;
17
+ crossOrigin?: 'use-credentials' | '';
18
+ }
19
+ export interface RscManifestPerEntry {
20
+ serverManifest: Record<string, RscManifestExport>;
21
+ clientManifest: Record<string, RscManifestExport>;
22
+ serverConsumerModuleMap: Record<string, RscManifestNode>;
23
+ moduleLoading: RscModuleLoading;
24
+ entryCssFiles: Record<string, string[]>;
25
+ entryJsFiles: string[];
26
+ }
27
+ /** Full RSC manifest (all entries) passed to onManifest. Map from entry name to per-entry manifest. */
28
+ export type RscManifest = Record<string, RscManifestPerEntry>;
29
+ export type RscServerPluginOptions = {
30
+ coordinator: Coordinator;
31
+ onServerComponentChanges?: () => Promise<void>;
32
+ onManifest?: (manifest: RscManifest) => void | Promise<void>;
33
+ };
34
+ export declare class RscServerPlugin extends RspackBuiltinPlugin {
35
+ #private;
36
+ name: string;
37
+ constructor(options: RscServerPluginOptions);
38
+ raw(compiler: Compiler): binding.BuiltinPlugin;
39
+ }
@@ -0,0 +1,24 @@
1
+ import { RscClientPlugin, type RscClientPluginOptions } from './RscClientPlugin';
2
+ import { RscServerPlugin } from './RscServerPlugin';
3
+ declare class ServerPlugin extends RscServerPlugin {
4
+ constructor(options?: Omit<RscClientPluginOptions, 'coordinator'>);
5
+ }
6
+ declare class ClientPlugin extends RscClientPlugin {
7
+ }
8
+ export declare const rsc: {
9
+ createPlugins: () => {
10
+ ServerPlugin: new (options?: Omit<RscClientPluginOptions, "coordinator">) => ServerPlugin;
11
+ ClientPlugin: new () => ClientPlugin;
12
+ };
13
+ Layers: {
14
+ /**
15
+ * The layer for server-only runtime and picking up `react-server` export conditions.
16
+ */
17
+ readonly rsc: "react-server-components";
18
+ /**
19
+ * Server Side Rendering layer for app.
20
+ */
21
+ readonly ssr: "server-side-rendering";
22
+ };
23
+ };
24
+ export {};
@@ -0,0 +1 @@
1
+ declare function checkNodeVersion(): void;
@@ -186,7 +186,7 @@ export interface LoaderContext<OptionsType = {}> {
186
186
  */
187
187
  request: string;
188
188
  /**
189
- * An array of all the loaders. It is writeable in the pitch phase.
189
+ * An array of all the loaders. It is writable in the pitch phase.
190
190
  * loaders = [{request: string, path: string, query: string, module: function}]
191
191
  *
192
192
  * In the example: