@module-federation/runtime 0.6.10 → 0.6.12

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 CHANGED
@@ -92,11 +92,7 @@ async function loadEsmEntry({ entry, remoteEntryExports }) {
92
92
  return new Promise((resolve, reject)=>{
93
93
  try {
94
94
  if (!remoteEntryExports) {
95
- // eslint-disable-next-line no-eval
96
- new Function('callbacks', `import("${entry}").then(callbacks[0]).catch(callbacks[1])`)([
97
- resolve,
98
- reject
99
- ]);
95
+ import(/* webpackIgnore: true */ entry).then(resolve).catch(reject);
100
96
  } else {
101
97
  resolve(remoteEntryExports);
102
98
  }
@@ -109,11 +105,16 @@ async function loadSystemJsEntry({ entry, remoteEntryExports }) {
109
105
  return new Promise((resolve, reject)=>{
110
106
  try {
111
107
  if (!remoteEntryExports) {
112
- // eslint-disable-next-line no-eval
113
- new Function('callbacks', `System.import("${entry}").then(callbacks[0]).catch(callbacks[1])`)([
114
- resolve,
115
- reject
116
- ]);
108
+ //@ts-ignore
109
+ if (typeof __system_context__ === 'undefined') {
110
+ //@ts-ignore
111
+ System.import(entry).then(resolve).catch(reject);
112
+ } else {
113
+ new Function('callbacks', `System.import("${entry}").then(callbacks[0]).catch(callbacks[1])`)([
114
+ resolve,
115
+ reject
116
+ ]);
117
+ }
117
118
  } else {
118
119
  resolve(remoteEntryExports);
119
120
  }
@@ -1991,7 +1992,7 @@ class FederationHost {
1991
1992
  // maybe will change, temporarily for internal use only
1992
1993
  initContainer: new AsyncWaterfallHook('initContainer')
1993
1994
  });
1994
- this.version = "0.6.10";
1995
+ this.version = "0.6.12";
1995
1996
  this.moduleCache = new Map();
1996
1997
  this.loaderHook = new PluginSystem({
1997
1998
  // FIXME: may not be suitable , not open to the public yet
package/dist/index.esm.js CHANGED
@@ -92,11 +92,7 @@ async function loadEsmEntry({ entry, remoteEntryExports }) {
92
92
  return new Promise((resolve, reject)=>{
93
93
  try {
94
94
  if (!remoteEntryExports) {
95
- // eslint-disable-next-line no-eval
96
- new Function('callbacks', `import("${entry}").then(callbacks[0]).catch(callbacks[1])`)([
97
- resolve,
98
- reject
99
- ]);
95
+ import(/* webpackIgnore: true */ entry).then(resolve).catch(reject);
100
96
  } else {
101
97
  resolve(remoteEntryExports);
102
98
  }
@@ -109,11 +105,16 @@ async function loadSystemJsEntry({ entry, remoteEntryExports }) {
109
105
  return new Promise((resolve, reject)=>{
110
106
  try {
111
107
  if (!remoteEntryExports) {
112
- // eslint-disable-next-line no-eval
113
- new Function('callbacks', `System.import("${entry}").then(callbacks[0]).catch(callbacks[1])`)([
114
- resolve,
115
- reject
116
- ]);
108
+ //@ts-ignore
109
+ if (typeof __system_context__ === 'undefined') {
110
+ //@ts-ignore
111
+ System.import(entry).then(resolve).catch(reject);
112
+ } else {
113
+ new Function('callbacks', `System.import("${entry}").then(callbacks[0]).catch(callbacks[1])`)([
114
+ resolve,
115
+ reject
116
+ ]);
117
+ }
117
118
  } else {
118
119
  resolve(remoteEntryExports);
119
120
  }
@@ -1991,7 +1992,7 @@ class FederationHost {
1991
1992
  // maybe will change, temporarily for internal use only
1992
1993
  initContainer: new AsyncWaterfallHook('initContainer')
1993
1994
  });
1994
- this.version = "0.6.10";
1995
+ this.version = "0.6.12";
1995
1996
  this.moduleCache = new Map();
1996
1997
  this.loaderHook = new PluginSystem({
1997
1998
  // FIXME: may not be suitable , not open to the public yet
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/runtime",
3
- "version": "0.6.10",
3
+ "version": "0.6.12",
4
4
  "author": "zhouxiao <codingzx@gmail.com>",
5
5
  "main": "./index.cjs.js",
6
6
  "module": "./index.esm.js",
package/dist/share.cjs.js CHANGED
@@ -175,7 +175,7 @@ function getGlobalFederationConstructor() {
175
175
  function setGlobalFederationConstructor(FederationConstructor, isDebug = sdk.isDebugMode()) {
176
176
  if (isDebug) {
177
177
  globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = FederationConstructor;
178
- globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.6.10";
178
+ globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.6.12";
179
179
  }
180
180
  }
181
181
  // eslint-disable-next-line @typescript-eslint/ban-types
package/dist/share.esm.js CHANGED
@@ -173,7 +173,7 @@ function getGlobalFederationConstructor() {
173
173
  function setGlobalFederationConstructor(FederationConstructor, isDebug = isDebugMode()) {
174
174
  if (isDebug) {
175
175
  globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = FederationConstructor;
176
- globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.6.10";
176
+ globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.6.12";
177
177
  }
178
178
  }
179
179
  // eslint-disable-next-line @typescript-eslint/ban-types
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/runtime",
3
- "version": "0.6.10",
3
+ "version": "0.6.12",
4
4
  "author": "zhouxiao <codingzx@gmail.com>",
5
5
  "main": "./dist/index.cjs.js",
6
6
  "module": "./dist/index.esm.js",
@@ -50,6 +50,6 @@
50
50
  }
51
51
  },
52
52
  "dependencies": {
53
- "@module-federation/sdk": "0.6.10"
53
+ "@module-federation/sdk": "0.6.12"
54
54
  }
55
55
  }