@rspack/browser 2.0.0-beta.5 → 2.0.0-beta.7
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.
- package/dist/builtin-loader/swc/types.d.ts +17 -1
- package/dist/builtin-plugin/RsdoctorPlugin.d.ts +2 -2
- package/dist/builtin-plugin/WorkerPlugin.d.ts +1 -0
- package/dist/builtin-plugin/lazy-compilation/middleware.d.ts +2 -2
- package/dist/builtin-plugin/rsc/RscServerPlugin.d.ts +25 -0
- package/dist/checkNodeVersion.d.ts +1 -0
- package/dist/config/devServer.d.ts +102 -237
- package/dist/config/types.d.ts +2 -5
- package/dist/container/ContainerPlugin.d.ts +3 -2
- package/dist/container/ContainerReferencePlugin.d.ts +4 -3
- package/dist/container/ModuleFederationPlugin.d.ts +2 -1
- package/dist/container/ModuleFederationPluginV1.d.ts +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +665 -568
- package/dist/napi-binding.d.ts +20 -6
- package/dist/rslib-runtime.js +5 -8
- package/dist/rspack.wasm32-wasi.wasm +0 -0
- package/dist/sharing/CollectSharedEntryPlugin.d.ts +2 -2
- package/dist/sharing/ConsumeSharedPlugin.d.ts +5 -5
- package/dist/sharing/ProvideSharedPlugin.d.ts +6 -5
- package/dist/sharing/SharePlugin.d.ts +9 -7
- package/dist/wasi-worker-browser.mjs +202 -90
- package/package.json +1 -1
package/dist/napi-binding.d.ts
CHANGED
|
@@ -1060,6 +1060,7 @@ export interface JsRscClientPluginOptions {
|
|
|
1060
1060
|
export interface JsRscServerPluginOptions {
|
|
1061
1061
|
coordinator: JsCoordinator
|
|
1062
1062
|
onServerComponentChanges?: (() => void) | undefined | null
|
|
1063
|
+
onManifest?: ((arg: string) => Promise<undefined>) | undefined | null
|
|
1063
1064
|
}
|
|
1064
1065
|
|
|
1065
1066
|
export interface JsRsdoctorAsset {
|
|
@@ -1111,6 +1112,18 @@ export interface JsRsdoctorConnection {
|
|
|
1111
1112
|
active: boolean
|
|
1112
1113
|
}
|
|
1113
1114
|
|
|
1115
|
+
export interface JsRsdoctorConnectionsOnlyImport {
|
|
1116
|
+
moduleUkey: number
|
|
1117
|
+
modulePath: string
|
|
1118
|
+
connections: Array<JsRsdoctorConnectionsOnlyImportConnection>
|
|
1119
|
+
}
|
|
1120
|
+
|
|
1121
|
+
export interface JsRsdoctorConnectionsOnlyImportConnection {
|
|
1122
|
+
originModule?: number
|
|
1123
|
+
dependencyType: string
|
|
1124
|
+
userRequest: string
|
|
1125
|
+
}
|
|
1126
|
+
|
|
1114
1127
|
export interface JsRsdoctorDependency {
|
|
1115
1128
|
ukey: number
|
|
1116
1129
|
kind: string
|
|
@@ -1164,6 +1177,7 @@ export interface JsRsdoctorModuleGraph {
|
|
|
1164
1177
|
modules: Array<JsRsdoctorModule>
|
|
1165
1178
|
dependencies: Array<JsRsdoctorDependency>
|
|
1166
1179
|
chunkModules: Array<JsRsdoctorChunkModules>
|
|
1180
|
+
connectionsOnlyImports: Array<JsRsdoctorConnectionsOnlyImport>
|
|
1167
1181
|
}
|
|
1168
1182
|
|
|
1169
1183
|
export interface JsRsdoctorModuleGraphModule {
|
|
@@ -1930,7 +1944,7 @@ export interface RawConsumeOptions {
|
|
|
1930
1944
|
import?: string
|
|
1931
1945
|
importResolved?: string
|
|
1932
1946
|
shareKey: string
|
|
1933
|
-
shareScope: string
|
|
1947
|
+
shareScope: string | Array<string>
|
|
1934
1948
|
requiredVersion?: string | false | undefined
|
|
1935
1949
|
packageName?: string
|
|
1936
1950
|
strictVersion: boolean
|
|
@@ -1946,7 +1960,7 @@ export interface RawConsumeSharedPluginOptions {
|
|
|
1946
1960
|
|
|
1947
1961
|
export interface RawContainerPluginOptions {
|
|
1948
1962
|
name: string
|
|
1949
|
-
shareScope: string
|
|
1963
|
+
shareScope: string | Array<string>
|
|
1950
1964
|
library: JsLibraryOptions
|
|
1951
1965
|
runtime?: false | string
|
|
1952
1966
|
filename?: string
|
|
@@ -1957,7 +1971,7 @@ export interface RawContainerPluginOptions {
|
|
|
1957
1971
|
export interface RawContainerReferencePluginOptions {
|
|
1958
1972
|
remoteType: string
|
|
1959
1973
|
remotes: Array<RawRemoteOptions>
|
|
1960
|
-
shareScope?: string
|
|
1974
|
+
shareScope?: string | Array<string>
|
|
1961
1975
|
enhanced: boolean
|
|
1962
1976
|
}
|
|
1963
1977
|
|
|
@@ -2256,6 +2270,7 @@ export interface RawExternalsPresets {
|
|
|
2256
2270
|
export interface RawExtractComments {
|
|
2257
2271
|
banner?: string | boolean
|
|
2258
2272
|
condition?: string
|
|
2273
|
+
conditionFlags?: string
|
|
2259
2274
|
}
|
|
2260
2275
|
|
|
2261
2276
|
export interface RawFallbackCacheGroupOptions {
|
|
@@ -2655,7 +2670,6 @@ export interface RawOccurrenceChunkIdsPluginOptions {
|
|
|
2655
2670
|
}
|
|
2656
2671
|
|
|
2657
2672
|
export interface RawOptimizationOptions {
|
|
2658
|
-
removeAvailableModules: boolean
|
|
2659
2673
|
sideEffects: boolean | string
|
|
2660
2674
|
usedExports: boolean | string
|
|
2661
2675
|
providedExports: boolean
|
|
@@ -2773,7 +2787,7 @@ export interface RawProgressPluginOptions {
|
|
|
2773
2787
|
export interface RawProvideOptions {
|
|
2774
2788
|
key: string
|
|
2775
2789
|
shareKey: string
|
|
2776
|
-
shareScope: string
|
|
2790
|
+
shareScope: string | Array<string>
|
|
2777
2791
|
version?: string | false | undefined
|
|
2778
2792
|
eager: boolean
|
|
2779
2793
|
singleton?: boolean
|
|
@@ -2794,7 +2808,7 @@ export interface RawRemoteAliasTarget {
|
|
|
2794
2808
|
export interface RawRemoteOptions {
|
|
2795
2809
|
key: string
|
|
2796
2810
|
external: Array<string>
|
|
2797
|
-
shareScope: string
|
|
2811
|
+
shareScope: string | Array<string>
|
|
2798
2812
|
}
|
|
2799
2813
|
|
|
2800
2814
|
export interface RawResolveOptions {
|
package/dist/rslib-runtime.js
CHANGED
|
@@ -4,20 +4,12 @@ function __webpack_require__(moduleId) {
|
|
|
4
4
|
var cachedModule = __webpack_module_cache__[moduleId];
|
|
5
5
|
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
6
6
|
var module = __webpack_module_cache__[moduleId] = {
|
|
7
|
-
id: moduleId,
|
|
8
|
-
loaded: false,
|
|
9
7
|
exports: {}
|
|
10
8
|
};
|
|
11
9
|
__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
12
|
-
module.loaded = true;
|
|
13
10
|
return module.exports;
|
|
14
11
|
}
|
|
15
12
|
__webpack_require__.m = __webpack_modules__;
|
|
16
|
-
(()=>{
|
|
17
|
-
__webpack_require__.add = function(modules) {
|
|
18
|
-
Object.assign(__webpack_require__.m, modules);
|
|
19
|
-
};
|
|
20
|
-
})();
|
|
21
13
|
(()=>{
|
|
22
14
|
__webpack_require__.n = (module)=>{
|
|
23
15
|
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
@@ -35,6 +27,11 @@ __webpack_require__.m = __webpack_modules__;
|
|
|
35
27
|
});
|
|
36
28
|
};
|
|
37
29
|
})();
|
|
30
|
+
(()=>{
|
|
31
|
+
__webpack_require__.add = function(modules) {
|
|
32
|
+
Object.assign(__webpack_require__.m, modules);
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
38
35
|
(()=>{
|
|
39
36
|
__webpack_require__.g = (()=>{
|
|
40
37
|
if ('object' == typeof globalThis) return globalThis;
|
|
Binary file
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { type BuiltinPlugin, BuiltinPluginName } from '../binding';
|
|
2
2
|
import { RspackBuiltinPlugin } from '../builtin-plugin/base';
|
|
3
3
|
import type { Compiler } from '../Compiler';
|
|
4
|
-
import { type NormalizedSharedOptions } from './SharePlugin';
|
|
4
|
+
import { type NormalizedSharedOptions, type ShareScope } from './SharePlugin';
|
|
5
5
|
export type CollectSharedEntryPluginOptions = {
|
|
6
6
|
sharedOptions: NormalizedSharedOptions;
|
|
7
|
-
shareScope?:
|
|
7
|
+
shareScope?: ShareScope;
|
|
8
8
|
};
|
|
9
9
|
export type ShareRequestsMap = Record<string, {
|
|
10
10
|
shareScope: string;
|
|
@@ -3,7 +3,7 @@ import { RspackBuiltinPlugin } from '../builtin-plugin/base';
|
|
|
3
3
|
import type { Compiler } from '../Compiler';
|
|
4
4
|
export type ConsumeSharedPluginOptions = {
|
|
5
5
|
consumes: Consumes;
|
|
6
|
-
shareScope?: string;
|
|
6
|
+
shareScope?: string | string[];
|
|
7
7
|
enhanced?: boolean;
|
|
8
8
|
};
|
|
9
9
|
export type Consumes = (ConsumesItem | ConsumesObject)[] | ConsumesObject;
|
|
@@ -17,14 +17,14 @@ export type ConsumesConfig = {
|
|
|
17
17
|
packageName?: string;
|
|
18
18
|
requiredVersion?: false | string;
|
|
19
19
|
shareKey?: string;
|
|
20
|
-
shareScope?: string;
|
|
20
|
+
shareScope?: string | string[];
|
|
21
21
|
singleton?: boolean;
|
|
22
22
|
strictVersion?: boolean;
|
|
23
23
|
treeShakingMode?: 'server-calc' | 'runtime-infer';
|
|
24
24
|
};
|
|
25
|
-
export declare function normalizeConsumeShareOptions(consumes: Consumes, shareScope?: string): [string, {
|
|
25
|
+
export declare function normalizeConsumeShareOptions(consumes: Consumes, shareScope?: string | string[]): [string, {
|
|
26
26
|
import: string | undefined;
|
|
27
|
-
shareScope: string;
|
|
27
|
+
shareScope: string | string[];
|
|
28
28
|
shareKey: string;
|
|
29
29
|
requiredVersion: string | false | undefined;
|
|
30
30
|
strictVersion: boolean;
|
|
@@ -38,7 +38,7 @@ export declare class ConsumeSharedPlugin extends RspackBuiltinPlugin {
|
|
|
38
38
|
_options: {
|
|
39
39
|
consumes: [string, {
|
|
40
40
|
import: string | undefined;
|
|
41
|
-
shareScope: string;
|
|
41
|
+
shareScope: string | string[];
|
|
42
42
|
shareKey: string;
|
|
43
43
|
requiredVersion: string | false | undefined;
|
|
44
44
|
strictVersion: boolean;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { type BuiltinPlugin, BuiltinPluginName, type RawProvideOptions } from '../binding';
|
|
2
2
|
import { RspackBuiltinPlugin } from '../builtin-plugin/base';
|
|
3
3
|
import type { Compiler } from '../Compiler';
|
|
4
|
+
import type { ShareScope } from './SharePlugin';
|
|
4
5
|
export type ProvideSharedPluginOptions<Enhanced extends boolean = false> = {
|
|
5
6
|
provides: Provides<Enhanced>;
|
|
6
|
-
shareScope?:
|
|
7
|
+
shareScope?: ShareScope;
|
|
7
8
|
enhanced?: Enhanced;
|
|
8
9
|
};
|
|
9
10
|
export type Provides<Enhanced extends boolean> = (ProvidesItem | ProvidesObject<Enhanced>)[] | ProvidesObject<Enhanced>;
|
|
@@ -15,7 +16,7 @@ export type ProvidesConfig<Enhanced extends boolean> = Enhanced extends true ? P
|
|
|
15
16
|
type ProvidesV1Config = {
|
|
16
17
|
eager?: boolean;
|
|
17
18
|
shareKey: string;
|
|
18
|
-
shareScope?:
|
|
19
|
+
shareScope?: ShareScope;
|
|
19
20
|
version?: false | string;
|
|
20
21
|
};
|
|
21
22
|
type ProvidesEnhancedConfig = ProvidesV1Config & ProvidesEnhancedExtraConfig;
|
|
@@ -28,10 +29,10 @@ type ProvidesEnhancedExtraConfig = {
|
|
|
28
29
|
*/
|
|
29
30
|
treeShakingMode?: 'server-calc' | 'runtime-infer';
|
|
30
31
|
};
|
|
31
|
-
export declare function normalizeProvideShareOptions<Enhanced extends boolean = false>(options: Provides<Enhanced>, shareScope?:
|
|
32
|
+
export declare function normalizeProvideShareOptions<Enhanced extends boolean = false>(options: Provides<Enhanced>, shareScope?: ShareScope, enhanced?: boolean): [string, {
|
|
32
33
|
shareKey: string;
|
|
33
34
|
version: string | false | undefined;
|
|
34
|
-
shareScope:
|
|
35
|
+
shareScope: ShareScope;
|
|
35
36
|
eager: boolean;
|
|
36
37
|
} | {
|
|
37
38
|
singleton: boolean | undefined;
|
|
@@ -40,7 +41,7 @@ export declare function normalizeProvideShareOptions<Enhanced extends boolean =
|
|
|
40
41
|
treeShakingMode: "server-calc" | "runtime-infer" | undefined;
|
|
41
42
|
shareKey: string;
|
|
42
43
|
version: string | false | undefined;
|
|
43
|
-
shareScope:
|
|
44
|
+
shareScope: ShareScope;
|
|
44
45
|
eager: boolean;
|
|
45
46
|
}][];
|
|
46
47
|
export declare class ProvideSharedPlugin<Enhanced extends boolean = false> extends RspackBuiltinPlugin {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { Compiler } from '../Compiler';
|
|
2
|
+
export type ShareScope = string | string[];
|
|
3
|
+
export declare function validateShareScope(shareScope: ShareScope, enhanced: boolean, pluginName: string): void;
|
|
2
4
|
export type SharePluginOptions = {
|
|
3
|
-
shareScope?:
|
|
5
|
+
shareScope?: ShareScope;
|
|
4
6
|
shared: Shared;
|
|
5
7
|
enhanced: boolean;
|
|
6
8
|
};
|
|
@@ -20,7 +22,7 @@ export type SharedConfig = {
|
|
|
20
22
|
packageName?: string;
|
|
21
23
|
requiredVersion?: false | string;
|
|
22
24
|
shareKey?: string;
|
|
23
|
-
shareScope?:
|
|
25
|
+
shareScope?: ShareScope;
|
|
24
26
|
singleton?: boolean;
|
|
25
27
|
strictVersion?: boolean;
|
|
26
28
|
version?: false | string;
|
|
@@ -31,7 +33,7 @@ export declare function normalizeSharedOptions(shared: Shared): NormalizedShared
|
|
|
31
33
|
export declare function createProvideShareOptions(normalizedSharedOptions: NormalizedSharedOptions): {
|
|
32
34
|
[x: string]: {
|
|
33
35
|
shareKey: string;
|
|
34
|
-
shareScope:
|
|
36
|
+
shareScope: ShareScope | undefined;
|
|
35
37
|
version: string | false | undefined;
|
|
36
38
|
eager: boolean | undefined;
|
|
37
39
|
singleton: boolean | undefined;
|
|
@@ -44,7 +46,7 @@ export declare function createConsumeShareOptions(normalizedSharedOptions: Norma
|
|
|
44
46
|
[x: string]: {
|
|
45
47
|
import: string | false | undefined;
|
|
46
48
|
shareKey: string;
|
|
47
|
-
shareScope:
|
|
49
|
+
shareScope: ShareScope | undefined;
|
|
48
50
|
requiredVersion: string | false | undefined;
|
|
49
51
|
strictVersion: boolean | undefined;
|
|
50
52
|
singleton: boolean | undefined;
|
|
@@ -54,12 +56,12 @@ export declare function createConsumeShareOptions(normalizedSharedOptions: Norma
|
|
|
54
56
|
};
|
|
55
57
|
}[];
|
|
56
58
|
export declare class SharePlugin {
|
|
57
|
-
_shareScope:
|
|
59
|
+
_shareScope: ShareScope | undefined;
|
|
58
60
|
_consumes: {
|
|
59
61
|
[x: string]: {
|
|
60
62
|
import: string | false | undefined;
|
|
61
63
|
shareKey: string;
|
|
62
|
-
shareScope:
|
|
64
|
+
shareScope: ShareScope | undefined;
|
|
63
65
|
requiredVersion: string | false | undefined;
|
|
64
66
|
strictVersion: boolean | undefined;
|
|
65
67
|
singleton: boolean | undefined;
|
|
@@ -71,7 +73,7 @@ export declare class SharePlugin {
|
|
|
71
73
|
_provides: {
|
|
72
74
|
[x: string]: {
|
|
73
75
|
shareKey: string;
|
|
74
|
-
shareScope:
|
|
76
|
+
shareScope: ShareScope | undefined;
|
|
75
77
|
version: string | false | undefined;
|
|
76
78
|
eager: boolean | undefined;
|
|
77
79
|
singleton: boolean | undefined;
|