@empjs/share 3.13.7 → 3.13.8
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/sdk.cjs +1 -1
- package/dist/sdk.cjs.map +1 -1
- package/dist/sdk.d.cts +2 -1
- package/dist/sdk.d.ts +2 -1
- package/dist/sdk.js +1 -1
- package/dist/sdk.js.map +1 -1
- package/package.json +1 -1
package/dist/sdk.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var m=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var R=(e,t)=>{for(var n in t)m(e,n,{get:t[n],enumerable:!0})},g=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of l(t))!u.call(e,i)&&i!==n&&m(e,i,{get:()=>t[i],enumerable:!(r=p(t,i))||r.enumerable});return e};var d=e=>g(m({},"__esModule",{value:!0}),e);var M={};R(M,{createInstance:()=>y,getInstance:()=>c,getReactShare:()=>P,init:()=>h,loadRemote:()=>v,loadShare:()=>I,preloadRemote:()=>w,registerPlugins:()=>b,registerRemotes:()=>S,registerShared:()=>x});module.exports=d(M);var a=typeof window!="undefined"?window:void 0,f=a[a.EMPShareGlobalVal.runtimeLib].MFRuntime,s=[],c=()=>{let e=f.getInstance();return e&&(e.options.remotes.length>0?s=e.options.remotes:s.length>0&&(e.registerRemotes(s),s=[]),e)},o=e=>((...t)=>{var n,r;return(r=(n=c())==null?void 0:n[e])==null?void 0:r.call(n,...t)});var y=(...e)=>f.createInstance(...e),h=f.init,x=o("registerShared"),S=o("registerRemotes"),b=o("registerPlugins"),v=o("loadRemote"),w=o("preloadRemote"),I=o("loadShare"),P=()=>{let{React:e,ReactDOM:t,scope:n="default"}=a[a.EMPShareGlobalVal.frameworkLib];return{react:{lib:()=>e,version:e.version,scope:n,shareConfig:{singleton:!0,requiredVersion:`^${e.version}`}},"react-dom":{lib:()=>t,version:t.version,scope:n,shareConfig:{singleton:!0,requiredVersion:`^${e.version}`}}}};0&&(module.exports={createInstance,getInstance,getReactShare,init,loadRemote,loadShare,preloadRemote,registerPlugins,registerRemotes,registerShared});
|
|
2
2
|
//# sourceMappingURL=sdk.cjs.map
|
package/dist/sdk.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/runtime/sdk.ts"],"sourcesContent":["import * as mfRuntime from '@module-federation/runtime'\n\nconst win: any = window\nconst mf = win[win.EMPShareGlobalVal.runtimeLib]['MFRuntime']\n\n
|
|
1
|
+
{"version":3,"sources":["../src/runtime/sdk.ts"],"sourcesContent":["import * as mfRuntime from '@module-federation/runtime'\n\nconst win: any = typeof window !== 'undefined' ? window : undefined\nconst mf = win[win.EMPShareGlobalVal.runtimeLib]['MFRuntime'] as typeof mfRuntime\n\nlet pendingRemotes: any[] = []\n\nconst getInstance = (): ReturnType<typeof mfRuntime.getInstance> => {\n const inst = mf.getInstance()\n if (!inst) return inst\n if (inst.options.remotes.length > 0) pendingRemotes = inst.options.remotes\n else if (pendingRemotes.length > 0) {\n inst.registerRemotes(pendingRemotes)\n pendingRemotes = []\n }\n return inst\n}\n\nconst call = <T>(method: string) => ((...args: any[]) => (getInstance() as any)?.[method]?.(...args)) as T\n\nexport {getInstance}\nexport const createInstance: typeof mfRuntime.createInstance = (...args) => mf.createInstance(...args)\nexport const init: typeof mfRuntime.init = mf.init\nexport const registerShared = call<typeof mfRuntime.registerShared>('registerShared')\nexport const registerRemotes = call<typeof mfRuntime.registerRemotes>('registerRemotes')\nexport const registerPlugins = call<typeof mfRuntime.registerPlugins>('registerPlugins')\nexport const loadRemote = call<typeof mfRuntime.loadRemote>('loadRemote')\nexport const preloadRemote = call<typeof mfRuntime.preloadRemote>('preloadRemote')\nexport const loadShare = call<typeof mfRuntime.loadShare>('loadShare')\n\nexport const getReactShare = () => {\n const {React, ReactDOM, scope = 'default'} = win[win.EMPShareGlobalVal.frameworkLib]\n return {\n react: {\n lib: () => React,\n version: React.version,\n scope,\n shareConfig: {singleton: true, requiredVersion: `^${React.version}`},\n },\n 'react-dom': {\n lib: () => ReactDOM,\n version: ReactDOM.version,\n scope,\n shareConfig: {singleton: true, requiredVersion: `^${React.version}`},\n },\n }\n}\n"],"mappings":"yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,oBAAAE,EAAA,gBAAAC,EAAA,kBAAAC,EAAA,SAAAC,EAAA,eAAAC,EAAA,cAAAC,EAAA,kBAAAC,EAAA,oBAAAC,EAAA,oBAAAC,EAAA,mBAAAC,IAAA,eAAAC,EAAAZ,GAEA,IAAMa,EAAW,OAAO,QAAW,YAAc,OAAS,OACpDC,EAAKD,EAAIA,EAAI,kBAAkB,UAAU,EAAE,UAE7CE,EAAwB,CAAC,EAEvBZ,EAAc,IAAgD,CAClE,IAAMa,EAAOF,EAAG,YAAY,EAC5B,OAAKE,IACDA,EAAK,QAAQ,QAAQ,OAAS,EAAGD,EAAiBC,EAAK,QAAQ,QAC1DD,EAAe,OAAS,IAC/BC,EAAK,gBAAgBD,CAAc,EACnCA,EAAiB,CAAC,GAEbC,EACT,EAEMC,EAAWC,IAAoB,IAAIC,IAAa,CAlBtD,IAAAC,EAAAC,EAkB0D,OAAAA,GAAAD,EAAAjB,EAAY,IAAZ,YAAAiB,EAAwBF,KAAxB,YAAAG,EAAA,KAAAD,EAAkC,GAAGD,KAGxF,IAAMG,EAAkD,IAAIC,IAASC,EAAG,eAAe,GAAGD,CAAI,EACxFE,EAA8BD,EAAG,KACjCE,EAAiBC,EAAsC,gBAAgB,EACvEC,EAAkBD,EAAuC,iBAAiB,EAC1EE,EAAkBF,EAAuC,iBAAiB,EAC1EG,EAAaH,EAAkC,YAAY,EAC3DI,EAAgBJ,EAAqC,eAAe,EACpEK,EAAYL,EAAiC,WAAW,EAExDM,EAAgB,IAAM,CACjC,GAAM,CAAC,MAAAC,EAAO,SAAAC,EAAU,MAAAC,EAAQ,SAAS,EAAIC,EAAIA,EAAI,kBAAkB,YAAY,EACnF,MAAO,CACL,MAAO,CACL,IAAK,IAAMH,EACX,QAASA,EAAM,QACf,MAAAE,EACA,YAAa,CAAC,UAAW,GAAM,gBAAiB,IAAIF,EAAM,OAAO,EAAE,CACrE,EACA,YAAa,CACX,IAAK,IAAMC,EACX,QAASA,EAAS,QAClB,MAAAC,EACA,YAAa,CAAC,UAAW,GAAM,gBAAiB,IAAIF,EAAM,OAAO,EAAE,CACrE,CACF,CACF","names":["sdk_exports","__export","createInstance","getInstance","getReactShare","init","loadRemote","loadShare","preloadRemote","registerPlugins","registerRemotes","registerShared","__toCommonJS","win","mf","pendingRemotes","inst","call","method","args","_a","_b","createInstance","args","mf","init","registerShared","call","registerRemotes","registerPlugins","loadRemote","preloadRemote","loadShare","getReactShare","React","ReactDOM","scope","win"]}
|
package/dist/sdk.d.cts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as mfRuntime from '@module-federation/runtime';
|
|
2
2
|
|
|
3
|
-
declare const getInstance: typeof mfRuntime.getInstance
|
|
3
|
+
declare const getInstance: () => ReturnType<typeof mfRuntime.getInstance>;
|
|
4
|
+
|
|
4
5
|
declare const createInstance: typeof mfRuntime.createInstance;
|
|
5
6
|
declare const init: typeof mfRuntime.init;
|
|
6
7
|
declare const registerShared: typeof mfRuntime.registerShared;
|
package/dist/sdk.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as mfRuntime from '@module-federation/runtime';
|
|
2
2
|
|
|
3
|
-
declare const getInstance: typeof mfRuntime.getInstance
|
|
3
|
+
declare const getInstance: () => ReturnType<typeof mfRuntime.getInstance>;
|
|
4
|
+
|
|
4
5
|
declare const createInstance: typeof mfRuntime.createInstance;
|
|
5
6
|
declare const init: typeof mfRuntime.init;
|
|
6
7
|
declare const registerShared: typeof mfRuntime.registerShared;
|
package/dist/sdk.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var
|
|
1
|
+
var i=typeof window!="undefined"?window:void 0,s=i[i.EMPShareGlobalVal.runtimeLib].MFRuntime,r=[],m=()=>{let e=s.getInstance();return e&&(e.options.remotes.length>0?r=e.options.remotes:r.length>0&&(e.registerRemotes(r),r=[]),e)},n=e=>((...o)=>{var t,a;return(a=(t=m())==null?void 0:t[e])==null?void 0:a.call(t,...o)});var f=(...e)=>s.createInstance(...e),c=s.init,p=n("registerShared"),l=n("registerRemotes"),u=n("registerPlugins"),R=n("loadRemote"),g=n("preloadRemote"),d=n("loadShare"),y=()=>{let{React:e,ReactDOM:o,scope:t="default"}=i[i.EMPShareGlobalVal.frameworkLib];return{react:{lib:()=>e,version:e.version,scope:t,shareConfig:{singleton:!0,requiredVersion:`^${e.version}`}},"react-dom":{lib:()=>o,version:o.version,scope:t,shareConfig:{singleton:!0,requiredVersion:`^${e.version}`}}}};export{f as createInstance,m as getInstance,y as getReactShare,c as init,R as loadRemote,d as loadShare,g as preloadRemote,u as registerPlugins,l as registerRemotes,p as registerShared};
|
|
2
2
|
//# sourceMappingURL=sdk.js.map
|
package/dist/sdk.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/runtime/sdk.ts"],"sourcesContent":["import * as mfRuntime from '@module-federation/runtime'\n\nconst win: any = window\nconst mf = win[win.EMPShareGlobalVal.runtimeLib]['MFRuntime']\n\n
|
|
1
|
+
{"version":3,"sources":["../src/runtime/sdk.ts"],"sourcesContent":["import * as mfRuntime from '@module-federation/runtime'\n\nconst win: any = typeof window !== 'undefined' ? window : undefined\nconst mf = win[win.EMPShareGlobalVal.runtimeLib]['MFRuntime'] as typeof mfRuntime\n\nlet pendingRemotes: any[] = []\n\nconst getInstance = (): ReturnType<typeof mfRuntime.getInstance> => {\n const inst = mf.getInstance()\n if (!inst) return inst\n if (inst.options.remotes.length > 0) pendingRemotes = inst.options.remotes\n else if (pendingRemotes.length > 0) {\n inst.registerRemotes(pendingRemotes)\n pendingRemotes = []\n }\n return inst\n}\n\nconst call = <T>(method: string) => ((...args: any[]) => (getInstance() as any)?.[method]?.(...args)) as T\n\nexport {getInstance}\nexport const createInstance: typeof mfRuntime.createInstance = (...args) => mf.createInstance(...args)\nexport const init: typeof mfRuntime.init = mf.init\nexport const registerShared = call<typeof mfRuntime.registerShared>('registerShared')\nexport const registerRemotes = call<typeof mfRuntime.registerRemotes>('registerRemotes')\nexport const registerPlugins = call<typeof mfRuntime.registerPlugins>('registerPlugins')\nexport const loadRemote = call<typeof mfRuntime.loadRemote>('loadRemote')\nexport const preloadRemote = call<typeof mfRuntime.preloadRemote>('preloadRemote')\nexport const loadShare = call<typeof mfRuntime.loadShare>('loadShare')\n\nexport const getReactShare = () => {\n const {React, ReactDOM, scope = 'default'} = win[win.EMPShareGlobalVal.frameworkLib]\n return {\n react: {\n lib: () => React,\n version: React.version,\n scope,\n shareConfig: {singleton: true, requiredVersion: `^${React.version}`},\n },\n 'react-dom': {\n lib: () => ReactDOM,\n version: ReactDOM.version,\n scope,\n shareConfig: {singleton: true, requiredVersion: `^${React.version}`},\n },\n }\n}\n"],"mappings":"AAEA,IAAMA,EAAW,OAAO,QAAW,YAAc,OAAS,OACpDC,EAAKD,EAAIA,EAAI,kBAAkB,UAAU,EAAE,UAE7CE,EAAwB,CAAC,EAEvBC,EAAc,IAAgD,CAClE,IAAMC,EAAOH,EAAG,YAAY,EAC5B,OAAKG,IACDA,EAAK,QAAQ,QAAQ,OAAS,EAAGF,EAAiBE,EAAK,QAAQ,QAC1DF,EAAe,OAAS,IAC/BE,EAAK,gBAAgBF,CAAc,EACnCA,EAAiB,CAAC,GAEbE,EACT,EAEMC,EAAWC,IAAoB,IAAIC,IAAa,CAlBtD,IAAAC,EAAAC,EAkB0D,OAAAA,GAAAD,EAAAL,EAAY,IAAZ,YAAAK,EAAwBF,KAAxB,YAAAG,EAAA,KAAAD,EAAkC,GAAGD,KAGxF,IAAMG,EAAkD,IAAIC,IAASC,EAAG,eAAe,GAAGD,CAAI,EACxFE,EAA8BD,EAAG,KACjCE,EAAiBC,EAAsC,gBAAgB,EACvEC,EAAkBD,EAAuC,iBAAiB,EAC1EE,EAAkBF,EAAuC,iBAAiB,EAC1EG,EAAaH,EAAkC,YAAY,EAC3DI,EAAgBJ,EAAqC,eAAe,EACpEK,EAAYL,EAAiC,WAAW,EAExDM,EAAgB,IAAM,CACjC,GAAM,CAAC,MAAAC,EAAO,SAAAC,EAAU,MAAAC,EAAQ,SAAS,EAAIC,EAAIA,EAAI,kBAAkB,YAAY,EACnF,MAAO,CACL,MAAO,CACL,IAAK,IAAMH,EACX,QAASA,EAAM,QACf,MAAAE,EACA,YAAa,CAAC,UAAW,GAAM,gBAAiB,IAAIF,EAAM,OAAO,EAAE,CACrE,EACA,YAAa,CACX,IAAK,IAAMC,EACX,QAASA,EAAS,QAClB,MAAAC,EACA,YAAa,CAAC,UAAW,GAAM,gBAAiB,IAAIF,EAAM,OAAO,EAAE,CACrE,CACF,CACF","names":["win","mf","pendingRemotes","getInstance","inst","call","method","args","_a","_b","createInstance","args","mf","init","registerShared","call","registerRemotes","registerPlugins","loadRemote","preloadRemote","loadShare","getReactShare","React","ReactDOM","scope","win"]}
|