@module-federation/bridge-react 2.8.1 → 2.9.0

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/base.cjs.js CHANGED
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const createHelpers = require("./createHelpers-19BP0xtB.js");
4
- const lazyLoadComponentPlugin = require("./lazy-load-component-plugin-DBTxuAYf.js");
3
+ const createHelpers = require("./createHelpers-D6thyyLv.js");
4
+ const lazyLoadComponentPlugin = require("./lazy-load-component-plugin-CRqjWQ5N.js");
5
5
  const lazyUtils = require("./utils-5dGErM3C.js");
6
6
  const dataFetchUtils = require("./data-fetch-utils.cjs.js");
7
- const prefetch = require("./prefetch-QJLnti7A.js");
7
+ const prefetch = require("./prefetch-CMvAw8F3.js");
8
8
  const createRemoteAppComponent = createHelpers.createRemoteAppComponentFactory(createHelpers.RemoteAppWrapper);
9
9
  const createRemoteComponent = createHelpers.createDeprecatedRemoteComponentFactory(
10
10
  createRemoteAppComponent
package/dist/base.es.js CHANGED
@@ -1,9 +1,9 @@
1
- import { c as createRemoteAppComponentFactory, a as createDeprecatedRemoteComponentFactory, R as RemoteAppWrapper } from "./createHelpers-BSHeKyd-.mjs";
2
- import { b } from "./createHelpers-BSHeKyd-.mjs";
3
- import { a, c, b as b2, l } from "./lazy-load-component-plugin-DlagtX0O.mjs";
1
+ import { c as createRemoteAppComponentFactory, a as createDeprecatedRemoteComponentFactory, R as RemoteAppWrapper } from "./createHelpers-D3Sg5lKp.mjs";
2
+ import { b } from "./createHelpers-D3Sg5lKp.mjs";
3
+ import { a, c, b as b2, l } from "./lazy-load-component-plugin-CyRfqVSE.mjs";
4
4
  import { C, a as a2, E, c as c2, b as b3, d, g, r, s } from "./utils-BBP3hEeV.mjs";
5
5
  import { callDataFetch } from "./data-fetch-utils.es.js";
6
- import { p } from "./prefetch-BzCq3MT3.mjs";
6
+ import { p } from "./prefetch-xvZIEaJL.mjs";
7
7
  const createRemoteAppComponent = createRemoteAppComponentFactory(RemoteAppWrapper);
8
8
  const createRemoteComponent = createDeprecatedRemoteComponentFactory(
9
9
  createRemoteAppComponent
@@ -89,11 +89,20 @@ function createBaseBridgeComponent({
89
89
  rootOptions,
90
90
  ...propsInfo
91
91
  } = info;
92
+ const operationContext = {
93
+ side: "producer",
94
+ framework: "react",
95
+ operation: rootMap.has(dom) ? "update" : "render",
96
+ reason: "direct"
97
+ };
92
98
  const mergedRootOptions = {
93
99
  ...defaultRootOptions,
94
100
  ...rootOptions
95
101
  };
96
- 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)) || {};
102
+ 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(
103
+ info,
104
+ operationContext
105
+ )) || {};
97
106
  const rootComponentWithErrorBoundary = /* @__PURE__ */ React.createElement(
98
107
  BridgeWrapper,
99
108
  {
@@ -108,9 +117,10 @@ function createBaseBridgeComponent({
108
117
  }
109
118
  );
110
119
  if (bridgeInfo.render) {
111
- await Promise.resolve(
120
+ const root = await Promise.resolve(
112
121
  bridgeInfo.render(rootComponentWithErrorBoundary, dom)
113
- ).then((root) => rootMap.set(dom, root));
122
+ );
123
+ rootMap.set(dom, root);
114
124
  } else {
115
125
  let root = rootMap.get(dom);
116
126
  if (!root && createRoot) {
@@ -121,13 +131,25 @@ function createBaseBridgeComponent({
121
131
  root.render(rootComponentWithErrorBoundary);
122
132
  }
123
133
  }
124
- ((_f = (_e = (_d = instance == null ? void 0 : instance.bridgeHook) == null ? void 0 : _d.lifecycle) == null ? void 0 : _e.afterBridgeRender) == null ? void 0 : _f.emit(info)) || {};
134
+ ((_f = (_e = (_d = instance == null ? void 0 : instance.bridgeHook) == null ? void 0 : _d.lifecycle) == null ? void 0 : _e.afterBridgeRender) == null ? void 0 : _f.emit(info, {
135
+ context: operationContext
136
+ })) || {};
125
137
  },
126
138
  destroy(info) {
127
- var _a, _b, _c;
139
+ var _a, _b, _c, _d, _e, _f;
128
140
  const { dom } = info;
129
141
  LoggerInstance.debug(`createBridgeComponent destroy Info`, info);
130
142
  const root = rootMap.get(dom);
143
+ const operationContext = {
144
+ side: "producer",
145
+ framework: "react",
146
+ operation: "destroy",
147
+ reason: "direct"
148
+ };
149
+ (_c = (_b = (_a = instance == null ? void 0 : instance.bridgeHook) == null ? void 0 : _a.lifecycle) == null ? void 0 : _b.beforeBridgeDestroy) == null ? void 0 : _c.emit(
150
+ info,
151
+ operationContext
152
+ );
131
153
  if (root) {
132
154
  if ("unmount" in root) {
133
155
  root.unmount();
@@ -136,7 +158,9 @@ function createBaseBridgeComponent({
136
158
  }
137
159
  rootMap.delete(dom);
138
160
  }
139
- (_c = (_b = (_a = instance == null ? void 0 : instance.bridgeHook) == null ? void 0 : _a.lifecycle) == null ? void 0 : _b.afterBridgeDestroy) == null ? void 0 : _c.emit(info);
161
+ (_f = (_e = (_d = instance == null ? void 0 : instance.bridgeHook) == null ? void 0 : _d.lifecycle) == null ? void 0 : _e.afterBridgeDestroy) == null ? void 0 : _f.emit(info, {
162
+ context: operationContext
163
+ });
140
164
  }
141
165
  };
142
166
  };
@@ -107,11 +107,20 @@ function createBaseBridgeComponent({
107
107
  rootOptions,
108
108
  ...propsInfo
109
109
  } = info;
110
+ const operationContext = {
111
+ side: "producer",
112
+ framework: "react",
113
+ operation: rootMap.has(dom) ? "update" : "render",
114
+ reason: "direct"
115
+ };
110
116
  const mergedRootOptions = {
111
117
  ...defaultRootOptions,
112
118
  ...rootOptions
113
119
  };
114
- 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)) || {};
120
+ 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(
121
+ info,
122
+ operationContext
123
+ )) || {};
115
124
  const rootComponentWithErrorBoundary = /* @__PURE__ */ React__namespace.createElement(
116
125
  BridgeWrapper,
117
126
  {
@@ -126,9 +135,10 @@ function createBaseBridgeComponent({
126
135
  }
127
136
  );
128
137
  if (bridgeInfo.render) {
129
- await Promise.resolve(
138
+ const root = await Promise.resolve(
130
139
  bridgeInfo.render(rootComponentWithErrorBoundary, dom)
131
- ).then((root) => rootMap.set(dom, root));
140
+ );
141
+ rootMap.set(dom, root);
132
142
  } else {
133
143
  let root = rootMap.get(dom);
134
144
  if (!root && createRoot) {
@@ -139,13 +149,25 @@ function createBaseBridgeComponent({
139
149
  root.render(rootComponentWithErrorBoundary);
140
150
  }
141
151
  }
142
- ((_f = (_e = (_d = instance == null ? void 0 : instance.bridgeHook) == null ? void 0 : _d.lifecycle) == null ? void 0 : _e.afterBridgeRender) == null ? void 0 : _f.emit(info)) || {};
152
+ ((_f = (_e = (_d = instance == null ? void 0 : instance.bridgeHook) == null ? void 0 : _d.lifecycle) == null ? void 0 : _e.afterBridgeRender) == null ? void 0 : _f.emit(info, {
153
+ context: operationContext
154
+ })) || {};
143
155
  },
144
156
  destroy(info) {
145
- var _a, _b, _c;
157
+ var _a, _b, _c, _d, _e, _f;
146
158
  const { dom } = info;
147
159
  index.LoggerInstance.debug(`createBridgeComponent destroy Info`, info);
148
160
  const root = rootMap.get(dom);
161
+ const operationContext = {
162
+ side: "producer",
163
+ framework: "react",
164
+ operation: "destroy",
165
+ reason: "direct"
166
+ };
167
+ (_c = (_b = (_a = instance == null ? void 0 : instance.bridgeHook) == null ? void 0 : _a.lifecycle) == null ? void 0 : _b.beforeBridgeDestroy) == null ? void 0 : _c.emit(
168
+ info,
169
+ operationContext
170
+ );
149
171
  if (root) {
150
172
  if ("unmount" in root) {
151
173
  root.unmount();
@@ -154,7 +176,9 @@ function createBaseBridgeComponent({
154
176
  }
155
177
  rootMap.delete(dom);
156
178
  }
157
- (_c = (_b = (_a = instance == null ? void 0 : instance.bridgeHook) == null ? void 0 : _a.lifecycle) == null ? void 0 : _b.afterBridgeDestroy) == null ? void 0 : _c.emit(info);
179
+ (_f = (_e = (_d = instance == null ? void 0 : instance.bridgeHook) == null ? void 0 : _d.lifecycle) == null ? void 0 : _e.afterBridgeDestroy) == null ? void 0 : _f.emit(info, {
180
+ context: operationContext
181
+ });
158
182
  }
159
183
  };
160
184
  };
@@ -1,4 +1,4 @@
1
- import { c as createBaseBridgeComponent, E as ErrorBoundary } from "./bridge-base-BaKy6CY_.mjs";
1
+ import { c as createBaseBridgeComponent, E as ErrorBoundary } from "./bridge-base-CHnL6Q9P.mjs";
2
2
  import ReactDOM from "react-dom";
3
3
  import { L as LoggerInstance, g as getRootDomDefaultClassName } from "./index-Bs2NxD2z.mjs";
4
4
  import React__default, { forwardRef, useRef, useState, useEffect } from "react";
@@ -57,31 +57,36 @@ const RemoteAppWrapper = forwardRef(function(props, ref) {
57
57
  providerInfoRef.current = providerReturn;
58
58
  setInitialized(true);
59
59
  return () => {
60
- var _a, _b, _c, _d, _e, _f, _g, _h;
60
+ var _a, _b, _c, _d, _e, _f, _g;
61
61
  if ((_a = providerInfoRef.current) == null ? void 0 : _a.destroy) {
62
62
  LoggerInstance.debug(
63
63
  `createRemoteAppComponent LazyComponent destroy >>>`,
64
64
  { moduleName, basename, dom: renderDom.current }
65
65
  );
66
- (_d = (_c = (_b = instance == null ? void 0 : instance.bridgeHook) == null ? void 0 : _b.lifecycle) == null ? void 0 : _c.beforeBridgeDestroy) == null ? void 0 : _d.emit({
66
+ const destroyInfo = {
67
67
  moduleName,
68
68
  dom: renderDom.current,
69
69
  basename,
70
70
  memoryRoute,
71
71
  fallback,
72
72
  ...resProps
73
- });
74
- (_e = providerInfoRef.current) == null ? void 0 : _e.destroy({
73
+ };
74
+ const operationContext = {
75
+ side: "consumer",
76
+ framework: "react",
77
+ operation: "destroy",
78
+ reason: "unmount"
79
+ };
80
+ (_d = (_c = (_b = instance == null ? void 0 : instance.bridgeHook) == null ? void 0 : _b.lifecycle) == null ? void 0 : _c.beforeBridgeDestroy) == null ? void 0 : _d.emit(
81
+ destroyInfo,
82
+ operationContext
83
+ );
84
+ providerInfoRef.current.destroy({
75
85
  moduleName,
76
86
  dom: renderDom.current
77
87
  });
78
- (_h = (_g = (_f = instance == null ? void 0 : instance.bridgeHook) == null ? void 0 : _f.lifecycle) == null ? void 0 : _g.afterBridgeDestroy) == null ? void 0 : _h.emit({
79
- moduleName,
80
- dom: renderDom.current,
81
- basename,
82
- memoryRoute,
83
- fallback,
84
- ...resProps
88
+ (_g = (_f = (_e = instance == null ? void 0 : instance.bridgeHook) == null ? void 0 : _e.lifecycle) == null ? void 0 : _f.afterBridgeDestroy) == null ? void 0 : _g.emit(destroyInfo, {
89
+ context: operationContext
85
90
  });
86
91
  }
87
92
  };
@@ -98,10 +103,20 @@ const RemoteAppWrapper = forwardRef(function(props, ref) {
98
103
  ...resProps
99
104
  };
100
105
  renderDom.current = rootRef.current;
101
- 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(renderProps)) || {};
106
+ const operationContext = {
107
+ side: "consumer",
108
+ framework: "react",
109
+ operation: "render"
110
+ };
111
+ 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(
112
+ renderProps,
113
+ operationContext
114
+ )) || {};
102
115
  renderProps = { ...renderProps, ...beforeBridgeRenderRes.extraProps };
103
116
  providerInfoRef.current.render(renderProps);
104
- (_f = (_e = (_d = instance == null ? void 0 : instance.bridgeHook) == null ? void 0 : _d.lifecycle) == null ? void 0 : _e.afterBridgeRender) == null ? void 0 : _f.emit(renderProps);
117
+ (_f = (_e = (_d = instance == null ? void 0 : instance.bridgeHook) == null ? void 0 : _d.lifecycle) == null ? void 0 : _e.afterBridgeRender) == null ? void 0 : _f.emit(renderProps, {
118
+ context: operationContext
119
+ });
105
120
  }, [initialized, ...Object.values(props)]);
106
121
  const rootComponentClassName = `${getRootDomDefaultClassName(moduleName)} ${className || ""}`;
107
122
  return /* @__PURE__ */ React__default.createElement("div", { className: rootComponentClassName, style, ref: rootRef }, loading);
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const bridgeBase = require("./bridge-base-Ch33UJuN.js");
2
+ const bridgeBase = require("./bridge-base-DSYKAGGD.js");
3
3
  const ReactDOM = require("react-dom");
4
4
  const index = require("./index-DbjGCKOr.js");
5
5
  const React = require("react");
@@ -58,31 +58,36 @@ const RemoteAppWrapper = React.forwardRef(function(props, ref) {
58
58
  providerInfoRef.current = providerReturn;
59
59
  setInitialized(true);
60
60
  return () => {
61
- var _a, _b, _c, _d, _e, _f, _g, _h;
61
+ var _a, _b, _c, _d, _e, _f, _g;
62
62
  if ((_a = providerInfoRef.current) == null ? void 0 : _a.destroy) {
63
63
  index.LoggerInstance.debug(
64
64
  `createRemoteAppComponent LazyComponent destroy >>>`,
65
65
  { moduleName, basename, dom: renderDom.current }
66
66
  );
67
- (_d = (_c = (_b = instance == null ? void 0 : instance.bridgeHook) == null ? void 0 : _b.lifecycle) == null ? void 0 : _c.beforeBridgeDestroy) == null ? void 0 : _d.emit({
67
+ const destroyInfo = {
68
68
  moduleName,
69
69
  dom: renderDom.current,
70
70
  basename,
71
71
  memoryRoute,
72
72
  fallback,
73
73
  ...resProps
74
- });
75
- (_e = providerInfoRef.current) == null ? void 0 : _e.destroy({
74
+ };
75
+ const operationContext = {
76
+ side: "consumer",
77
+ framework: "react",
78
+ operation: "destroy",
79
+ reason: "unmount"
80
+ };
81
+ (_d = (_c = (_b = instance == null ? void 0 : instance.bridgeHook) == null ? void 0 : _b.lifecycle) == null ? void 0 : _c.beforeBridgeDestroy) == null ? void 0 : _d.emit(
82
+ destroyInfo,
83
+ operationContext
84
+ );
85
+ providerInfoRef.current.destroy({
76
86
  moduleName,
77
87
  dom: renderDom.current
78
88
  });
79
- (_h = (_g = (_f = instance == null ? void 0 : instance.bridgeHook) == null ? void 0 : _f.lifecycle) == null ? void 0 : _g.afterBridgeDestroy) == null ? void 0 : _h.emit({
80
- moduleName,
81
- dom: renderDom.current,
82
- basename,
83
- memoryRoute,
84
- fallback,
85
- ...resProps
89
+ (_g = (_f = (_e = instance == null ? void 0 : instance.bridgeHook) == null ? void 0 : _e.lifecycle) == null ? void 0 : _f.afterBridgeDestroy) == null ? void 0 : _g.emit(destroyInfo, {
90
+ context: operationContext
86
91
  });
87
92
  }
88
93
  };
@@ -99,10 +104,20 @@ const RemoteAppWrapper = React.forwardRef(function(props, ref) {
99
104
  ...resProps
100
105
  };
101
106
  renderDom.current = rootRef.current;
102
- 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(renderProps)) || {};
107
+ const operationContext = {
108
+ side: "consumer",
109
+ framework: "react",
110
+ operation: "render"
111
+ };
112
+ 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(
113
+ renderProps,
114
+ operationContext
115
+ )) || {};
103
116
  renderProps = { ...renderProps, ...beforeBridgeRenderRes.extraProps };
104
117
  providerInfoRef.current.render(renderProps);
105
- (_f = (_e = (_d = instance == null ? void 0 : instance.bridgeHook) == null ? void 0 : _d.lifecycle) == null ? void 0 : _e.afterBridgeRender) == null ? void 0 : _f.emit(renderProps);
118
+ (_f = (_e = (_d = instance == null ? void 0 : instance.bridgeHook) == null ? void 0 : _d.lifecycle) == null ? void 0 : _e.afterBridgeRender) == null ? void 0 : _f.emit(renderProps, {
119
+ context: operationContext
120
+ });
106
121
  }, [initialized, ...Object.values(props)]);
107
122
  const rootComponentClassName = `${index.getRootDomDefaultClassName(moduleName)} ${className || ""}`;
108
123
  return /* @__PURE__ */ React.createElement("div", { className: rootComponentClassName, style, ref: rootRef }, loading);
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const lazyUtils = require("./utils-5dGErM3C.js");
4
- const prefetch = require("./prefetch-QJLnti7A.js");
4
+ const prefetch = require("./prefetch-CMvAw8F3.js");
5
5
  async function callDataFetch() {
6
6
  const dataFetch = globalThis[lazyUtils.DATA_FETCH_FUNCTION];
7
7
  if (dataFetch) {
@@ -1,7 +1,7 @@
1
1
  import { y as DATA_FETCH_FUNCTION } from "./utils-BBP3hEeV.mjs";
2
2
  import { C, a, c, b, d, g, r } from "./utils-BBP3hEeV.mjs";
3
- import { d as dataFetchFunction } from "./prefetch-BzCq3MT3.mjs";
4
- import { i, p } from "./prefetch-BzCq3MT3.mjs";
3
+ import { d as dataFetchFunction } from "./prefetch-xvZIEaJL.mjs";
4
+ import { i, p } from "./prefetch-xvZIEaJL.mjs";
5
5
  async function callDataFetch() {
6
6
  const dataFetch = globalThis[DATA_FETCH_FUNCTION];
7
7
  if (dataFetch) {
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const lazyLoadComponentPlugin = require("./lazy-load-component-plugin-DBTxuAYf.js");
3
+ const lazyLoadComponentPlugin = require("./lazy-load-component-plugin-CRqjWQ5N.js");
4
4
  const lazyUtils = require("./utils-5dGErM3C.js");
5
5
  const dataFetchUtils = require("./data-fetch-utils.cjs.js");
6
- const prefetch = require("./prefetch-QJLnti7A.js");
6
+ const prefetch = require("./prefetch-CMvAw8F3.js");
7
7
  exports.autoFetchDataPlugin = lazyLoadComponentPlugin.autoFetchData;
8
8
  exports.collectSSRAssets = lazyLoadComponentPlugin.collectSSRAssets;
9
9
  exports.createLazyComponent = lazyLoadComponentPlugin.createLazyComponent;
@@ -1,7 +1,7 @@
1
- import { a, c, b, l } from "./lazy-load-component-plugin-DlagtX0O.mjs";
1
+ import { a, c, b, l } from "./lazy-load-component-plugin-CyRfqVSE.mjs";
2
2
  import { C, a as a2, E, c as c2, b as b2, d, f, g, r, s } from "./utils-BBP3hEeV.mjs";
3
3
  import { callDataFetch } from "./data-fetch-utils.es.js";
4
- import { p } from "./prefetch-BzCq3MT3.mjs";
4
+ import { p } from "./prefetch-xvZIEaJL.mjs";
5
5
  export {
6
6
  C as CacheSize,
7
7
  a2 as CacheTime,
package/dist/index.cjs.js CHANGED
@@ -1,13 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const createHelpers = require("./createHelpers-19BP0xtB.js");
4
- const lazyLoadComponentPlugin = require("./lazy-load-component-plugin-DBTxuAYf.js");
3
+ const createHelpers = require("./createHelpers-D6thyyLv.js");
4
+ const lazyLoadComponentPlugin = require("./lazy-load-component-plugin-CRqjWQ5N.js");
5
5
  const lazyUtils = require("./utils-5dGErM3C.js");
6
6
  const dataFetchUtils = require("./data-fetch-utils.cjs.js");
7
7
  const React = require("react");
8
8
  const ReactRouterDOM = require("react-router-dom");
9
9
  const index = require("./index-DbjGCKOr.js");
10
- const prefetch = require("./prefetch-QJLnti7A.js");
10
+ const plugin = require("./plugin.cjs.js");
11
+ const prefetch = require("./prefetch-CMvAw8F3.js");
11
12
  function _interopNamespaceDefault(e2) {
12
13
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
13
14
  if (e2) {
@@ -81,6 +82,7 @@ function withRouterData(WrappedComponent) {
81
82
  const location = ReactRouterDOM__namespace.useLocation();
82
83
  const [pathname, setPathname] = React.useState(location.pathname);
83
84
  React.useEffect(() => {
85
+ var _a2;
84
86
  if (pathname !== "" && pathname !== location.pathname) {
85
87
  index.LoggerInstance.debug(
86
88
  `createRemoteAppComponent dispatchPopstateEnv >>>`,
@@ -89,7 +91,26 @@ function withRouterData(WrappedComponent) {
89
91
  pathname: location.pathname
90
92
  }
91
93
  );
94
+ const route = {
95
+ action: "host-to-remote",
96
+ mechanism: "popstate",
97
+ from: pathname,
98
+ to: location.pathname,
99
+ basename
100
+ };
101
+ const operationContext = {
102
+ side: "consumer",
103
+ framework: "react",
104
+ operation: "route-sync",
105
+ moduleName: props.moduleName,
106
+ route
107
+ };
92
108
  e();
109
+ (_a2 = plugin.federationRuntime.instance) == null ? void 0 : _a2.bridgeHook.lifecycle.afterBridgeRouteSync.emit(
110
+ {
111
+ context: operationContext
112
+ }
113
+ );
93
114
  }
94
115
  setPathname(location.pathname);
95
116
  }, [location]);
package/dist/index.es.js CHANGED
@@ -1,12 +1,13 @@
1
- import { R as RemoteAppWrapper, c as createRemoteAppComponentFactory, a as createDeprecatedRemoteComponentFactory } from "./createHelpers-BSHeKyd-.mjs";
2
- import { b } from "./createHelpers-BSHeKyd-.mjs";
3
- import { a, c, b as b2, l } from "./lazy-load-component-plugin-DlagtX0O.mjs";
1
+ import { R as RemoteAppWrapper, c as createRemoteAppComponentFactory, a as createDeprecatedRemoteComponentFactory } from "./createHelpers-D3Sg5lKp.mjs";
2
+ import { b } from "./createHelpers-D3Sg5lKp.mjs";
3
+ import { a, c, b as b2, l } from "./lazy-load-component-plugin-CyRfqVSE.mjs";
4
4
  import { C, a as a2, E, c as c2, b as b3, d, g, r, s } from "./utils-BBP3hEeV.mjs";
5
5
  import { callDataFetch } from "./data-fetch-utils.es.js";
6
6
  import React__default, { forwardRef, useContext, useState, useEffect } from "react";
7
7
  import * as ReactRouterDOM from "react-router-dom";
8
8
  import { p as pathJoin, L as LoggerInstance } from "./index-Bs2NxD2z.mjs";
9
- import { p } from "./prefetch-BzCq3MT3.mjs";
9
+ import { federationRuntime } from "./plugin.es.js";
10
+ import { p } from "./prefetch-xvZIEaJL.mjs";
10
11
  function e() {
11
12
  const t = new PopStateEvent("popstate", { state: window.history.state });
12
13
  window.dispatchEvent(t);
@@ -63,6 +64,7 @@ function withRouterData(WrappedComponent) {
63
64
  const location = ReactRouterDOM.useLocation();
64
65
  const [pathname, setPathname] = useState(location.pathname);
65
66
  useEffect(() => {
67
+ var _a2;
66
68
  if (pathname !== "" && pathname !== location.pathname) {
67
69
  LoggerInstance.debug(
68
70
  `createRemoteAppComponent dispatchPopstateEnv >>>`,
@@ -71,7 +73,26 @@ function withRouterData(WrappedComponent) {
71
73
  pathname: location.pathname
72
74
  }
73
75
  );
76
+ const route = {
77
+ action: "host-to-remote",
78
+ mechanism: "popstate",
79
+ from: pathname,
80
+ to: location.pathname,
81
+ basename
82
+ };
83
+ const operationContext = {
84
+ side: "consumer",
85
+ framework: "react",
86
+ operation: "route-sync",
87
+ moduleName: props.moduleName,
88
+ route
89
+ };
74
90
  e();
91
+ (_a2 = federationRuntime.instance) == null ? void 0 : _a2.bridgeHook.lifecycle.afterBridgeRouteSync.emit(
92
+ {
93
+ context: operationContext
94
+ }
95
+ );
75
96
  }
76
97
  setPathname(location.pathname);
77
98
  }, [location]);
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ export declare function HydratedStylesheetAssets({ hrefs }: {
3
+ hrefs: string[];
4
+ }): React.JSX.Element;
@@ -23,6 +23,6 @@ export type CreateLazyComponentOptions<T, E extends keyof T> = {
23
23
  type ReactKey = {
24
24
  key?: React.Key | null;
25
25
  };
26
- export declare function collectSSRAssets(options: IProps): ReactNode[];
26
+ export declare function collectSSRAssets(options: IProps): React.ReactNode[];
27
27
  export declare function createLazyComponent<T, E extends keyof T>(options: CreateLazyComponentOptions<T, E>): (props: T[E] extends (...args: any) => any ? Parameters<T[E]>[0] extends undefined ? ReactKey : Parameters<T[E]>[0] & ReactKey : ReactKey) => React.JSX.Element;
28
28
  export {};