@module-federation/bridge-react 0.0.0-next-20240903075658 → 0.0.0-next-20240904030559

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
@@ -3,7 +3,6 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const React = require("react");
4
4
  const context = require("./context--mtFt3tp.cjs");
5
5
  const ReactRouterDOM = require("react-router-dom");
6
- const runtime = require("@module-federation/runtime");
7
6
  const ReactDOM = require("react-dom");
8
7
  function _interopNamespaceDefault(e) {
9
8
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
@@ -34,17 +33,17 @@ class ErrorBoundary extends React.Component {
34
33
  this.resetErrorBoundary = this.resetErrorBoundary.bind(this);
35
34
  this.state = initialState;
36
35
  }
37
- static getDerivedStateFromError(error2) {
36
+ static getDerivedStateFromError(error) {
38
37
  return {
39
38
  didCatch: true,
40
- error: error2
39
+ error
41
40
  };
42
41
  }
43
42
  resetErrorBoundary() {
44
43
  const {
45
- error: error2
44
+ error
46
45
  } = this.state;
47
- if (error2 !== null) {
46
+ if (error !== null) {
48
47
  var _this$props$onReset, _this$props;
49
48
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
50
49
  args[_key] = arguments[_key];
@@ -56,9 +55,9 @@ class ErrorBoundary extends React.Component {
56
55
  this.setState(initialState);
57
56
  }
58
57
  }
59
- componentDidCatch(error2, info) {
58
+ componentDidCatch(error, info) {
60
59
  var _this$props$onError, _this$props2;
61
- (_this$props$onError = (_this$props2 = this.props).onError) === null || _this$props$onError === void 0 ? void 0 : _this$props$onError.call(_this$props2, error2, info);
60
+ (_this$props$onError = (_this$props2 = this.props).onError) === null || _this$props$onError === void 0 ? void 0 : _this$props$onError.call(_this$props2, error, info);
62
61
  }
63
62
  componentDidUpdate(prevProps, prevState) {
64
63
  const {
@@ -86,12 +85,12 @@ class ErrorBoundary extends React.Component {
86
85
  } = this.props;
87
86
  const {
88
87
  didCatch,
89
- error: error2
88
+ error
90
89
  } = this.state;
91
90
  let childToRender = children;
92
91
  if (didCatch) {
93
92
  const props = {
94
- error: error2,
93
+ error,
95
94
  resetErrorBoundary: this.resetErrorBoundary
96
95
  };
97
96
  if (typeof fallbackRender === "function") {
@@ -101,13 +100,13 @@ class ErrorBoundary extends React.Component {
101
100
  } else if (fallback === null || React.isValidElement(fallback)) {
102
101
  childToRender = fallback;
103
102
  } else {
104
- throw error2;
103
+ throw error;
105
104
  }
106
105
  }
107
106
  return React.createElement(ErrorBoundaryContext.Provider, {
108
107
  value: {
109
108
  didCatch,
110
- error: error2,
109
+ error,
111
110
  resetErrorBoundary: this.resetErrorBoundary
112
111
  }
113
112
  }, childToRender);
@@ -118,1009 +117,6 @@ function hasArrayChanged() {
118
117
  let b = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
119
118
  return a.length !== b.length || a.some((item, index) => !Object.is(item, b[index]));
120
119
  }
121
- const BROWSER_LOG_KEY = "FEDERATION_DEBUG";
122
- const BROWSER_LOG_VALUE = "1";
123
- function isBrowserEnv() {
124
- return typeof window !== "undefined";
125
- }
126
- function isDebugMode() {
127
- if (typeof process !== "undefined" && process.env && process.env["FEDERATION_DEBUG"]) {
128
- return Boolean(process.env["FEDERATION_DEBUG"]);
129
- }
130
- return typeof FEDERATION_DEBUG !== "undefined" && Boolean(FEDERATION_DEBUG);
131
- }
132
- const DEBUG_LOG = "[ FEDERATION DEBUG ]";
133
- function safeGetLocalStorageItem() {
134
- try {
135
- if (typeof window !== "undefined" && window.localStorage) {
136
- return localStorage.getItem(BROWSER_LOG_KEY) === BROWSER_LOG_VALUE;
137
- }
138
- } catch (error2) {
139
- return typeof document !== "undefined";
140
- }
141
- return false;
142
- }
143
- let Logger = class Logger2 {
144
- info(msg, info) {
145
- if (this.enable) {
146
- const argsToString = safeToString(info) || "";
147
- if (isBrowserEnv()) {
148
- console.info(`%c ${this.identifier}: ${msg} ${argsToString}`, "color:#3300CC");
149
- } else {
150
- console.info("\x1B[34m%s", `${this.identifier}: ${msg} ${argsToString ? `
151
- ${argsToString}` : ""}`);
152
- }
153
- }
154
- }
155
- logOriginalInfo(...args) {
156
- if (this.enable) {
157
- if (isBrowserEnv()) {
158
- console.info(`%c ${this.identifier}: OriginalInfo`, "color:#3300CC");
159
- console.log(...args);
160
- } else {
161
- console.info(`%c ${this.identifier}: OriginalInfo`, "color:#3300CC");
162
- console.log(...args);
163
- }
164
- }
165
- }
166
- constructor(identifier) {
167
- this.enable = false;
168
- this.identifier = identifier || DEBUG_LOG;
169
- if (isBrowserEnv() && safeGetLocalStorageItem()) {
170
- this.enable = true;
171
- } else if (isDebugMode()) {
172
- this.enable = true;
173
- }
174
- }
175
- };
176
- new Logger();
177
- function safeToString(info) {
178
- try {
179
- return JSON.stringify(info, null, 2);
180
- } catch (e) {
181
- return "";
182
- }
183
- }
184
- function getBuilderId() {
185
- return typeof FEDERATION_BUILD_IDENTIFIER !== "undefined" ? FEDERATION_BUILD_IDENTIFIER : "";
186
- }
187
- const LOG_CATEGORY = "[ Federation Runtime ]";
188
- function assert(condition, msg) {
189
- if (!condition) {
190
- error(msg);
191
- }
192
- }
193
- function error(msg) {
194
- if (msg instanceof Error) {
195
- msg.message = `${LOG_CATEGORY}: ${msg.message}`;
196
- throw msg;
197
- }
198
- throw new Error(`${LOG_CATEGORY}: ${msg}`);
199
- }
200
- function warn(msg) {
201
- if (msg instanceof Error) {
202
- msg.message = `${LOG_CATEGORY}: ${msg.message}`;
203
- console.warn(msg);
204
- } else {
205
- console.warn(`${LOG_CATEGORY}: ${msg}`);
206
- }
207
- }
208
- function getFMId(remoteInfo) {
209
- if ("version" in remoteInfo && remoteInfo.version) {
210
- return `${remoteInfo.name}:${remoteInfo.version}`;
211
- } else if ("entry" in remoteInfo && remoteInfo.entry) {
212
- return `${remoteInfo.name}:${remoteInfo.entry}`;
213
- } else {
214
- return `${remoteInfo.name}`;
215
- }
216
- }
217
- function isObject(val) {
218
- return val && typeof val === "object";
219
- }
220
- const objectToString = Object.prototype.toString;
221
- function isPlainObject(val) {
222
- return objectToString.call(val) === "[object Object]";
223
- }
224
- function _extends$1() {
225
- _extends$1 = Object.assign || function(target) {
226
- for (var i = 1; i < arguments.length; i++) {
227
- var source = arguments[i];
228
- for (var key in source) {
229
- if (Object.prototype.hasOwnProperty.call(source, key)) {
230
- target[key] = source[key];
231
- }
232
- }
233
- }
234
- return target;
235
- };
236
- return _extends$1.apply(this, arguments);
237
- }
238
- function _object_without_properties_loose(source, excluded) {
239
- if (source == null)
240
- return {};
241
- var target = {};
242
- var sourceKeys = Object.keys(source);
243
- var key, i;
244
- for (i = 0; i < sourceKeys.length; i++) {
245
- key = sourceKeys[i];
246
- if (excluded.indexOf(key) >= 0)
247
- continue;
248
- target[key] = source[key];
249
- }
250
- return target;
251
- }
252
- const nativeGlobal = (() => {
253
- try {
254
- return new Function("return this")();
255
- } catch (e) {
256
- return globalThis;
257
- }
258
- })();
259
- const Global = nativeGlobal;
260
- function definePropertyGlobalVal(target, key, val) {
261
- Object.defineProperty(target, key, {
262
- value: val,
263
- configurable: false,
264
- writable: true
265
- });
266
- }
267
- function includeOwnProperty(target, key) {
268
- return Object.hasOwnProperty.call(target, key);
269
- }
270
- if (!includeOwnProperty(globalThis, "__GLOBAL_LOADING_REMOTE_ENTRY__")) {
271
- definePropertyGlobalVal(globalThis, "__GLOBAL_LOADING_REMOTE_ENTRY__", {});
272
- }
273
- function setGlobalDefaultVal(target) {
274
- var _target___FEDERATION__, _target___FEDERATION__1, _target___FEDERATION__2, _target___FEDERATION__3, _target___FEDERATION__4, _target___FEDERATION__5;
275
- if (includeOwnProperty(target, "__VMOK__") && !includeOwnProperty(target, "__FEDERATION__")) {
276
- definePropertyGlobalVal(target, "__FEDERATION__", target.__VMOK__);
277
- }
278
- if (!includeOwnProperty(target, "__FEDERATION__")) {
279
- definePropertyGlobalVal(target, "__FEDERATION__", {
280
- __GLOBAL_PLUGIN__: [],
281
- __INSTANCES__: [],
282
- moduleInfo: {},
283
- __SHARE__: {},
284
- __MANIFEST_LOADING__: {},
285
- __PRELOADED_MAP__: /* @__PURE__ */ new Map()
286
- });
287
- definePropertyGlobalVal(target, "__VMOK__", target.__FEDERATION__);
288
- }
289
- var ___GLOBAL_PLUGIN__;
290
- (___GLOBAL_PLUGIN__ = (_target___FEDERATION__ = target.__FEDERATION__).__GLOBAL_PLUGIN__) != null ? ___GLOBAL_PLUGIN__ : _target___FEDERATION__.__GLOBAL_PLUGIN__ = [];
291
- var ___INSTANCES__;
292
- (___INSTANCES__ = (_target___FEDERATION__1 = target.__FEDERATION__).__INSTANCES__) != null ? ___INSTANCES__ : _target___FEDERATION__1.__INSTANCES__ = [];
293
- var _moduleInfo;
294
- (_moduleInfo = (_target___FEDERATION__2 = target.__FEDERATION__).moduleInfo) != null ? _moduleInfo : _target___FEDERATION__2.moduleInfo = {};
295
- var ___SHARE__;
296
- (___SHARE__ = (_target___FEDERATION__3 = target.__FEDERATION__).__SHARE__) != null ? ___SHARE__ : _target___FEDERATION__3.__SHARE__ = {};
297
- var ___MANIFEST_LOADING__;
298
- (___MANIFEST_LOADING__ = (_target___FEDERATION__4 = target.__FEDERATION__).__MANIFEST_LOADING__) != null ? ___MANIFEST_LOADING__ : _target___FEDERATION__4.__MANIFEST_LOADING__ = {};
299
- var ___PRELOADED_MAP__;
300
- (___PRELOADED_MAP__ = (_target___FEDERATION__5 = target.__FEDERATION__).__PRELOADED_MAP__) != null ? ___PRELOADED_MAP__ : _target___FEDERATION__5.__PRELOADED_MAP__ = /* @__PURE__ */ new Map();
301
- }
302
- setGlobalDefaultVal(globalThis);
303
- setGlobalDefaultVal(nativeGlobal);
304
- function resetFederationGlobalInfo() {
305
- globalThis.__FEDERATION__.__GLOBAL_PLUGIN__ = [];
306
- globalThis.__FEDERATION__.__INSTANCES__ = [];
307
- globalThis.__FEDERATION__.moduleInfo = {};
308
- globalThis.__FEDERATION__.__SHARE__ = {};
309
- globalThis.__FEDERATION__.__MANIFEST_LOADING__ = {};
310
- }
311
- function getGlobalFederationInstance(name, version) {
312
- const buildId = getBuilderId();
313
- return globalThis.__FEDERATION__.__INSTANCES__.find((GMInstance) => {
314
- if (buildId && GMInstance.options.id === getBuilderId()) {
315
- return true;
316
- }
317
- if (GMInstance.options.name === name && !GMInstance.options.version && !version) {
318
- return true;
319
- }
320
- if (GMInstance.options.name === name && version && GMInstance.options.version === version) {
321
- return true;
322
- }
323
- return false;
324
- });
325
- }
326
- function setGlobalFederationInstance(FederationInstance) {
327
- globalThis.__FEDERATION__.__INSTANCES__.push(FederationInstance);
328
- }
329
- function getGlobalFederationConstructor() {
330
- return globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR__;
331
- }
332
- function setGlobalFederationConstructor(FederationConstructor, isDebug = isDebugMode()) {
333
- if (isDebug) {
334
- globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = FederationConstructor;
335
- globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.6.0";
336
- }
337
- }
338
- function getInfoWithoutType(target, key) {
339
- if (typeof key === "string") {
340
- const keyRes = target[key];
341
- if (keyRes) {
342
- return {
343
- value: target[key],
344
- key
345
- };
346
- } else {
347
- const targetKeys = Object.keys(target);
348
- for (const targetKey of targetKeys) {
349
- const [targetTypeOrName, _] = targetKey.split(":");
350
- const nKey = `${targetTypeOrName}:${key}`;
351
- const typeWithKeyRes = target[nKey];
352
- if (typeWithKeyRes) {
353
- return {
354
- value: typeWithKeyRes,
355
- key: nKey
356
- };
357
- }
358
- }
359
- return {
360
- value: void 0,
361
- key
362
- };
363
- }
364
- } else {
365
- throw new Error("key must be string");
366
- }
367
- }
368
- const getGlobalSnapshot = () => nativeGlobal.__FEDERATION__.moduleInfo;
369
- const getTargetSnapshotInfoByModuleInfo = (moduleInfo, snapshot) => {
370
- const moduleKey = getFMId(moduleInfo);
371
- const getModuleInfo = getInfoWithoutType(snapshot, moduleKey).value;
372
- if (getModuleInfo && !getModuleInfo.version && "version" in moduleInfo && moduleInfo["version"]) {
373
- getModuleInfo.version = moduleInfo["version"];
374
- }
375
- if (getModuleInfo) {
376
- return getModuleInfo;
377
- }
378
- if ("version" in moduleInfo && moduleInfo["version"]) {
379
- const { version } = moduleInfo, resModuleInfo = _object_without_properties_loose(moduleInfo, [
380
- "version"
381
- ]);
382
- const moduleKeyWithoutVersion = getFMId(resModuleInfo);
383
- const getModuleInfoWithoutVersion = getInfoWithoutType(nativeGlobal.__FEDERATION__.moduleInfo, moduleKeyWithoutVersion).value;
384
- if ((getModuleInfoWithoutVersion == null ? void 0 : getModuleInfoWithoutVersion.version) === version) {
385
- return getModuleInfoWithoutVersion;
386
- }
387
- }
388
- return;
389
- };
390
- const getGlobalSnapshotInfoByModuleInfo = (moduleInfo) => getTargetSnapshotInfoByModuleInfo(moduleInfo, nativeGlobal.__FEDERATION__.moduleInfo);
391
- const setGlobalSnapshotInfoByModuleInfo = (remoteInfo, moduleDetailInfo) => {
392
- const moduleKey = getFMId(remoteInfo);
393
- nativeGlobal.__FEDERATION__.moduleInfo[moduleKey] = moduleDetailInfo;
394
- return nativeGlobal.__FEDERATION__.moduleInfo;
395
- };
396
- const addGlobalSnapshot = (moduleInfos) => {
397
- nativeGlobal.__FEDERATION__.moduleInfo = _extends$1({}, nativeGlobal.__FEDERATION__.moduleInfo, moduleInfos);
398
- return () => {
399
- const keys = Object.keys(moduleInfos);
400
- for (const key of keys) {
401
- delete nativeGlobal.__FEDERATION__.moduleInfo[key];
402
- }
403
- };
404
- };
405
- const getRemoteEntryExports = (name, globalName) => {
406
- const remoteEntryKey = globalName || `__FEDERATION_${name}:custom__`;
407
- const entryExports = globalThis[remoteEntryKey];
408
- return {
409
- remoteEntryKey,
410
- entryExports
411
- };
412
- };
413
- const registerGlobalPlugins = (plugins) => {
414
- const { __GLOBAL_PLUGIN__ } = nativeGlobal.__FEDERATION__;
415
- plugins.forEach((plugin) => {
416
- if (__GLOBAL_PLUGIN__.findIndex((p) => p.name === plugin.name) === -1) {
417
- __GLOBAL_PLUGIN__.push(plugin);
418
- } else {
419
- warn(`The plugin ${plugin.name} has been registered.`);
420
- }
421
- });
422
- };
423
- const getGlobalHostPlugins = () => nativeGlobal.__FEDERATION__.__GLOBAL_PLUGIN__;
424
- const getPreloaded = (id) => globalThis.__FEDERATION__.__PRELOADED_MAP__.get(id);
425
- const setPreloaded = (id) => globalThis.__FEDERATION__.__PRELOADED_MAP__.set(id, true);
426
- function registerPlugins(plugins, hookInstances) {
427
- const globalPlugins = getGlobalHostPlugins();
428
- if (globalPlugins.length > 0) {
429
- globalPlugins.forEach((plugin) => {
430
- if (plugins == null ? void 0 : plugins.find((item) => item.name !== plugin.name)) {
431
- plugins.push(plugin);
432
- }
433
- });
434
- }
435
- if (plugins && plugins.length > 0) {
436
- plugins.forEach((plugin) => {
437
- hookInstances.forEach((hookInstance) => {
438
- hookInstance.applyPlugin(plugin);
439
- });
440
- });
441
- }
442
- return plugins;
443
- }
444
- const DEFAULT_SCOPE = "default";
445
- class SyncHook {
446
- on(fn) {
447
- if (typeof fn === "function") {
448
- this.listeners.add(fn);
449
- }
450
- }
451
- once(fn) {
452
- const self = this;
453
- this.on(function wrapper(...args) {
454
- self.remove(wrapper);
455
- return fn.apply(null, args);
456
- });
457
- }
458
- emit(...data) {
459
- let result;
460
- if (this.listeners.size > 0) {
461
- this.listeners.forEach((fn) => {
462
- result = fn(...data);
463
- });
464
- }
465
- return result;
466
- }
467
- remove(fn) {
468
- this.listeners.delete(fn);
469
- }
470
- removeAll() {
471
- this.listeners.clear();
472
- }
473
- constructor(type) {
474
- this.type = "";
475
- this.listeners = /* @__PURE__ */ new Set();
476
- if (type) {
477
- this.type = type;
478
- }
479
- }
480
- }
481
- class AsyncHook extends SyncHook {
482
- emit(...data) {
483
- let result;
484
- const ls = Array.from(this.listeners);
485
- if (ls.length > 0) {
486
- let i = 0;
487
- const call = (prev) => {
488
- if (prev === false) {
489
- return false;
490
- } else if (i < ls.length) {
491
- return Promise.resolve(ls[i++].apply(null, data)).then(call);
492
- } else {
493
- return prev;
494
- }
495
- };
496
- result = call();
497
- }
498
- return Promise.resolve(result);
499
- }
500
- }
501
- function checkReturnData(originalData, returnedData) {
502
- if (!isObject(returnedData)) {
503
- return false;
504
- }
505
- if (originalData !== returnedData) {
506
- for (const key in originalData) {
507
- if (!(key in returnedData)) {
508
- return false;
509
- }
510
- }
511
- }
512
- return true;
513
- }
514
- class SyncWaterfallHook extends SyncHook {
515
- emit(data) {
516
- if (!isObject(data)) {
517
- error(`The data for the "${this.type}" hook should be an object.`);
518
- }
519
- for (const fn of this.listeners) {
520
- try {
521
- const tempData = fn(data);
522
- if (checkReturnData(data, tempData)) {
523
- data = tempData;
524
- } else {
525
- this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);
526
- break;
527
- }
528
- } catch (e) {
529
- warn(e);
530
- this.onerror(e);
531
- }
532
- }
533
- return data;
534
- }
535
- constructor(type) {
536
- super();
537
- this.onerror = error;
538
- this.type = type;
539
- }
540
- }
541
- class AsyncWaterfallHook extends SyncHook {
542
- emit(data) {
543
- if (!isObject(data)) {
544
- error(`The response data for the "${this.type}" hook must be an object.`);
545
- }
546
- const ls = Array.from(this.listeners);
547
- if (ls.length > 0) {
548
- let i = 0;
549
- const processError = (e) => {
550
- warn(e);
551
- this.onerror(e);
552
- return data;
553
- };
554
- const call = (prevData) => {
555
- if (checkReturnData(data, prevData)) {
556
- data = prevData;
557
- if (i < ls.length) {
558
- try {
559
- return Promise.resolve(ls[i++](data)).then(call, processError);
560
- } catch (e) {
561
- return processError(e);
562
- }
563
- }
564
- } else {
565
- this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`);
566
- }
567
- return data;
568
- };
569
- return Promise.resolve(call(data));
570
- }
571
- return Promise.resolve(data);
572
- }
573
- constructor(type) {
574
- super();
575
- this.onerror = error;
576
- this.type = type;
577
- }
578
- }
579
- class PluginSystem {
580
- applyPlugin(plugin) {
581
- assert(isPlainObject(plugin), "Plugin configuration is invalid.");
582
- const pluginName = plugin.name;
583
- assert(pluginName, "A name must be provided by the plugin.");
584
- if (!this.registerPlugins[pluginName]) {
585
- this.registerPlugins[pluginName] = plugin;
586
- Object.keys(this.lifecycle).forEach((key) => {
587
- const pluginLife = plugin[key];
588
- if (pluginLife) {
589
- this.lifecycle[key].on(pluginLife);
590
- }
591
- });
592
- }
593
- }
594
- removePlugin(pluginName) {
595
- assert(pluginName, "A name is required.");
596
- const plugin = this.registerPlugins[pluginName];
597
- assert(plugin, `The plugin "${pluginName}" is not registered.`);
598
- Object.keys(plugin).forEach((key) => {
599
- if (key !== "name") {
600
- this.lifecycle[key].remove(plugin[key]);
601
- }
602
- });
603
- }
604
- // eslint-disable-next-line @typescript-eslint/no-shadow
605
- inherit({ lifecycle, registerPlugins: registerPlugins2 }) {
606
- Object.keys(lifecycle).forEach((hookName) => {
607
- assert(!this.lifecycle[hookName], `The hook "${hookName}" has a conflict and cannot be inherited.`);
608
- this.lifecycle[hookName] = lifecycle[hookName];
609
- });
610
- Object.keys(registerPlugins2).forEach((pluginName) => {
611
- assert(!this.registerPlugins[pluginName], `The plugin "${pluginName}" has a conflict and cannot be inherited.`);
612
- this.applyPlugin(registerPlugins2[pluginName]);
613
- });
614
- }
615
- constructor(lifecycle) {
616
- this.registerPlugins = {};
617
- this.lifecycle = lifecycle;
618
- this.lifecycleKeys = Object.keys(lifecycle);
619
- }
620
- }
621
- const buildIdentifier = "[0-9A-Za-z-]+";
622
- const build = `(?:\\+(${buildIdentifier}(?:\\.${buildIdentifier})*))`;
623
- const numericIdentifier = "0|[1-9]\\d*";
624
- const numericIdentifierLoose = "[0-9]+";
625
- const nonNumericIdentifier = "\\d*[a-zA-Z-][a-zA-Z0-9-]*";
626
- const preReleaseIdentifierLoose = `(?:${numericIdentifierLoose}|${nonNumericIdentifier})`;
627
- const preReleaseLoose = `(?:-?(${preReleaseIdentifierLoose}(?:\\.${preReleaseIdentifierLoose})*))`;
628
- const preReleaseIdentifier = `(?:${numericIdentifier}|${nonNumericIdentifier})`;
629
- const preRelease = `(?:-(${preReleaseIdentifier}(?:\\.${preReleaseIdentifier})*))`;
630
- const xRangeIdentifier = `${numericIdentifier}|x|X|\\*`;
631
- const xRangePlain = `[v=\\s]*(${xRangeIdentifier})(?:\\.(${xRangeIdentifier})(?:\\.(${xRangeIdentifier})(?:${preRelease})?${build}?)?)?`;
632
- const hyphenRange = `^\\s*(${xRangePlain})\\s+-\\s+(${xRangePlain})\\s*$`;
633
- const mainVersionLoose = `(${numericIdentifierLoose})\\.(${numericIdentifierLoose})\\.(${numericIdentifierLoose})`;
634
- const loosePlain = `[v=\\s]*${mainVersionLoose}${preReleaseLoose}?${build}?`;
635
- const gtlt = "((?:<|>)?=?)";
636
- const comparatorTrim = `(\\s*)${gtlt}\\s*(${loosePlain}|${xRangePlain})`;
637
- const loneTilde = "(?:~>?)";
638
- const tildeTrim = `(\\s*)${loneTilde}\\s+`;
639
- const loneCaret = "(?:\\^)";
640
- const caretTrim = `(\\s*)${loneCaret}\\s+`;
641
- const star = "(<|>)?=?\\s*\\*";
642
- const caret = `^${loneCaret}${xRangePlain}$`;
643
- const mainVersion = `(${numericIdentifier})\\.(${numericIdentifier})\\.(${numericIdentifier})`;
644
- const fullPlain = `v?${mainVersion}${preRelease}?${build}?`;
645
- const tilde = `^${loneTilde}${xRangePlain}$`;
646
- const xRange = `^${gtlt}\\s*${xRangePlain}$`;
647
- const comparator = `^${gtlt}\\s*(${fullPlain})$|^$`;
648
- const gte0 = "^\\s*>=\\s*0.0.0\\s*$";
649
- function parseRegex(source) {
650
- return new RegExp(source);
651
- }
652
- function isXVersion(version) {
653
- return !version || version.toLowerCase() === "x" || version === "*";
654
- }
655
- function pipe(...fns) {
656
- return (x) => fns.reduce((v, f) => f(v), x);
657
- }
658
- function extractComparator(comparatorString) {
659
- return comparatorString.match(parseRegex(comparator));
660
- }
661
- function combineVersion(major, minor, patch, preRelease2) {
662
- const mainVersion2 = `${major}.${minor}.${patch}`;
663
- if (preRelease2) {
664
- return `${mainVersion2}-${preRelease2}`;
665
- }
666
- return mainVersion2;
667
- }
668
- function parseHyphen(range) {
669
- return range.replace(parseRegex(hyphenRange), (_range, from, fromMajor, fromMinor, fromPatch, _fromPreRelease, _fromBuild, to, toMajor, toMinor, toPatch, toPreRelease) => {
670
- if (isXVersion(fromMajor)) {
671
- from = "";
672
- } else if (isXVersion(fromMinor)) {
673
- from = `>=${fromMajor}.0.0`;
674
- } else if (isXVersion(fromPatch)) {
675
- from = `>=${fromMajor}.${fromMinor}.0`;
676
- } else {
677
- from = `>=${from}`;
678
- }
679
- if (isXVersion(toMajor)) {
680
- to = "";
681
- } else if (isXVersion(toMinor)) {
682
- to = `<${Number(toMajor) + 1}.0.0-0`;
683
- } else if (isXVersion(toPatch)) {
684
- to = `<${toMajor}.${Number(toMinor) + 1}.0-0`;
685
- } else if (toPreRelease) {
686
- to = `<=${toMajor}.${toMinor}.${toPatch}-${toPreRelease}`;
687
- } else {
688
- to = `<=${to}`;
689
- }
690
- return `${from} ${to}`.trim();
691
- });
692
- }
693
- function parseComparatorTrim(range) {
694
- return range.replace(parseRegex(comparatorTrim), "$1$2$3");
695
- }
696
- function parseTildeTrim(range) {
697
- return range.replace(parseRegex(tildeTrim), "$1~");
698
- }
699
- function parseCaretTrim(range) {
700
- return range.replace(parseRegex(caretTrim), "$1^");
701
- }
702
- function parseCarets(range) {
703
- return range.trim().split(/\s+/).map((rangeVersion) => rangeVersion.replace(parseRegex(caret), (_, major, minor, patch, preRelease2) => {
704
- if (isXVersion(major)) {
705
- return "";
706
- } else if (isXVersion(minor)) {
707
- return `>=${major}.0.0 <${Number(major) + 1}.0.0-0`;
708
- } else if (isXVersion(patch)) {
709
- if (major === "0") {
710
- return `>=${major}.${minor}.0 <${major}.${Number(minor) + 1}.0-0`;
711
- } else {
712
- return `>=${major}.${minor}.0 <${Number(major) + 1}.0.0-0`;
713
- }
714
- } else if (preRelease2) {
715
- if (major === "0") {
716
- if (minor === "0") {
717
- return `>=${major}.${minor}.${patch}-${preRelease2} <${major}.${minor}.${Number(patch) + 1}-0`;
718
- } else {
719
- return `>=${major}.${minor}.${patch}-${preRelease2} <${major}.${Number(minor) + 1}.0-0`;
720
- }
721
- } else {
722
- return `>=${major}.${minor}.${patch}-${preRelease2} <${Number(major) + 1}.0.0-0`;
723
- }
724
- } else {
725
- if (major === "0") {
726
- if (minor === "0") {
727
- return `>=${major}.${minor}.${patch} <${major}.${minor}.${Number(patch) + 1}-0`;
728
- } else {
729
- return `>=${major}.${minor}.${patch} <${major}.${Number(minor) + 1}.0-0`;
730
- }
731
- }
732
- return `>=${major}.${minor}.${patch} <${Number(major) + 1}.0.0-0`;
733
- }
734
- })).join(" ");
735
- }
736
- function parseTildes(range) {
737
- return range.trim().split(/\s+/).map((rangeVersion) => rangeVersion.replace(parseRegex(tilde), (_, major, minor, patch, preRelease2) => {
738
- if (isXVersion(major)) {
739
- return "";
740
- } else if (isXVersion(minor)) {
741
- return `>=${major}.0.0 <${Number(major) + 1}.0.0-0`;
742
- } else if (isXVersion(patch)) {
743
- return `>=${major}.${minor}.0 <${major}.${Number(minor) + 1}.0-0`;
744
- } else if (preRelease2) {
745
- return `>=${major}.${minor}.${patch}-${preRelease2} <${major}.${Number(minor) + 1}.0-0`;
746
- }
747
- return `>=${major}.${minor}.${patch} <${major}.${Number(minor) + 1}.0-0`;
748
- })).join(" ");
749
- }
750
- function parseXRanges(range) {
751
- return range.split(/\s+/).map((rangeVersion) => rangeVersion.trim().replace(parseRegex(xRange), (ret, gtlt2, major, minor, patch, preRelease2) => {
752
- const isXMajor = isXVersion(major);
753
- const isXMinor = isXMajor || isXVersion(minor);
754
- const isXPatch = isXMinor || isXVersion(patch);
755
- if (gtlt2 === "=" && isXPatch) {
756
- gtlt2 = "";
757
- }
758
- preRelease2 = "";
759
- if (isXMajor) {
760
- if (gtlt2 === ">" || gtlt2 === "<") {
761
- return "<0.0.0-0";
762
- } else {
763
- return "*";
764
- }
765
- } else if (gtlt2 && isXPatch) {
766
- if (isXMinor) {
767
- minor = 0;
768
- }
769
- patch = 0;
770
- if (gtlt2 === ">") {
771
- gtlt2 = ">=";
772
- if (isXMinor) {
773
- major = Number(major) + 1;
774
- minor = 0;
775
- patch = 0;
776
- } else {
777
- minor = Number(minor) + 1;
778
- patch = 0;
779
- }
780
- } else if (gtlt2 === "<=") {
781
- gtlt2 = "<";
782
- if (isXMinor) {
783
- major = Number(major) + 1;
784
- } else {
785
- minor = Number(minor) + 1;
786
- }
787
- }
788
- if (gtlt2 === "<") {
789
- preRelease2 = "-0";
790
- }
791
- return `${gtlt2 + major}.${minor}.${patch}${preRelease2}`;
792
- } else if (isXMinor) {
793
- return `>=${major}.0.0${preRelease2} <${Number(major) + 1}.0.0-0`;
794
- } else if (isXPatch) {
795
- return `>=${major}.${minor}.0${preRelease2} <${major}.${Number(minor) + 1}.0-0`;
796
- }
797
- return ret;
798
- })).join(" ");
799
- }
800
- function parseStar(range) {
801
- return range.trim().replace(parseRegex(star), "");
802
- }
803
- function parseGTE0(comparatorString) {
804
- return comparatorString.trim().replace(parseRegex(gte0), "");
805
- }
806
- function compareAtom(rangeAtom, versionAtom) {
807
- rangeAtom = Number(rangeAtom) || rangeAtom;
808
- versionAtom = Number(versionAtom) || versionAtom;
809
- if (rangeAtom > versionAtom) {
810
- return 1;
811
- }
812
- if (rangeAtom === versionAtom) {
813
- return 0;
814
- }
815
- return -1;
816
- }
817
- function comparePreRelease(rangeAtom, versionAtom) {
818
- const { preRelease: rangePreRelease } = rangeAtom;
819
- const { preRelease: versionPreRelease } = versionAtom;
820
- if (rangePreRelease === void 0 && Boolean(versionPreRelease)) {
821
- return 1;
822
- }
823
- if (Boolean(rangePreRelease) && versionPreRelease === void 0) {
824
- return -1;
825
- }
826
- if (rangePreRelease === void 0 && versionPreRelease === void 0) {
827
- return 0;
828
- }
829
- for (let i = 0, n = rangePreRelease.length; i <= n; i++) {
830
- const rangeElement = rangePreRelease[i];
831
- const versionElement = versionPreRelease[i];
832
- if (rangeElement === versionElement) {
833
- continue;
834
- }
835
- if (rangeElement === void 0 && versionElement === void 0) {
836
- return 0;
837
- }
838
- if (!rangeElement) {
839
- return 1;
840
- }
841
- if (!versionElement) {
842
- return -1;
843
- }
844
- return compareAtom(rangeElement, versionElement);
845
- }
846
- return 0;
847
- }
848
- function compareVersion(rangeAtom, versionAtom) {
849
- return compareAtom(rangeAtom.major, versionAtom.major) || compareAtom(rangeAtom.minor, versionAtom.minor) || compareAtom(rangeAtom.patch, versionAtom.patch) || comparePreRelease(rangeAtom, versionAtom);
850
- }
851
- function eq(rangeAtom, versionAtom) {
852
- return rangeAtom.version === versionAtom.version;
853
- }
854
- function compare(rangeAtom, versionAtom) {
855
- switch (rangeAtom.operator) {
856
- case "":
857
- case "=":
858
- return eq(rangeAtom, versionAtom);
859
- case ">":
860
- return compareVersion(rangeAtom, versionAtom) < 0;
861
- case ">=":
862
- return eq(rangeAtom, versionAtom) || compareVersion(rangeAtom, versionAtom) < 0;
863
- case "<":
864
- return compareVersion(rangeAtom, versionAtom) > 0;
865
- case "<=":
866
- return eq(rangeAtom, versionAtom) || compareVersion(rangeAtom, versionAtom) > 0;
867
- case void 0: {
868
- return true;
869
- }
870
- default:
871
- return false;
872
- }
873
- }
874
- function parseComparatorString(range) {
875
- return pipe(
876
- // handle caret
877
- // ^ --> * (any, kinda silly)
878
- // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0
879
- // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0
880
- // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0
881
- // ^1.2.3 --> >=1.2.3 <2.0.0-0
882
- // ^1.2.0 --> >=1.2.0 <2.0.0-0
883
- parseCarets,
884
- // handle tilde
885
- // ~, ~> --> * (any, kinda silly)
886
- // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0
887
- // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0
888
- // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0
889
- // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0
890
- // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0
891
- parseTildes,
892
- parseXRanges,
893
- parseStar
894
- )(range);
895
- }
896
- function parseRange(range) {
897
- return pipe(
898
- // handle hyphenRange
899
- // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
900
- parseHyphen,
901
- // handle trim comparator
902
- // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
903
- parseComparatorTrim,
904
- // handle trim tilde
905
- // `~ 1.2.3` => `~1.2.3`
906
- parseTildeTrim,
907
- // handle trim caret
908
- // `^ 1.2.3` => `^1.2.3`
909
- parseCaretTrim
910
- )(range.trim()).split(/\s+/).join(" ");
911
- }
912
- function satisfy(version, range) {
913
- if (!version) {
914
- return false;
915
- }
916
- const parsedRange = parseRange(range);
917
- const parsedComparator = parsedRange.split(" ").map((rangeVersion) => parseComparatorString(rangeVersion)).join(" ");
918
- const comparators = parsedComparator.split(/\s+/).map((comparator2) => parseGTE0(comparator2));
919
- const extractedVersion = extractComparator(version);
920
- if (!extractedVersion) {
921
- return false;
922
- }
923
- const [, versionOperator, , versionMajor, versionMinor, versionPatch, versionPreRelease] = extractedVersion;
924
- const versionAtom = {
925
- operator: versionOperator,
926
- version: combineVersion(versionMajor, versionMinor, versionPatch, versionPreRelease),
927
- major: versionMajor,
928
- minor: versionMinor,
929
- patch: versionPatch,
930
- preRelease: versionPreRelease == null ? void 0 : versionPreRelease.split(".")
931
- };
932
- for (const comparator2 of comparators) {
933
- const extractedComparator = extractComparator(comparator2);
934
- if (!extractedComparator) {
935
- return false;
936
- }
937
- const [, rangeOperator, , rangeMajor, rangeMinor, rangePatch, rangePreRelease] = extractedComparator;
938
- const rangeAtom = {
939
- operator: rangeOperator,
940
- version: combineVersion(rangeMajor, rangeMinor, rangePatch, rangePreRelease),
941
- major: rangeMajor,
942
- minor: rangeMinor,
943
- patch: rangePatch,
944
- preRelease: rangePreRelease == null ? void 0 : rangePreRelease.split(".")
945
- };
946
- if (!compare(rangeAtom, versionAtom)) {
947
- return false;
948
- }
949
- }
950
- return true;
951
- }
952
- function versionLt(a, b) {
953
- const transformInvalidVersion = (version) => {
954
- const isNumberVersion = !Number.isNaN(Number(version));
955
- if (isNumberVersion) {
956
- const splitArr = version.split(".");
957
- let validVersion = version;
958
- for (let i = 0; i < 3 - splitArr.length; i++) {
959
- validVersion += ".0";
960
- }
961
- return validVersion;
962
- }
963
- return version;
964
- };
965
- if (satisfy(transformInvalidVersion(a), `<=${transformInvalidVersion(b)}`)) {
966
- return true;
967
- } else {
968
- return false;
969
- }
970
- }
971
- const findVersion = (shareVersionMap, cb) => {
972
- const callback = cb || function(prev, cur) {
973
- return versionLt(prev, cur);
974
- };
975
- return Object.keys(shareVersionMap).reduce((prev, cur) => {
976
- if (!prev) {
977
- return cur;
978
- }
979
- if (callback(prev, cur)) {
980
- return cur;
981
- }
982
- if (prev === "0") {
983
- return cur;
984
- }
985
- return prev;
986
- }, 0);
987
- };
988
- const isLoaded = (shared) => {
989
- return Boolean(shared.loaded) || typeof shared.lib === "function";
990
- };
991
- function findSingletonVersionOrderByVersion(shareScopeMap, scope, pkgName) {
992
- const versions = shareScopeMap[scope][pkgName];
993
- const callback = function(prev, cur) {
994
- return !isLoaded(versions[prev]) && versionLt(prev, cur);
995
- };
996
- return findVersion(shareScopeMap[scope][pkgName], callback);
997
- }
998
- function findSingletonVersionOrderByLoaded(shareScopeMap, scope, pkgName) {
999
- const versions = shareScopeMap[scope][pkgName];
1000
- const callback = function(prev, cur) {
1001
- if (isLoaded(versions[cur])) {
1002
- if (isLoaded(versions[prev])) {
1003
- return Boolean(versionLt(prev, cur));
1004
- } else {
1005
- return true;
1006
- }
1007
- }
1008
- if (isLoaded(versions[prev])) {
1009
- return false;
1010
- }
1011
- return versionLt(prev, cur);
1012
- };
1013
- return findVersion(shareScopeMap[scope][pkgName], callback);
1014
- }
1015
- function getFindShareFunction(strategy) {
1016
- if (strategy === "loaded-first") {
1017
- return findSingletonVersionOrderByLoaded;
1018
- }
1019
- return findSingletonVersionOrderByVersion;
1020
- }
1021
- function getRegisteredShare(localShareScopeMap, pkgName, shareInfo, resolveShare) {
1022
- if (!localShareScopeMap) {
1023
- return;
1024
- }
1025
- const { shareConfig, scope = DEFAULT_SCOPE, strategy } = shareInfo;
1026
- const scopes = Array.isArray(scope) ? scope : [
1027
- scope
1028
- ];
1029
- for (const sc of scopes) {
1030
- if (shareConfig && localShareScopeMap[sc] && localShareScopeMap[sc][pkgName]) {
1031
- const { requiredVersion } = shareConfig;
1032
- const findShareFunction = getFindShareFunction(strategy);
1033
- const maxOrSingletonVersion = findShareFunction(localShareScopeMap, sc, pkgName);
1034
- const defaultResolver = () => {
1035
- if (shareConfig.singleton) {
1036
- if (typeof requiredVersion === "string" && !satisfy(maxOrSingletonVersion, requiredVersion)) {
1037
- const msg = `Version ${maxOrSingletonVersion} from ${maxOrSingletonVersion && localShareScopeMap[sc][pkgName][maxOrSingletonVersion].from} of shared singleton module ${pkgName} does not satisfy the requirement of ${shareInfo.from} which needs ${requiredVersion})`;
1038
- if (shareConfig.strictVersion) {
1039
- error(msg);
1040
- } else {
1041
- warn(msg);
1042
- }
1043
- }
1044
- return localShareScopeMap[sc][pkgName][maxOrSingletonVersion];
1045
- } else {
1046
- if (requiredVersion === false || requiredVersion === "*") {
1047
- return localShareScopeMap[sc][pkgName][maxOrSingletonVersion];
1048
- }
1049
- if (satisfy(maxOrSingletonVersion, requiredVersion)) {
1050
- return localShareScopeMap[sc][pkgName][maxOrSingletonVersion];
1051
- }
1052
- for (const [versionKey, versionValue] of Object.entries(localShareScopeMap[sc][pkgName])) {
1053
- if (satisfy(versionKey, requiredVersion)) {
1054
- return versionValue;
1055
- }
1056
- }
1057
- }
1058
- };
1059
- const params = {
1060
- shareScopeMap: localShareScopeMap,
1061
- scope: sc,
1062
- pkgName,
1063
- version: maxOrSingletonVersion,
1064
- GlobalFederation: Global.__FEDERATION__,
1065
- resolver: defaultResolver
1066
- };
1067
- const resolveShared = resolveShare.emit(params) || params;
1068
- return resolveShared.resolver();
1069
- }
1070
- }
1071
- }
1072
- function getGlobalShareScope() {
1073
- return Global.__FEDERATION__.__SHARE__;
1074
- }
1075
- var pluginHelper$1 = /* @__PURE__ */ Object.freeze({
1076
- __proto__: null,
1077
- SyncHook,
1078
- AsyncHook,
1079
- SyncWaterfallHook,
1080
- AsyncWaterfallHook,
1081
- PluginSystem
1082
- });
1083
- const ShareUtils = {
1084
- getRegisteredShare,
1085
- getGlobalShareScope
1086
- };
1087
- const GlobalUtils = {
1088
- Global,
1089
- nativeGlobal,
1090
- resetFederationGlobalInfo,
1091
- getGlobalFederationInstance,
1092
- setGlobalFederationInstance,
1093
- getGlobalFederationConstructor,
1094
- setGlobalFederationConstructor,
1095
- getInfoWithoutType,
1096
- getGlobalSnapshot,
1097
- getTargetSnapshotInfoByModuleInfo,
1098
- getGlobalSnapshotInfoByModuleInfo,
1099
- setGlobalSnapshotInfoByModuleInfo,
1100
- addGlobalSnapshot,
1101
- getRemoteEntryExports,
1102
- registerGlobalPlugins,
1103
- getGlobalHostPlugins,
1104
- getPreloaded,
1105
- setPreloaded,
1106
- registerPlugins,
1107
- pluginHelper: pluginHelper$1
1108
- };
1109
- var helpers = {
1110
- global: GlobalUtils,
1111
- share: ShareUtils
1112
- };
1113
- const registerPlugin = helpers.global.registerPlugins;
1114
- const pluginHelper = helpers.global.pluginHelper;
1115
- const host = runtime.getInstance();
1116
- const pluginSystem = new pluginHelper.PluginSystem({
1117
- bridgeRender: new pluginHelper.SyncHook(),
1118
- bridgeDestroy: new pluginHelper.SyncHook()
1119
- });
1120
- registerPlugin(
1121
- host.options.plugins,
1122
- [pluginSystem]
1123
- );
1124
120
  const RemoteAppWrapper = React.forwardRef(function(props, ref) {
1125
121
  const RemoteApp2 = () => {
1126
122
  context.LoggerInstance.log(`RemoteAppWrapper RemoteApp props >>>`, { props });
@@ -1154,9 +150,6 @@ const RemoteAppWrapper = React.forwardRef(function(props, ref) {
1154
150
  `createRemoteComponent LazyComponent render >>>`,
1155
151
  renderProps
1156
152
  );
1157
- pluginSystem.lifecycle.bridgeRender.emit({
1158
- ...renderProps
1159
- });
1160
153
  providerReturn.render(renderProps);
1161
154
  });
1162
155
  return () => {
@@ -1168,14 +161,6 @@ const RemoteAppWrapper = React.forwardRef(function(props, ref) {
1168
161
  `createRemoteComponent LazyComponent destroy >>>`,
1169
162
  { moduleName, basename, dom: renderDom.current }
1170
163
  );
1171
- pluginSystem.lifecycle.bridgeDestroy.emit({
1172
- moduleName,
1173
- dom: renderDom.current,
1174
- basename,
1175
- memoryRoute,
1176
- fallback,
1177
- ...resProps
1178
- });
1179
164
  (_b = providerInfoRef.current) == null ? void 0 : _b.destroy({
1180
165
  dom: renderDom.current
1181
166
  });
@@ -1304,8 +289,8 @@ function createLazyRemoteComponent(info) {
1304
289
  )}`
1305
290
  );
1306
291
  }
1307
- } catch (error2) {
1308
- throw error2;
292
+ } catch (error) {
293
+ throw error;
1309
294
  }
1310
295
  });
1311
296
  }
@@ -1358,7 +343,6 @@ function createBridgeComponent(bridgeInfo) {
1358
343
  };
1359
344
  return {
1360
345
  async render(info) {
1361
- var _a;
1362
346
  context.LoggerInstance.log(`createBridgeComponent render Info`, info);
1363
347
  const {
1364
348
  moduleName,
@@ -1382,7 +366,6 @@ function createBridgeComponent(bridgeInfo) {
1382
366
  }
1383
367
  ))
1384
368
  );
1385
- (_a = bridgeInfo == null ? void 0 : bridgeInfo.renderLifecycle) == null ? void 0 : _a.call(bridgeInfo, info);
1386
369
  if (context.atLeastReact18(React__namespace)) {
1387
370
  if (bridgeInfo == null ? void 0 : bridgeInfo.render) {
1388
371
  Promise.resolve(
@@ -1399,7 +382,6 @@ function createBridgeComponent(bridgeInfo) {
1399
382
  }
1400
383
  },
1401
384
  async destroy(info) {
1402
- var _a;
1403
385
  context.LoggerInstance.log(`createBridgeComponent destroy Info`, {
1404
386
  dom: info.dom
1405
387
  });
@@ -1410,7 +392,6 @@ function createBridgeComponent(bridgeInfo) {
1410
392
  } else {
1411
393
  ReactDOM.unmountComponentAtNode(info.dom);
1412
394
  }
1413
- (_a = bridgeInfo == null ? void 0 : bridgeInfo.destroyLifecycle) == null ? void 0 : _a.call(bridgeInfo, info);
1414
395
  },
1415
396
  rawComponent: bridgeInfo.rootComponent,
1416
397
  __BRIDGE_FN__: (_args) => {