@ice/mf-runtime 1.0.5-beta.0 → 1.0.5

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.
@@ -87,19 +87,23 @@ export const runtimePlugin = ()=>({
87
87
  async beforeRequest (args) {
88
88
  const remoteName = args.id.split('/')[0];
89
89
  const hostName = args.options.name;
90
- // 清除 window 上带版本号的模块(如果存在)
91
- if (args.id.includes('/')) {
92
- var _microMod;
93
- const moduleNameWithDash = remoteName; // 如 guanghe-workspace
94
- const microMod = getMicroMod(moduleNameWithDash);
95
- if ((_microMod = microMod) === null || _microMod === void 0 ? void 0 : _microMod.moduleFederatedName) {
96
- const versionedModuleName = microMod.moduleFederatedName;
97
- if (window[versionedModuleName]) {
98
- console.log(`[beforeRequest] Clearing versioned module from window: ${versionedModuleName}`);
99
- // @ts-expect-error for global module
100
- window[versionedModuleName] = null;
90
+ try {
91
+ // 清除 window 上带版本号的模块(如果存在)
92
+ if (args.id.includes('/')) {
93
+ var _microMod;
94
+ const moduleNameWithDash = remoteName; // 如 guanghe-workspace
95
+ const microMod = getMicroMod(moduleNameWithDash);
96
+ if ((_microMod = microMod) === null || _microMod === void 0 ? void 0 : _microMod.moduleFederatedName) {
97
+ const versionedModuleName = microMod.moduleFederatedName;
98
+ if (window[versionedModuleName]) {
99
+ console.log(`[beforeRequest] Clearing versioned module from window: ${versionedModuleName}`);
100
+ // @ts-expect-error for global module
101
+ window[versionedModuleName] = null;
102
+ }
101
103
  }
102
104
  }
105
+ } catch (error) {
106
+ console.error('[beforeRequest] error', error);
103
107
  }
104
108
  if (!hasConflict(hostName, remoteName)) {
105
109
  return args;
@@ -167,19 +167,23 @@ export var runtimePlugin = function() {
167
167
  return _ts_generator(this, function(_state) {
168
168
  remoteName = args.id.split("/")[0];
169
169
  hostName = args.options.name;
170
- // 清除 window 上带版本号的模块(如果存在)
171
- if (args.id.includes("/")) {
172
- ;
173
- moduleNameWithDash = remoteName; // 如 guanghe-workspace
174
- microMod = getMicroMod(moduleNameWithDash);
175
- if ((_microMod = microMod) === null || _microMod === void 0 ? void 0 : _microMod.moduleFederatedName) {
176
- versionedModuleName = microMod.moduleFederatedName;
177
- if (window[versionedModuleName]) {
178
- console.log("[beforeRequest] Clearing versioned module from window: ".concat(versionedModuleName));
179
- // @ts-expect-error for global module
180
- window[versionedModuleName] = null;
170
+ try {
171
+ // 清除 window 上带版本号的模块(如果存在)
172
+ if (args.id.includes("/")) {
173
+ ;
174
+ moduleNameWithDash = remoteName; // 如 guanghe-workspace
175
+ microMod = getMicroMod(moduleNameWithDash);
176
+ if ((_microMod = microMod) === null || _microMod === void 0 ? void 0 : _microMod.moduleFederatedName) {
177
+ versionedModuleName = microMod.moduleFederatedName;
178
+ if (window[versionedModuleName]) {
179
+ console.log("[beforeRequest] Clearing versioned module from window: ".concat(versionedModuleName));
180
+ // @ts-expect-error for global module
181
+ window[versionedModuleName] = null;
182
+ }
181
183
  }
182
184
  }
185
+ } catch (error) {
186
+ console.error("[beforeRequest] error", error);
183
187
  }
184
188
  if (!hasConflict(hostName, remoteName)) {
185
189
  return [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ice/mf-runtime",
3
- "version": "1.0.5-beta.0",
3
+ "version": "1.0.5",
4
4
  "description": "ice mf runtime",
5
5
  "files": [
6
6
  "esm",