@module-federation/sdk 0.0.0-next-20240708090519 → 0.0.0-next-20240709063914
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
|
|
339
|
+
const { remoteEntry: { path: remoteEntryPath, name: remoteEntryName, type: remoteEntryType }, types: remoteTypes, buildInfo: { buildVersion }, globalName } = manifest.metaData;
|
|
340
340
|
const { exposes } = manifest;
|
|
341
341
|
let basicRemoteSnapshot = {
|
|
342
342
|
version: version ? version : '',
|
|
@@ -381,11 +381,6 @@ 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
|
-
}
|
|
389
384
|
return remoteSnapshot;
|
|
390
385
|
}
|
|
391
386
|
function isManifestProvider(moduleInfo) {
|
|
@@ -657,7 +652,7 @@ function createScriptNode(url, cb, attrs, createScriptHook) {
|
|
|
657
652
|
}
|
|
658
653
|
cb(undefined, exportedInterface);
|
|
659
654
|
} catch (e) {
|
|
660
|
-
cb(
|
|
655
|
+
cb(new Error(`Script execution error: ${e}`));
|
|
661
656
|
}
|
|
662
657
|
};
|
|
663
658
|
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
|
|
335
|
+
const { remoteEntry: { path: remoteEntryPath, name: remoteEntryName, type: remoteEntryType }, types: remoteTypes, buildInfo: { buildVersion }, globalName } = manifest.metaData;
|
|
336
336
|
const { exposes } = manifest;
|
|
337
337
|
let basicRemoteSnapshot = {
|
|
338
338
|
version: version ? version : '',
|
|
@@ -377,11 +377,6 @@ 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
|
-
}
|
|
385
380
|
return remoteSnapshot;
|
|
386
381
|
}
|
|
387
382
|
function isManifestProvider(moduleInfo) {
|
|
@@ -653,7 +648,7 @@ function createScriptNode(url, cb, attrs, createScriptHook) {
|
|
|
653
648
|
}
|
|
654
649
|
cb(undefined, exportedInterface);
|
|
655
650
|
} catch (e) {
|
|
656
|
-
cb(
|
|
651
|
+
cb(new Error(`Script execution error: ${e}`));
|
|
657
652
|
}
|
|
658
653
|
};
|
|
659
654
|
getFetch().then((f)=>handleScriptFetch(f, urlObj)).catch((err)=>{
|
|
@@ -91,7 +91,6 @@ export interface DtsHostOptions {
|
|
|
91
91
|
deleteTypesFolder?: boolean;
|
|
92
92
|
maxRetries?: number;
|
|
93
93
|
consumeAPITypes?: boolean;
|
|
94
|
-
runtimePkgs?: string[];
|
|
95
94
|
}
|
|
96
95
|
export interface DtsRemoteOptions {
|
|
97
96
|
tsConfigPath?: string;
|
|
@@ -113,10 +112,6 @@ export interface PluginDtsOptions {
|
|
|
113
112
|
extraOptions?: Record<string, any>;
|
|
114
113
|
implementation?: string;
|
|
115
114
|
}
|
|
116
|
-
export type AsyncBoundaryOptions = {
|
|
117
|
-
eager?: RegExp | ((module: any) => boolean);
|
|
118
|
-
excludeChunk?: (chunk: any) => boolean;
|
|
119
|
-
};
|
|
120
115
|
export interface ModuleFederationPluginOptions {
|
|
121
116
|
/**
|
|
122
117
|
* 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.
|
|
@@ -169,7 +164,6 @@ export interface ModuleFederationPluginOptions {
|
|
|
169
164
|
manifest?: boolean | PluginManifestOptions;
|
|
170
165
|
dev?: boolean | PluginDevOptions;
|
|
171
166
|
dts?: boolean | PluginDtsOptions;
|
|
172
|
-
async?: boolean | AsyncBoundaryOptions;
|
|
173
167
|
}
|
|
174
168
|
/**
|
|
175
169
|
* Modules that should be exposed by this container. Property names are used as public paths.
|
|
@@ -23,8 +23,6 @@ interface BasicModuleInfo {
|
|
|
23
23
|
export interface BasicProviderModuleInfo extends BasicModuleInfo {
|
|
24
24
|
remoteEntry: string;
|
|
25
25
|
remoteEntryType: RemoteEntryType;
|
|
26
|
-
ssrRemoteEntry?: string;
|
|
27
|
-
ssrRemoteEntryType?: RemoteEntryType;
|
|
28
26
|
remoteManifest?: string;
|
|
29
27
|
globalName: string;
|
|
30
28
|
modules: Array<{
|
|
@@ -44,7 +42,6 @@ interface BasicProviderModuleInfoWithGetPublicPath extends BasicProviderModuleIn
|
|
|
44
42
|
}
|
|
45
43
|
export interface ManifestProvider {
|
|
46
44
|
remoteEntry: string;
|
|
47
|
-
ssrRemoteEntry?: string;
|
|
48
45
|
version?: string;
|
|
49
46
|
}
|
|
50
47
|
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
|
-
|
|
3
|
+
interface ResourceInfo {
|
|
4
4
|
path: string;
|
|
5
5
|
name: string;
|
|
6
6
|
type: RemoteEntryType;
|
|
@@ -20,7 +20,6 @@ export interface BasicStatsMetaData {
|
|
|
20
20
|
globalName: string;
|
|
21
21
|
buildInfo: StatsBuildInfo;
|
|
22
22
|
remoteEntry: ResourceInfo;
|
|
23
|
-
ssrRemoteEntry?: ResourceInfo;
|
|
24
23
|
prefetchInterface?: boolean;
|
|
25
24
|
prefetchEntry?: ResourceInfo;
|
|
26
25
|
types: MetaDataTypes;
|