@module-federation/sdk 0.0.0-next-20240717101902 → 0.0.0-next-20240718035334
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/index.cjs.js
CHANGED
|
@@ -336,7 +336,7 @@ function generateSnapshotFromManifest(manifest, options = {}) {
|
|
|
336
336
|
// overrides will override dependencies
|
|
337
337
|
matchedVersion: overridesKeys.includes(key) ? overrides[key] : remotes[key]
|
|
338
338
|
});
|
|
339
|
-
const { remoteEntry: { path: remoteEntryPath, name: remoteEntryName, type: remoteEntryType }, types: remoteTypes, buildInfo: { buildVersion }, globalName } = manifest.metaData;
|
|
339
|
+
const { remoteEntry: { path: remoteEntryPath, name: remoteEntryName, type: remoteEntryType }, types: remoteTypes, buildInfo: { buildVersion }, globalName, ssrRemoteEntry } = manifest.metaData;
|
|
340
340
|
const { exposes } = manifest;
|
|
341
341
|
let basicRemoteSnapshot = {
|
|
342
342
|
version: version ? version : '',
|
|
@@ -381,6 +381,11 @@ function generateSnapshotFromManifest(manifest, options = {}) {
|
|
|
381
381
|
getPublicPath: getPublicPath()
|
|
382
382
|
});
|
|
383
383
|
}
|
|
384
|
+
if (ssrRemoteEntry) {
|
|
385
|
+
const fullSSRRemoteEntry = simpleJoinRemoteEntry(ssrRemoteEntry.path, ssrRemoteEntry.name);
|
|
386
|
+
remoteSnapshot.ssrRemoteEntry = fullSSRRemoteEntry;
|
|
387
|
+
remoteSnapshot.ssrRemoteEntryType = 'commonjs-module';
|
|
388
|
+
}
|
|
384
389
|
return remoteSnapshot;
|
|
385
390
|
}
|
|
386
391
|
function isManifestProvider(moduleInfo) {
|
|
@@ -652,7 +657,7 @@ function createScriptNode(url, cb, attrs, createScriptHook) {
|
|
|
652
657
|
}
|
|
653
658
|
cb(undefined, exportedInterface);
|
|
654
659
|
} catch (e) {
|
|
655
|
-
cb(new Error(`Script execution error: ${e}`));
|
|
660
|
+
cb(e instanceof Error ? e : new Error(`Script execution error: ${e}`));
|
|
656
661
|
}
|
|
657
662
|
};
|
|
658
663
|
getFetch().then((f)=>handleScriptFetch(f, urlObj)).catch((err)=>{
|
package/dist/index.esm.js
CHANGED
|
@@ -332,7 +332,7 @@ function generateSnapshotFromManifest(manifest, options = {}) {
|
|
|
332
332
|
// overrides will override dependencies
|
|
333
333
|
matchedVersion: overridesKeys.includes(key) ? overrides[key] : remotes[key]
|
|
334
334
|
});
|
|
335
|
-
const { remoteEntry: { path: remoteEntryPath, name: remoteEntryName, type: remoteEntryType }, types: remoteTypes, buildInfo: { buildVersion }, globalName } = manifest.metaData;
|
|
335
|
+
const { remoteEntry: { path: remoteEntryPath, name: remoteEntryName, type: remoteEntryType }, types: remoteTypes, buildInfo: { buildVersion }, globalName, ssrRemoteEntry } = manifest.metaData;
|
|
336
336
|
const { exposes } = manifest;
|
|
337
337
|
let basicRemoteSnapshot = {
|
|
338
338
|
version: version ? version : '',
|
|
@@ -377,6 +377,11 @@ function generateSnapshotFromManifest(manifest, options = {}) {
|
|
|
377
377
|
getPublicPath: getPublicPath()
|
|
378
378
|
});
|
|
379
379
|
}
|
|
380
|
+
if (ssrRemoteEntry) {
|
|
381
|
+
const fullSSRRemoteEntry = simpleJoinRemoteEntry(ssrRemoteEntry.path, ssrRemoteEntry.name);
|
|
382
|
+
remoteSnapshot.ssrRemoteEntry = fullSSRRemoteEntry;
|
|
383
|
+
remoteSnapshot.ssrRemoteEntryType = 'commonjs-module';
|
|
384
|
+
}
|
|
380
385
|
return remoteSnapshot;
|
|
381
386
|
}
|
|
382
387
|
function isManifestProvider(moduleInfo) {
|
|
@@ -648,7 +653,7 @@ function createScriptNode(url, cb, attrs, createScriptHook) {
|
|
|
648
653
|
}
|
|
649
654
|
cb(undefined, exportedInterface);
|
|
650
655
|
} catch (e) {
|
|
651
|
-
cb(new Error(`Script execution error: ${e}`));
|
|
656
|
+
cb(e instanceof Error ? e : new Error(`Script execution error: ${e}`));
|
|
652
657
|
}
|
|
653
658
|
};
|
|
654
659
|
getFetch().then((f)=>handleScriptFetch(f, urlObj)).catch((err)=>{
|
|
@@ -91,6 +91,7 @@ export interface DtsHostOptions {
|
|
|
91
91
|
deleteTypesFolder?: boolean;
|
|
92
92
|
maxRetries?: number;
|
|
93
93
|
consumeAPITypes?: boolean;
|
|
94
|
+
runtimePkgs?: string[];
|
|
94
95
|
}
|
|
95
96
|
export interface DtsRemoteOptions {
|
|
96
97
|
tsConfigPath?: string;
|
|
@@ -112,6 +113,10 @@ export interface PluginDtsOptions {
|
|
|
112
113
|
extraOptions?: Record<string, any>;
|
|
113
114
|
implementation?: string;
|
|
114
115
|
}
|
|
116
|
+
export type AsyncBoundaryOptions = {
|
|
117
|
+
eager?: RegExp | ((module: any) => boolean);
|
|
118
|
+
excludeChunk?: (chunk: any) => boolean;
|
|
119
|
+
};
|
|
115
120
|
export interface ModuleFederationPluginOptions {
|
|
116
121
|
/**
|
|
117
122
|
* Modules that should be exposed by this container. When provided, property name is used as public name, otherwise public name is automatically inferred from request.
|
|
@@ -164,6 +169,7 @@ export interface ModuleFederationPluginOptions {
|
|
|
164
169
|
manifest?: boolean | PluginManifestOptions;
|
|
165
170
|
dev?: boolean | PluginDevOptions;
|
|
166
171
|
dts?: boolean | PluginDtsOptions;
|
|
172
|
+
async?: boolean | AsyncBoundaryOptions;
|
|
167
173
|
}
|
|
168
174
|
/**
|
|
169
175
|
* Modules that should be exposed by this container. Property names are used as public paths.
|
|
@@ -23,6 +23,8 @@ interface BasicModuleInfo {
|
|
|
23
23
|
export interface BasicProviderModuleInfo extends BasicModuleInfo {
|
|
24
24
|
remoteEntry: string;
|
|
25
25
|
remoteEntryType: RemoteEntryType;
|
|
26
|
+
ssrRemoteEntry?: string;
|
|
27
|
+
ssrRemoteEntryType?: RemoteEntryType;
|
|
26
28
|
remoteManifest?: string;
|
|
27
29
|
globalName: string;
|
|
28
30
|
modules: Array<{
|
|
@@ -42,6 +44,7 @@ interface BasicProviderModuleInfoWithGetPublicPath extends BasicProviderModuleIn
|
|
|
42
44
|
}
|
|
43
45
|
export interface ManifestProvider {
|
|
44
46
|
remoteEntry: string;
|
|
47
|
+
ssrRemoteEntry?: string;
|
|
45
48
|
version?: string;
|
|
46
49
|
}
|
|
47
50
|
export interface PureEntryProvider extends ManifestProvider {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RemoteWithEntry, RemoteWithVersion } from './common';
|
|
2
2
|
export type RemoteEntryType = 'var' | 'module' | 'assign' | 'assign-properties' | 'this' | 'window' | 'self' | 'global' | 'commonjs' | 'commonjs2' | 'commonjs-module' | 'commonjs-static' | 'amd' | 'amd-require' | 'umd' | 'umd2' | 'jsonp' | 'system' | string;
|
|
3
|
-
interface ResourceInfo {
|
|
3
|
+
export interface ResourceInfo {
|
|
4
4
|
path: string;
|
|
5
5
|
name: string;
|
|
6
6
|
type: RemoteEntryType;
|
|
@@ -20,6 +20,7 @@ export interface BasicStatsMetaData {
|
|
|
20
20
|
globalName: string;
|
|
21
21
|
buildInfo: StatsBuildInfo;
|
|
22
22
|
remoteEntry: ResourceInfo;
|
|
23
|
+
ssrRemoteEntry?: ResourceInfo;
|
|
23
24
|
prefetchInterface?: boolean;
|
|
24
25
|
prefetchEntry?: ResourceInfo;
|
|
25
26
|
types: MetaDataTypes;
|