@module-federation/bridge-vue3
Advanced tools
Comparing version 0.0.0-next-20241114065146 to 0.0.0-next-20241114091142
# @module-federation/bridge-vue3 | ||
## 0.0.0-next-20241114065146 | ||
## 0.0.0-next-20241114091142 | ||
### Patch Changes | ||
- @module-federation/sdk@0.0.0-next-20241114091142 | ||
- @module-federation/bridge-shared@0.0.0-next-20241114091142 | ||
## 0.7.3 | ||
### Patch Changes | ||
- Updated dependencies [4ab9295] | ||
- @module-federation/sdk@0.0.0-next-20241114065146 | ||
- @module-federation/bridge-shared@0.0.0-next-20241114065146 | ||
- @module-federation/sdk@0.7.3 | ||
- @module-federation/bridge-shared@0.7.3 | ||
@@ -11,0 +18,0 @@ ## 0.7.2 |
@@ -6,2 +6,2 @@ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("vue"),w=require("vue-router");function j(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const t=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(o,r,t.get?t:{enumerable:!0,get:()=>e[r]})}}return o.default=e,Object.freeze(o)}const G=j(i),E=j(w);var $=Object.defineProperty,W=Object.getOwnPropertyDescriptor,U=Object.getOwnPropertyNames,T=Object.prototype.hasOwnProperty,k=(e,o)=>{for(var r in o)$(e,r,{get:o[r],enumerable:!0})},x=(e,o,r,t)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of U(o))!T.call(e,n)&&n!==r&&$(e,n,{get:()=>o[n],enumerable:!(t=W(o,n))||t.enumerable});return e},z=e=>x($({},"__esModule",{value:!0}),e),A={};k(A,{createLogger:()=>M,logger:()=>ne});var H=z(A),R=void 0,I=()=>{if(typeof R<"u")return R;try{const e="color test",o="color: red;",r=console.log;console.log=(...t)=>{t[0]===`%c${e}`&&t[1]===o&&(R=!0)},console.log(`%c${e}`,o),console.log=r}catch{R=!1}return R},h={bold:"font-weight: bold;",red:"color: red;",green:"color: green;",orange:"color: orange;",dodgerblue:"color: dodgerblue;",magenta:"color: magenta;",gray:"color: gray;"},v=e=>I()?o=>{if(Array.isArray(o)){const[r,t]=o;return[`%c${r.replace("%c","")}`,t?`${h[e]}${t}`:`${h[e]||""}`]}return[`%c${String(o).replace("%c","")}`,h[e]||""]}:o=>[String(o)],q=v("bold"),J=v("red"),S=v("green"),K=v("orange"),L=v("dodgerblue"),X=v("magenta");v("gray");function Y(e,o,r){let t=[""];return"label"in o&&(t=[r[e]||o.label||""],t=q(o.color?o.color(t):t[0])),t=t.filter(Boolean),t}function Q(e,o,r,t){e.length?Array.isArray(t)?console.log(...e,...t):console.log(...e,o):Array.isArray(t)?console.log(...t):console.log(o,...r)}var P={error:0,warn:1,info:2,log:3,verbose:4},Z=/at\s.*:\d+:\d+[\s\)]*$/,ee=/at\s.*\(<anonymous>\)$/,oe=e=>Z.test(e)||ee.test(e),re=(e={},{getLabel:o,handleError:r,finalLog:t,greet:n,LOG_TYPES:c})=>{let l=e.level||"log",a=e.labels||{},g=(s,u,...F)=>{if(P[c[s].level]>P[l])return;if(u==null)return console.log();let C=c[s],b="";const V=o(s,C,a);if(u instanceof Error)if(u.stack){let[y,..._]=u.stack.split(` | ||
`).map(_=>oe(_)?r(_):_).join(` | ||
`):b=`${u}`;t(V,b,F,u)},d={greet:s=>g("log",n(s))};return Object.keys(c).forEach(s=>{d[s]=(...u)=>g(s,...u)}),Object.defineProperty(d,"level",{get:()=>l,set(s){l=s}}),Object.defineProperty(d,"labels",{get:()=>a,set(s){a=s}}),d.override=s=>{Object.assign(d,s)},d},p=[189,255,243],O=[74,194,154],B=e=>!/[\s\n]/.test(e);function D(e){if(!I())return[e];const o=[...e],r=o.filter(B),t=r.length-1;if(t===0)return console.log(`%c${e}`,`color: rgb(${p.join(",")}); font-weight: bold;`),[e];let n="",c=[];return o.forEach(l=>{if(B(l)){const a=r.indexOf(l)/t,g=Math.round(p[0]+(O[0]-p[0])*a),d=Math.round(p[1]+(O[1]-p[1])*a),s=Math.round(p[2]+(O[2]-p[2])*a);n+=`%c${l}`,c.push(`color: rgb(${g},${d},${s}); font-weight: bold;`)}else n+=l}),[n,...c]}var te={error:{label:"error",level:"error",color:J},warn:{label:"warn",level:"warn",color:K},info:{label:"info",level:"info",color:L},start:{label:"start",level:"info",color:L},ready:{label:"ready",level:"info",color:S},success:{label:"success",level:"info",color:S},log:{level:"log"},debug:{label:"debug",level:"verbose",color:X}};function M(e={}){return re(e,{handleError:o=>o,getLabel:Y,gradient:D,finalLog:Q,LOG_TYPES:te,greet:o=>D(o)})}var ne=M();const ae="FEDERATION_DEBUG",le="1";function ce(){return typeof window<"u"}function se(){try{if(ce()&&window.localStorage)return localStorage.getItem(ae)===le}catch{return!1}return!1}function ue(){return typeof process<"u"&&process.env&&process.env.FEDERATION_DEBUG?!!process.env.FEDERATION_DEBUG:typeof FEDERATION_DEBUG<"u"&&FEDERATION_DEBUG?!0:se()}const f="[ Module Federation ]";function de(e){ue()&&(e.level="verbose")}function ie(e,o){e.labels={warn:`${o} Warn`,error:`${o} Error`,success:`${o} Success`,info:`${o} Info`,ready:`${o} Ready`,debug:`${o} Debug`}}function N(e){const o=H.createLogger({labels:{warn:`${f} Warn`,error:`${f} Error`,success:`${f} Success`,info:`${f} Info`,ready:`${f} Ready`,debug:`${f} Debug`}});return de(o),ie(o,e),o}N(f);const m=N("[ Module Federation Bridge Vue3 ]");function ge(e){const o=new Map;return()=>({__APP_VERSION__:"0.7.2",render(r){m.log("createBridgeComponent render Info",r);const t=G.createApp(e.rootComponent);o.set(r.dom,t);const n=e.appOptions({basename:r.basename,memoryRoute:r.memoryRoute}),c=r.memoryRoute?E.createMemoryHistory(r.basename):E.createWebHistory(r.basename),l=E.createRouter({...n.router.options,history:c,routes:n.router.getRoutes()});m.log("createBridgeComponent render router info>>>",{name:r.moduleName,router:l}),r.memoryRoute?l.push(r.memoryRoute.entryPath).then(()=>{t.use(l),t.mount(r.dom)}):(t.use(l),t.mount(r.dom))},destroy(r){m.log("createBridgeComponent destroy Info",r);const t=o.get(r==null?void 0:r.dom);t==null||t.unmount()}})}function me(){const e=new PopStateEvent("popstate",{state:window.history.state});window.dispatchEvent(e)}const pe=i.defineComponent({name:"RemoteApp",props:{moduleName:String,basename:String,memoryRoute:Object,providerInfo:Function},setup(e){const o=i.ref(null),r=i.ref(null),t=i.ref(""),n=w.useRoute(),c=()=>{var d;const a=(d=e.providerInfo)==null?void 0:d.call(e);r.value=a;const g={name:e.moduleName,dom:o.value,basename:e.basename,memoryRoute:e.memoryRoute};m.log("createRemoteComponent LazyComponent render >>>",g),a.render(g)},l=i.watch(()=>n.path,a=>{a!==n.path&&c(),t.value!==""&&t.value!==a&&(m.log("createRemoteComponent dispatchPopstateEnv >>>",{...e,pathname:n.path}),me()),t.value=a});return i.onMounted(()=>{c()}),i.onBeforeUnmount(()=>{var a;m.log("createRemoteComponent LazyComponent destroy >>>",{...e}),l(),(a=r.value)==null||a.destroy({dom:o.value})}),()=>i.createVNode("div",{ref:o},null)}});function fe(e){return i.defineAsyncComponent({__APP_VERSION__:"0.7.2",loader:async()=>{var g;const o=w.useRoute();let r="/";const t=(g=o.matched[0])==null?void 0:g.path;t&&(t.endsWith("/:pathMatch(.*)*")?r=t.replace("/:pathMatch(.*)*",""):r=o.matched[0].path);const n=(e==null?void 0:e.export)||"default";m.log("createRemoteComponent LazyComponent create >>>",{basename:r,info:e});const c=await e.loader(),l=c&&c[Symbol.for("mf_module_id")],a=c[n];if(m.log("createRemoteComponent LazyComponent loadRemote info >>>",{name:l,module:c,exportName:n,basename:r,route:o}),n in c&&typeof a=="function")return{render(){return i.h(pe,{moduleName:l,...e,providerInfo:a,basename:r})}};throw new Error("module not found")},loadingComponent:{template:"<div>Loading...</div>"},errorComponent:{template:"<div>Error loading component</div>"},delay:200,timeout:3e3})}exports.createBridgeComponent=ge;exports.createRemoteComponent=fe; | ||
`):b=`${u}`;t(V,b,F,u)},d={greet:s=>g("log",n(s))};return Object.keys(c).forEach(s=>{d[s]=(...u)=>g(s,...u)}),Object.defineProperty(d,"level",{get:()=>l,set(s){l=s}}),Object.defineProperty(d,"labels",{get:()=>a,set(s){a=s}}),d.override=s=>{Object.assign(d,s)},d},p=[189,255,243],O=[74,194,154],B=e=>!/[\s\n]/.test(e);function D(e){if(!I())return[e];const o=[...e],r=o.filter(B),t=r.length-1;if(t===0)return console.log(`%c${e}`,`color: rgb(${p.join(",")}); font-weight: bold;`),[e];let n="",c=[];return o.forEach(l=>{if(B(l)){const a=r.indexOf(l)/t,g=Math.round(p[0]+(O[0]-p[0])*a),d=Math.round(p[1]+(O[1]-p[1])*a),s=Math.round(p[2]+(O[2]-p[2])*a);n+=`%c${l}`,c.push(`color: rgb(${g},${d},${s}); font-weight: bold;`)}else n+=l}),[n,...c]}var te={error:{label:"error",level:"error",color:J},warn:{label:"warn",level:"warn",color:K},info:{label:"info",level:"info",color:L},start:{label:"start",level:"info",color:L},ready:{label:"ready",level:"info",color:S},success:{label:"success",level:"info",color:S},log:{level:"log"},debug:{label:"debug",level:"verbose",color:X}};function M(e={}){return re(e,{handleError:o=>o,getLabel:Y,gradient:D,finalLog:Q,LOG_TYPES:te,greet:o=>D(o)})}var ne=M();const ae="FEDERATION_DEBUG",le="1";function ce(){return typeof window<"u"}function se(){try{if(ce()&&window.localStorage)return localStorage.getItem(ae)===le}catch{return!1}return!1}function ue(){return typeof process<"u"&&process.env&&process.env.FEDERATION_DEBUG?!!process.env.FEDERATION_DEBUG:typeof FEDERATION_DEBUG<"u"&&FEDERATION_DEBUG?!0:se()}const f="[ Module Federation ]";function de(e){ue()&&(e.level="verbose")}function ie(e,o){e.labels={warn:`${o} Warn`,error:`${o} Error`,success:`${o} Success`,info:`${o} Info`,ready:`${o} Ready`,debug:`${o} Debug`}}function N(e){const o=H.createLogger({labels:{warn:`${f} Warn`,error:`${f} Error`,success:`${f} Success`,info:`${f} Info`,ready:`${f} Ready`,debug:`${f} Debug`}});return de(o),ie(o,e),o}N(f);const m=N("[ Module Federation Bridge Vue3 ]");function ge(e){const o=new Map;return()=>({__APP_VERSION__:"0.7.3",render(r){m.log("createBridgeComponent render Info",r);const t=G.createApp(e.rootComponent);o.set(r.dom,t);const n=e.appOptions({basename:r.basename,memoryRoute:r.memoryRoute}),c=r.memoryRoute?E.createMemoryHistory(r.basename):E.createWebHistory(r.basename),l=E.createRouter({...n.router.options,history:c,routes:n.router.getRoutes()});m.log("createBridgeComponent render router info>>>",{name:r.moduleName,router:l}),r.memoryRoute?l.push(r.memoryRoute.entryPath).then(()=>{t.use(l),t.mount(r.dom)}):(t.use(l),t.mount(r.dom))},destroy(r){m.log("createBridgeComponent destroy Info",r);const t=o.get(r==null?void 0:r.dom);t==null||t.unmount()}})}function me(){const e=new PopStateEvent("popstate",{state:window.history.state});window.dispatchEvent(e)}const pe=i.defineComponent({name:"RemoteApp",props:{moduleName:String,basename:String,memoryRoute:Object,providerInfo:Function},setup(e){const o=i.ref(null),r=i.ref(null),t=i.ref(""),n=w.useRoute(),c=()=>{var d;const a=(d=e.providerInfo)==null?void 0:d.call(e);r.value=a;const g={name:e.moduleName,dom:o.value,basename:e.basename,memoryRoute:e.memoryRoute};m.log("createRemoteComponent LazyComponent render >>>",g),a.render(g)},l=i.watch(()=>n.path,a=>{a!==n.path&&c(),t.value!==""&&t.value!==a&&(m.log("createRemoteComponent dispatchPopstateEnv >>>",{...e,pathname:n.path}),me()),t.value=a});return i.onMounted(()=>{c()}),i.onBeforeUnmount(()=>{var a;m.log("createRemoteComponent LazyComponent destroy >>>",{...e}),l(),(a=r.value)==null||a.destroy({dom:o.value})}),()=>i.createVNode("div",{ref:o},null)}});function fe(e){return i.defineAsyncComponent({__APP_VERSION__:"0.7.3",loader:async()=>{var g;const o=w.useRoute();let r="/";const t=(g=o.matched[0])==null?void 0:g.path;t&&(t.endsWith("/:pathMatch(.*)*")?r=t.replace("/:pathMatch(.*)*",""):r=o.matched[0].path);const n=(e==null?void 0:e.export)||"default";m.log("createRemoteComponent LazyComponent create >>>",{basename:r,info:e});const c=await e.loader(),l=c&&c[Symbol.for("mf_module_id")],a=c[n];if(m.log("createRemoteComponent LazyComponent loadRemote info >>>",{name:l,module:c,exportName:n,basename:r,route:o}),n in c&&typeof a=="function")return{render(){return i.h(pe,{moduleName:l,...e,providerInfo:a,basename:r})}};throw new Error("module not found")},loadingComponent:{template:"<div>Loading...</div>"},errorComponent:{template:"<div>Error loading component</div>"},delay:200,timeout:3e3})}exports.createBridgeComponent=ge;exports.createRemoteComponent=fe; |
@@ -220,3 +220,3 @@ import * as G from "vue"; | ||
return () => ({ | ||
__APP_VERSION__: "0.7.2", | ||
__APP_VERSION__: "0.7.3", | ||
render(r) { | ||
@@ -294,3 +294,3 @@ g.log("createBridgeComponent render Info", r); | ||
return z({ | ||
__APP_VERSION__: "0.7.2", | ||
__APP_VERSION__: "0.7.3", | ||
//@ts-ignore | ||
@@ -297,0 +297,0 @@ loader: async () => { |
@@ -10,3 +10,3 @@ { | ||
}, | ||
"version": "0.0.0-next-20241114065146", | ||
"version": "0.0.0-next-20241114091142", | ||
"publishConfig": { | ||
@@ -36,4 +36,4 @@ "access": "public" | ||
"dependencies": { | ||
"@module-federation/bridge-shared": "0.0.0-next-20241114065146", | ||
"@module-federation/sdk": "0.0.0-next-20241114065146" | ||
"@module-federation/bridge-shared": "0.0.0-next-20241114091142", | ||
"@module-federation/sdk": "0.0.0-next-20241114091142" | ||
}, | ||
@@ -40,0 +40,0 @@ "devDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
35788
0
+ Added@module-federation/bridge-shared@0.0.0-next-20241114091142(transitive)
+ Added@module-federation/sdk@0.0.0-next-20241114091142(transitive)
- Removed@module-federation/bridge-shared@0.0.0-next-20241114065146(transitive)
- Removed@module-federation/sdk@0.0.0-next-20241114065146(transitive)
Updated@module-federation/bridge-shared@0.0.0-next-20241114091142