@module-federation/bridge-react 0.0.0-refactor-manifest-20251017113212 → 0.0.0-release-v0-21-5-20251119055555

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.
Files changed (40) hide show
  1. package/CHANGELOG.md +47 -4
  2. package/dist/{bridge-base-29j7dZKh.mjs → bridge-base-CPSTBjEp.mjs} +30 -20
  3. package/dist/{bridge-base-CTNdBioh.js → bridge-base-RStDxH71.js} +30 -20
  4. package/dist/data-fetch-server-middleware.cjs.js +2 -2
  5. package/dist/data-fetch-server-middleware.es.js +2 -2
  6. package/dist/data-fetch-utils.cjs.js +2 -2
  7. package/dist/data-fetch-utils.es.js +4 -4
  8. package/dist/{index-DqCpgmgH.js → index-DRSBaSu3.js} +1 -1
  9. package/dist/{index-Dm-M9ouh.mjs → index-DyQNwY2M.mjs} +1 -1
  10. package/dist/index.cjs.js +5 -5
  11. package/dist/index.d.ts +26 -3
  12. package/dist/index.es.js +5 -5
  13. package/dist/{index.esm-CzoIcLts.js → index.esm-BWaKho-8.js} +34 -2
  14. package/dist/{index.esm-JLwyxgUK.mjs → index.esm-CPwSeCvw.mjs} +34 -2
  15. package/dist/{lazy-load-component-plugin-CuvFHvnT.js → lazy-load-component-plugin-Cro6iAlH.js} +2 -2
  16. package/dist/{lazy-load-component-plugin-C1YB9KOU.mjs → lazy-load-component-plugin-DIOyKGOf.mjs} +2 -2
  17. package/dist/lazy-load-component-plugin.cjs.js +2 -2
  18. package/dist/lazy-load-component-plugin.es.js +2 -2
  19. package/dist/lazy-utils.cjs.js +2 -2
  20. package/dist/lazy-utils.es.js +2 -2
  21. package/dist/{prefetch-DbIbG27M.mjs → prefetch-DGZDT6Vu.mjs} +3 -3
  22. package/dist/{prefetch-tx57ImtO.js → prefetch-ZeDogG_h.js} +3 -3
  23. package/dist/router-v5.cjs.js +1 -1
  24. package/dist/router-v5.es.js +1 -1
  25. package/dist/router-v6.cjs.js +1 -1
  26. package/dist/router-v6.es.js +1 -1
  27. package/dist/router-v7.cjs.js +1 -1
  28. package/dist/router-v7.es.js +1 -1
  29. package/dist/router.cjs.js +1 -1
  30. package/dist/router.es.js +1 -1
  31. package/dist/{utils-BTpxHmva.mjs → utils-Bx_8GGd-.mjs} +1 -1
  32. package/dist/{utils-0HFFqmd4.js → utils-tM9yE73c.js} +1 -1
  33. package/dist/v18.cjs.js +1 -1
  34. package/dist/v18.es.js +1 -1
  35. package/dist/v19.cjs.js +1 -1
  36. package/dist/v19.es.js +1 -1
  37. package/package.json +31 -10
  38. package/src/index.ts +5 -0
  39. package/src/provider/versions/bridge-base.tsx +45 -22
  40. package/src/remote/create.tsx +4 -1
package/CHANGELOG.md CHANGED
@@ -1,6 +1,49 @@
1
1
  # @module-federation/bridge-react
2
2
 
3
- ## 0.0.0-refactor-manifest-20251017113212
3
+ ## 0.0.0-release-v0-21-5-20251119055555
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [94d8868]
8
+ - @module-federation/sdk@0.0.0-release-v0-21-5-20251119055555
9
+ - @module-federation/bridge-shared@0.0.0-release-v0-21-5-20251119055555
10
+
11
+ ## 0.21.4
12
+
13
+ ### Patch Changes
14
+
15
+ - 444db72: fix(bridge-react): hoist BridgeWrapper to prevent component recreation
16
+ - Updated dependencies [a50e068]
17
+ - @module-federation/sdk@0.21.4
18
+ - @module-federation/bridge-shared@0.21.4
19
+
20
+ ## 0.21.3
21
+
22
+ ### Patch Changes
23
+
24
+ - @module-federation/sdk@0.21.3
25
+ - @module-federation/bridge-shared@0.21.3
26
+
27
+ ## 0.21.2
28
+
29
+ ### Patch Changes
30
+
31
+ - e98133e: feat: Re-export the exports of the v18/v19/plugin from @module-federation/bridge-react in modernjs
32
+ - dc103ee: fix: support React Router v6 in peer dependencies
33
+
34
+ Update react-router peer dependency from "^7" to "^6 || ^7" to fix npm install failures for projects using React Router v6.
35
+
36
+ - @module-federation/sdk@0.21.2
37
+ - @module-federation/bridge-shared@0.21.2
38
+
39
+ ## 0.21.1
40
+
41
+ ### Patch Changes
42
+
43
+ - @module-federation/sdk@0.21.1
44
+ - @module-federation/bridge-shared@0.21.1
45
+
46
+ ## 0.21.0
4
47
 
5
48
  ### Minor Changes
6
49
 
@@ -8,9 +51,9 @@
8
51
 
9
52
  ### Patch Changes
10
53
 
11
- - Updated dependencies [ef4ada0]
12
- - @module-federation/sdk@0.0.0-refactor-manifest-20251017113212
13
- - @module-federation/bridge-shared@0.0.0-refactor-manifest-20251017113212
54
+ - Updated dependencies [d1e90a4]
55
+ - @module-federation/sdk@0.21.0
56
+ - @module-federation/bridge-shared@0.21.0
14
57
 
15
58
  ## 0.20.0
16
59
 
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  import { Component, createElement, createContext } from "react";
3
- import { L as LoggerInstance, R as RouterContext } from "./index-Dm-M9ouh.mjs";
3
+ import { L as LoggerInstance, R as RouterContext } from "./index-DyQNwY2M.mjs";
4
4
  import { federationRuntime } from "./plugin.es.js";
5
5
  const ErrorBoundaryContext = createContext(null);
6
6
  const initialState = {
@@ -121,6 +121,24 @@ function createBaseBridgeComponent({
121
121
  }
122
122
  ));
