@module-federation/bridge-vue3 0.0.0-next-20250321032801 → 0.0.0-next-20250321090937
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/CHANGELOG.md +4 -4
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +3 -0
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# @module-federation/bridge-vue3
|
|
2
2
|
|
|
3
|
-
## 0.0.0-next-
|
|
3
|
+
## 0.0.0-next-20250321090937
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
-
- @module-federation/runtime@0.0.0-next-
|
|
8
|
-
- @module-federation/sdk@0.0.0-next-
|
|
9
|
-
- @module-federation/bridge-shared@0.0.0-next-
|
|
7
|
+
- @module-federation/runtime@0.0.0-next-20250321090937
|
|
8
|
+
- @module-federation/sdk@0.0.0-next-20250321090937
|
|
9
|
+
- @module-federation/bridge-shared@0.0.0-next-20250321090937
|
|
10
10
|
|
|
11
11
|
## 0.11.1
|
|
12
12
|
|
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Vue=require("vue"),VueRouter=require("vue-router");function _interopNamespaceDefault(n){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const o in n)if(o!=="default"){const r=Object.getOwnPropertyDescriptor(n,o);Object.defineProperty(t,o,r.get?r:{enumerable:!0,get:()=>n[o]})}}return t.default=n,Object.freeze(t)}const Vue__namespace=_interopNamespaceDefault(Vue),VueRouter__namespace=_interopNamespaceDefault(VueRouter);function _extends$2(){return _extends$2=Object.assign||function(t){for(var o=1;o<arguments.length;o++){var r=arguments[o];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},_extends$2.apply(this,arguments)}const MANIFEST_EXT=".json",BROWSER_LOG_KEY="FEDERATION_DEBUG",BROWSER_LOG_VALUE="1",SEPARATOR=":";function isBrowserEnv(){return typeof window<"u"}function isBrowserDebug(){try{if(isBrowserEnv()&&window.localStorage)return localStorage.getItem(BROWSER_LOG_KEY)===BROWSER_LOG_VALUE}catch{return!1}return!1}function isDebugMode(){return typeof process<"u"&&process.env&&process.env.FEDERATION_DEBUG?!!process.env.FEDERATION_DEBUG:typeof FEDERATION_DEBUG<"u"&&FEDERATION_DEBUG?!0:isBrowserDebug()}const LOG_CATEGORY$1="[ Federation Runtime ]",composeKeyWithSeparator=function(...n){return n.length?n.reduce((t,o)=>o?t?`${t}${SEPARATOR}${o}`:o:t,""):""},getResourceUrl=(n,t)=>{if("getPublicPath"in n){let o;return n.getPublicPath.startsWith("function")?o=new Function("return "+n.getPublicPath)()():o=new Function(n.getPublicPath)(),`${o}${t}`}else return"publicPath"in n?`${n.publicPath}${t}`:(console.warn("Cannot get resource URL. If in debug mode, please ignore.",n,t),"")},warn$1=n=>{console.warn(`${LOG_CATEGORY$1}: ${n}`)};function safeToString(n){try{return JSON.stringify(n,null,2)}catch{return""}}const simpleJoinRemoteEntry=(n,t)=>{if(!n)return t;const r=(s=>{if(s===".")return"";if(s.startsWith("./"))return s.replace("./","");if(s.startsWith("/")){const l=s.slice(1);return l.endsWith("/")?l.slice(0,-1):l}return s})(n);return r?r.endsWith("/")?`${r}${t}`:`${r}/${t}`:t};function inferAutoPublicPath(n){return n.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")}function generateSnapshotFromManifest(n,t={}){var o,r;const{remotes:s={},overrides:l={},version:a}=t;let i;const c=()=>"publicPath"in n.metaData?n.metaData.publicPath==="auto"&&a?inferAutoPublicPath(a):n.metaData.publicPath:n.metaData.getPublicPath,u=Object.keys(l);let d={};if(!Object.keys(s).length){var p;d=((p=n.remotes)==null?void 0:p.reduce((b,v)=>{let A;const $=v.federationContainerName;return u.includes($)?A=l[$]:"version"in v?A=v.version:A=v.entry,b[$]={matchedVersion:A},b},{}))||{}}Object.keys(s).forEach(b=>d[b]={matchedVersion:u.includes(b)?l[b]:s[b]});const{remoteEntry:{path:h,name:m,type:_},types:g,buildInfo:{buildVersion:y},globalName:E,ssrRemoteEntry:I}=n.metaData,{exposes:S}=n;let R={version:a||"",buildVersion:y,globalName:E,remoteEntry:simpleJoinRemoteEntry(h,m),remoteEntryType:_,remoteTypes:simpleJoinRemoteEntry(g.path,g.name),remoteTypesZip:g.zip||"",remoteTypesAPI:g.api||"",remotesInfo:d,shared:n==null?void 0:n.shared.map(b=>({assets:b.assets,sharedName:b.name,version:b.version})),modules:S==null?void 0:S.map(b=>({moduleName:b.name,modulePath:b.path,assets:b.assets}))};if((o=n.metaData)!=null&&o.prefetchInterface){const b=n.metaData.prefetchInterface;R=_extends$2({},R,{prefetchInterface:b})}if((r=n.metaData)!=null&&r.prefetchEntry){const{path:b,name:v,type:A}=n.metaData.prefetchEntry;R=_extends$2({},R,{prefetchEntry:simpleJoinRemoteEntry(b,v),prefetchEntryType:A})}if("publicPath"in n.metaData?i=_extends$2({},R,{publicPath:c()}):i=_extends$2({},R,{getPublicPath:c()}),I){const b=simpleJoinRemoteEntry(I.path,I.name);i.ssrRemoteEntry=b,i.ssrRemoteEntryType=I.type||"commonjs-module"}return i}function isManifestProvider(n){return!!("remoteEntry"in n&&n.remoteEntry.includes(MANIFEST_EXT))}let Logger=class{log(...t){console.log(this.prefix,...t)}warn(...t){console.log(this.prefix,...t)}error(...t){console.log(this.prefix,...t)}success(...t){console.log(this.prefix,...t)}info(...t){console.log(this.prefix,...t)}ready(...t){console.log(this.prefix,...t)}debug(...t){isDebugMode()&&console.log(this.prefix,...t)}constructor(t){this.prefix=t}};function createLogger(n){return new Logger(n)}async function safeWrapper(n,t){try{return await n()}catch(o){warn$1(o);return}}function isStaticResourcesEqual(n,t){const o=/^(https?:)?\/\//i,r=n.replace(o,"").replace(/\/$/,""),s=t.replace(o,"").replace(/\/$/,"");return r===s}function createScript(n){let t=null,o=!0,r=2e4,s;const l=document.getElementsByTagName("script");for(let i=0;i<l.length;i++){const c=l[i],u=c.getAttribute("src");if(u&&isStaticResourcesEqual(u,n.url)){t=c,o=!1;break}}if(!t){const i=n.attrs;t=document.createElement("script"),t.type=(i==null?void 0:i.type)==="module"?"module":"text/javascript";let c;n.createScriptHook&&(c=n.createScriptHook(n.url,n.attrs),c instanceof HTMLScriptElement?t=c:typeof c=="object"&&("script"in c&&c.script&&(t=c.script),"timeout"in c&&c.timeout&&(r=c.timeout))),t.src||(t.src=n.url),i&&!c&&Object.keys(i).forEach(u=>{t&&(u==="async"||u==="defer"?t[u]=i[u]:t.getAttribute(u)||t.setAttribute(u,i[u]))})}const a=async(i,c)=>{clearTimeout(s);const u=()=>{(c==null?void 0:c.type)==="error"?n!=null&&n.onErrorCallback&&(n==null||n.onErrorCallback(c)):n!=null&&n.cb&&(n==null||n.cb())};if(t&&(t.onerror=null,t.onload=null,safeWrapper(()=>{const{needDeleteScript:d=!0}=n;d&&t!=null&&t.parentNode&&t.parentNode.removeChild(t)}),i&&typeof i=="function")){const d=i(c);if(d instanceof Promise){const p=await d;return u(),p}return u(),d}u()};return t.onerror=a.bind(null,t.onerror),t.onload=a.bind(null,t.onload),s=setTimeout(()=>{a(null,new Error(`Remote script "${n.url}" time-outed.`))},r),{script:t,needAttach:o}}function createLink(n){let t=null,o=!0;const r=document.getElementsByTagName("link");for(let l=0;l<r.length;l++){const a=r[l],i=a.getAttribute("href"),c=a.getAttribute("rel");if(i&&isStaticResourcesEqual(i,n.url)&&c===n.attrs.rel){t=a,o=!1;break}}if(!t){t=document.createElement("link"),t.setAttribute("href",n.url);let l;const a=n.attrs;n.createLinkHook&&(l=n.createLinkHook(n.url,a),l instanceof HTMLLinkElement&&(t=l)),a&&!l&&Object.keys(a).forEach(i=>{t&&!t.getAttribute(i)&&t.setAttribute(i,a[i])})}const s=(l,a)=>{const i=()=>{(a==null?void 0:a.type)==="error"?n!=null&&n.onErrorCallback&&(n==null||n.onErrorCallback(a)):n!=null&&n.cb&&(n==null||n.cb())};if(t&&(t.onerror=null,t.onload=null,safeWrapper(()=>{const{needDeleteLink:c=!0}=n;c&&t!=null&&t.parentNode&&t.parentNode.removeChild(t)}),l)){const c=l(a);return i(),c}i()};return t.onerror=s.bind(null,t.onerror),t.onload=s.bind(null,t.onload),{link:t,needAttach:o}}function loadScript(n,t){const{attrs:o={},createScriptHook:r}=t;return new Promise((s,l)=>{const{script:a,needAttach:i}=createScript({url:n,cb:s,onErrorCallback:l,attrs:_extends$2({fetchpriority:"high"},o),createScriptHook:r,needDeleteScript:!0});i&&document.head.appendChild(a)})}function importNodeModule(n){if(!n)throw new Error("import specifier is required");return new Function("name","return import(name)")(n).then(o=>o).catch(o=>{throw console.error(`Error importing module ${n}:`,o),o})}const loadNodeFetch=async()=>{const n=await importNodeModule("node-fetch");return n.default||n},lazyLoaderHookFetch=async(n,t,o)=>{const s=await((l,a)=>o.lifecycle.fetch.emit(l,a))(n,t||{});return!s||!(s instanceof Response)?(typeof fetch>"u"?await loadNodeFetch():fetch)(n,t||{}):s};function createScriptNode(url,cb,attrs,loaderHook){if(loaderHook!=null&&loaderHook.createScriptHook){const n=loaderHook.createScriptHook(url);n&&typeof n=="object"&&"url"in n&&(url=n.url)}let urlObj;try{urlObj=new URL(url)}catch(n){console.error("Error constructing URL:",n),cb(new Error(`Invalid URL: ${n}`));return}const getFetch=async()=>loaderHook!=null&&loaderHook.fetch?(n,t)=>lazyLoaderHookFetch(n,t,loaderHook):typeof fetch>"u"?loadNodeFetch():fetch,handleScriptFetch=async(f,urlObj)=>{try{var _vm_constants;const res=await f(urlObj.href),data=await res.text(),[path,vm]=await Promise.all([importNodeModule("path"),importNodeModule("vm")]),scriptContext={exports:{},module:{exports:{}}},urlDirname=urlObj.pathname.split("/").slice(0,-1).join("/"),filename=path.basename(urlObj.pathname);var _vm_constants_USE_MAIN_CONTEXT_DEFAULT_LOADER;const script=new vm.Script(`(function(exports, module, require, __dirname, __filename) {${data}
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Vue=require("vue"),VueRouter=require("vue-router");function _interopNamespaceDefault(n){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const o in n)if(o!=="default"){const r=Object.getOwnPropertyDescriptor(n,o);Object.defineProperty(t,o,r.get?r:{enumerable:!0,get:()=>n[o]})}}return t.default=n,Object.freeze(t)}const Vue__namespace=_interopNamespaceDefault(Vue),VueRouter__namespace=_interopNamespaceDefault(VueRouter);function _extends$2(){return _extends$2=Object.assign||function(t){for(var o=1;o<arguments.length;o++){var r=arguments[o];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},_extends$2.apply(this,arguments)}const MANIFEST_EXT=".json",BROWSER_LOG_KEY="FEDERATION_DEBUG",BROWSER_LOG_VALUE="1",SEPARATOR=":";function isBrowserEnv(){return typeof window<"u"}function isBrowserDebug(){try{if(isBrowserEnv()&&window.localStorage)return localStorage.getItem(BROWSER_LOG_KEY)===BROWSER_LOG_VALUE}catch{return!1}return!1}function isDebugMode(){return typeof process<"u"&&process.env&&process.env.FEDERATION_DEBUG?!!process.env.FEDERATION_DEBUG:typeof FEDERATION_DEBUG<"u"&&FEDERATION_DEBUG?!0:isBrowserDebug()}const LOG_CATEGORY$1="[ Federation Runtime ]",composeKeyWithSeparator=function(...n){return n.length?n.reduce((t,o)=>o?t?`${t}${SEPARATOR}${o}`:o:t,""):""},getResourceUrl=(n,t)=>{if("getPublicPath"in n){let o;return n.getPublicPath.startsWith("function")?o=new Function("return "+n.getPublicPath)()():o=new Function(n.getPublicPath)(),`${o}${t}`}else return"publicPath"in n?`${n.publicPath}${t}`:(console.warn("Cannot get resource URL. If in debug mode, please ignore.",n,t),"")},warn$1=n=>{console.warn(`${LOG_CATEGORY$1}: ${n}`)};function safeToString(n){try{return JSON.stringify(n,null,2)}catch{return""}}const simpleJoinRemoteEntry=(n,t)=>{if(!n)return t;const r=(s=>{if(s===".")return"";if(s.startsWith("./"))return s.replace("./","");if(s.startsWith("/")){const l=s.slice(1);return l.endsWith("/")?l.slice(0,-1):l}return s})(n);return r?r.endsWith("/")?`${r}${t}`:`${r}/${t}`:t};function inferAutoPublicPath(n){return n.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")}function generateSnapshotFromManifest(n,t={}){var o,r;const{remotes:s={},overrides:l={},version:a}=t;let i;const c=()=>"publicPath"in n.metaData?n.metaData.publicPath==="auto"&&a?inferAutoPublicPath(a):n.metaData.publicPath:n.metaData.getPublicPath,u=Object.keys(l);let d={};if(!Object.keys(s).length){var p;d=((p=n.remotes)==null?void 0:p.reduce((b,v)=>{let A;const $=v.federationContainerName;return u.includes($)?A=l[$]:"version"in v?A=v.version:A=v.entry,b[$]={matchedVersion:A},b},{}))||{}}Object.keys(s).forEach(b=>d[b]={matchedVersion:u.includes(b)?l[b]:s[b]});const{remoteEntry:{path:h,name:m,type:_},types:g,buildInfo:{buildVersion:y},globalName:E,ssrRemoteEntry:I}=n.metaData,{exposes:S}=n;let R={version:a||"",buildVersion:y,globalName:E,remoteEntry:simpleJoinRemoteEntry(h,m),remoteEntryType:_,remoteTypes:simpleJoinRemoteEntry(g.path,g.name),remoteTypesZip:g.zip||"",remoteTypesAPI:g.api||"",remotesInfo:d,shared:n==null?void 0:n.shared.map(b=>({assets:b.assets,sharedName:b.name,version:b.version})),modules:S==null?void 0:S.map(b=>({moduleName:b.name,modulePath:b.path,assets:b.assets}))};if((o=n.metaData)!=null&&o.prefetchInterface){const b=n.metaData.prefetchInterface;R=_extends$2({},R,{prefetchInterface:b})}if((r=n.metaData)!=null&&r.prefetchEntry){const{path:b,name:v,type:A}=n.metaData.prefetchEntry;R=_extends$2({},R,{prefetchEntry:simpleJoinRemoteEntry(b,v),prefetchEntryType:A})}if("publicPath"in n.metaData?i=_extends$2({},R,{publicPath:c()}):i=_extends$2({},R,{getPublicPath:c()}),I){const b=simpleJoinRemoteEntry(I.path,I.name);i.ssrRemoteEntry=b,i.ssrRemoteEntryType=I.type||"commonjs-module"}return i}function isManifestProvider(n){return!!("remoteEntry"in n&&n.remoteEntry.includes(MANIFEST_EXT))}let Logger=class{setPrefix(t){this.prefix=t}log(...t){console.log(this.prefix,...t)}warn(...t){console.log(this.prefix,...t)}error(...t){console.log(this.prefix,...t)}success(...t){console.log(this.prefix,...t)}info(...t){console.log(this.prefix,...t)}ready(...t){console.log(this.prefix,...t)}debug(...t){isDebugMode()&&console.log(this.prefix,...t)}constructor(t){this.prefix=t}};function createLogger(n){return new Logger(n)}async function safeWrapper(n,t){try{return await n()}catch(o){warn$1(o);return}}function isStaticResourcesEqual(n,t){const o=/^(https?:)?\/\//i,r=n.replace(o,"").replace(/\/$/,""),s=t.replace(o,"").replace(/\/$/,"");return r===s}function createScript(n){let t=null,o=!0,r=2e4,s;const l=document.getElementsByTagName("script");for(let i=0;i<l.length;i++){const c=l[i],u=c.getAttribute("src");if(u&&isStaticResourcesEqual(u,n.url)){t=c,o=!1;break}}if(!t){const i=n.attrs;t=document.createElement("script"),t.type=(i==null?void 0:i.type)==="module"?"module":"text/javascript";let c;n.createScriptHook&&(c=n.createScriptHook(n.url,n.attrs),c instanceof HTMLScriptElement?t=c:typeof c=="object"&&("script"in c&&c.script&&(t=c.script),"timeout"in c&&c.timeout&&(r=c.timeout))),t.src||(t.src=n.url),i&&!c&&Object.keys(i).forEach(u=>{t&&(u==="async"||u==="defer"?t[u]=i[u]:t.getAttribute(u)||t.setAttribute(u,i[u]))})}const a=async(i,c)=>{clearTimeout(s);const u=()=>{(c==null?void 0:c.type)==="error"?n!=null&&n.onErrorCallback&&(n==null||n.onErrorCallback(c)):n!=null&&n.cb&&(n==null||n.cb())};if(t&&(t.onerror=null,t.onload=null,safeWrapper(()=>{const{needDeleteScript:d=!0}=n;d&&t!=null&&t.parentNode&&t.parentNode.removeChild(t)}),i&&typeof i=="function")){const d=i(c);if(d instanceof Promise){const p=await d;return u(),p}return u(),d}u()};return t.onerror=a.bind(null,t.onerror),t.onload=a.bind(null,t.onload),s=setTimeout(()=>{a(null,new Error(`Remote script "${n.url}" time-outed.`))},r),{script:t,needAttach:o}}function createLink(n){let t=null,o=!0;const r=document.getElementsByTagName("link");for(let l=0;l<r.length;l++){const a=r[l],i=a.getAttribute("href"),c=a.getAttribute("rel");if(i&&isStaticResourcesEqual(i,n.url)&&c===n.attrs.rel){t=a,o=!1;break}}if(!t){t=document.createElement("link"),t.setAttribute("href",n.url);let l;const a=n.attrs;n.createLinkHook&&(l=n.createLinkHook(n.url,a),l instanceof HTMLLinkElement&&(t=l)),a&&!l&&Object.keys(a).forEach(i=>{t&&!t.getAttribute(i)&&t.setAttribute(i,a[i])})}const s=(l,a)=>{const i=()=>{(a==null?void 0:a.type)==="error"?n!=null&&n.onErrorCallback&&(n==null||n.onErrorCallback(a)):n!=null&&n.cb&&(n==null||n.cb())};if(t&&(t.onerror=null,t.onload=null,safeWrapper(()=>{const{needDeleteLink:c=!0}=n;c&&t!=null&&t.parentNode&&t.parentNode.removeChild(t)}),l)){const c=l(a);return i(),c}i()};return t.onerror=s.bind(null,t.onerror),t.onload=s.bind(null,t.onload),{link:t,needAttach:o}}function loadScript(n,t){const{attrs:o={},createScriptHook:r}=t;return new Promise((s,l)=>{const{script:a,needAttach:i}=createScript({url:n,cb:s,onErrorCallback:l,attrs:_extends$2({fetchpriority:"high"},o),createScriptHook:r,needDeleteScript:!0});i&&document.head.appendChild(a)})}function importNodeModule(n){if(!n)throw new Error("import specifier is required");return new Function("name","return import(name)")(n).then(o=>o).catch(o=>{throw console.error(`Error importing module ${n}:`,o),o})}const loadNodeFetch=async()=>{const n=await importNodeModule("node-fetch");return n.default||n},lazyLoaderHookFetch=async(n,t,o)=>{const s=await((l,a)=>o.lifecycle.fetch.emit(l,a))(n,t||{});return!s||!(s instanceof Response)?(typeof fetch>"u"?await loadNodeFetch():fetch)(n,t||{}):s};function createScriptNode(url,cb,attrs,loaderHook){if(loaderHook!=null&&loaderHook.createScriptHook){const n=loaderHook.createScriptHook(url);n&&typeof n=="object"&&"url"in n&&(url=n.url)}let urlObj;try{urlObj=new URL(url)}catch(n){console.error("Error constructing URL:",n),cb(new Error(`Invalid URL: ${n}`));return}const getFetch=async()=>loaderHook!=null&&loaderHook.fetch?(n,t)=>lazyLoaderHookFetch(n,t,loaderHook):typeof fetch>"u"?loadNodeFetch():fetch,handleScriptFetch=async(f,urlObj)=>{try{var _vm_constants;const res=await f(urlObj.href),data=await res.text(),[path,vm]=await Promise.all([importNodeModule("path"),importNodeModule("vm")]),scriptContext={exports:{},module:{exports:{}}},urlDirname=urlObj.pathname.split("/").slice(0,-1).join("/"),filename=path.basename(urlObj.pathname);var _vm_constants_USE_MAIN_CONTEXT_DEFAULT_LOADER;const script=new vm.Script(`(function(exports, module, require, __dirname, __filename) {${data}
|
|
2
2
|
})`,{filename,importModuleDynamically:(_vm_constants_USE_MAIN_CONTEXT_DEFAULT_LOADER=(_vm_constants=vm.constants)==null?void 0:_vm_constants.USE_MAIN_CONTEXT_DEFAULT_LOADER)!=null?_vm_constants_USE_MAIN_CONTEXT_DEFAULT_LOADER:importNodeModule});script.runInThisContext()(scriptContext.exports,scriptContext.module,eval("require"),urlDirname,filename);const exportedInterface=scriptContext.module.exports||scriptContext.exports;if(attrs&&exportedInterface&&attrs.globalName){const n=exportedInterface[attrs.globalName]||exportedInterface;cb(void 0,n);return}cb(void 0,exportedInterface)}catch(n){cb(n instanceof Error?n:new Error(`Script execution error: ${n}`))}};getFetch().then(async n=>{if((attrs==null?void 0:attrs.type)==="esm"||(attrs==null?void 0:attrs.type)==="module")return loadModule(urlObj.href,{fetch:n,vm:await importNodeModule("vm")}).then(async t=>{await t.evaluate(),cb(void 0,t.namespace)}).catch(t=>{cb(t instanceof Error?t:new Error(`Script execution error: ${t}`))});handleScriptFetch(n,urlObj)}).catch(n=>{cb(n)})}function loadScriptNode(n,t){return new Promise((o,r)=>{createScriptNode(n,(s,l)=>{if(s)r(s);else{var a,i;const c=(t==null||(a=t.attrs)==null?void 0:a.globalName)||`__FEDERATION_${t==null||(i=t.attrs)==null?void 0:i.name}:custom__`,u=globalThis[c]=l;o(u)}},t.attrs,t.loaderHook)})}async function loadModule(n,t){const{fetch:o,vm:r}=t,l=await(await o(n)).text(),a=new r.SourceTextModule(l,{importModuleDynamically:async(i,c)=>{const u=new URL(i,n).href;return loadModule(u,t)}});return await a.link(async i=>{const c=new URL(i,n).href;return await loadModule(c,t)}),a}const LoggerInstance=createLogger("[ Module Federation Bridge Vue3 ]");function _extends$1(){return _extends$1=Object.assign||function(t){for(var o=1;o<arguments.length;o++){var r=arguments[o];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},_extends$1.apply(this,arguments)}function _object_without_properties_loose(n,t){if(n==null)return{};var o={},r=Object.keys(n),s,l;for(l=0;l<r.length;l++)s=r[l],!(t.indexOf(s)>=0)&&(o[s]=n[s]);return o}const RUNTIME_001="RUNTIME-001",RUNTIME_002="RUNTIME-002",RUNTIME_003="RUNTIME-003",RUNTIME_004="RUNTIME-004",RUNTIME_005="RUNTIME-005",RUNTIME_006="RUNTIME-006",RUNTIME_007="RUNTIME-007",RUNTIME_008="RUNTIME-008",TYPE_001="TYPE-001",BUILD_001="BUILD-001",getDocsUrl=n=>`https://module-federation.io/guide/troubleshooting/${n.split("-")[0].toLowerCase()}/${n}`,getShortErrorMsg=(n,t,o,r)=>{const s=[`${[t[n]]} #${n}`];return o&&s.push(`args: ${JSON.stringify(o)}`),s.push(getDocsUrl(n)),r&&s.push(`Original Error Message:
|
|
3
3
|
${r}`),s.join(`
|
|
4
4
|
`)};function _extends(){return _extends=Object.assign||function(t){for(var o=1;o<arguments.length;o++){var r=arguments[o];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},_extends.apply(this,arguments)}const runtimeDescMap={[RUNTIME_001]:"Failed to get remoteEntry exports.",[RUNTIME_002]:'The remote entry interface does not contain "init"',[RUNTIME_003]:"Failed to get manifest.",[RUNTIME_004]:"Failed to locate remote.",[RUNTIME_005]:"Invalid loadShareSync function call from bundler runtime",[RUNTIME_006]:"Invalid loadShareSync function call from runtime",[RUNTIME_007]:"Failed to get remote snapshot.",[RUNTIME_008]:"Failed to load script resources."},typeDescMap={[TYPE_001]:"Failed to generate type declaration."},buildDescMap={[BUILD_001]:"Failed to find expose module."};_extends({},runtimeDescMap,typeDescMap,buildDescMap);const LOG_CATEGORY="[ Federation Runtime ]",logger=createLogger(LOG_CATEGORY);function assert(n,t){n||error(t)}function error(n){throw n instanceof Error?(n.message=`${LOG_CATEGORY}: ${n.message}`,n):new Error(`${LOG_CATEGORY}: ${n}`)}function warn(n){n instanceof Error&&(n.message=`${LOG_CATEGORY}: ${n.message}`),logger.warn(n)}function addUniqueItem(n,t){return n.findIndex(o=>o===t)===-1&&n.push(t),n}function getFMId(n){return"version"in n&&n.version?`${n.name}:${n.version}`:"entry"in n&&n.entry?`${n.name}:${n.entry}`:`${n.name}`}function isRemoteInfoWithEntry(n){return typeof n.entry<"u"}function isPureRemoteEntry(n){return!n.entry.includes(".json")&&n.entry.includes(".js")}function isObject(n){return n&&typeof n=="object"}const objectToString=Object.prototype.toString;function isPlainObject(n){return objectToString.call(n)==="[object Object]"}function arrayOptions(n){return Array.isArray(n)?n:[n]}function getRemoteEntryInfoFromSnapshot(n){const t={url:"",type:"global",globalName:""};return isBrowserEnv()?"remoteEntry"in n?{url:n.remoteEntry,type:n.remoteEntryType,globalName:n.globalName}:t:"ssrRemoteEntry"in n?{url:n.ssrRemoteEntry||t.url,type:n.ssrRemoteEntryType||t.type,globalName:n.globalName}:t}const processModuleAlias=(n,t)=>{let o;return n.endsWith("/")?o=n.slice(0,-1):o=n,t.startsWith(".")&&(t=t.slice(1)),o=o+t,o},CurrentGlobal=typeof globalThis=="object"?globalThis:window,nativeGlobal=(()=>{try{return document.defaultView}catch{return CurrentGlobal}})(),Global=nativeGlobal;function definePropertyGlobalVal(n,t,o){Object.defineProperty(n,t,{value:o,configurable:!1,writable:!0})}function includeOwnProperty(n,t){return Object.hasOwnProperty.call(n,t)}includeOwnProperty(CurrentGlobal,"__GLOBAL_LOADING_REMOTE_ENTRY__")||definePropertyGlobalVal(CurrentGlobal,"__GLOBAL_LOADING_REMOTE_ENTRY__",{});const globalLoading=CurrentGlobal.__GLOBAL_LOADING_REMOTE_ENTRY__;function setGlobalDefaultVal(n){var t,o,r,s,l,a;includeOwnProperty(n,"__VMOK__")&&!includeOwnProperty(n,"__FEDERATION__")&&definePropertyGlobalVal(n,"__FEDERATION__",n.__VMOK__),includeOwnProperty(n,"__FEDERATION__")||(definePropertyGlobalVal(n,"__FEDERATION__",{__GLOBAL_PLUGIN__:[],__INSTANCES__:[],moduleInfo:{},__SHARE__:{},__MANIFEST_LOADING__:{},__PRELOADED_MAP__:new Map}),definePropertyGlobalVal(n,"__VMOK__",n.__FEDERATION__));var i;(i=(t=n.__FEDERATION__).__GLOBAL_PLUGIN__)!=null||(t.__GLOBAL_PLUGIN__=[]);var c;(c=(o=n.__FEDERATION__).__INSTANCES__)!=null||(o.__INSTANCES__=[]);var u;(u=(r=n.__FEDERATION__).moduleInfo)!=null||(r.moduleInfo={});var d;(d=(s=n.__FEDERATION__).__SHARE__)!=null||(s.__SHARE__={});var p;(p=(l=n.__FEDERATION__).__MANIFEST_LOADING__)!=null||(l.__MANIFEST_LOADING__={});var h;(h=(a=n.__FEDERATION__).__PRELOADED_MAP__)!=null||(a.__PRELOADED_MAP__=new Map)}setGlobalDefaultVal(CurrentGlobal);setGlobalDefaultVal(nativeGlobal);function setGlobalFederationConstructor(n,t=isDebugMode()){t&&(CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR__=n,CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__="0.11.1")}function getInfoWithoutType(n,t){if(typeof t=="string"){if(n[t])return{value:n[t],key:t};{const r=Object.keys(n);for(const s of r){const[l,a]=s.split(":"),i=`${l}:${t}`,c=n[i];if(c)return{value:c,key:i}}return{value:void 0,key:t}}}else throw new Error("key must be string")}const getGlobalSnapshot=()=>nativeGlobal.__FEDERATION__.moduleInfo,getTargetSnapshotInfoByModuleInfo=(n,t)=>{const o=getFMId(n),r=getInfoWithoutType(t,o).value;if(r&&!r.version&&"version"in n&&n.version&&(r.version=n.version),r)return r;if("version"in n&&n.version){const{version:s}=n,l=_object_without_properties_loose(n,["version"]),a=getFMId(l),i=getInfoWithoutType(nativeGlobal.__FEDERATION__.moduleInfo,a).value;if((i==null?void 0:i.version)===s)return i}},getGlobalSnapshotInfoByModuleInfo=n=>getTargetSnapshotInfoByModuleInfo(n,nativeGlobal.__FEDERATION__.moduleInfo),setGlobalSnapshotInfoByModuleInfo=(n,t)=>{const o=getFMId(n);return nativeGlobal.__FEDERATION__.moduleInfo[o]=t,nativeGlobal.__FEDERATION__.moduleInfo},addGlobalSnapshot=n=>(nativeGlobal.__FEDERATION__.moduleInfo=_extends$1({},nativeGlobal.__FEDERATION__.moduleInfo,n),()=>{const t=Object.keys(n);for(const o of t)delete nativeGlobal.__FEDERATION__.moduleInfo[o]}),getRemoteEntryExports=(n,t)=>{const o=t||`__FEDERATION_${n}:custom__`,r=CurrentGlobal[o];return{remoteEntryKey:o,entryExports:r}},getGlobalHostPlugins=()=>nativeGlobal.__FEDERATION__.__GLOBAL_PLUGIN__,getPreloaded=n=>CurrentGlobal.__FEDERATION__.__PRELOADED_MAP__.get(n),setPreloaded=n=>CurrentGlobal.__FEDERATION__.__PRELOADED_MAP__.set(n,!0),DEFAULT_SCOPE="default",DEFAULT_REMOTE_TYPE="global",buildIdentifier="[0-9A-Za-z-]+",build=`(?:\\+(${buildIdentifier}(?:\\.${buildIdentifier})*))`,numericIdentifier="0|[1-9]\\d*",numericIdentifierLoose="[0-9]+",nonNumericIdentifier="\\d*[a-zA-Z-][a-zA-Z0-9-]*",preReleaseIdentifierLoose=`(?:${numericIdentifierLoose}|${nonNumericIdentifier})`,preReleaseLoose=`(?:-?(${preReleaseIdentifierLoose}(?:\\.${preReleaseIdentifierLoose})*))`,preReleaseIdentifier=`(?:${numericIdentifier}|${nonNumericIdentifier})`,preRelease=`(?:-(${preReleaseIdentifier}(?:\\.${preReleaseIdentifier})*))`,xRangeIdentifier=`${numericIdentifier}|x|X|\\*`,xRangePlain=`[v=\\s]*(${xRangeIdentifier})(?:\\.(${xRangeIdentifier})(?:\\.(${xRangeIdentifier})(?:${preRelease})?${build}?)?)?`,hyphenRange=`^\\s*(${xRangePlain})\\s+-\\s+(${xRangePlain})\\s*$`,mainVersionLoose=`(${numericIdentifierLoose})\\.(${numericIdentifierLoose})\\.(${numericIdentifierLoose})`,loosePlain=`[v=\\s]*${mainVersionLoose}${preReleaseLoose}?${build}?`,gtlt="((?:<|>)?=?)",comparatorTrim=`(\\s*)${gtlt}\\s*(${loosePlain}|${xRangePlain})`,loneTilde="(?:~>?)",tildeTrim=`(\\s*)${loneTilde}\\s+`,loneCaret="(?:\\^)",caretTrim=`(\\s*)${loneCaret}\\s+`,star="(<|>)?=?\\s*\\*",caret=`^${loneCaret}${xRangePlain}$`,mainVersion=`(${numericIdentifier})\\.(${numericIdentifier})\\.(${numericIdentifier})`,fullPlain=`v?${mainVersion}${preRelease}?${build}?`,tilde=`^${loneTilde}${xRangePlain}$`,xRange=`^${gtlt}\\s*${xRangePlain}$`,comparator=`^${gtlt}\\s*(${fullPlain})$|^$`,gte0="^\\s*>=\\s*0.0.0\\s*$";function parseRegex(n){return new RegExp(n)}function isXVersion(n){return!n||n.toLowerCase()==="x"||n==="*"}function pipe(...n){return t=>n.reduce((o,r)=>r(o),t)}function extractComparator(n){return n.match(parseRegex(comparator))}function combineVersion(n,t,o,r){const s=`${n}.${t}.${o}`;return r?`${s}-${r}`:s}function parseHyphen(n){return n.replace(parseRegex(hyphenRange),(t,o,r,s,l,a,i,c,u,d,p,h)=>(isXVersion(r)?o="":isXVersion(s)?o=`>=${r}.0.0`:isXVersion(l)?o=`>=${r}.${s}.0`:o=`>=${o}`,isXVersion(u)?c="":isXVersion(d)?c=`<${Number(u)+1}.0.0-0`:isXVersion(p)?c=`<${u}.${Number(d)+1}.0-0`:h?c=`<=${u}.${d}.${p}-${h}`:c=`<=${c}`,`${o} ${c}`.trim()))}function parseComparatorTrim(n){return n.replace(parseRegex(comparatorTrim),"$1$2$3")}function parseTildeTrim(n){return n.replace(parseRegex(tildeTrim),"$1~")}function parseCaretTrim(n){return n.replace(parseRegex(caretTrim),"$1^")}function parseCarets(n){return n.trim().split(/\s+/).map(t=>t.replace(parseRegex(caret),(o,r,s,l,a)=>isXVersion(r)?"":isXVersion(s)?`>=${r}.0.0 <${Number(r)+1}.0.0-0`:isXVersion(l)?r==="0"?`>=${r}.${s}.0 <${r}.${Number(s)+1}.0-0`:`>=${r}.${s}.0 <${Number(r)+1}.0.0-0`:a?r==="0"?s==="0"?`>=${r}.${s}.${l}-${a} <${r}.${s}.${Number(l)+1}-0`:`>=${r}.${s}.${l}-${a} <${r}.${Number(s)+1}.0-0`:`>=${r}.${s}.${l}-${a} <${Number(r)+1}.0.0-0`:r==="0"?s==="0"?`>=${r}.${s}.${l} <${r}.${s}.${Number(l)+1}-0`:`>=${r}.${s}.${l} <${r}.${Number(s)+1}.0-0`:`>=${r}.${s}.${l} <${Number(r)+1}.0.0-0`)).join(" ")}function parseTildes(n){return n.trim().split(/\s+/).map(t=>t.replace(parseRegex(tilde),(o,r,s,l,a)=>isXVersion(r)?"":isXVersion(s)?`>=${r}.0.0 <${Number(r)+1}.0.0-0`:isXVersion(l)?`>=${r}.${s}.0 <${r}.${Number(s)+1}.0-0`:a?`>=${r}.${s}.${l}-${a} <${r}.${Number(s)+1}.0-0`:`>=${r}.${s}.${l} <${r}.${Number(s)+1}.0-0`)).join(" ")}function parseXRanges(n){return n.split(/\s+/).map(t=>t.trim().replace(parseRegex(xRange),(o,r,s,l,a,i)=>{const c=isXVersion(s),u=c||isXVersion(l),d=u||isXVersion(a);return r==="="&&d&&(r=""),i="",c?r===">"||r==="<"?"<0.0.0-0":"*":r&&d?(u&&(l=0),a=0,r===">"?(r=">=",u?(s=Number(s)+1,l=0,a=0):(l=Number(l)+1,a=0)):r==="<="&&(r="<",u?s=Number(s)+1:l=Number(l)+1),r==="<"&&(i="-0"),`${r+s}.${l}.${a}${i}`):u?`>=${s}.0.0${i} <${Number(s)+1}.0.0-0`:d?`>=${s}.${l}.0${i} <${s}.${Number(l)+1}.0-0`:o})).join(" ")}function parseStar(n){return n.trim().replace(parseRegex(star),"")}function parseGTE0(n){return n.trim().replace(parseRegex(gte0),"")}function compareAtom(n,t){return n=Number(n)||n,t=Number(t)||t,n>t?1:n===t?0:-1}function comparePreRelease(n,t){const{preRelease:o}=n,{preRelease:r}=t;if(o===void 0&&r)return 1;if(o&&r===void 0)return-1;if(o===void 0&&r===void 0)return 0;for(let s=0,l=o.length;s<=l;s++){const a=o[s],i=r[s];if(a!==i)return a===void 0&&i===void 0?0:a?i?compareAtom(a,i):-1:1}return 0}function compareVersion(n,t){return compareAtom(n.major,t.major)||compareAtom(n.minor,t.minor)||compareAtom(n.patch,t.patch)||comparePreRelease(n,t)}function eq(n,t){return n.version===t.version}function compare(n,t){switch(n.operator){case"":case"=":return eq(n,t);case">":return compareVersion(n,t)<0;case">=":return eq(n,t)||compareVersion(n,t)<0;case"<":return compareVersion(n,t)>0;case"<=":return eq(n,t)||compareVersion(n,t)>0;case void 0:return!0;default:return!1}}function parseComparatorString(n){return pipe(parseCarets,parseTildes,parseXRanges,parseStar)(n)}function parseRange(n){return pipe(parseHyphen,parseComparatorTrim,parseTildeTrim,parseCaretTrim)(n.trim()).split(/\s+/).join(" ")}function satisfy(n,t){if(!n)return!1;const s=parseRange(t).split(" ").map(h=>parseComparatorString(h)).join(" ").split(/\s+/).map(h=>parseGTE0(h)),l=extractComparator(n);if(!l)return!1;const[,a,,i,c,u,d]=l,p={operator:a,version:combineVersion(i,c,u,d),major:i,minor:c,patch:u,preRelease:d==null?void 0:d.split(".")};for(const h of s){const m=extractComparator(h);if(!m)return!1;const[,_,,g,y,E,I]=m,S={operator:_,version:combineVersion(g,y,E,I),major:g,minor:y,patch:E,preRelease:I==null?void 0:I.split(".")};if(!compare(S,p))return!1}return!0}function formatShare(n,t,o,r){let s;"get"in n?s=n.get:"lib"in n?s=()=>Promise.resolve(n.lib):s=()=>Promise.resolve(()=>{throw new Error(`Can not get shared '${o}'!`)}),n.strategy&&warn('"shared.strategy is deprecated, please set in initOptions.shareStrategy instead!"');var l,a,i;return _extends$1({deps:[],useIn:[],from:t,loading:null},n,{shareConfig:_extends$1({requiredVersion:`^${n.version}`,singleton:!1,eager:!1,strictVersion:!1},n.shareConfig),get:s,loaded:n!=null&&n.loaded||"lib"in n?!0:void 0,version:(l=n.version)!=null?l:"0",scope:Array.isArray(n.scope)?n.scope:[(a=n.scope)!=null?a:"default"],strategy:((i=n.strategy)!=null?i:r)||"version-first"})}function formatShareConfigs(n,t){const o=t.shared||{},r=t.name,s=Object.keys(o).reduce((a,i)=>{const c=arrayOptions(o[i]);return a[i]=a[i]||[],c.forEach(u=>{a[i].push(formatShare(u,r,i,t.shareStrategy))}),a},{}),l=_extends$1({},n.shared);return Object.keys(s).forEach(a=>{l[a]?s[a].forEach(i=>{l[a].find(u=>u.version===i.version)||l[a].push(i)}):l[a]=s[a]}),{shared:l,shareInfos:s}}function versionLt(n,t){const o=r=>{if(!Number.isNaN(Number(r))){const l=r.split(".");let a=r;for(let i=0;i<3-l.length;i++)a+=".0";return a}return r};return!!satisfy(o(n),`<=${o(t)}`)}const findVersion=(n,t)=>{const o=t||function(r,s){return versionLt(r,s)};return Object.keys(n).reduce((r,s)=>!r||o(r,s)||r==="0"?s:r,0)},isLoaded=n=>!!n.loaded||typeof n.lib=="function",isLoading=n=>!!n.loading;function findSingletonVersionOrderByVersion(n,t,o){const r=n[t][o],s=function(l,a){return!isLoaded(r[l])&&versionLt(l,a)};return findVersion(n[t][o],s)}function findSingletonVersionOrderByLoaded(n,t,o){const r=n[t][o],s=function(l,a){const i=c=>isLoaded(c)||isLoading(c);return i(r[a])?i(r[l])?!!versionLt(l,a):!0:i(r[l])?!1:versionLt(l,a)};return findVersion(n[t][o],s)}function getFindShareFunction(n){return n==="loaded-first"?findSingletonVersionOrderByLoaded:findSingletonVersionOrderByVersion}function getRegisteredShare(n,t,o,r){if(!n)return;const{shareConfig:s,scope:l=DEFAULT_SCOPE,strategy:a}=o,i=Array.isArray(l)?l:[l];for(const c of i)if(s&&n[c]&&n[c][t]){const{requiredVersion:u}=s,p=getFindShareFunction(a)(n,c,t),h=()=>{if(s.singleton){if(typeof u=="string"&&!satisfy(p,u)){const g=`Version ${p} from ${p&&n[c][t][p].from} of shared singleton module ${t} does not satisfy the requirement of ${o.from} which needs ${u})`;s.strictVersion?error(g):warn(g)}return n[c][t][p]}else{if(u===!1||u==="*"||satisfy(p,u))return n[c][t][p];for(const[g,y]of Object.entries(n[c][t]))if(satisfy(g,u))return y}},m={shareScopeMap:n,scope:c,pkgName:t,version:p,GlobalFederation:Global.__FEDERATION__,resolver:h};return(r.emit(m)||m).resolver()}}function getGlobalShareScope(){return Global.__FEDERATION__.__SHARE__}function getTargetSharedOptions(n){const{pkgName:t,extraOptions:o,shareInfos:r}=n,s=i=>{if(!i)return;const c={};i.forEach(p=>{c[p.version]=p});const d=findVersion(c,function(p,h){return!isLoaded(c[p])&&versionLt(p,h)});return c[d]};var l;const a=(l=o==null?void 0:o.resolver)!=null?l:s;return Object.assign({},a(r[t]),o==null?void 0:o.customShareInfo)}function getBuilderId(){return typeof FEDERATION_BUILD_IDENTIFIER<"u"?FEDERATION_BUILD_IDENTIFIER:""}function matchRemoteWithNameAndExpose(n,t){for(const o of n){const r=t.startsWith(o.name);let s=t.replace(o.name,"");if(r){if(s.startsWith("/")){const i=o.name;return s=`.${s}`,{pkgNameOrAlias:i,expose:s,remote:o}}else if(s==="")return{pkgNameOrAlias:o.name,expose:".",remote:o}}const l=o.alias&&t.startsWith(o.alias);let a=o.alias&&t.replace(o.alias,"");if(o.alias&&l){if(a&&a.startsWith("/")){const i=o.alias;return a=`.${a}`,{pkgNameOrAlias:i,expose:a,remote:o}}else if(a==="")return{pkgNameOrAlias:o.alias,expose:".",remote:o}}}}function matchRemote(n,t){for(const o of n)if(t===o.name||o.alias&&t===o.alias)return o}function registerPlugins(n,t){const o=getGlobalHostPlugins();return o.length>0&&o.forEach(r=>{n!=null&&n.find(s=>s.name!==r.name)&&n.push(r)}),n&&n.length>0&&n.forEach(r=>{t.forEach(s=>{s.applyPlugin(r)})}),n}async function loadEsmEntry({entry:n,remoteEntryExports:t}){return new Promise((o,r)=>{try{t?o(t):typeof FEDERATION_ALLOW_NEW_FUNCTION<"u"?new Function("callbacks",`import("${n}").then(callbacks[0]).catch(callbacks[1])`)([o,r]):import(n).then(o).catch(r)}catch(s){r(s)}})}async function loadSystemJsEntry({entry:n,remoteEntryExports:t}){return new Promise((o,r)=>{try{t?o(t):typeof __system_context__>"u"?System.import(n).then(o).catch(r):new Function("callbacks",`System.import("${n}").then(callbacks[0]).catch(callbacks[1])`)([o,r])}catch(s){r(s)}})}async function loadEntryScript({name:n,globalName:t,entry:o,loaderHook:r}){const{entryExports:s}=getRemoteEntryExports(n,t);return s||loadScript(o,{attrs:{},createScriptHook:(l,a)=>{const i=r.lifecycle.createScript.emit({url:l,attrs:a});if(i&&(i instanceof HTMLScriptElement||"script"in i||"timeout"in i))return i}}).then(()=>{const{remoteEntryKey:l,entryExports:a}=getRemoteEntryExports(n,t);return assert(a,getShortErrorMsg(RUNTIME_001,runtimeDescMap,{remoteName:n,remoteEntryUrl:o,remoteEntryKey:l})),a}).catch(l=>{throw assert(void 0,getShortErrorMsg(RUNTIME_008,runtimeDescMap,{remoteName:n,resourceUrl:o})),l})}async function loadEntryDom({remoteInfo:n,remoteEntryExports:t,loaderHook:o}){const{entry:r,entryGlobalName:s,name:l,type:a}=n;switch(a){case"esm":case"module":return loadEsmEntry({entry:r,remoteEntryExports:t});case"system":return loadSystemJsEntry({entry:r,remoteEntryExports:t});default:return loadEntryScript({entry:r,globalName:s,name:l,loaderHook:o})}}async function loadEntryNode({remoteInfo:n,loaderHook:t}){const{entry:o,entryGlobalName:r,name:s,type:l}=n,{entryExports:a}=getRemoteEntryExports(s,r);return a||loadScriptNode(o,{attrs:{name:s,globalName:r,type:l},loaderHook:{createScriptHook:(i,c={})=>{const u=t.lifecycle.createScript.emit({url:i,attrs:c});if(u&&"url"in u)return u}}}).then(()=>{const{remoteEntryKey:i,entryExports:c}=getRemoteEntryExports(s,r);return assert(c,getShortErrorMsg(RUNTIME_001,runtimeDescMap,{remoteName:s,remoteEntryUrl:o,remoteEntryKey:i})),c}).catch(i=>{throw i})}function getRemoteEntryUniqueKey(n){const{entry:t,name:o}=n;return composeKeyWithSeparator(o,t)}async function getRemoteEntry({origin:n,remoteEntryExports:t,remoteInfo:o}){const r=getRemoteEntryUniqueKey(o);if(t)return t;if(!globalLoading[r]){const s=n.remoteHandler.hooks.lifecycle.loadEntry,l=n.loaderHook;globalLoading[r]=s.emit({loaderHook:l,remoteInfo:o,remoteEntryExports:t}).then(a=>a||(isBrowserEnv()?loadEntryDom({remoteInfo:o,remoteEntryExports:t,loaderHook:l}):loadEntryNode({remoteInfo:o,loaderHook:l})))}return globalLoading[r]}function getRemoteInfo(n){return _extends$1({},n,{entry:"entry"in n?n.entry:"",type:n.type||DEFAULT_REMOTE_TYPE,entryGlobalName:n.entryGlobalName||n.name,shareScope:n.shareScope||DEFAULT_SCOPE})}let Module=class{async getEntry(){if(this.remoteEntryExports)return this.remoteEntryExports;let t;try{t=await getRemoteEntry({origin:this.host,remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports})}catch{const r=getRemoteEntryUniqueKey(this.remoteInfo);t=await this.host.loaderHook.lifecycle.loadEntryError.emit({getRemoteEntry,origin:this.host,remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports,globalLoading,uniqueKey:r})}return assert(t,`remoteEntryExports is undefined
|
package/dist/index.es.js
CHANGED
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"url": "https://github.com/module-federation/core",
|
|
8
8
|
"directory": "packages/vue3-bridge"
|
|
9
9
|
},
|
|
10
|
-
"version": "0.0.0-next-
|
|
10
|
+
"version": "0.0.0-next-20250321090937",
|
|
11
11
|
"publishConfig": {
|
|
12
12
|
"access": "public"
|
|
13
13
|
},
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
"vue-router": "=4"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@module-federation/bridge-shared": "0.0.0-next-
|
|
36
|
-
"@module-federation/sdk": "0.0.0-next-
|
|
37
|
-
"@module-federation/runtime": "0.0.0-next-
|
|
35
|
+
"@module-federation/bridge-shared": "0.0.0-next-20250321090937",
|
|
36
|
+
"@module-federation/sdk": "0.0.0-next-20250321090937",
|
|
37
|
+
"@module-federation/runtime": "0.0.0-next-20250321090937"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@vitejs/plugin-vue": "^5.0.4",
|