@rspack/core 2.0.2 → 2.0.3

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 (36) hide show
  1. package/compiled/http-proxy-middleware/index.d.ts +4 -4
  2. package/compiled/http-proxy-middleware/package.json +1 -1
  3. package/dist/Compilation.d.ts +1 -1
  4. package/dist/MultiCompiler.d.ts +1 -1
  5. package/dist/RuntimeGlobals.d.ts +1 -1
  6. package/dist/builtin-plugin/DeterministicChunkIdsPlugin.d.ts +1 -1
  7. package/dist/builtin-plugin/DeterministicModuleIdsPlugin.d.ts +1 -1
  8. package/dist/builtin-plugin/DynamicEntryPlugin.d.ts +1 -1
  9. package/dist/builtin-plugin/FlagDependencyUsagePlugin.d.ts +1 -1
  10. package/dist/builtin-plugin/HttpUriPlugin.d.ts +1 -1
  11. package/dist/builtin-plugin/JavascriptModulesPlugin.d.ts +1 -1
  12. package/dist/builtin-plugin/MangleExportsPlugin.d.ts +1 -1
  13. package/dist/builtin-plugin/ModuleConcatenationPlugin.d.ts +1 -1
  14. package/dist/builtin-plugin/NaturalChunkIdsPlugin.d.ts +1 -1
  15. package/dist/builtin-plugin/NaturalModuleIdsPlugin.d.ts +1 -1
  16. package/dist/builtin-plugin/SideEffectsFlagPlugin.d.ts +1 -1
  17. package/dist/builtin-plugin/SizeLimitsPlugin.d.ts +2 -2
  18. package/dist/builtin-plugin/SplitChunksPlugin.d.ts +1 -1
  19. package/dist/builtin-plugin/WorkerPlugin.d.ts +1 -1
  20. package/dist/builtin-plugin/rsc/RscServerPlugin.d.ts +7 -0
  21. package/dist/builtin-plugin/rsc/index.d.ts +3 -3
  22. package/dist/config/target.d.ts +1 -1
  23. package/dist/config/types.d.ts +4 -4
  24. package/dist/exports.d.ts +1 -1
  25. package/dist/index.js +11 -10
  26. package/dist/lib/CacheFacade.d.ts +1 -1
  27. package/dist/runtime/cssExtractHmr.d.ts +2 -2
  28. package/dist/runtime/moduleFederationDefaultRuntime.d.ts +1 -1
  29. package/dist/sharing/ConsumeSharedPlugin.d.ts +2 -2
  30. package/dist/sharing/ProvideSharedPlugin.d.ts +4 -4
  31. package/dist/sharing/SharePlugin.d.ts +4 -4
  32. package/dist/util/comparators.d.ts +1 -1
  33. package/dist/util/createHash.d.ts +1 -1
  34. package/dist/util/identifier.d.ts +35 -8
  35. package/module.d.ts +6 -0
  36. package/package.json +6 -6
@@ -182,7 +182,7 @@ interface Options<TReq extends http.IncomingMessage = http.IncomingMessage, TRes
182
182
  */
183
183
  pathRewrite?: PathRewriteConfig<TReq>;
184
184
  /**
185
- * Access the internal http-proxy server instance to customize behavior
185
+ * Access the internal `httpxy` server instance to customize behavior
186
186
  *
187
187
  * @example
188
188
  * ```js
@@ -207,7 +207,7 @@ interface Options<TReq extends http.IncomingMessage = http.IncomingMessage, TRes
207
207
  */
208
208
  ejectPlugins?: boolean;
209
209
  /**
210
- * Listen to http-proxy events
210
+ * Listen to `httpxy` events
211
211
  * @see {@link OnProxyEvent} for available events
212
212
  * @example
213
213
  * ```js
@@ -347,7 +347,7 @@ type BodyParserLikeRequest = http.IncomingMessage & {
347
347
  declare function fixRequestBody<TReq extends BodyParserLikeRequest = BodyParserLikeRequest>(proxyReq: http.ClientRequest, req: TReq): void;
348
348
 
349
349
  /**
350
- * Subscribe to {@link https://www.npmjs.com/package/http-proxy#listening-for-proxy-events http-proxy error events} to prevent server from crashing.
350
+ * Subscribe to {@link https://github.com/unjs/httpxy#events `httpxy` error events} to prevent server from crashing.
351
351
  * Errors are logged with {@link https://www.npmjs.com/package/debug debug} library.
352
352
  */
353
353
  declare const debugProxyErrorsPlugin: Plugin;
@@ -357,7 +357,7 @@ declare const errorResponsePlugin: Plugin;
357
357
  declare const loggerPlugin: Plugin;
358
358
 
359
359
  /**
360
- * Implements option.on object to subscribe to http-proxy events.
360
+ * Implements option.on object to subscribe to `httpxy` events.
361
361
  *
362
362
  * @example
363
363
  * ```js
@@ -1 +1 @@
1
- {"name":"http-proxy-middleware","author":"Steven Chim","version":"4.0.0-beta.6","license":"MIT","types":"index.d.ts","type":"module"}
1
+ {"name":"http-proxy-middleware","author":"Steven Chim","version":"4.0.0","license":"MIT","types":"index.d.ts","type":"module"}
@@ -235,7 +235,7 @@ export declare class Compilation {
235
235
  *
236
236
  * Note: This is a proxy for webpack internal API, only method `get`, `keys`, `values` and `entries` are supported now.
237
237
  */