123
123
  };
124
+ const DefaultFallback = ({ error }) => /* @__PURE__ */ React.createElement("div", { role: "alert" }, /* @__PURE__ */ React.createElement("p", null, "Something went wrong:"), /* @__PURE__ */ React.createElement("pre", { style: { color: "red" } }, error.message));
125
+ const BridgeWrapper = ({
126
+ basename,
127
+ moduleName,
128
+ memoryRoute,
129
+ propsInfo,
130
+ fallback
131
+ }) => /* @__PURE__ */ React.createElement(ErrorBoundary, { FallbackComponent: fallback || DefaultFallback }, /* @__PURE__ */ React.createElement(
132
+ RawComponent,
133
+ {
134
+ appInfo: {
135
+ moduleName,
136
+ basename,
137
+ memoryRoute
138
+ },
139
+ propsInfo
140
+ }
141
+ ));
124
142
  return {
125
143
  async render(info) {
126
144
  var _a, _b, _c, _d, _e, _f;
@@ -139,28 +157,20 @@ function createBaseBridgeComponent({
139
157
  ...rootOptions
140
158
  };
141
159
  const beforeBridgeRenderRes = ((_c = (_b = (_a = instance == null ? void 0 : instance.bridgeHook) == null ? void 0 : _a.lifecycle) == null ? void 0 : _b.beforeBridgeRender) == null ? void 0 : _c.emit(info)) || {};
142
- const BridgeWrapper = ({ basename: basename2 }) => /* @__PURE__ */ React.createElement(
143
- ErrorBoundary,
160
+ const rootComponentWithErrorBoundary = /* @__PURE__ */ React.createElement(
161
+ BridgeWrapper,
144
162
  {
145
- FallbackComponent: fallback
146
- },
147
- /* @__PURE__ */ React.createElement(
148
- RawComponent,
149
- {
150
- appInfo: {
151
- moduleName,
152
- basename: basename2,
153
- memoryRoute
154
- },
155
- propsInfo: {
156
- ...propsInfo,
157
- basename: basename2,
158
- ...beforeBridgeRenderRes == null ? void 0 : beforeBridgeRenderRes.extraProps
159
- }
163
+ basename,
164
+ moduleName,
165
+ memoryRoute,
166
+ fallback,
167
+ propsInfo: {
168
+ ...propsInfo,
169
+ basename,
170
+ ...beforeBridgeRenderRes == null ? void 0 : beforeBridgeRenderRes.extraProps
160
171
  }
161
- )
172
+ }
162
173
  );
163
- const rootComponentWithErrorBoundary = /* @__PURE__ */ React.createElement(BridgeWrapper, { basename });
164
174
  if (bridgeInfo.render) {
165
175
  await Promise.resolve(
166
176
  bridgeInfo.render(rootComponentWithErrorBoundary, dom)
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  const React = require("react");
3
- const index = require("./index-DqCpgmgH.js");
3
+ const index = require("./index-DRSBaSu3.js");
4
4
  const plugin = require("./plugin.cjs.js");
5
5
  function _interopNamespaceDefault(e) {
6
6
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
@@ -138,6 +138,24 @@ function createBaseBridgeComponent({
138
138
  }
139
139
  ));
140
140
  };
141
+ const DefaultFallback = ({ error }) => /* @__PURE__ */ React__namespace.createElement("div", { role: "alert" }, /* @__PURE__ */ React__namespace.createElement("p", null, "Something went wrong:"), /* @__PURE__ */ React__namespace.createElement("pre", { style: { color: "red" } }, error.message));
142
+ const BridgeWrapper = ({
143
+ basename,
144
+ moduleName,
145
+ memoryRoute,
146
+ propsInfo,
147
+ fallback
148
+ }) => /* @__PURE__ */ React__namespace.createElement(ErrorBoundary, { FallbackComponent: fallback || DefaultFallback }, /* @__PURE__ */ React__namespace.createElement(
149
+ RawComponent,
150
+ {
151
+ appInfo: {
152
+ moduleName,
153
+ basename,
154
+ memoryRoute
155
+ },
156
+ propsInfo
157
+ }
158
+ ));
141
159
  return {
142
160
  async render(info) {
143
161
  var _a, _b, _c, _d, _e, _f;
@@ -156,28 +174,20 @@ function createBaseBridgeComponent({
156
174
  ...rootOptions
157
175
  };
158
176
  const beforeBridgeRenderRes = ((_c = (_b = (_a = instance == null ? void 0 : instance.bridgeHook) == null ? void 0 : _a.lifecycle) == null ? void 0 : _b.beforeBridgeRender) == null ? void 0 : _c.emit(info)) || {};
159
- const BridgeWrapper = ({ basename: basename2 }) => /* @__PURE__ */ React__namespace.createElement(
160
- ErrorBoundary,
177
+ const rootComponentWithErrorBoundary = /* @__PURE__ */ React__namespace.createElement(
178
+ BridgeWrapper,
161
179
  {
162
- FallbackComponent: fallback
163
- },
164
- /* @__PURE__ */ React__namespace.createElement(
165
- RawComponent,
166
- {
167
- appInfo: {
168
- moduleName,
169
- basename: basename2,
170
- memoryRoute
171
- },
172
- propsInfo: {
173
- ...propsInfo,
174
- basename: basename2,
175
- ...beforeBridgeRenderRes == null ? void 0 : beforeBridgeRenderRes.extraProps
176
- }
180
+ basename,
181
+ moduleName,
182
+ memoryRoute,
183
+ fallback,
184
+ propsInfo: {
185
+ ...propsInfo,
186
+ basename,
187
+ ...beforeBridgeRenderRes == null ? void 0 : beforeBridgeRenderRes.extraProps
177
188
  }
178
- )
189
+ }
179
190
  );
180
- const rootComponentWithErrorBoundary = /* @__PURE__ */ React__namespace.createElement(BridgeWrapper, { basename });
181
191
  if (bridgeInfo.render) {
182
192
  await Promise.resolve(
183
193
  bridgeInfo.render(rootComponentWithErrorBoundary, dom)
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
- const lazyUtils = require("./utils-0HFFqmd4.js");
3
- const index_esm = require("./index.esm-CzoIcLts.js");
2
+ const lazyUtils = require("./utils-tM9yE73c.js");
3
+ const index_esm = require("./index.esm-BWaKho-8.js");
4
4
  function wrapSetTimeout(targetPromise, delay = 2e4, id) {
5
5
  if (targetPromise && typeof targetPromise.then === "function") {
6
6
  return new Promise((resolve, reject) => {
@@ -1,5 +1,5 @@
1
- import { D as DATA_FETCH_QUERY, l as logger, g as getDataFetchMap, i as initDataFetchMap, M as MF_DATA_FETCH_STATUS, f as fetchData, a as loadDataFetchModule } from "./utils-BTpxHmva.mjs";
2
- import { M as MANIFEST_EXT, S as SEPARATOR } from "./index.esm-JLwyxgUK.mjs";
1
+ import { D as DATA_FETCH_QUERY, l as logger, g as getDataFetchMap, i as initDataFetchMap, M as MF_DATA_FETCH_STATUS, f as fetchData, a as loadDataFetchModule } from "./utils-Bx_8GGd-.mjs";
2
+ import { M as MANIFEST_EXT, S as SEPARATOR } from "./index.esm-CPwSeCvw.mjs";
3
3
  function wrapSetTimeout(targetPromise, delay = 2e4, id) {
4
4
  if (targetPromise && typeof targetPromise.then === "function") {
5
5
  return new Promise((resolve, reject) => {
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const lazyUtils = require("./utils-0HFFqmd4.js");
4
- const prefetch = require("./prefetch-tx57ImtO.js");
3
+ const lazyUtils = require("./utils-tM9yE73c.js");
4
+ const prefetch = require("./prefetch-ZeDogG_h.js");
5
5
  async function callDataFetch() {
6
6
  const dataFetch = globalThis[lazyUtils.DATA_FETCH_FUNCTION];
7
7
  if (dataFetch) {
@@ -1,7 +1,7 @@
1
- import { x as DATA_FETCH_FUNCTION } from "./utils-BTpxHmva.mjs";
2
- import { C, b, e, h, c, d, r } from "./utils-BTpxHmva.mjs";
3
- import { d as dataFetchFunction } from "./prefetch-DbIbG27M.mjs";
4
- import { i, p } from "./prefetch-DbIbG27M.mjs";
1
+ import { x as DATA_FETCH_FUNCTION } from "./utils-Bx_8GGd-.mjs";
2
+ import { C, b, e, h, c, d, r } from "./utils-Bx_8GGd-.mjs";
3
+ import { d as dataFetchFunction } from "./prefetch-DGZDT6Vu.mjs";
4
+ import { i, p } from "./prefetch-DGZDT6Vu.mjs";
5
5
  async function callDataFetch() {
6
6
  const dataFetch = globalThis[DATA_FETCH_FUNCTION];
7
7
  if (dataFetch) {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  const React = require("react");
3
- const index_esm = require("./index.esm-CzoIcLts.js");
3
+ const index_esm = require("./index.esm-BWaKho-8.js");
4
4
  const RouterContext = React.createContext(null);
5
5
  const LoggerInstance = index_esm.createLogger(
6
6
  "[ Module Federation Bridge React ]"
@@ -1,5 +1,5 @@
1
1
  import React__default from "react";
2
- import { c as createLogger } from "./index.esm-JLwyxgUK.mjs";
2
+ import { c as createLogger } from "./index.esm-CPwSeCvw.mjs";
3
3
  const RouterContext = React__default.createContext(null);
4
4
  const LoggerInstance = createLogger(
5
5
  "[ Module Federation Bridge React ]"
package/dist/index.cjs.js CHANGED
@@ -1,15 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const bridgeBase = require("./bridge-base-CTNdBioh.js");
3
+ const bridgeBase = require("./bridge-base-RStDxH71.js");
4
4
  const ReactDOM = require("react-dom");
5
- const index = require("./index-DqCpgmgH.js");
5
+ const index = require("./index-DRSBaSu3.js");
6
6
  const React = require("react");
7
7
  const ReactRouterDOM = require("react-router-dom");
8
8
  const plugin = require("./plugin.cjs.js");
9
- const lazyLoadComponentPlugin = require("./lazy-load-component-plugin-CuvFHvnT.js");
10
- const lazyUtils = require("./utils-0HFFqmd4.js");
9
+ const lazyLoadComponentPlugin = require("./lazy-load-component-plugin-Cro6iAlH.js");
10
+ const lazyUtils = require("./utils-tM9yE73c.js");
11
11
  const dataFetchUtils = require("./data-fetch-utils.cjs.js");
12
- const prefetch = require("./prefetch-tx57ImtO.js");
12
+ const prefetch = require("./prefetch-ZeDogG_h.js");
13
13
  function _interopNamespaceDefault(e2) {
14
14
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
15
15
  if (e2) {
package/dist/index.d.ts CHANGED
@@ -134,7 +134,7 @@ export declare function generateKey(dataFetchOptions: DataFetchParams): string;
134
134
 
135
135
  export declare function lazyLoadComponentPlugin(): ModuleFederationRuntimePlugin;
136
136
 
137
- declare type LazyRemoteComponentInfo<T, _E extends keyof T> = RemoteComponentParams<T>;
137
+ export declare type LazyRemoteComponentInfo<T, _E extends keyof T> = RemoteComponentParams<T>;
138
138
 
139
139
  export declare type NoSSRRemoteInfo = {
140
140
  name: string;
@@ -193,7 +193,7 @@ declare type ReactKey = {
193
193
  /**
194
194
  * Parameters for the remote component loader
195
195
  */
196
- declare interface RemoteComponentParams<T = Record<string, unknown>, E extends keyof T = keyof T> {
196
+ export declare interface RemoteComponentParams<T = Record<string, unknown>, E extends keyof T = keyof T> {
197
197
  loader: () => Promise<T>;
198
198
  loading: React_2.ReactNode;
199
199
  fallback: React_2.ComponentType<{
@@ -206,7 +206,7 @@ declare interface RemoteComponentParams<T = Record<string, unknown>, E extends k
206
206
  /**
207
207
  * Parameters for the remote component
208
208
  */
209
- declare interface RemoteComponentProps<T = Record<string, unknown>> {
209
+ export declare interface RemoteComponentProps<T = Record<string, unknown>> {
210
210
  props?: T;
211
211
  fallback?: React_2.ComponentType<{
212
212
  error: Error;
@@ -215,6 +215,29 @@ declare interface RemoteComponentProps<T = Record<string, unknown>> {
215
215
  [key: string]: unknown;
216
216
  }
217
217
 
218
+ /**
219
+ * Interface for a remote module provider
220
+ */
221
+ export declare interface RemoteModule {
222
+ provider: () => {
223
+ render: (info: RenderFnParams) => void;
224
+ destroy: (info: {
225
+ dom: any;
226
+ }) => void;
227
+ };
228
+ }
229
+
230
+ /**
231
+ * Parameters for the render function, extending ProviderParams
232
+ */
233
+ export declare interface RenderFnParams extends ProviderParams {
234
+ dom: HTMLElement;
235
+ fallback?: React_2.ComponentType<{
236
+ error: Error;
237
+ }>;
238
+ [key: string]: unknown;
239
+ }
240
+
218
241
  /**
219
242
  * Parameters for the render function
220
243
  */
package/dist/index.es.js CHANGED
@@ -1,13 +1,13 @@
1
- import { c as createBaseBridgeComponent, E as ErrorBoundary } from "./bridge-base-29j7dZKh.mjs";
1
+ import { c as createBaseBridgeComponent, E as ErrorBoundary } from "./bridge-base-CPSTBjEp.mjs";
2
2
  import ReactDOM from "react-dom";
3
- import { L as LoggerInstance, p as pathJoin, g as getRootDomDefaultClassName } from "./index-Dm-M9ouh.mjs";
3
+ import { L as LoggerInstance, p as pathJoin, g as getRootDomDefaultClassName } from "./index-DyQNwY2M.mjs";
4
4
  import React__default, { forwardRef, useContext, useState, useEffect, useRef } from "react";
5
5
  import * as ReactRouterDOM from "react-router-dom";
6
6
  import { federationRuntime } from "./plugin.es.js";
7
- import { b, a, c, l } from "./lazy-load-component-plugin-C1YB9KOU.mjs";
8
- import { C, b as b2, E, e, h, c as c2, d, r, s } from "./utils-BTpxHmva.mjs";
7
+ import { b, a, c, l } from "./lazy-load-component-plugin-DIOyKGOf.mjs";
8
+ import { C, b as b2, E, e, h, c as c2, d, r, s } from "./utils-Bx_8GGd-.mjs";
9
9
  import { callDataFetch } from "./data-fetch-utils.es.js";
10
- import { p } from "./prefetch-DbIbG27M.mjs";
10
+ import { p } from "./prefetch-DGZDT6Vu.mjs";
11
11
  function createReact16Or17Root(container) {
12
12
  return {
13
13
  render(children) {
@@ -44,6 +44,35 @@ const warn = (msg) => {
44
44
  };
45
45
  const PREFIX = "[ Module Federation ]";
46
46
  const DEFAULT_DELEGATE = console;
47
+ const LOGGER_STACK_SKIP_TOKENS = [
48
+ "logger.ts",
49
+ "logger.js",
50
+ "captureStackTrace",
51
+ "Logger.emit",
52
+ "Logger.log",
53
+ "Logger.info",
54
+ "Logger.warn",
55
+ "Logger.error",
56
+ "Logger.debug"
57
+ ];
58
+ function captureStackTrace() {
59
+ try {
60
+ const stack = new Error().stack;
61
+ if (!stack) {
62
+ return void 0;
63
+ }
64
+ const [, ...rawLines] = stack.split("\n");
65
+ const filtered = rawLines.filter((line) => !LOGGER_STACK_SKIP_TOKENS.some((token) => line.includes(token)));
66
+ if (!filtered.length) {
67
+ return void 0;
68
+ }
69
+ const stackPreview = filtered.slice(0, 5).join("\n");
70
+ return `Stack trace:
71
+ ${stackPreview}`;
72
+ } catch {
73
+ return void 0;
74
+ }
75
+ }
47
76
  class Logger {
48
77
  constructor(prefix, delegate = DEFAULT_DELEGATE) {
49
78
  this.prefix = prefix;
@@ -57,6 +86,9 @@ class Logger {
57
86
  }
58
87
  emit(method, args) {
59
88
  const delegate = this.delegate;
89
+ const debugMode = isDebugMode();
90
+ const stackTrace = debugMode ? captureStackTrace() : void 0;
91
+ const enrichedArgs = stackTrace ? [...args, stackTrace] : args;
60
92
  const order = (() => {
61
93
  switch (method) {
62
94
  case "log":
@@ -75,14 +107,14 @@ class Logger {
75
107
  for (const candidate of order) {
76
108
  const handler = delegate[candidate];
77
109
  if (typeof handler === "function") {
78
- handler.call(delegate, this.prefix, ...args);
110
+ handler.call(delegate, this.prefix, ...enrichedArgs);
79
111
  return;
80
112
  }
81
113
  }
82
114
  for (const candidate of order) {
83
115
  const handler = DEFAULT_DELEGATE[candidate];
84
116
  if (typeof handler === "function") {
85
- handler.call(DEFAULT_DELEGATE, this.prefix, ...args);
117
+ handler.call(DEFAULT_DELEGATE, this.prefix, ...enrichedArgs);
86
118
  return;
87
119
  }
88
120
  }
@@ -43,6 +43,35 @@ const warn = (msg) => {
43
43
  };
44
44
  const PREFIX = "[ Module Federation ]";
45
45
  const DEFAULT_DELEGATE = console;
46
+ const LOGGER_STACK_SKIP_TOKENS = [
47
+ "logger.ts",
48
+ "logger.js",
49
+ "captureStackTrace",
50
+ "Logger.emit",
51
+ "Logger.log",
52
+ "Logger.info",
53
+ "Logger.warn",
54
+ "Logger.error",
55
+ "Logger.debug"
56
+ ];
57
+ function captureStackTrace() {
58
+ try {
59
+ const stack = new Error().stack;
60
+ if (!stack) {
61
+ return void 0;
62
+ }
63
+ const [, ...rawLines] = stack.split("\n");
64
+ const filtered = rawLines.filter((line) => !LOGGER_STACK_SKIP_TOKENS.some((token) => line.includes(token)));
65
+ if (!filtered.length) {
66
+ return void 0;
67
+ }
68
+ const stackPreview = filtered.slice(0, 5).join("\n");
69
+ return `Stack trace:
70
+ ${stackPreview}`;
71
+ } catch {
72
+ return void 0;
73
+ }
74
+ }
46
75
  class Logger {
47
76
  constructor(prefix, delegate = DEFAULT_DELEGATE) {
48
77
  this.prefix = prefix;
@@ -56,6 +85,9 @@ class Logger {
56
85
  }
57
86
  emit(method, args) {
58
87
  const delegate = this.delegate;
88
+ const debugMode = isDebugMode();
89
+ const stackTrace = debugMode ? captureStackTrace() : void 0;
90
+ const enrichedArgs = stackTrace ? [...args, stackTrace] : args;
59
91
  const order = (() => {
60
92
  switch (method) {
61
93
  case "log":
@@ -74,14 +106,14 @@ class Logger {
74
106
  for (const candidate of order) {
75
107
  const handler = delegate[candidate];
76
108
  if (typeof handler === "function") {
77
- handler.call(delegate, this.prefix, ...args);
109
+ handler.call(delegate, this.prefix, ...enrichedArgs);
78
110
  return;
79
111
  }
80
112
  }
81
113
  for (const candidate of order) {
82
114
  const handler = DEFAULT_DELEGATE[candidate];
83
115
  if (typeof handler === "function") {
84
- handler.call(DEFAULT_DELEGATE, this.prefix, ...args);
116
+ handler.call(DEFAULT_DELEGATE, this.prefix, ...enrichedArgs);
85
117
  return;
86
118
  }
87
119
  }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
- const prefetch = require("./prefetch-tx57ImtO.js");
3
- const lazyUtils = require("./utils-0HFFqmd4.js");
2
+ const prefetch = require("./prefetch-ZeDogG_h.js");
3
+ const lazyUtils = require("./utils-tM9yE73c.js");
4
4
  const React = require("react");
5
5
  const autoFetchData = () => {
6
6
  lazyUtils.initDataFetchMap();
@@ -1,5 +1,5 @@
1
- import { i as injectDataFetch, p as prefetch } from "./prefetch-DbIbG27M.mjs";
2
- import { i as initDataFetchMap, j as isDataLoaderExpose, k as getDataFetchInfo, m as getDataFetchMapKey, l as logger, n as getDataFetchItem, o as DATA_FETCH_CLIENT_SUFFIX, p as MF_DATA_FETCH_TYPE, q as isCSROnly, a as loadDataFetchModule, M as MF_DATA_FETCH_STATUS, g as getDataFetchMap, t as isServerEnv, u as getDataFetchIdWithErrorMsgs, v as DATA_FETCH_ERROR_PREFIX, E as ERROR_TYPE, w as wrapDataFetchId, L as LOAD_REMOTE_ERROR_PREFIX, x as DATA_FETCH_FUNCTION, y as getLoadedRemoteInfos, f as fetchData$1, z as setDataFetchItemLoadedStatus, F as FS_HREF } from "./utils-BTpxHmva.mjs";
1
+ import { i as injectDataFetch, p as prefetch } from "./prefetch-DGZDT6Vu.mjs";
2
+ import { i as initDataFetchMap, j as isDataLoaderExpose, k as getDataFetchInfo, m as getDataFetchMapKey, l as logger, n as getDataFetchItem, o as DATA_FETCH_CLIENT_SUFFIX, p as MF_DATA_FETCH_TYPE, q as isCSROnly, a as loadDataFetchModule, M as MF_DATA_FETCH_STATUS, g as getDataFetchMap, t as isServerEnv, u as getDataFetchIdWithErrorMsgs, v as DATA_FETCH_ERROR_PREFIX, E as ERROR_TYPE, w as wrapDataFetchId, L as LOAD_REMOTE_ERROR_PREFIX, x as DATA_FETCH_FUNCTION, y as getLoadedRemoteInfos, f as fetchData$1, z as setDataFetchItemLoadedStatus, F as FS_HREF } from "./utils-Bx_8GGd-.mjs";
3
3
  import React__default, { useRef, useState, Suspense, useEffect } from "react";
4
4
  const autoFetchData = () => {
5
5
  initDataFetchMap();
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- const lazyLoadComponentPlugin = require("./lazy-load-component-plugin-CuvFHvnT.js");
4
- require("./prefetch-tx57ImtO.js");
3
+ const lazyLoadComponentPlugin = require("./lazy-load-component-plugin-Cro6iAlH.js");
4
+ require("./prefetch-ZeDogG_h.js");
5
5
  exports.default = lazyLoadComponentPlugin.lazyLoadComponentPlugin;
6
6
  exports.lazyLoadComponentPlugin = lazyLoadComponentPlugin.lazyLoadComponentPlugin;
@@ -1,5 +1,5 @@
1
- import { l, l as l2 } from "./lazy-load-component-plugin-C1YB9KOU.mjs";
2
- import "./prefetch-DbIbG27M.mjs";
1
+ import { l, l as l2 } from "./lazy-load-component-plugin-DIOyKGOf.mjs";
2
+ import "./prefetch-DGZDT6Vu.mjs";
3
3
  export {
4
4
  l as default,
5
5
  l2 as lazyLoadComponentPlugin
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- require("./index.esm-CzoIcLts.js");
4
- const lazyUtils = require("./utils-0HFFqmd4.js");
3
+ require("./index.esm-BWaKho-8.js");
4
+ const lazyUtils = require("./utils-tM9yE73c.js");
5
5
  exports.callAllDowngrade = lazyUtils.callAllDowngrade;
6
6
  exports.callDowngrade = lazyUtils.callDowngrade;
7
7
  exports.fetchData = lazyUtils.fetchData;
@@ -1,5 +1,5 @@
1
- import "./index.esm-JLwyxgUK.mjs";
2
- import { G, H, f, J, I, u, k, n, g, m, B, y, i, q, j, t, a, z, s, w } from "./utils-BTpxHmva.mjs";
1
+ import "./index.esm-CPwSeCvw.mjs";
2
+ import { G, H, f, J, I, u, k, n, g, m, B, y, i, q, j, t, a, z, s, w } from "./utils-Bx_8GGd-.mjs";
3
3
  export {
4
4
  G as callAllDowngrade,
5
5
  H as callDowngrade,
@@ -1,5 +1,5 @@
1
- import { x as DATA_FETCH_FUNCTION, F as FS_HREF, l as logger$1, g as getDataFetchMap, i as initDataFetchMap, n as getDataFetchItem, M as MF_DATA_FETCH_STATUS, p as MF_DATA_FETCH_TYPE, A as DOWNGRADE_KEY, B as getDowngradeTag, G as callAllDowngrade, H as callDowngrade, k as getDataFetchInfo, m as getDataFetchMapKey } from "./utils-BTpxHmva.mjs";
2
- import { i as isDebugMode, a as createLink, b as createScript, d as isBrowserEnv, c as createLogger, e as composeKeyWithSeparator, l as loadScriptNode, f as loadScript } from "./index.esm-JLwyxgUK.mjs";
1
+ import { x as DATA_FETCH_FUNCTION, F as FS_HREF, l as logger$1, g as getDataFetchMap, i as initDataFetchMap, n as getDataFetchItem, M as MF_DATA_FETCH_STATUS, p as MF_DATA_FETCH_TYPE, A as DOWNGRADE_KEY, B as getDowngradeTag, G as callAllDowngrade, H as callDowngrade, k as getDataFetchInfo, m as getDataFetchMapKey } from "./utils-Bx_8GGd-.mjs";
2
+ import { i as isDebugMode, a as createLink, b as createScript, d as isBrowserEnv, c as createLogger, e as composeKeyWithSeparator, l as loadScriptNode, f as loadScript } from "./index.esm-CPwSeCvw.mjs";
3
3
  const dataFetchFunction = async function(options) {
4
4
  var _a, _b;
5
5
  const [id, data, downgrade] = options;
@@ -210,7 +210,7 @@ function getGlobalFederationConstructor() {
210
210
  function setGlobalFederationConstructor(FederationConstructor, isDebug = isDebugMode()) {
211
211
  if (isDebug) {
212
212
  CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = FederationConstructor;
213
- CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.0.0-refactor-manifest-20251017113212";
213
+ CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.0.0-release-v0-21-5-20251119055555";
214
214
  }
215
215
  }
216
216
  function getInfoWithoutType(target, key) {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
- const lazyUtils = require("./utils-0HFFqmd4.js");
3
- const index_esm = require("./index.esm-CzoIcLts.js");
2
+ const lazyUtils = require("./utils-tM9yE73c.js");
3
+ const index_esm = require("./index.esm-BWaKho-8.js");
4
4
  const dataFetchFunction = async function(options) {
5
5
  var _a, _b;
6
6
  const [id, data, downgrade] = options;
@@ -211,7 +211,7 @@ function getGlobalFederationConstructor() {
211
211
  function setGlobalFederationConstructor(FederationConstructor, isDebug = index_esm.isDebugMode()) {
212
212
  if (isDebug) {
213
213
  CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = FederationConstructor;
214
- CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.0.0-refactor-manifest-20251017113212";
214
+ CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.0.0-release-v0-21-5-20251119055555";
215
215
  }
216
216
  }
217
217
  function getInfoWithoutType(target, key) {
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const React = require("react");
4
4
  const ReactRouterDom$1 = require("react-router-dom/index.js");
5
- const index = require("./index-DqCpgmgH.js");
5
+ const index = require("./index-DRSBaSu3.js");
6
6
  const ReactRouterDom = require("react-router-dom/index.js");
7
7
  function _interopNamespaceDefault(e) {
8
8
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
@@ -1,6 +1,6 @@
1
1
  import React__default, { useContext } from "react";
2
2
  import * as ReactRouterDom$1 from "react-router-dom/index.js";
3
- import { R as RouterContext, L as LoggerInstance } from "./index-Dm-M9ouh.mjs";
3
+ import { R as RouterContext, L as LoggerInstance } from "./index-DyQNwY2M.mjs";
4
4
  export * from "react-router-dom/index.js";
5
5
  function WraperRouter(props) {
6
6
  const { basename, ...propsRes } = props;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const React = require("react");
4
4
  const ReactRouterDom$1 = require("react-router-dom/dist/index.js");
5
- const index = require("./index-DqCpgmgH.js");
5
+ const index = require("./index-DRSBaSu3.js");
6
6
  const ReactRouterDom = require("react-router-dom/dist/index.js");
7
7
  function _interopNamespaceDefault(e) {
8
8
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
@@ -1,6 +1,6 @@
1
1
  import React__default, { useContext } from "react";
2
2
  import * as ReactRouterDom$1 from "react-router-dom/dist/index.js";
3
- import { R as RouterContext, L as LoggerInstance } from "./index-Dm-M9ouh.mjs";
3
+ import { R as RouterContext, L as LoggerInstance } from "./index-DyQNwY2M.mjs";
4
4
  export * from "react-router-dom/dist/index.js";
5
5
  function WraperRouter(props) {
6
6
  const { basename, ...propsRes } = props;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const React = require("react");
4
4
  const ReactRouterDom = require("react-router");
5
- const index = require("./index-DqCpgmgH.js");
5
+ const index = require("./index-DRSBaSu3.js");
6
6
  function _interopNamespaceDefault(e) {
7
7
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
8
8
  if (e) {
@@ -1,7 +1,7 @@
1
1
  import React__default, { useContext } from "react";
2
2
  import * as ReactRouterDom from 'react-router/dist/production/index.js';
3
3
  export * from 'react-router/dist/production/index.js';
4
- import { R as RouterContext, L as LoggerInstance } from "./index-Dm-M9ouh.mjs";
4
+ import { R as RouterContext, L as LoggerInstance } from "./index-DyQNwY2M.mjs";
5
5
  function WraperRouter(props) {
6
6
  const { basename, ...propsRes } = props;
7
7
  const routerContextProps = useContext(RouterContext) || {};
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const React = require("react");
4
4
  const ReactRouterDom = require("react-router-dom/");
5
- const index = require("./index-DqCpgmgH.js");
5
+ const index = require("./index-DRSBaSu3.js");
6
6
  function _interopNamespaceDefault(e) {
7
7
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
8
8
  if (e) {
package/dist/router.es.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import React__default, { useContext } from "react";
2
2
  import * as ReactRouterDom from "react-router-dom/";
3
3
  export * from "react-router-dom/";
4
- import { R as RouterContext, L as LoggerInstance } from "./index-Dm-M9ouh.mjs";
4
+ import { R as RouterContext, L as LoggerInstance } from "./index-DyQNwY2M.mjs";
5
5
  function WrapperRouter(props) {
6
6
  const { basename, ...propsRes } = props;
7
7
  const routerContextProps = useContext(RouterContext) || {};
@@ -18,7 +18,7 @@ var __privateWrapper = (obj, member, setter, getter) => ({
18
18
  }
19
19
  });
20
20
  var _a, _constructing, _b, _c, _max, _maxSize, _dispose, _disposeAfter, _fetchMethod, _memoMethod, _size, _calculatedSize, _keyMap, _keyList, _valList, _next, _prev, _head, _tail, _free, _disposed, _sizes, _starts, _ttls, _hasDispose, _hasFetchMethod, _hasDisposeAfter, _LRUCache_instances, initializeTTLTracking_fn, _updateItemAge, _statusTTL, _setItemTTL, _isStale, initializeSizeTracking_fn, _removeItemSize, _addItemSize, _requireSize, indexes_fn, rindexes_fn, isValidIndex_fn, evict_fn, backgroundFetch_fn, isBackgroundFetch_fn, connect_fn, moveToTail_fn, delete_fn, clear_fn;
21
- import { c as createLogger, d as isBrowserEnv, e as composeKeyWithSeparator } from "./index.esm-JLwyxgUK.mjs";
21
+ import { c as createLogger, d as isBrowserEnv, e as composeKeyWithSeparator } from "./index.esm-CPwSeCvw.mjs";
22
22
  const PLUGIN_IDENTIFIER = "[ Module Federation React ]";
23
23
  const DOWNGRADE_KEY = "_mfSSRDowngrade";
24
24
  const DATA_FETCH_FUNCTION = "_mfDataFetch";
@@ -19,7 +19,7 @@ var __privateWrapper = (obj, member, setter, getter) => ({
19
19
  }
20
20
  });
21
21
  var _a, _constructing, _b, _c, _max, _maxSize, _dispose, _disposeAfter, _fetchMethod, _memoMethod, _size, _calculatedSize, _keyMap, _keyList, _valList, _next, _prev, _head, _tail, _free, _disposed, _sizes, _starts, _ttls, _hasDispose, _hasFetchMethod, _hasDisposeAfter, _LRUCache_instances, initializeTTLTracking_fn, _updateItemAge, _statusTTL, _setItemTTL, _isStale, initializeSizeTracking_fn, _removeItemSize, _addItemSize, _requireSize, indexes_fn, rindexes_fn, isValidIndex_fn, evict_fn, backgroundFetch_fn, isBackgroundFetch_fn, connect_fn, moveToTail_fn, delete_fn, clear_fn;
22
- const index_esm = require("./index.esm-CzoIcLts.js");
22
+ const index_esm = require("./index.esm-BWaKho-8.js");
23
23
  const PLUGIN_IDENTIFIER = "[ Module Federation React ]";
24
24
  const DOWNGRADE_KEY = "_mfSSRDowngrade";
25
25
  const DATA_FETCH_FUNCTION = "_mfDataFetch";
package/dist/v18.cjs.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const client = require("react-dom/client");
4
- const bridgeBase = require("./bridge-base-CTNdBioh.js");
4
+ const bridgeBase = require("./bridge-base-RStDxH71.js");
5
5
  function createReact18Root(container, options) {
6
6
  return client.createRoot(container, options);
7
7
  }
package/dist/v18.es.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { createRoot } from "react-dom/client";
2
- import { c as createBaseBridgeComponent } from "./bridge-base-29j7dZKh.mjs";
2
+ import { c as createBaseBridgeComponent } from "./bridge-base-CPSTBjEp.mjs";
3
3
  function createReact18Root(container, options) {
4
4
  return createRoot(container, options);
5
5
  }
package/dist/v19.cjs.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const client = require("react-dom/client");
4
- const bridgeBase = require("./bridge-base-CTNdBioh.js");
4
+ const bridgeBase = require("./bridge-base-RStDxH71.js");
5
5
  function createReact19Root(container, options) {
6
6
  return client.createRoot(container, options);
7
7
  }
package/dist/v19.es.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { createRoot } from "react-dom/client";
2
- import { c as createBaseBridgeComponent } from "./bridge-base-29j7dZKh.mjs";
2
+ import { c as createBaseBridgeComponent } from "./bridge-base-CPSTBjEp.mjs";
3
3
  function createReact19Root(container, options) {
4
4
  return createRoot(container, options);
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/bridge-react",
3
- "version": "0.0.0-refactor-manifest-20251017113212",
3
+ "version": "0.0.0-release-v0-21-5-20251119055555",
4
4
  "sideEffects": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -39,7 +39,7 @@
39
39
  "./plugin": {
40
40
  "types": "./dist/plugin.d.ts",
41
41
  "import": "./dist/plugin.es.js",
42
- "require": "./dist/plugin.es.js"
42
+ "require": "./dist/plugin.cjs.js"
43
43
  },
44
44
  "./router-v5": {
45
45
  "types": "./dist/router-v5.d.ts",
@@ -81,7 +81,28 @@
81
81
  "typesVersions": {
82
82
  "*": {
83
83
  ".": [
84
- "./dist/types/index.d.ts"
84
+ "./dist/index.d.ts"
85
+ ],
86
+ "v18": [
87
+ "./dist/v18.d.ts"
88
+ ],
89
+ "v19": [
90
+ "./dist/v19.d.ts"
91
+ ],
92
+ "router": [
93
+ "./dist/router.d.ts"
94
+ ],
95
+ "plugin": [
96
+ "./dist/plugin.d.ts"
97
+ ],
98
+ "router-v5": [
99
+ "./dist/router-v5.d.ts"
100
+ ],
101
+ "router-v6": [
102
+ "./dist/router-v6.d.ts"
103
+ ],
104
+ "router-v7": [
105
+ "./dist/router-v7.d.ts"
85
106
  ],
86
107
  "lazy-load-component-plugin": [
87
108
  "./dist/lazy-load-component-plugin.d.ts"
@@ -100,14 +121,14 @@
100
121
  "dependencies": {
101
122
  "react-error-boundary": "^4.1.2",
102
123
  "lru-cache": "^10.4.3",
103
- "@module-federation/sdk": "0.0.0-refactor-manifest-20251017113212",
104
- "@module-federation/bridge-shared": "0.0.0-refactor-manifest-20251017113212"
124
+ "@module-federation/sdk": "0.0.0-release-v0-21-5-20251119055555",
125
+ "@module-federation/bridge-shared": "0.0.0-release-v0-21-5-20251119055555"
105
126
  },
106
127
  "peerDependencies": {
107
128
  "react": ">=16.9.0",
108
129
  "react-dom": ">=16.9.0",
109
130
  "react-router-dom": "^4 || ^5 || ^6 || ^7",
110
- "react-router": "^7"
131
+ "react-router": "^6 || ^7"
111
132
  },
112
133
  "peerDependenciesMeta": {
113
134
  "react-router-dom": {
@@ -130,11 +151,11 @@
130
151
  "react-router-dom": "6.22.3",
131
152
  "react-router": "7.9.4",
132
153
  "typescript": "^5.2.2",
133
- "vite": "^5.4.20",
154
+ "vite": "^5.4.21",
134
155
  "vite-plugin-dts": "^4.3.0",
135
- "hono": "3.12.12",
136
- "@module-federation/runtime": "0.0.0-refactor-manifest-20251017113212",
137
- "@module-federation/runtime-core": "0.0.0-refactor-manifest-20251017113212"
156
+ "hono": "4.10.3",
157
+ "@module-federation/runtime-core": "0.0.0-release-v0-21-5-20251119055555",
158
+ "@module-federation/runtime": "0.0.0-release-v0-21-5-20251119055555"
138
159
  },
139
160
  "scripts": {
140
161
  "dev": "vite",
package/src/index.ts CHANGED
@@ -7,6 +7,7 @@ export {
7
7
  createRemoteComponent,
8
8
  createRemoteAppComponent,
9
9
  } from './remote/create';
10
+ export type { LazyRemoteComponentInfo } from './remote/create';
10
11
  export {
11
12
  ERROR_TYPE,
12
13
  createLazyComponent,
@@ -34,6 +35,10 @@ export type {
34
35
  RootType,
35
36
  DestroyParams,
36
37
  RenderParams,
38
+ RemoteComponentParams,
39
+ RenderFnParams,
40
+ RemoteComponentProps,
41
+ RemoteModule,
37
42
  } from './types';
38
43
  export type {
39
44
  DataFetchParams,
@@ -43,6 +43,38 @@ export function createBaseBridgeComponent<T>({
43
43
  );
44
44
  };
45
45
 
46
+ const DefaultFallback = ({ error }: FallbackProps) => (
47
+ <div role="alert">
48
+ <p>Something went wrong:</p>
49
+ <pre style={{ color: 'red' }}>{error.message}</pre>
50
+ </div>
51
+ );
52
+
53
+ const BridgeWrapper = ({
54
+ basename,
55
+ moduleName,
56
+ memoryRoute,
57
+ propsInfo,
58
+ fallback,
59
+ }: {
60
+ basename?: string;
61
+ moduleName?: string;
62
+ memoryRoute?: any;
63
+ propsInfo: T;
64
+ fallback?: React.ComponentType<FallbackProps>;
65
+ }) => (
66
+ <ErrorBoundary FallbackComponent={fallback || DefaultFallback}>
67
+ <RawComponent
68
+ appInfo={{
69
+ moduleName,
70
+ basename,
71
+ memoryRoute,
72
+ }}
73
+ propsInfo={propsInfo}
74
+ />
75
+ </ErrorBoundary>
76
+ );
77
+
46
78
  return {
47
79
  async render(info: RenderParams) {
48
80
  LoggerInstance.debug(`createBridgeComponent render Info`, info);
@@ -64,29 +96,20 @@ export function createBaseBridgeComponent<T>({
64
96
  const beforeBridgeRenderRes =
65
97
  instance?.bridgeHook?.lifecycle?.beforeBridgeRender?.emit(info) || {};
66
98
 
67
- const BridgeWrapper = ({ basename }: { basename?: string }) => (
68
- <ErrorBoundary
69
- FallbackComponent={fallback as React.ComponentType<FallbackProps>}
70
- >
71
- <RawComponent
72
- appInfo={{
73
- moduleName,
74
- basename,
75
- memoryRoute,
76
- }}
77
- propsInfo={
78
- {
79
- ...propsInfo,
80
- basename,
81
- ...(beforeBridgeRenderRes as any)?.extraProps,
82
- } as T
83
- }
84
- />
85
- </ErrorBoundary>
86
- );
87
-
88
99
  const rootComponentWithErrorBoundary = (
89
- <BridgeWrapper basename={basename} />
100
+ <BridgeWrapper
101
+ basename={basename}
102
+ moduleName={moduleName}
103
+ memoryRoute={memoryRoute}
104
+ fallback={fallback as React.ComponentType<FallbackProps>}
105
+ propsInfo={
106
+ {
107
+ ...propsInfo,
108
+ basename,
109
+ ...(beforeBridgeRenderRes as any)?.extraProps,
110
+ } as T
111
+ }
112
+ />
90
113
  );
91
114
 
92
115
  if (bridgeInfo.render) {
@@ -8,7 +8,10 @@ import {
8
8
  RemoteModule,
9
9
  } from '../types';
10
10
 
11
- type LazyRemoteComponentInfo<T, _E extends keyof T> = RemoteComponentParams<T>;
11
+ export type LazyRemoteComponentInfo<
12
+ T,
13
+ _E extends keyof T,
14
+ > = RemoteComponentParams<T>;
12
15
 
13
16
  function createLazyRemoteComponent<
14
17
  T = Record<string, unknown>,