@module-federation/sdk 0.0.0-next-20240205095446 → 0.0.0-next-20240205220829
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 +3 -62
- package/dist/index.esm.js +4 -62
- package/dist/package.json +1 -1
- package/dist/src/dom.d.ts +0 -4
- package/dist/src/types/snapshot.d.ts +1 -2
- package/dist/src/types/stats.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -490,11 +490,10 @@ function generateSnapshotFromManifest(manifest) {
|
|
|
490
490
|
};
|
|
491
491
|
})
|
|
492
492
|
};
|
|
493
|
-
if ((_manifest_metaData = manifest.metaData) === null || _manifest_metaData === void 0 ? void 0 : _manifest_metaData.
|
|
494
|
-
var
|
|
493
|
+
if ((_manifest_metaData = manifest.metaData) === null || _manifest_metaData === void 0 ? void 0 : _manifest_metaData.prefetchInterface) {
|
|
494
|
+
var prefetchInterface = manifest.metaData.prefetchInterface;
|
|
495
495
|
basicRemoteSnapshot = _object_spread_props(_object_spread({}, basicRemoteSnapshot), {
|
|
496
|
-
|
|
497
|
-
prefetchEntryType: type
|
|
496
|
+
prefetchInterface: prefetchInterface
|
|
498
497
|
});
|
|
499
498
|
}
|
|
500
499
|
if ("publicPath" in manifest.metaData) {
|
|
@@ -757,63 +756,6 @@ function createScript(url, cb, attrs, createScriptHook) {
|
|
|
757
756
|
needAttach: needAttach
|
|
758
757
|
};
|
|
759
758
|
}
|
|
760
|
-
function createLink(url, cb, attrs, createLinkHook) {
|
|
761
|
-
// <link rel="preload" href="script.js" as="script">
|
|
762
|
-
// Retrieve the existing script element by its src attribute
|
|
763
|
-
var link = null;
|
|
764
|
-
var needAttach = true;
|
|
765
|
-
var links = document.getElementsByTagName("link");
|
|
766
|
-
for(var i = 0; i < links.length; i++){
|
|
767
|
-
var l = links[i];
|
|
768
|
-
var linkHref = l.getAttribute("href");
|
|
769
|
-
if (linkHref && isStaticResourcesEqual(linkHref, url)) {
|
|
770
|
-
link = l;
|
|
771
|
-
needAttach = false;
|
|
772
|
-
break;
|
|
773
|
-
}
|
|
774
|
-
}
|
|
775
|
-
if (!link) {
|
|
776
|
-
link = document.createElement("link");
|
|
777
|
-
link.setAttribute("href", url);
|
|
778
|
-
if (createLinkHook) {
|
|
779
|
-
var createLinkRes = createLinkHook(url);
|
|
780
|
-
if (_instanceof(createLinkRes, HTMLLinkElement)) {
|
|
781
|
-
link = createLinkRes;
|
|
782
|
-
}
|
|
783
|
-
}
|
|
784
|
-
}
|
|
785
|
-
if (attrs) {
|
|
786
|
-
Object.keys(attrs).forEach(function(name) {
|
|
787
|
-
if (link) {
|
|
788
|
-
link.setAttribute(name, attrs[name]);
|
|
789
|
-
}
|
|
790
|
-
});
|
|
791
|
-
}
|
|
792
|
-
var onLinkComplete = function(prev, // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
793
|
-
event) {
|
|
794
|
-
// Prevent memory leaks in IE.
|
|
795
|
-
if (link) {
|
|
796
|
-
link.onerror = null;
|
|
797
|
-
link.onload = null;
|
|
798
|
-
safeWrapper(function() {
|
|
799
|
-
(link === null || link === void 0 ? void 0 : link.parentNode) && link.parentNode.removeChild(link);
|
|
800
|
-
});
|
|
801
|
-
if (prev) {
|
|
802
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
803
|
-
var res = prev(event);
|
|
804
|
-
cb();
|
|
805
|
-
return res;
|
|
806
|
-
}
|
|
807
|
-
}
|
|
808
|
-
cb();
|
|
809
|
-
};
|
|
810
|
-
link.onerror = onLinkComplete.bind(null, link.onerror);
|
|
811
|
-
link.onload = onLinkComplete.bind(null, link.onload);
|
|
812
|
-
return {
|
|
813
|
-
link: link,
|
|
814
|
-
needAttach: needAttach
|
|
815
|
-
};
|
|
816
|
-
}
|
|
817
759
|
function loadScript(url, info) {
|
|
818
760
|
var attrs = info.attrs, createScriptHook = info.createScriptHook;
|
|
819
761
|
return new Promise(function(resolve, _reject) {
|
|
@@ -1145,7 +1087,6 @@ exports.NameTransformSymbol = NameTransformSymbol;
|
|
|
1145
1087
|
exports.SEPARATOR = SEPARATOR;
|
|
1146
1088
|
exports.assert = assert;
|
|
1147
1089
|
exports.composeKeyWithSeparator = composeKeyWithSeparator;
|
|
1148
|
-
exports.createLink = createLink;
|
|
1149
1090
|
exports.createScript = createScript;
|
|
1150
1091
|
exports.createScriptNode = createScriptNode;
|
|
1151
1092
|
exports.decodeName = decodeName;
|
package/dist/index.esm.js
CHANGED
|
@@ -486,11 +486,10 @@ function generateSnapshotFromManifest(manifest) {
|
|
|
486
486
|
};
|
|
487
487
|
})
|
|
488
488
|
};
|
|
489
|
-
if ((_manifest_metaData = manifest.metaData) === null || _manifest_metaData === void 0 ? void 0 : _manifest_metaData.
|
|
490
|
-
var
|
|
489
|
+
if ((_manifest_metaData = manifest.metaData) === null || _manifest_metaData === void 0 ? void 0 : _manifest_metaData.prefetchInterface) {
|
|
490
|
+
var prefetchInterface = manifest.metaData.prefetchInterface;
|
|
491
491
|
basicRemoteSnapshot = _object_spread_props(_object_spread({}, basicRemoteSnapshot), {
|
|
492
|
-
|
|
493
|
-
prefetchEntryType: type
|
|
492
|
+
prefetchInterface: prefetchInterface
|
|
494
493
|
});
|
|
495
494
|
}
|
|
496
495
|
if ("publicPath" in manifest.metaData) {
|
|
@@ -753,63 +752,6 @@ function createScript(url, cb, attrs, createScriptHook) {
|
|
|
753
752
|
needAttach: needAttach
|
|
754
753
|
};
|
|
755
754
|
}
|
|
756
|
-
function createLink(url, cb, attrs, createLinkHook) {
|
|
757
|
-
// <link rel="preload" href="script.js" as="script">
|
|
758
|
-
// Retrieve the existing script element by its src attribute
|
|
759
|
-
var link = null;
|
|
760
|
-
var needAttach = true;
|
|
761
|
-
var links = document.getElementsByTagName("link");
|
|
762
|
-
for(var i = 0; i < links.length; i++){
|
|
763
|
-
var l = links[i];
|
|
764
|
-
var linkHref = l.getAttribute("href");
|
|
765
|
-
if (linkHref && isStaticResourcesEqual(linkHref, url)) {
|
|
766
|
-
link = l;
|
|
767
|
-
needAttach = false;
|
|
768
|
-
break;
|
|
769
|
-
}
|
|
770
|
-
}
|
|
771
|
-
if (!link) {
|
|
772
|
-
link = document.createElement("link");
|
|
773
|
-
link.setAttribute("href", url);
|
|
774
|
-
if (createLinkHook) {
|
|
775
|
-
var createLinkRes = createLinkHook(url);
|
|
776
|
-
if (_instanceof(createLinkRes, HTMLLinkElement)) {
|
|
777
|
-
link = createLinkRes;
|
|
778
|
-
}
|
|
779
|
-
}
|
|
780
|
-
}
|
|
781
|
-
if (attrs) {
|
|
782
|
-
Object.keys(attrs).forEach(function(name) {
|
|
783
|
-
if (link) {
|
|
784
|
-
link.setAttribute(name, attrs[name]);
|
|
785
|
-
}
|
|
786
|
-
});
|
|
787
|
-
}
|
|
788
|
-
var onLinkComplete = function(prev, // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
789
|
-
event) {
|
|
790
|
-
// Prevent memory leaks in IE.
|
|
791
|
-
if (link) {
|
|
792
|
-
link.onerror = null;
|
|
793
|
-
link.onload = null;
|
|
794
|
-
safeWrapper(function() {
|
|
795
|
-
(link === null || link === void 0 ? void 0 : link.parentNode) && link.parentNode.removeChild(link);
|
|
796
|
-
});
|
|
797
|
-
if (prev) {
|
|
798
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
799
|
-
var res = prev(event);
|
|
800
|
-
cb();
|
|
801
|
-
return res;
|
|
802
|
-
}
|
|
803
|
-
}
|
|
804
|
-
cb();
|
|
805
|
-
};
|
|
806
|
-
link.onerror = onLinkComplete.bind(null, link.onerror);
|
|
807
|
-
link.onload = onLinkComplete.bind(null, link.onload);
|
|
808
|
-
return {
|
|
809
|
-
link: link,
|
|
810
|
-
needAttach: needAttach
|
|
811
|
-
};
|
|
812
|
-
}
|
|
813
755
|
function loadScript(url, info) {
|
|
814
756
|
var attrs = info.attrs, createScriptHook = info.createScriptHook;
|
|
815
757
|
return new Promise(function(resolve, _reject) {
|
|
@@ -1130,4 +1072,4 @@ function loadScriptNode(url, info) {
|
|
|
1130
1072
|
});
|
|
1131
1073
|
}
|
|
1132
1074
|
|
|
1133
|
-
export { BROWSER_LOG_KEY, BROWSER_LOG_VALUE, EncodedNameTransformMap, FederationModuleManifest, Logger, MANIFEST_EXT, NameTransformMap, NameTransformSymbol, SEPARATOR, assert, composeKeyWithSeparator,
|
|
1075
|
+
export { BROWSER_LOG_KEY, BROWSER_LOG_VALUE, EncodedNameTransformMap, FederationModuleManifest, Logger, MANIFEST_EXT, NameTransformMap, NameTransformSymbol, SEPARATOR, assert, composeKeyWithSeparator, createScript, createScriptNode, decodeName, encodeName, error, generateExposeFilename, generateShareFilename, generateSnapshotFromManifest, getProcessEnv, getResourceUrl, isBrowserEnv, isDebugMode, isManifestProvider, isStaticResourcesEqual, loadScript, loadScriptNode, logger, parseEntry, safeWrapper, simpleJoinRemoteEntry, warn };
|
package/dist/package.json
CHANGED
package/dist/src/dom.d.ts
CHANGED
|
@@ -4,10 +4,6 @@ export declare function createScript(url: string, cb: (value: void | PromiseLike
|
|
|
4
4
|
script: HTMLScriptElement;
|
|
5
5
|
needAttach: boolean;
|
|
6
6
|
};
|
|
7
|
-
export declare function createLink(url: string, cb: (value: void | PromiseLike<void>) => void, attrs?: Record<string, any>, createLinkHook?: (url: string) => HTMLLinkElement | void): {
|
|
8
|
-
link: HTMLLinkElement;
|
|
9
|
-
needAttach: boolean;
|
|
10
|
-
};
|
|
11
7
|
export declare function loadScript(url: string, info: {
|
|
12
8
|
attrs?: Record<string, any>;
|
|
13
9
|
createScriptHook?: (url: string) => HTMLScriptElement | void;
|
|
@@ -27,8 +27,7 @@ export interface BasicProviderModuleInfo extends BasicModuleInfo {
|
|
|
27
27
|
modulePath?: string;
|
|
28
28
|
assets: StatsAssets;
|
|
29
29
|
}>;
|
|
30
|
-
|
|
31
|
-
prefetchEntryType?: RemoteEntryType;
|
|
30
|
+
prefetchInterface?: boolean;
|
|
32
31
|
}
|
|
33
32
|
interface BasicProviderModuleInfoWithPublicPath extends BasicProviderModuleInfo {
|
|
34
33
|
publicPath: string;
|
|
@@ -14,7 +14,7 @@ export interface BasicStatsMetaData {
|
|
|
14
14
|
globalName: string;
|
|
15
15
|
buildInfo: StatsBuildInfo;
|
|
16
16
|
remoteEntry: ResourceInfo;
|
|
17
|
-
|
|
17
|
+
prefetchInterface: boolean;
|
|
18
18
|
types: Omit<ResourceInfo, 'type'>;
|
|
19
19
|
}
|
|
20
20
|
type StatsMetaDataWithGetPublicPath<T = BasicStatsMetaData> = T & {
|