@module-federation/runtime 0.1.17 → 0.1.19
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/helpers.esm.js +1 -1
- package/dist/index.cjs.js +100 -37
- package/dist/index.esm.js +104 -41
- package/dist/package.json +1 -1
- package/dist/share.cjs.js +1 -1
- package/dist/share.esm.js +2 -2
- package/dist/src/utils/preload.d.ts +1 -1
- package/package.json +2 -2
package/dist/helpers.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { p as getRegisteredShare, z as getGlobalShareScope, G as Global, J as nativeGlobal, K as resetFederationGlobalInfo, E as getGlobalFederationInstance, H as setGlobalFederationInstance, F as getGlobalFederationConstructor, C as setGlobalFederationConstructor, m as getInfoWithoutType, v as getGlobalSnapshot, L as getTargetSnapshotInfoByModuleInfo, r as getGlobalSnapshotInfoByModuleInfo, u as setGlobalSnapshotInfoByModuleInfo, t as addGlobalSnapshot, c as getRemoteEntryExports, I as registerGlobalPlugins, g as getGlobalHostPlugins, n as getPreloaded, o as setPreloaded } from './share.esm.js';
|
|
2
2
|
|
|
3
3
|
const ShareUtils = {
|
|
4
4
|
getRegisteredShare,
|
package/dist/index.cjs.js
CHANGED
|
@@ -142,7 +142,7 @@ async function loadEntryScript({ name, globalName, entry, createScriptHook }) {
|
|
|
142
142
|
`);
|
|
143
143
|
return entryExports;
|
|
144
144
|
}).catch((e)=>{
|
|
145
|
-
|
|
145
|
+
throw e;
|
|
146
146
|
});
|
|
147
147
|
}
|
|
148
148
|
return sdk.loadScript(entry, {
|
|
@@ -158,7 +158,7 @@ async function loadEntryScript({ name, globalName, entry, createScriptHook }) {
|
|
|
158
158
|
`);
|
|
159
159
|
return entryExports;
|
|
160
160
|
}).catch((e)=>{
|
|
161
|
-
|
|
161
|
+
throw e;
|
|
162
162
|
});
|
|
163
163
|
}
|
|
164
164
|
function getRemoteEntryUniqueKey(remoteInfo) {
|
|
@@ -172,7 +172,10 @@ async function getRemoteEntry({ remoteEntryExports, remoteInfo, createScriptHook
|
|
|
172
172
|
return remoteEntryExports;
|
|
173
173
|
}
|
|
174
174
|
if (!share.globalLoading[uniqueKey]) {
|
|
175
|
-
if (
|
|
175
|
+
if ([
|
|
176
|
+
'esm',
|
|
177
|
+
'module'
|
|
178
|
+
].includes(type)) {
|
|
176
179
|
share.globalLoading[uniqueKey] = loadEsmEntry({
|
|
177
180
|
entry,
|
|
178
181
|
remoteEntryExports
|
|
@@ -560,7 +563,8 @@ function normalizePreloadExposes(exposes) {
|
|
|
560
563
|
return expose;
|
|
561
564
|
});
|
|
562
565
|
}
|
|
563
|
-
function preloadAssets(remoteInfo, host, assets
|
|
566
|
+
function preloadAssets(remoteInfo, host, assets, // It is used to distinguish preload from load remote parallel loading
|
|
567
|
+
useLinkPreload = true) {
|
|
564
568
|
const { cssAssets, jsAssetsWithoutEntry, entryAssets } = assets;
|
|
565
569
|
if (host.options.inBrowser) {
|
|
566
570
|
entryAssets.forEach((asset)=>{
|
|
@@ -612,40 +616,96 @@ function preloadAssets(remoteInfo, host, assets) {
|
|
|
612
616
|
});
|
|
613
617
|
}
|
|
614
618
|
});
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
619
|
+
if (useLinkPreload) {
|
|
620
|
+
cssAssets.forEach((cssUrl)=>{
|
|
621
|
+
const { link: cssEl, needAttach } = sdk.createLink({
|
|
622
|
+
url: cssUrl,
|
|
623
|
+
cb: ()=>{},
|
|
624
|
+
attrs: {
|
|
625
|
+
rel: 'preload',
|
|
626
|
+
as: 'style',
|
|
627
|
+
crossorigin: 'anonymous'
|
|
628
|
+
},
|
|
629
|
+
createLinkHook: (url)=>{
|
|
630
|
+
const res = host.loaderHook.lifecycle.createLink.emit({
|
|
631
|
+
url
|
|
632
|
+
});
|
|
633
|
+
if (res instanceof HTMLLinkElement) {
|
|
634
|
+
return res;
|
|
635
|
+
}
|
|
636
|
+
return;
|
|
637
|
+
}
|
|
623
638
|
});
|
|
624
|
-
|
|
625
|
-
return res;
|
|
626
|
-
}
|
|
627
|
-
return;
|
|
639
|
+
needAttach && document.head.appendChild(cssEl);
|
|
628
640
|
});
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
641
|
+
} else {
|
|
642
|
+
cssAssets.forEach((cssUrl)=>{
|
|
643
|
+
const { link: cssEl, needAttach } = sdk.createLink({
|
|
644
|
+
url: cssUrl,
|
|
645
|
+
cb: ()=>{},
|
|
646
|
+
attrs: {
|
|
647
|
+
rel: 'stylesheet',
|
|
648
|
+
type: 'text/css'
|
|
649
|
+
},
|
|
650
|
+
createLinkHook: (url)=>{
|
|
651
|
+
const res = host.loaderHook.lifecycle.createLink.emit({
|
|
652
|
+
url
|
|
653
|
+
});
|
|
654
|
+
if (res instanceof HTMLLinkElement) {
|
|
655
|
+
return res;
|
|
656
|
+
}
|
|
657
|
+
return;
|
|
658
|
+
},
|
|
659
|
+
needDeleteLink: false
|
|
640
660
|
});
|
|
641
|
-
|
|
642
|
-
return res;
|
|
643
|
-
}
|
|
644
|
-
return;
|
|
661
|
+
needAttach && document.head.appendChild(cssEl);
|
|
645
662
|
});
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
663
|
+
}
|
|
664
|
+
if (useLinkPreload) {
|
|
665
|
+
jsAssetsWithoutEntry.forEach((jsUrl)=>{
|
|
666
|
+
const { link: linkEl, needAttach } = sdk.createLink({
|
|
667
|
+
url: jsUrl,
|
|
668
|
+
cb: ()=>{},
|
|
669
|
+
attrs: {
|
|
670
|
+
rel: 'preload',
|
|
671
|
+
as: 'script',
|
|
672
|
+
crossorigin: 'anonymous'
|
|
673
|
+
},
|
|
674
|
+
createLinkHook: (url)=>{
|
|
675
|
+
const res = host.loaderHook.lifecycle.createLink.emit({
|
|
676
|
+
url
|
|
677
|
+
});
|
|
678
|
+
if (res instanceof HTMLLinkElement) {
|
|
679
|
+
return res;
|
|
680
|
+
}
|
|
681
|
+
return;
|
|
682
|
+
}
|
|
683
|
+
});
|
|
684
|
+
needAttach && document.head.appendChild(linkEl);
|
|
685
|
+
});
|
|
686
|
+
} else {
|
|
687
|
+
jsAssetsWithoutEntry.forEach((jsUrl)=>{
|
|
688
|
+
const { script: scriptEl, needAttach } = sdk.createScript({
|
|
689
|
+
url: jsUrl,
|
|
690
|
+
cb: ()=>{},
|
|
691
|
+
attrs: {
|
|
692
|
+
crossorigin: 'anonymous',
|
|
693
|
+
fetchpriority: 'high'
|
|
694
|
+
},
|
|
695
|
+
createScriptHook: (url)=>{
|
|
696
|
+
const res = host.loaderHook.lifecycle.createScript.emit({
|
|
697
|
+
url
|
|
698
|
+
});
|
|
699
|
+
if (res instanceof HTMLScriptElement) {
|
|
700
|
+
return res;
|
|
701
|
+
}
|
|
702
|
+
return;
|
|
703
|
+
},
|
|
704
|
+
needDeleteScript: true
|
|
705
|
+
});
|
|
706
|
+
needAttach && document.head.appendChild(scriptEl);
|
|
707
|
+
});
|
|
708
|
+
}
|
|
649
709
|
}
|
|
650
710
|
}
|
|
651
711
|
|
|
@@ -668,7 +728,10 @@ function assignRemoteInfo(remoteInfo, remoteSnapshot) {
|
|
|
668
728
|
share.error(`The attribute remoteEntry of ${name} must not be undefined.`);
|
|
669
729
|
}
|
|
670
730
|
const { remoteEntry } = remoteSnapshot;
|
|
671
|
-
|
|
731
|
+
let entryUrl = sdk.getResourceUrl(remoteSnapshot, remoteEntry);
|
|
732
|
+
if (!share.isBrowserEnv() && !entryUrl.startsWith('http')) {
|
|
733
|
+
entryUrl = `https:${entryUrl}`;
|
|
734
|
+
}
|
|
672
735
|
remoteInfo.type = remoteSnapshot.remoteEntryType;
|
|
673
736
|
remoteInfo.entryGlobalName = remoteSnapshot.globalName;
|
|
674
737
|
remoteInfo.entry = entryUrl;
|
|
@@ -705,7 +768,7 @@ function snapshotPlugin() {
|
|
|
705
768
|
globalSnapshot
|
|
706
769
|
});
|
|
707
770
|
if (assets) {
|
|
708
|
-
preloadAssets(remoteInfo, origin, assets);
|
|
771
|
+
preloadAssets(remoteInfo, origin, assets, false);
|
|
709
772
|
}
|
|
710
773
|
return _extends$4({}, args, {
|
|
711
774
|
remoteSnapshot
|
|
@@ -1907,7 +1970,7 @@ class FederationHost {
|
|
|
1907
1970
|
// maybe will change, temporarily for internal use only
|
|
1908
1971
|
initContainer: new AsyncWaterfallHook('initContainer')
|
|
1909
1972
|
});
|
|
1910
|
-
this.version = "0.1.
|
|
1973
|
+
this.version = "0.1.19";
|
|
1911
1974
|
this.moduleCache = new Map();
|
|
1912
1975
|
this.loaderHook = new PluginSystem({
|
|
1913
1976
|
// FIXME: may not be suitable , not open to the public yet
|
package/dist/index.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { g as getGlobalHostPlugins, a as globalLoading, D as DEFAULT_REMOTE_TYPE, b as DEFAULT_SCOPE, c as getRemoteEntryExports, d as assert, s as safeToString, e as getFMId, i as isObject, f as error, w as warn, h as isPlainObject, j as isRemoteInfoWithEntry, k as isPureRemoteEntry, l as
|
|
1
|
+
import { g as getGlobalHostPlugins, a as globalLoading, D as DEFAULT_REMOTE_TYPE, b as DEFAULT_SCOPE, c as getRemoteEntryExports, d as assert, s as safeToString, e as getFMId, i as isObject, f as error, w as warn, h as isPlainObject, j as isRemoteInfoWithEntry, k as isPureRemoteEntry, l as isBrowserEnv, m as getInfoWithoutType, n as getPreloaded, o as setPreloaded, p as getRegisteredShare, q as arrayOptions, r as getGlobalSnapshotInfoByModuleInfo, t as addGlobalSnapshot, u as setGlobalSnapshotInfoByModuleInfo, v as getGlobalSnapshot, G as Global, x as formatShareConfigs, y as getTargetSharedOptions, z as getGlobalShareScope, A as addUniqueItem, B as getBuilderId, C as setGlobalFederationConstructor, E as getGlobalFederationInstance, F as getGlobalFederationConstructor, H as setGlobalFederationInstance } from './share.esm.js';
|
|
2
2
|
export { I as registerGlobalPlugins } from './share.esm.js';
|
|
3
|
-
import { loadScriptNode, loadScript, composeKeyWithSeparator, createLink, getResourceUrl, isManifestProvider, generateSnapshotFromManifest, warn as warn$1, isBrowserEnv } from '@module-federation/sdk';
|
|
3
|
+
import { loadScriptNode, loadScript, composeKeyWithSeparator, createLink, createScript, getResourceUrl, isManifestProvider, generateSnapshotFromManifest, warn as warn$1, isBrowserEnv as isBrowserEnv$1 } from '@module-federation/sdk';
|
|
4
4
|
export { loadScript, loadScriptNode } from '@module-federation/sdk';
|
|
5
5
|
|
|
6
6
|
// Function to match a remote with its name and expose
|
|
@@ -140,7 +140,7 @@ async function loadEntryScript({ name, globalName, entry, createScriptHook }) {
|
|
|
140
140
|
`);
|
|
141
141
|
return entryExports;
|
|
142
142
|
}).catch((e)=>{
|
|
143
|
-
|
|
143
|
+
throw e;
|
|
144
144
|
});
|
|
145
145
|
}
|
|
146
146
|
return loadScript(entry, {
|
|
@@ -156,7 +156,7 @@ async function loadEntryScript({ name, globalName, entry, createScriptHook }) {
|
|
|
156
156
|
`);
|
|
157
157
|
return entryExports;
|
|
158
158
|
}).catch((e)=>{
|
|
159
|
-
|
|
159
|
+
throw e;
|
|
160
160
|
});
|
|
161
161
|
}
|
|
162
162
|
function getRemoteEntryUniqueKey(remoteInfo) {
|
|
@@ -170,7 +170,10 @@ async function getRemoteEntry({ remoteEntryExports, remoteInfo, createScriptHook
|
|
|
170
170
|
return remoteEntryExports;
|
|
171
171
|
}
|
|
172
172
|
if (!globalLoading[uniqueKey]) {
|
|
173
|
-
if (
|
|
173
|
+
if ([
|
|
174
|
+
'esm',
|
|
175
|
+
'module'
|
|
176
|
+
].includes(type)) {
|
|
174
177
|
globalLoading[uniqueKey] = loadEsmEntry({
|
|
175
178
|
entry,
|
|
176
179
|
remoteEntryExports
|
|
@@ -558,7 +561,8 @@ function normalizePreloadExposes(exposes) {
|
|
|
558
561
|
return expose;
|
|
559
562
|
});
|
|
560
563
|
}
|
|
561
|
-
function preloadAssets(remoteInfo, host, assets
|
|
564
|
+
function preloadAssets(remoteInfo, host, assets, // It is used to distinguish preload from load remote parallel loading
|
|
565
|
+
useLinkPreload = true) {
|
|
562
566
|
const { cssAssets, jsAssetsWithoutEntry, entryAssets } = assets;
|
|
563
567
|
if (host.options.inBrowser) {
|
|
564
568
|
entryAssets.forEach((asset)=>{
|
|
@@ -610,40 +614,96 @@ function preloadAssets(remoteInfo, host, assets) {
|
|
|
610
614
|
});
|
|
611
615
|
}
|
|
612
616
|
});
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
617
|
+
if (useLinkPreload) {
|
|
618
|
+
cssAssets.forEach((cssUrl)=>{
|
|
619
|
+
const { link: cssEl, needAttach } = createLink({
|
|
620
|
+
url: cssUrl,
|
|
621
|
+
cb: ()=>{},
|
|
622
|
+
attrs: {
|
|
623
|
+
rel: 'preload',
|
|
624
|
+
as: 'style',
|
|
625
|
+
crossorigin: 'anonymous'
|
|
626
|
+
},
|
|
627
|
+
createLinkHook: (url)=>{
|
|
628
|
+
const res = host.loaderHook.lifecycle.createLink.emit({
|
|
629
|
+
url
|
|
630
|
+
});
|
|
631
|
+
if (res instanceof HTMLLinkElement) {
|
|
632
|
+
return res;
|
|
633
|
+
}
|
|
634
|
+
return;
|
|
635
|
+
}
|
|
621
636
|
});
|
|
622
|
-
|
|
623
|
-
return res;
|
|
624
|
-
}
|
|
625
|
-
return;
|
|
637
|
+
needAttach && document.head.appendChild(cssEl);
|
|
626
638
|
});
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
639
|
+
} else {
|
|
640
|
+
cssAssets.forEach((cssUrl)=>{
|
|
641
|
+
const { link: cssEl, needAttach } = createLink({
|
|
642
|
+
url: cssUrl,
|
|
643
|
+
cb: ()=>{},
|
|
644
|
+
attrs: {
|
|
645
|
+
rel: 'stylesheet',
|
|
646
|
+
type: 'text/css'
|
|
647
|
+
},
|
|
648
|
+
createLinkHook: (url)=>{
|
|
649
|
+
const res = host.loaderHook.lifecycle.createLink.emit({
|
|
650
|
+
url
|
|
651
|
+
});
|
|
652
|
+
if (res instanceof HTMLLinkElement) {
|
|
653
|
+
return res;
|
|
654
|
+
}
|
|
655
|
+
return;
|
|
656
|
+
},
|
|
657
|
+
needDeleteLink: false
|
|
638
658
|
});
|
|
639
|
-
|
|
640
|
-
return res;
|
|
641
|
-
}
|
|
642
|
-
return;
|
|
659
|
+
needAttach && document.head.appendChild(cssEl);
|
|
643
660
|
});
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
661
|
+
}
|
|
662
|
+
if (useLinkPreload) {
|
|
663
|
+
jsAssetsWithoutEntry.forEach((jsUrl)=>{
|
|
664
|
+
const { link: linkEl, needAttach } = createLink({
|
|
665
|
+
url: jsUrl,
|
|
666
|
+
cb: ()=>{},
|
|
667
|
+
attrs: {
|
|
668
|
+
rel: 'preload',
|
|
669
|
+
as: 'script',
|
|
670
|
+
crossorigin: 'anonymous'
|
|
671
|
+
},
|
|
672
|
+
createLinkHook: (url)=>{
|
|
673
|
+
const res = host.loaderHook.lifecycle.createLink.emit({
|
|
674
|
+
url
|
|
675
|
+
});
|
|
676
|
+
if (res instanceof HTMLLinkElement) {
|
|
677
|
+
return res;
|
|
678
|
+
}
|
|
679
|
+
return;
|
|
680
|
+
}
|
|
681
|
+
});
|
|
682
|
+
needAttach && document.head.appendChild(linkEl);
|
|
683
|
+
});
|
|
684
|
+
} else {
|
|
685
|
+
jsAssetsWithoutEntry.forEach((jsUrl)=>{
|
|
686
|
+
const { script: scriptEl, needAttach } = createScript({
|
|
687
|
+
url: jsUrl,
|
|
688
|
+
cb: ()=>{},
|
|
689
|
+
attrs: {
|
|
690
|
+
crossorigin: 'anonymous',
|
|
691
|
+
fetchpriority: 'high'
|
|
692
|
+
},
|
|
693
|
+
createScriptHook: (url)=>{
|
|
694
|
+
const res = host.loaderHook.lifecycle.createScript.emit({
|
|
695
|
+
url
|
|
696
|
+
});
|
|
697
|
+
if (res instanceof HTMLScriptElement) {
|
|
698
|
+
return res;
|
|
699
|
+
}
|
|
700
|
+
return;
|
|
701
|
+
},
|
|
702
|
+
needDeleteScript: true
|
|
703
|
+
});
|
|
704
|
+
needAttach && document.head.appendChild(scriptEl);
|
|
705
|
+
});
|
|
706
|
+
}
|
|
647
707
|
}
|
|
648
708
|
}
|
|
649
709
|
|
|
@@ -666,7 +726,10 @@ function assignRemoteInfo(remoteInfo, remoteSnapshot) {
|
|
|
666
726
|
error(`The attribute remoteEntry of ${name} must not be undefined.`);
|
|
667
727
|
}
|
|
668
728
|
const { remoteEntry } = remoteSnapshot;
|
|
669
|
-
|
|
729
|
+
let entryUrl = getResourceUrl(remoteSnapshot, remoteEntry);
|
|
730
|
+
if (!isBrowserEnv() && !entryUrl.startsWith('http')) {
|
|
731
|
+
entryUrl = `https:${entryUrl}`;
|
|
732
|
+
}
|
|
670
733
|
remoteInfo.type = remoteSnapshot.remoteEntryType;
|
|
671
734
|
remoteInfo.entryGlobalName = remoteSnapshot.globalName;
|
|
672
735
|
remoteInfo.entry = entryUrl;
|
|
@@ -703,7 +766,7 @@ function snapshotPlugin() {
|
|
|
703
766
|
globalSnapshot
|
|
704
767
|
});
|
|
705
768
|
if (assets) {
|
|
706
|
-
preloadAssets(remoteInfo, origin, assets);
|
|
769
|
+
preloadAssets(remoteInfo, origin, assets, false);
|
|
707
770
|
}
|
|
708
771
|
return _extends$4({}, args, {
|
|
709
772
|
remoteSnapshot
|
|
@@ -1664,7 +1727,7 @@ class RemoteHandler {
|
|
|
1664
1727
|
}
|
|
1665
1728
|
// Set the remote entry to a complete path
|
|
1666
1729
|
if ('entry' in remote) {
|
|
1667
|
-
if (isBrowserEnv() && !remote.entry.startsWith('http')) {
|
|
1730
|
+
if (isBrowserEnv$1() && !remote.entry.startsWith('http')) {
|
|
1668
1731
|
remote.entry = new URL(remote.entry, window.location.origin).href;
|
|
1669
1732
|
}
|
|
1670
1733
|
}
|
|
@@ -1905,7 +1968,7 @@ class FederationHost {
|
|
|
1905
1968
|
// maybe will change, temporarily for internal use only
|
|
1906
1969
|
initContainer: new AsyncWaterfallHook('initContainer')
|
|
1907
1970
|
});
|
|
1908
|
-
this.version = "0.1.
|
|
1971
|
+
this.version = "0.1.19";
|
|
1909
1972
|
this.moduleCache = new Map();
|
|
1910
1973
|
this.loaderHook = new PluginSystem({
|
|
1911
1974
|
// FIXME: may not be suitable , not open to the public yet
|
|
@@ -1926,7 +1989,7 @@ class FederationHost {
|
|
|
1926
1989
|
],
|
|
1927
1990
|
remotes: [],
|
|
1928
1991
|
shared: {},
|
|
1929
|
-
inBrowser: isBrowserEnv
|
|
1992
|
+
inBrowser: isBrowserEnv()
|
|
1930
1993
|
};
|
|
1931
1994
|
this.name = userOptions.name;
|
|
1932
1995
|
this.options = defaultOptions;
|
package/dist/package.json
CHANGED
package/dist/share.cjs.js
CHANGED
|
@@ -190,7 +190,7 @@ function getGlobalFederationConstructor() {
|
|
|
190
190
|
function setGlobalFederationConstructor(FederationConstructor, isDebug = isDebugMode()) {
|
|
191
191
|
if (isDebug) {
|
|
192
192
|
globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = FederationConstructor;
|
|
193
|
-
globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.1.
|
|
193
|
+
globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.1.19";
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
196
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
package/dist/share.esm.js
CHANGED
|
@@ -188,7 +188,7 @@ function getGlobalFederationConstructor() {
|
|
|
188
188
|
function setGlobalFederationConstructor(FederationConstructor, isDebug = isDebugMode()) {
|
|
189
189
|
if (isDebug) {
|
|
190
190
|
globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = FederationConstructor;
|
|
191
|
-
globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.1.
|
|
191
|
+
globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.1.19";
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
194
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
@@ -870,4 +870,4 @@ function getTargetSharedOptions(options) {
|
|
|
870
870
|
return Object.assign({}, resolver(shareInfos[pkgName]), extraOptions == null ? void 0 : extraOptions.customShareInfo);
|
|
871
871
|
}
|
|
872
872
|
|
|
873
|
-
export {
|
|
873
|
+
export { addUniqueItem as A, getBuilderId as B, setGlobalFederationConstructor as C, DEFAULT_REMOTE_TYPE as D, getGlobalFederationInstance as E, getGlobalFederationConstructor as F, Global as G, setGlobalFederationInstance as H, registerGlobalPlugins as I, nativeGlobal as J, resetFederationGlobalInfo as K, getTargetSnapshotInfoByModuleInfo as L, globalLoading as a, DEFAULT_SCOPE as b, getRemoteEntryExports as c, assert as d, getFMId as e, error as f, getGlobalHostPlugins as g, isPlainObject as h, isObject as i, isRemoteInfoWithEntry as j, isPureRemoteEntry as k, isBrowserEnv as l, getInfoWithoutType as m, getPreloaded as n, setPreloaded as o, getRegisteredShare as p, arrayOptions as q, getGlobalSnapshotInfoByModuleInfo as r, safeToString as s, addGlobalSnapshot as t, setGlobalSnapshotInfoByModuleInfo as u, getGlobalSnapshot as v, warn as w, formatShareConfigs as x, getTargetSharedOptions as y, getGlobalShareScope as z };
|
|
@@ -3,4 +3,4 @@ import { FederationHost } from '../core';
|
|
|
3
3
|
export declare function defaultPreloadArgs(preloadConfig: PreloadRemoteArgs | depsPreloadArg): PreloadConfig;
|
|
4
4
|
export declare function formatPreloadArgs(remotes: Array<Remote>, preloadArgs: Array<PreloadRemoteArgs>): PreloadOptions;
|
|
5
5
|
export declare function normalizePreloadExposes(exposes?: string[]): string[];
|
|
6
|
-
export declare function preloadAssets(remoteInfo: RemoteInfo, host: FederationHost, assets: PreloadAssets): void;
|
|
6
|
+
export declare function preloadAssets(remoteInfo: RemoteInfo, host: FederationHost, assets: PreloadAssets, useLinkPreload?: boolean): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@module-federation/runtime",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.19",
|
|
4
4
|
"author": "zhouxiao <codingzx@gmail.com>",
|
|
5
5
|
"main": "./dist/index.cjs.js",
|
|
6
6
|
"module": "./dist/index.esm.js",
|
|
@@ -45,6 +45,6 @@
|
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@module-federation/sdk": "0.1.
|
|
48
|
+
"@module-federation/sdk": "0.1.19"
|
|
49
49
|
}
|
|
50
50
|
}
|