238
- get namedChunks(): ReadonlyMap<string, Readonly<binding.Chunk>>;
238
+ get namedChunks(): ReadonlyMap<string, Readonly<Chunk>>;
239
239
  get entries(): Map<string, EntryData>;
240
240
  get codeGenerationResults(): binding.CodeGenerationResults;
241
241
  getCache(name: string): import("./lib/CacheFacade.js").CacheFacade;
@@ -45,7 +45,7 @@ export declare class MultiCompiler {
45
45
  get options(): import("./config/index.js").RspackOptionsNormalized[] & MultiCompilerOptions;
46
46
  get outputPath(): string;
47
47
  get inputFileSystem(): InputFileSystem;
48
- get outputFileSystem(): typeof import("fs");
48
+ get outputFileSystem(): typeof import('fs');
49
49
  get watchFileSystem(): WatchFileSystem;
50
50
  get intermediateFileSystem(): IntermediateFileSystem;
51
51
  set inputFileSystem(value: InputFileSystem);
@@ -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<"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>;
355
+ declare const DefaultRuntimeGlobals: Record<"amdDefine" | "amdOptions" | "asyncModule" | "asyncModuleExportSymbol" | "baseURI" | "chunkCallback" | "chunkName" | "compatGetDefaultExport" | "createFakeNamespaceObject" | "createScript" | "createScriptUrl" | "currentRemoteGetScope" | "definePropertyGetters" | "ensureChunk" | "ensureChunkHandlers" | "ensureChunkIncludeEntries" | "entryModuleId" | "exports" | "externalInstallChunk" | "getChunkCssFilename" | "getChunkScriptFilename" | "getChunkUpdateCssFilename" | "getChunkUpdateScriptFilename" | "getFullHash" | "getTrustedTypesPolicy" | "getUpdateManifestFilename" | "global" | "harmonyModuleDecorator" | "hasCssModules" | "hasFetchPriority" | "hasOwnProperty" | "hmrDownloadManifest" | "hmrDownloadUpdateHandlers" | "hmrInvalidateModuleHandlers" | "hmrModuleData" | "hmrRuntimeStatePrefix" | "initializeSharing" | "instantiateWasm" | "interceptModuleExecution" | "loadScript" | "makeDeferredNamespaceObject" | "makeDeferredNamespaceObjectSymbol" | "makeNamespaceObject" | "module" | "moduleCache" | "moduleFactories" | "moduleFactoriesAddOnly" | "moduleId" | "moduleLoaded" | "nodeModuleDecorator" | "onChunksLoaded" | "prefetchChunk" | "prefetchChunkHandlers" | "preloadChunk" | "preloadChunkHandlers" | "publicPath" | "relativeUrl" | "require" | "requireScope" | "returnExportsFromRuntime" | "rspackUniqueId" | "rspackVersion" | "runtimeId" | "scriptNonce" | "shareScopeMap" | "startup" | "startupChunkDependencies" | "startupEntrypoint" | "startupNoDefault" | "startupOnlyAfter" | "startupOnlyBefore" | "system" | "systemContext" | "thisAsExports" | "uncaughtErrorHandler" | "wasmInstances", string>;
356
356
  export { DefaultRuntimeGlobals as RuntimeGlobals };
@@ -2,6 +2,6 @@ import { type BuiltinPlugin, BuiltinPluginName } from '@rspack/binding';
2
2
  import { RspackBuiltinPlugin } from './base.js';
3
3
  export declare class DeterministicChunkIdsPlugin extends RspackBuiltinPlugin {
4
4
  name: BuiltinPluginName;
5
- affectedHooks: "compilation";
5
+ affectedHooks: 'compilation';
6
6
  raw(): BuiltinPlugin;
7
7
  }
@@ -2,6 +2,6 @@ import { type BuiltinPlugin, BuiltinPluginName } from '@rspack/binding';
2
2
  import { RspackBuiltinPlugin } from './base.js';
3
3
  export declare class DeterministicModuleIdsPlugin extends RspackBuiltinPlugin {
4
4
  name: BuiltinPluginName;
5
- affectedHooks: "compilation";
5
+ affectedHooks: 'compilation';
6
6
  raw(): BuiltinPlugin;
7
7
  }
@@ -6,7 +6,7 @@ export declare class DynamicEntryPlugin extends RspackBuiltinPlugin {
6
6
  private context;
7
7
  private entry;
8
8
  name: BuiltinPluginName;
9
- affectedHooks: "make";
9
+ affectedHooks: 'make';
10
10
  constructor(context: string, entry: EntryDynamicNormalized);
11
11
  raw(compiler: Compiler): BuiltinPlugin | undefined;
12
12
  }
@@ -3,7 +3,7 @@ import { RspackBuiltinPlugin } from './base.js';
3
3
  export declare class FlagDependencyUsagePlugin extends RspackBuiltinPlugin {
4
4
  private global;
5
5
  name: BuiltinPluginName;
6
- affectedHooks: "compilation";
6
+ affectedHooks: 'compilation';
7
7
  constructor(global: boolean);
8
8
  raw(): BuiltinPlugin;
9
9
  }
@@ -30,7 +30,7 @@ export type HttpUriPluginOptions = {
30
30
  export declare class HttpUriPlugin extends RspackBuiltinPlugin {
31
31
  private options;
32
32
  name: BuiltinPluginName;
33
- affectedHooks: "compilation";
33
+ affectedHooks: 'compilation';
34
34
  constructor(options: HttpUriPluginOptions);
35
35
  raw(compiler: Compiler): BuiltinPlugin | undefined;
36
36
  }
@@ -9,7 +9,7 @@ export type CompilationHooks = {
9
9
  };
10
10
  export declare class JavascriptModulesPlugin extends RspackBuiltinPlugin {
11
11
  name: BuiltinPluginName;
12
- affectedHooks: "compilation";
12
+ affectedHooks: 'compilation';
13
13
  raw(): BuiltinPlugin;
14
14
  static getCompilationHooks(compilation: Compilation): CompilationHooks;
15
15
  }
@@ -3,7 +3,7 @@ import { RspackBuiltinPlugin } from './base.js';
3
3
  export declare class MangleExportsPlugin extends RspackBuiltinPlugin {
4
4
  private deterministic;
5
5
  name: BuiltinPluginName;
6
- affectedHooks: "compilation";
6
+ affectedHooks: 'compilation';
7
7
  constructor(deterministic: boolean);
8
8
  raw(): BuiltinPlugin;
9
9
  }
@@ -2,6 +2,6 @@ import { type BuiltinPlugin, BuiltinPluginName } from '@rspack/binding';
2
2
  import { RspackBuiltinPlugin } from './base.js';
3
3
  export declare class ModuleConcatenationPlugin extends RspackBuiltinPlugin {
4
4
  name: BuiltinPluginName;
5
- affectedHooks: "compilation";
5
+ affectedHooks: 'compilation';
6
6
  raw(): BuiltinPlugin;
7
7
  }
@@ -2,6 +2,6 @@ import { type BuiltinPlugin, BuiltinPluginName } from '@rspack/binding';
2
2
  import { RspackBuiltinPlugin } from './base.js';
3
3
  export declare class NaturalChunkIdsPlugin extends RspackBuiltinPlugin {
4
4
  name: BuiltinPluginName;
5
- affectedHooks: "compilation";
5
+ affectedHooks: 'compilation';
6
6
  raw(): BuiltinPlugin;
7
7
  }
@@ -2,6 +2,6 @@ import { type BuiltinPlugin, BuiltinPluginName } from '@rspack/binding';
2
2
  import { RspackBuiltinPlugin } from './base.js';
3
3
  export declare class NaturalModuleIdsPlugin extends RspackBuiltinPlugin {
4
4
  name: BuiltinPluginName;
5
- affectedHooks: "compilation";
5
+ affectedHooks: 'compilation';
6
6
  raw(): BuiltinPlugin;
7
7
  }
@@ -3,7 +3,7 @@ import { RspackBuiltinPlugin } from './base.js';
3
3
  export declare class SideEffectsFlagPlugin extends RspackBuiltinPlugin {
4
4
  private analyzeSideEffectsFree;
5
5
  name: BuiltinPluginName;
6
- affectedHooks: "compilation";
6
+ affectedHooks: 'compilation';
7
7
  constructor(analyzeSideEffectsFree?: boolean);
8
8
  raw(): BuiltinPlugin;
9
9
  }
@@ -1,14 +1,14 @@
1
1
  export declare const SizeLimitsPlugin: {
2
2
  new (options: {
3
3
  assetFilter?: (assetFilename: string) => boolean;
4
- hints?: false | "warning" | "error";
4
+ hints?: false | 'warning' | 'error';
5
5
  maxAssetSize?: number;
6
6
  maxEntrypointSize?: number;
7
7
  }): {
8
8
  name: string;
9
9
  _args: [options: {
10
10
  assetFilter?: (assetFilename: string) => boolean;
11
- hints?: false | "warning" | "error";
11
+ hints?: false | 'warning' | 'error';
12
12
  maxAssetSize?: number;
13
13
  maxEntrypointSize?: number;
14
14
  }];
@@ -5,7 +5,7 @@ import { RspackBuiltinPlugin } from './base.js';
5
5
  export declare class SplitChunksPlugin extends RspackBuiltinPlugin {
6
6
  private options;
7
7
  name: BuiltinPluginName;
8
- affectedHooks: "thisCompilation";
8
+ affectedHooks: 'thisCompilation';
9
9
  constructor(options: OptimizationSplitChunksOptions);
10
10
  raw(compiler: Compiler): BuiltinPlugin;
11
11
  }
@@ -8,7 +8,7 @@ export declare class WorkerPlugin extends RspackBuiltinPlugin {
8
8
  private module;
9
9
  private workerPublicPath;
10
10
  name: BuiltinPluginName;
11
- affectedHooks: "compilation";
11
+ affectedHooks: 'compilation';
12
12
  constructor(chunkLoading: ChunkLoading, wasmLoading: WasmLoading, module: OutputModule, workerPublicPath: WorkerPublicPath);
13
13
  raw(compiler: Compiler): BuiltinPlugin;
14
14
  }
@@ -24,11 +24,18 @@ export interface RscManifestPerEntry {
24
24
  moduleLoading: RscModuleLoading;
25
25
  entryCssFiles: Record<string, string[]>;
26
26
  entryJsFiles: string[];
27
+ cssLinkProps: RscCssLinkProps;
27
28
  }
28
29
  /** Full RSC manifest (all entries) passed to onManifest. Map from entry name to per-entry manifest. */
29
30
  export type RscManifest = Record<string, RscManifestPerEntry>;
31
+ export type RscCssLinkProps = Record<string, string>;
32
+ export type RscCssLinkOptions = {
33
+ precedence?: string | false;
34
+ props?: RscCssLinkProps;
35
+ };
30
36
  export type RscServerPluginOptions = {
31
37
  coordinator: Coordinator;
38
+ cssLink?: RscCssLinkOptions | null;
32
39
  onServerComponentChanges?: () => void | Promise<void>;
33
40
  onManifest?: (manifest: RscManifest) => void | Promise<void>;
34
41
  };
@@ -7,18 +7,18 @@ declare class ClientPlugin extends RscClientPlugin {
7
7
  }
8
8
  export declare const rsc: {
9
9
  createPlugins: () => {
10
- ServerPlugin: new (options?: Omit<RscServerPluginOptions, "coordinator">) => ServerPlugin;
10
+ ServerPlugin: new (options?: Omit<RscServerPluginOptions, 'coordinator'>) => ServerPlugin;
11
11
  ClientPlugin: new () => ClientPlugin;
12
12
  };
13
13
  Layers: {
14
14
  /**
15
15
  * The layer for server-only runtime and picking up `react-server` export conditions.
16
16
  */
17
- readonly rsc: "react-server-components";
17
+ readonly rsc: 'react-server-components';
18
18
  /**
19
19
  * Server Side Rendering layer for app.
20
20
  */
21
- readonly ssr: "server-side-rendering";
21
+ readonly ssr: 'server-side-rendering';
22
22
  };
23
23
  };
24
24
  export {};
@@ -11,7 +11,7 @@
11
11
  * @param context the context directory
12
12
  * @returns default target
13
13
  */
14
- export declare const getDefaultTarget: (context: string) => "browserslist" | "web";
14
+ export declare const getDefaultTarget: (context: string) => 'browserslist' | 'web';
15
15
  export type PlatformTargetProperties = {
16
16
  /** web platform, importing of http(s) and std: is available */
17
17
  web?: boolean | null;
@@ -189,7 +189,7 @@ export type Clean = boolean | {
189
189
  export type OutputModule = boolean;
190
190
  /** Tell Rspack to remove a module from the module instance cache (require.cache) if it throws an exception when it is required. */
191
191
  export type StrictModuleExceptionHandling = boolean;
192
- /** Handle error in module loading as per EcmaScript Modules spec at a performance cost. */
192
+ /** Handle error in module loading as per ECMAScript Modules spec at a performance cost. */
193
193
  export type StrictModuleErrorHandling = boolean;
194
194
  /** Indicates what global object will be used to mount the library. */
195
195
  export type GlobalObject = string;
@@ -272,7 +272,7 @@ export type Environment = {
272
272
  destructuring?: boolean;
273
273
  /** The environment supports 'document' variable. */
274
274
  document?: boolean;
275
- /** The environment supports an async import() function to import EcmaScript modules. */
275
+ /** The environment supports an async import() function to import ECMAScript modules. */
276
276
  dynamicImport?: boolean;
277
277
  /** The environment supports an async import() when creating a worker, only for web targets at the moment. */
278
278
  dynamicImportInWorker?: boolean;
@@ -373,7 +373,7 @@ export type Output = {
373
373
  /** Tell Rspack to remove a module from the module instance cache (require.cache) if it throws an exception when it is required. */
374
374
  strictModuleExceptionHandling?: StrictModuleExceptionHandling;
375
375
  /**
376
- * Handle error in module loading as per EcmaScript Modules spec at a performance cost.
376
+ * Handle error in module loading as per ECMAScript Modules spec at a performance cost.
377
377
  * @default false
378
378
  * */
379
379
  strictModuleErrorHandling?: StrictModuleErrorHandling;
@@ -1099,7 +1099,7 @@ export type Target = false | AllowTarget | AllowTarget[];
1099
1099
  * `amd`, `umd`, `system` and `jsonp` externals depend on the `output.library.type` being set to the same value e.g. you can only consume amd externals within an amd library.
1100
1100
  * @default 'var'
1101
1101
  */
1102
- export type ExternalsType = 'var' | 'module' | 'assign' | 'this' | 'window' | 'self' | 'global' | 'commonjs' | 'commonjs2' | 'commonjs-module' | 'commonjs-static' | 'amd' | 'amd-require' | 'umd' | 'umd2' | 'jsonp' | 'system' | 'promise' | 'import' | 'module-import' | 'script' | 'node-commonjs' | 'commonjs-import';
1102
+ export type ExternalsType = 'var' | 'module' | 'assign' | 'this' | 'window' | 'self' | 'global' | 'commonjs' | 'commonjs2' | 'commonjs-module' | 'commonjs-static' | 'amd' | 'amd-require' | 'umd' | 'umd2' | 'jsonp' | 'system' | 'promise' | 'import' | 'module-import' | 'modern-module' | 'script' | 'node-commonjs' | 'commonjs-import';
1103
1103
  /**
1104
1104
  * External item object when both library.type and externalsType is 'umd'
1105
1105
  */
package/dist/exports.d.ts CHANGED
@@ -44,7 +44,7 @@ type Config = {
44
44
  export declare const config: Config;
45
45
  export type * from './config/index.js';
46
46
  export declare const util: {
47
- createHash: (algorithm: "xxhash64" | "md4" | "native-md4" | (string & {}) | (new () => import("./util/hash/index.js").default)) => import("./util/hash/index.js").default;
47
+ createHash: (algorithm: 'xxhash64' | 'md4' | 'native-md4' | (string & {}) | (new () => import("./util/hash/index.js").default)) => import("./util/hash/index.js").default;
48
48
  cleverMerge: <First, Second>(first: First, second: Second) => First | Second | (First & Second);
49
49
  };
50
50
  export type { BannerPluginArgument, DefinePluginOptions, EntryOptions, ProgressPluginHandlerInfo, ProgressPluginOptions, ProvidePluginOptions, } from './builtin-plugin/index.js';
package/dist/index.js CHANGED
@@ -34,7 +34,7 @@ __webpack_require__.m = __webpack_modules__, __webpack_require__.n = (module)=>{
34
34
  value: !0
35
35
  });
36
36
  }, __webpack_require__.add({
37
- "../../node_modules/.pnpm/enhanced-resolve@5.21.0/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js" (module, __unused_rspack_exports, __webpack_require__) {
37
+ "../../node_modules/.pnpm/enhanced-resolve@5.21.2/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js" (module, __unused_rspack_exports, __webpack_require__) {
38
38
  let { nextTick } = __webpack_require__("process"), dirname = (path)=>{
39
39
  let idx = path.length - 1;
40
40
  for(; idx >= 0;){
@@ -5198,6 +5198,7 @@ class RscServerPlugin extends RspackBuiltinPlugin {
5198
5198
  let { coordinator, onServerComponentChanges } = this.#options;
5199
5199
  return this.#options.onManifest && (onManifest = (json)=>Promise.resolve(this.#options.onManifest(JSON.parse(json)))), createBuiltinPlugin(this.name, {
5200
5200
  coordinator: coordinator[GET_OR_INIT_BINDING](),
5201
+ cssLink: this.#options.cssLink,
5201
5202
  onServerComponentChanges,
5202
5203
  onManifest
5203
5204
  });
@@ -6464,7 +6465,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
6464
6465
  ],
6465
6466
  [
6466
6467
  'esX',
6467
- 'EcmaScript in this version. Examples: es2020, es5.',
6468
+ 'ECMAScript in this version. Examples: es2020, es5.',
6468
6469
  /^es(\d+)$/,
6469
6470
  (version)=>{
6470
6471
  let v = +version;
@@ -6559,7 +6560,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
6559
6560
  targetProperties,
6560
6561
  buildHttp: !!options.experiments.buildHttp,
6561
6562
  outputModule: options.output.module
6562
- }), F(options, 'externalsType', ()=>options.output.library ? options.output.library.type : options.output.module ? 'module-import' : 'var'), applyNodeDefaults(options.node, {
6563
+ }), F(options, 'externalsType', ()=>options.output.library?.type && 'modern-module' !== options.output.library.type ? options.output.library.type : options.output.module ? 'module-import' : 'var'), applyNodeDefaults(options.node, {
6563
6564
  targetProperties,
6564
6565
  outputModule: options.output.module
6565
6566
  }), applyLoaderDefaults(options.loader, {
@@ -6871,7 +6872,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
6871
6872
  return output.wasmLoading && enabledWasmLoadingTypes.add(output.wasmLoading), output.workerWasmLoading && enabledWasmLoadingTypes.add(output.workerWasmLoading), forEachEntry((desc)=>{
6872
6873
  desc.wasmLoading && enabledWasmLoadingTypes.add(desc.wasmLoading);
6873
6874
  }), Array.from(enabledWasmLoadingTypes);
6874
- }), D(output, 'bundlerInfo', {}), 'object' == typeof output.bundlerInfo && (D(output.bundlerInfo, 'version', "2.0.2"), D(output.bundlerInfo, 'bundler', 'rspack'), D(output.bundlerInfo, 'force', !1));
6875
+ }), D(output, 'bundlerInfo', {}), 'object' == typeof output.bundlerInfo && (D(output.bundlerInfo, 'version', "2.0.3"), D(output.bundlerInfo, 'bundler', 'rspack'), D(output.bundlerInfo, 'force', !1));
6875
6876
  }, applyExternalsPresetsDefaults = (externalsPresets, { targetProperties, buildHttp, outputModule })=>{
6876
6877
  let isUniversal = (key)=>!!(outputModule && targetProperties && null === targetProperties[key]);
6877
6878
  D(externalsPresets, 'web', !buildHttp && targetProperties && (targetProperties.web || isUniversal('node'))), D(externalsPresets, 'node', targetProperties && (targetProperties.node || isUniversal('node'))), D(externalsPresets, 'electron', targetProperties && targetProperties.electron || isUniversal('electron')), D(externalsPresets, 'electronMain', targetProperties && !!targetProperties.electron && (targetProperties.electronMain || isUniversal('electronMain'))), D(externalsPresets, 'electronPreload', targetProperties && !!targetProperties.electron && (targetProperties.electronPreload || isUniversal('electronPreload'))), D(externalsPresets, 'electronRenderer', targetProperties && !!targetProperties.electron && (targetProperties.electronRenderer || isUniversal('electronRenderer'))), D(externalsPresets, 'nwjs', targetProperties && (targetProperties.nwjs || isUniversal('nwjs')));
@@ -8125,7 +8126,7 @@ class MultiStats {
8125
8126
  obj.children = this.stats.map((stat, idx)=>{
8126
8127
  let obj = stat.toJson(childOptions.children[idx]), compilationName = stat.compilation.name;
8127
8128
  return obj.name = compilationName && makePathsRelative(childOptions.context, compilationName, stat.compilation.compiler.root), obj;
8128
- }), childOptions.version && (obj.rspackVersion = "2.0.2", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(''));
8129
+ }), childOptions.version && (obj.rspackVersion = "2.0.3", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(''));
8129
8130
  let mapError = (j, obj)=>({
8130
8131
  ...obj,
8131
8132
  compilerPath: obj.compilerPath ? `${j.name}.${obj.compilerPath}` : j.name
@@ -8634,7 +8635,7 @@ let arraySum = (array)=>{
8634
8635
  let str = `${a}`, length = lengths[i];
8635
8636
  return str.length === length ? str : length > 5 ? `...${str.slice(-length + 3)}` : length > 0 ? str.slice(-length) : '';
8636
8637
  });
8637
- }, CachedInputFileSystem = __webpack_require__("../../node_modules/.pnpm/enhanced-resolve@5.21.0/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js");
8638
+ }, CachedInputFileSystem = __webpack_require__("../../node_modules/.pnpm/enhanced-resolve@5.21.2/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js");
8638
8639
  var CachedInputFileSystem_default = __webpack_require__.n(CachedInputFileSystem);
8639
8640
  class NodeEnvironmentPlugin {
8640
8641
  options;
@@ -9399,7 +9400,7 @@ let iterateConfig = (config, options, fn)=>{
9399
9400
  object.hash = context.getStatsCompilation(compilation).hash;
9400
9401
  },
9401
9402
  version: (object)=>{
9402
- object.version = "5.75.0", object.rspackVersion = "2.0.2";
9403
+ object.version = "5.75.0", object.rspackVersion = "2.0.3";
9403
9404
  },
9404
9405
  env: (object, _compilation, _context, { _env })=>{
9405
9406
  object.env = _env;
@@ -11057,7 +11058,7 @@ class TraceHookPlugin {
11057
11058
  });
11058
11059
  }
11059
11060
  }
11060
- let CORE_VERSION = "2.0.2", VFILES_BY_COMPILER = new WeakMap();
11061
+ let CORE_VERSION = "2.0.3", VFILES_BY_COMPILER = new WeakMap();
11061
11062
  class VirtualModulesPlugin {
11062
11063
  #staticModules;
11063
11064
  #compiler;
@@ -13337,7 +13338,7 @@ class ContainerReferencePlugin extends RspackBuiltinPlugin {
13337
13338
  for (let external of config.external){
13338
13339
  if (external.startsWith('internal ')) continue;
13339
13340
  let request = `webpack/container/reference/${key}${i ? `/fallback-${i}` : ''}`;
13340
- ('module' === remoteType || 'module-import' === remoteType) && external.startsWith('.') ? importExternals[request] = external : remoteExternals[request] = external, i++;
13341
+ ('module' === remoteType || 'module-import' === remoteType || 'modern-module' === remoteType) && external.startsWith('.') ? importExternals[request] = external : remoteExternals[request] = external, i++;
13341
13342
  }
13342
13343
  }
13343
13344
  new ExternalsPlugin(remoteType, remoteExternals, !0).apply(compiler), Object.keys(importExternals).length > 0 && new ExternalsPlugin('import', importExternals, !0).apply(compiler), new ShareRuntimePlugin(this._options.enhanced).apply(compiler);
@@ -13360,7 +13361,7 @@ async function transform(source, options) {
13360
13361
  let _options = JSON.stringify(options || {});
13361
13362
  return binding_default().transform(source, _options);
13362
13363
  }
13363
- let exports_rspackVersion = "2.0.2", exports_version = "5.75.0", exports_WebpackError = Error, exports_config = {
13364
+ let exports_rspackVersion = "2.0.3", exports_version = "5.75.0", exports_WebpackError = Error, exports_config = {
13364
13365
  getNormalizedRspackOptions: getNormalizedRspackOptions,
13365
13366
  applyRspackOptionsDefaults: applyRspackOptionsDefaults,
13366
13367
  getNormalizedWebpackOptions: getNormalizedRspackOptions,
@@ -134,6 +134,6 @@ export declare class CacheFacade {
134
134
  * @param computer function to compute the value if not cached
135
135
  * @returns promise with the data
136
136
  */
137
- providePromise<T>(identifier: string, etag: Etag | null, computer: () => Promise<T> | T): Promise<{} | T | null>;
137
+ providePromise<T>(identifier: string, etag: Etag | null, computer: () => Promise<T> | T): Promise<T | {} | null>;
138
138
  }
139
139
  export default CacheFacade;
@@ -1,4 +1,4 @@
1
1
  export declare function normalizeUrl(url: string): string;
2
- declare function noop(): void;
3
- declare function cssReload(moduleId: string, options: Record<string, any>): typeof noop;
2
+ type DebouncedFunction<T extends (...args: any[]) => any> = (...args: Parameters<T>) => void;
3
+ declare function cssReload(moduleId: string, options: Record<string, any>): DebouncedFunction<() => void>;
4
4
  export { cssReload };
@@ -1 +1 @@
1
- export default function _default(): void;
1
+ export default function (): void;
@@ -31,7 +31,7 @@ export declare function normalizeConsumeShareOptions(consumes: Consumes, shareSc
31
31
  packageName: string | undefined;
32
32
  singleton: boolean;
33
33
  eager: boolean;
34
- treeShakingMode: "server-calc" | "runtime-infer" | undefined;
34
+ treeShakingMode: "runtime-infer" | "server-calc" | undefined;
35
35
  }][];
36
36
  export declare class ConsumeSharedPlugin extends RspackBuiltinPlugin {
37
37
  name: BuiltinPluginName;
@@ -45,7 +45,7 @@ export declare class ConsumeSharedPlugin extends RspackBuiltinPlugin {
45
45
  packageName: string | undefined;
46
46
  singleton: boolean;
47
47
  eager: boolean;
48
- treeShakingMode: "server-calc" | "runtime-infer" | undefined;
48
+ treeShakingMode: "runtime-infer" | "server-calc" | undefined;
49
49
  }][];
50
50
  enhanced: boolean;
51
51
  };
@@ -35,14 +35,14 @@ export declare function normalizeProvideShareOptions<Enhanced extends boolean =
35
35
  shareScope: ShareScope;
36
36
  eager: boolean;
37
37
  } | {
38
- singleton: boolean | undefined;
39
- requiredVersion: string | false | undefined;
40
- strictVersion: boolean | undefined;
41
- treeShakingMode: "server-calc" | "runtime-infer" | undefined;
42
38
  shareKey: string;
43
39
  version: string | false | undefined;
44
40
  shareScope: ShareScope;
45
41
  eager: boolean;
42
+ singleton: boolean | undefined;
43
+ requiredVersion: string | false | undefined;
44
+ strictVersion: boolean | undefined;
45
+ treeShakingMode: "runtime-infer" | "server-calc" | undefined;
46
46
  }][];
47
47
  export declare class ProvideSharedPlugin<Enhanced extends boolean = false> extends RspackBuiltinPlugin {
48
48
  name: BuiltinPluginName;
@@ -39,7 +39,7 @@ export declare function createProvideShareOptions(normalizedSharedOptions: Norma
39
39
  singleton: boolean | undefined;
40
40
  requiredVersion: string | false | undefined;
41
41
  strictVersion: boolean | undefined;
42
- treeShakingMode: "server-calc" | "runtime-infer" | undefined;
42
+ treeShakingMode: "runtime-infer" | "server-calc" | undefined;
43
43
  };
44
44
  }[];
45
45
  export declare function createConsumeShareOptions(normalizedSharedOptions: NormalizedSharedOptions): {
@@ -52,7 +52,7 @@ export declare function createConsumeShareOptions(normalizedSharedOptions: Norma
52
52
  singleton: boolean | undefined;
53
53
  packageName: string | undefined;
54
54
  eager: boolean | undefined;
55
- treeShakingMode: "server-calc" | "runtime-infer" | undefined;
55
+ treeShakingMode: "runtime-infer" | "server-calc" | undefined;
56
56
  };
57
57
  }[];
58
58
  export declare class SharePlugin {
@@ -67,7 +67,7 @@ export declare class SharePlugin {
67
67
  singleton: boolean | undefined;
68
68
  packageName: string | undefined;
69
69
  eager: boolean | undefined;
70
- treeShakingMode: "server-calc" | "runtime-infer" | undefined;
70
+ treeShakingMode: "runtime-infer" | "server-calc" | undefined;
71
71
  };
72
72
  }[];
73
73
  _provides: {
@@ -79,7 +79,7 @@ export declare class SharePlugin {
79
79
  singleton: boolean | undefined;
80
80
  requiredVersion: string | false | undefined;
81
81
  strictVersion: boolean | undefined;
82
- treeShakingMode: "server-calc" | "runtime-infer" | undefined;
82
+ treeShakingMode: "runtime-infer" | "server-calc" | undefined;
83
83
  };
84
84
  }[];
85
85
  _enhanced: boolean;
@@ -12,5 +12,5 @@ type Selector<A, B> = (input: A) => B;
12
12
  export declare const concatComparators: (...comps: Comparator[]) => Comparator;
13
13
  export declare const compareIds: <T = string | number>(a: T, b: T) => -1 | 0 | 1;
14
14
  export declare const compareSelect: <T, R>(getter: Selector<T, R>, comparator: Comparator) => Comparator;
15
- export declare const compareNumbers: (a: number, b: number) => 0 | 1 | -1;
15
+ export declare const compareNumbers: (a: number, b: number) => -1 | 0 | 1;
16
16
  export {};
@@ -13,4 +13,4 @@ import Hash from './hash/index.js';
13
13
  * @param algorithm the algorithm name or a constructor creating a hash
14
14
  * @returns the hash
15
15
  */
16
- export declare const createHash: (algorithm: "xxhash64" | "md4" | "native-md4" | (string & {}) | (new () => Hash)) => Hash;
16
+ export declare const createHash: (algorithm: 'xxhash64' | 'md4' | 'native-md4' | (string & {}) | (new () => Hash)) => Hash;
@@ -7,25 +7,52 @@ interface ParsedResource {
7
7
  type ParsedResourceWithoutFragment = Omit<ParsedResource, 'fragment'>;
8
8
  export declare const makePathsRelative: {
9
9
  (context: string, identifier: string, associatedObjectForCache: object | undefined): string;
10
- bindCache(associatedObjectForCache: object | undefined): ((arg0: string, arg1: string) => string);
11
- bindContextCache(context: string, associatedObjectForCache: object | undefined): ((arg0: string) => string);
10
+ /**
11
+ * @param {Object=} associatedObjectForCache an object to which the cache will be attached
12
+ * @returns {function(string, string): string} cached function
13
+ */
14
+ bindCache: (associatedObjectForCache: object | undefined) => ((arg0: string, arg1: string) => string);
15
+ /**
16
+ * @param {string} context context used to create relative path
17
+ * @param {Object=} associatedObjectForCache an object to which the cache will be attached
18
+ * @returns {function(string): string} cached function
19
+ */
20
+ bindContextCache: (context: string, associatedObjectForCache: object | undefined) => ((arg0: string) => string);
12
21
  };
13
22
  export declare const contextify: {
14
23
  (context: string, identifier: string, associatedObjectForCache: object | undefined): string;
15
- bindCache(associatedObjectForCache: object | undefined): ((arg0: string, arg1: string) => string);
16
- bindContextCache(context: string, associatedObjectForCache: object | undefined): ((arg0: string) => string);
24
+ /**
25
+ * @param {Object=} associatedObjectForCache an object to which the cache will be attached
26
+ * @returns {function(string, string): string} cached function
27
+ */
28
+ bindCache: (associatedObjectForCache: object | undefined) => ((arg0: string, arg1: string) => string);
29
+ /**
30
+ * @param {string} context context used to create relative path
31
+ * @param {Object=} associatedObjectForCache an object to which the cache will be attached
32
+ * @returns {function(string): string} cached function
33
+ */
34
+ bindContextCache: (context: string, associatedObjectForCache: object | undefined) => ((arg0: string) => string);
17
35
  };
18
36
  export declare const absolutify: {
19
37
  (context: string, identifier: string, associatedObjectForCache: object | undefined): string;
20
- bindCache(associatedObjectForCache: object | undefined): ((arg0: string, arg1: string) => string);
21
- bindContextCache(context: string, associatedObjectForCache: object | undefined): ((arg0: string) => string);
38
+ /**
39
+ * @param {Object=} associatedObjectForCache an object to which the cache will be attached
40
+ * @returns {function(string, string): string} cached function
41
+ */
42
+ bindCache: (associatedObjectForCache: object | undefined) => ((arg0: string, arg1: string) => string);
43
+ /**
44
+ * @param {string} context context used to create relative path
45
+ * @param {Object=} associatedObjectForCache an object to which the cache will be attached
46
+ * @returns {function(string): string} cached function
47
+ */
48
+ bindContextCache: (context: string, associatedObjectForCache: object | undefined) => ((arg0: string) => string);
22
49
  };
23
50
  export declare const parseResource: {
24
51
  (str: string, associatedObjectForCache?: object): ParsedResource;
25
- bindCache(associatedObjectForCache: object): (str: string) => ParsedResource;
52
+ bindCache: (associatedObjectForCache: object) => (str: string) => ParsedResource;
26
53
  };
27
54
  export declare const parseResourceWithoutFragment: {
28
55
  (str: string, associatedObjectForCache?: object): ParsedResourceWithoutFragment;
29
- bindCache(associatedObjectForCache: object): (str: string) => ParsedResourceWithoutFragment;
56
+ bindCache: (associatedObjectForCache: object) => (str: string) => ParsedResourceWithoutFragment;
30
57
  };
31
58
  export {};
package/module.d.ts CHANGED
@@ -235,6 +235,12 @@ interface ImportMeta {
235
235
  mode?: 'sync' | 'eager' | 'weak' | 'lazy' | 'lazy-once';
236
236
  },
237
237
  ) => Rspack.Context;
238
+ /**
239
+ * Available in server components when using the RSC plugins.
240
+ */
241
+ rspackRsc?: {
242
+ loadCss(): any;
243
+ };
238
244
  }
239
245
 
240
246
  declare const __resourceQuery: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/core",
3
- "version": "2.0.2",
3
+ "version": "2.0.3",
4
4
  "webpackVersion": "5.75.0",
5
5
  "license": "MIT",
6
6
  "description": "Fast Rust-based bundler for the web with a modernized webpack API",
@@ -40,15 +40,15 @@
40
40
  "@ast-grep/napi": "^0.42.1",
41
41
  "@napi-rs/wasm-runtime": "1.1.4",
42
42
  "@rsbuild/plugin-node-polyfill": "^1.4.4",
43
- "@rslib/core": "0.21.3",
43
+ "@rslib/core": "^0.21.4",
44
44
  "@rspack/lite-tapable": "1.1.0",
45
45
  "@swc/types": "0.1.26",
46
- "@types/node": "^20.19.39",
46
+ "@types/node": "^20.19.40",
47
47
  "browserslist-load-config": "^1.0.1",
48
48
  "browserslist-to-es-version": "^1.4.1",
49
49
  "connect-next": "^4.0.1",
50
- "enhanced-resolve": "5.21.0",
51
- "http-proxy-middleware": "^4.0.0-beta.6",
50
+ "enhanced-resolve": "5.21.2",
51
+ "http-proxy-middleware": "^4.0.0",
52
52
  "memfs": "4.57.2",
53
53
  "open": "^11.0.0",
54
54
  "prebundle": "^1.6.4",
@@ -58,7 +58,7 @@
58
58
  "webpack-sources": "3.3.4"
59
59
  },
60
60
  "dependencies": {
61
- "@rspack/binding": "2.0.2"
61
+ "@rspack/binding": "2.0.3"
62
62
  },
63
63
  "peerDependencies": {
64
64
  "@module-federation/runtime-tools": "^0.24.1 || ^2.0.0",