@rspack-debug/browser 2.0.2 → 2.0.4

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 (38) hide show
  1. package/dist/Compilation.d.ts +1 -1
  2. package/dist/MultiCompiler.d.ts +1 -1
  3. package/dist/RuntimeGlobals.d.ts +1 -1
  4. package/dist/builtin-plugin/CircularModulesInfoPlugin.d.ts +7 -0
  5. package/dist/builtin-plugin/CssHttpExternalsRspackPlugin.d.ts +9 -0
  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/HttpExternalsRspackPlugin.d.ts +2 -2
  11. package/dist/builtin-plugin/HttpUriPlugin.d.ts +1 -1
  12. package/dist/builtin-plugin/JavascriptModulesPlugin.d.ts +1 -1
  13. package/dist/builtin-plugin/MangleExportsPlugin.d.ts +1 -1
  14. package/dist/builtin-plugin/ModuleConcatenationPlugin.d.ts +1 -1
  15. package/dist/builtin-plugin/NaturalChunkIdsPlugin.d.ts +1 -1
  16. package/dist/builtin-plugin/NaturalModuleIdsPlugin.d.ts +1 -1
  17. package/dist/builtin-plugin/SideEffectsFlagPlugin.d.ts +1 -1
  18. package/dist/builtin-plugin/SizeLimitsPlugin.d.ts +2 -2
  19. package/dist/builtin-plugin/SplitChunksPlugin.d.ts +1 -1
  20. package/dist/builtin-plugin/WorkerPlugin.d.ts +1 -1
  21. package/dist/builtin-plugin/index.d.ts +2 -0
  22. package/dist/builtin-plugin/rsc/RscServerPlugin.d.ts +7 -0
  23. package/dist/builtin-plugin/rsc/index.d.ts +3 -3
  24. package/dist/config/target.d.ts +1 -1
  25. package/dist/config/types.d.ts +33 -29
  26. package/dist/exports.d.ts +1 -1
  27. package/dist/index.js +149 -96
  28. package/dist/lib/CacheFacade.d.ts +1 -1
  29. package/dist/napi-binding.d.ts +25 -21
  30. package/dist/runtime/cssExtractHmr.d.ts +2 -2
  31. package/dist/runtime/moduleFederationDefaultRuntime.d.ts +1 -1
  32. package/dist/sharing/ConsumeSharedPlugin.d.ts +2 -2
  33. package/dist/sharing/ProvideSharedPlugin.d.ts +4 -4
  34. package/dist/sharing/SharePlugin.d.ts +4 -4
  35. package/dist/util/comparators.d.ts +1 -1
  36. package/dist/util/createHash.d.ts +1 -1
  37. package/dist/util/identifier.d.ts +35 -8
  38. package/package.json +1 -1
@@ -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;
@@ -216,6 +216,7 @@ export declare class Dependency {
216
216
  get type(): string
217
217
  get category(): string
218
218
  get request(): string | undefined
219
+ get attributes(): Record<string, string> | undefined
219
220
  get critical(): boolean
220
221
  set critical(val: boolean)
221
222
  get ids(): Array<string> | undefined
@@ -602,6 +603,7 @@ export declare enum BuiltinPluginName {
602
603
  DllReferenceAgencyPlugin = 'DllReferenceAgencyPlugin',
603
604
  LibManifestPlugin = 'LibManifestPlugin',
604
605
  FlagAllModulesAsUsedPlugin = 'FlagAllModulesAsUsedPlugin',
606
+ CssHttpExternalsRspackPlugin = 'CssHttpExternalsRspackPlugin',
605
607
  HttpExternalsRspackPlugin = 'HttpExternalsRspackPlugin',
606
608
  CopyRspackPlugin = 'CopyRspackPlugin',
607
609
  HtmlRspackPlugin = 'HtmlRspackPlugin',
@@ -613,6 +615,7 @@ export declare enum BuiltinPluginName {
613
615
  RsdoctorPlugin = 'RsdoctorPlugin',
614
616
  RstestPlugin = 'RstestPlugin',
615
617
  RslibPlugin = 'RslibPlugin',
618
+ CircularModulesInfoPlugin = 'CircularModulesInfoPlugin',
616
619
  CircularDependencyRspackPlugin = 'CircularDependencyRspackPlugin',
617
620
  URLPlugin = 'URLPlugin',
618
621
  JsLoaderRspackPlugin = 'JsLoaderRspackPlugin',
@@ -741,7 +744,6 @@ export interface JsBuildMeta {
741
744
  exportsType?: undefined | 'unset' | 'default' | 'namespace' | 'flagged' | 'dynamic'
742
745
  defaultObject?: undefined | 'false' | 'redirect' | 'redirect-warn'
743
746
  sideEffectFree?: boolean
744
- exportsFinalName?: Array<[string, string]> | undefined
745
747
  }
746
748
 
747
749
  export interface JsBuildTimeExecutionOption {
@@ -1055,8 +1057,14 @@ export interface JsRscClientPluginOptions {
1055
1057
  coordinator: JsCoordinator
1056
1058
  }
1057
1059
 
1060
+ export interface JsRscCssLinkOptions {
1061
+ precedence?: string | boolean
1062
+ props?: Record<string, string>
1063
+ }
1064
+
1058
1065
  export interface JsRscServerPluginOptions {
1059
1066
  coordinator: JsCoordinator
1067
+ cssLink?: JsRscCssLinkOptions | undefined | null
1060
1068
  onServerComponentChanges?: (() => void | Promise<void>) | undefined | null
1061
1069
  onManifest?: ((arg: string) => Promise<undefined>) | undefined | null
1062
1070
  }
@@ -2085,19 +2093,6 @@ export interface RawCopyRspackPluginOptions {
2085
2093
  patterns: Array<RawCopyPattern>
2086
2094
  }
2087
2095
 
2088
- export interface RawCssAutoGeneratorOptions {
2089
- exportsConvention?: "as-is" | "camel-case" | "camel-case-only" | "dashes" | "dashes-only"
2090
- exportsOnly?: boolean
2091
- localIdentName?: string
2092
- esModule?: boolean
2093
- }
2094
-
2095
- export interface RawCssAutoParserOptions {
2096
- namedExports?: boolean
2097
- url?: boolean
2098
- resolveImport?: boolean | ((context: { url: string, media: string | undefined, resourcePath: string, supports: string | undefined, layer: string | undefined }) => boolean)
2099
- }
2100
-
2101
2096
  export interface RawCssChunkingPluginOptions {
2102
2097
  strict?: boolean
2103
2098
  minSize?: number
@@ -2133,6 +2128,10 @@ export interface RawCssImportContext {
2133
2128
  export interface RawCssModuleGeneratorOptions {
2134
2129
  exportsConvention?: "as-is" | "camel-case" | "camel-case-only" | "dashes" | "dashes-only"
2135
2130
  exportsOnly?: boolean
2131
+ localIdentHashDigest?: string
2132
+ localIdentHashDigestLength?: number
2133
+ localIdentHashFunction?: string
2134
+ localIdentHashSalt?: string
2136
2135
  localIdentName?: string
2137
2136
  esModule?: boolean
2138
2137
  }
@@ -2297,12 +2296,13 @@ export interface RawFuncUseCtx {
2297
2296
  }
2298
2297
 
2299
2298
  export interface RawGeneratorOptions {
2300
- type: "asset" | "asset/inline" | "asset/resource" | "css" | "css/auto" | "css/module" | "json"
2299
+ type: "asset" | "asset/inline" | "asset/resource" | "css" | "css/auto" | "css/global" | "css/module" | "json"
2301
2300
  asset?: RawAssetGeneratorOptions
2302
2301
  assetInline?: RawAssetInlineGeneratorOptions
2303
2302
  assetResource?: RawAssetResourceGeneratorOptions
2304
2303
  css?: RawCssGeneratorOptions
2305
- cssAuto?: RawCssAutoGeneratorOptions
2304
+ cssAuto?: RawCssModuleGeneratorOptions
2305
+ cssGlobal?: RawCssModuleGeneratorOptions
2306
2306
  cssModule?: RawCssModuleGeneratorOptions
2307
2307
  json?: RawJsonGeneratorOptions
2308
2308
  }
@@ -2347,7 +2347,6 @@ export interface RawHtmlRspackPluginOptions {
2347
2347
  }
2348
2348
 
2349
2349
  export interface RawHttpExternalsRspackPluginOptions {
2350
- css: boolean
2351
2350
  webAsync: boolean
2352
2351
  }
2353
2352
 
@@ -2772,10 +2771,11 @@ export interface RawOutputOptions {
2772
2771
  }
2773
2772
 
2774
2773
  export interface RawParserOptions {
2775
- type: "asset" | "css" | "css/auto" | "css/module" | "javascript" | "javascript/auto" | "javascript/dynamic" | "javascript/esm" | "json"
2774
+ type: "asset" | "css" | "css/auto" | "css/global" | "css/module" | "javascript" | "javascript/auto" | "javascript/dynamic" | "javascript/esm" | "json"
2776
2775
  asset?: RawAssetParserOptions
2777
2776
  css?: RawCssParserOptions
2778
- cssAuto?: RawCssAutoParserOptions
2777
+ cssAuto?: RawCssModuleParserOptions
2778
+ cssGlobal?: RawCssModuleParserOptions
2779
2779
  cssModule?: RawCssModuleParserOptions
2780
2780
  javascript?: RawJavascriptParserOptions
2781
2781
  json?: RawJsonParserOptions
@@ -2914,6 +2914,10 @@ export interface RawRslibPluginOptions {
2914
2914
  emitDts?: RawSwcEmitDtsOptions
2915
2915
  }
2916
2916
 
2917
+ export interface RawRstestDynamicImportOriginOptions {
2918
+ functionName?: string
2919
+ }
2920
+
2917
2921
  export interface RawRstestPluginOptions {
2918
2922
  injectModulePathName: boolean
2919
2923
  importMetaPathName: boolean
@@ -2921,7 +2925,7 @@ export interface RawRstestPluginOptions {
2921
2925
  manualMockRoot: string
2922
2926
  preserveNewUrl?: Array<string>
2923
2927
  globals?: boolean
2924
- injectDynamicImportOrigin?: boolean
2928
+ injectDynamicImportOrigin?: boolean | { functionName?: string }
2925
2929
  }
2926
2930
 
2927
2931
  export interface RawRuleSetCondition {
@@ -3292,7 +3296,7 @@ export interface TsconfigOptions {
3292
3296
  */
3293
3297
  configFile: string
3294
3298
  /**
3295
- * Support for Typescript Project References.
3299
+ * Support for TypeScript Project References.
3296
3300
  *
3297
3301
  * * `'auto'`: use the `references` field from tsconfig of `config_file`.
3298
3302
  * * `string[]`: manually provided relative or absolute path.
@@ -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';
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack-debug/browser",
3
- "version": "2.0.2",
3
+ "version": "2.0.4",
4
4
  "webpackVersion": "5.75.0",
5
5
  "license": "MIT",
6
6
  "description": "Rspack for running in the browser. This is still in early stage and may not follow the semver.",