@module-federation/bridge-react 0.0.0-perf-devtools-20260107043700 → 0.0.0-pre-release-2-5-20260518135705

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 (104) hide show
  1. package/dist/base.cjs.js +4 -4
  2. package/dist/base.es.js +11 -11
  3. package/dist/{bridge-base-CPSTBjEp.mjs → bridge-base-EnVXD4Hr.mjs} +3 -2
  4. package/dist/{bridge-base-RStDxH71.js → bridge-base-IlvdqYIj.js} +3 -2
  5. package/dist/{createHelpers-B_L612IN.js → createHelpers-9B0ttrN_.js} +4 -3
  6. package/dist/{createHelpers-Ui5pt7je.mjs → createHelpers-D77sECmY.mjs} +6 -5
  7. package/dist/data-fetch-server-middleware.cjs.js +4 -4
  8. package/dist/data-fetch-server-middleware.es.js +2 -2
  9. package/dist/data-fetch-utils.cjs.js +2 -2
  10. package/dist/data-fetch-utils.es.js +7 -7
  11. package/dist/data-fetch.cjs.js +22 -0
  12. package/dist/data-fetch.d.ts +140 -0
  13. package/dist/data-fetch.es.js +22 -0
  14. package/dist/{index-DyQNwY2M.mjs → index-Bs2NxD2z.mjs} +1 -1
  15. package/dist/{index-DRSBaSu3.js → index-DbjGCKOr.js} +2 -2
  16. package/dist/index.cjs.js +6 -6
  17. package/dist/index.es.js +13 -13
  18. package/dist/{lazy-load-component-plugin-CNyT62wB.mjs → lazy-load-component-plugin-Dcx_Gz4P.mjs} +5 -5
  19. package/dist/{lazy-load-component-plugin-Dr5VV1mu.js → lazy-load-component-plugin-KDXBEQue.js} +2 -2
  20. package/dist/lazy-load-component-plugin.cjs.js +2 -2
  21. package/dist/lazy-load-component-plugin.es.js +2 -2
  22. package/dist/lazy-utils.cjs.js +2 -2
  23. package/dist/lazy-utils.es.js +19 -19
  24. package/dist/logger-DwWkXsWl.mjs +139 -0
  25. package/dist/logger-Dxblx6P-.js +138 -0
  26. package/dist/prefetch-BWCJr9-2.mjs +924 -0
  27. package/dist/prefetch-CzQ0E8Fz.js +923 -0
  28. package/dist/router-v5.cjs.js +5 -3
  29. package/dist/router-v5.d.ts +1 -2
  30. package/dist/router-v5.es.js +5 -3
  31. package/dist/router-v6.cjs.js +1 -1
  32. package/dist/router-v6.es.js +1 -1
  33. package/dist/router-v7.cjs.js +5 -3
  34. package/dist/router-v7.d.ts +2 -3
  35. package/dist/router-v7.es.js +5 -3
  36. package/dist/router.cjs.js +1 -1
  37. package/dist/router.es.js +1 -1
  38. package/dist/{utils-tM9yE73c.js → utils-CFTy4LVE.js} +18 -4
  39. package/dist/{utils-dUgb9Jkm.mjs → utils-DGS4pYp8.mjs} +41 -27
  40. package/dist/v18.cjs.js +1 -1
  41. package/dist/v18.es.js +1 -1
  42. package/dist/v19.cjs.js +1 -1
  43. package/dist/v19.es.js +1 -1
  44. package/package.json +25 -11
  45. package/CHANGELOG.md +0 -735
  46. package/__tests__/bridge.spec.tsx +0 -160
  47. package/__tests__/createLazyComponent.spec.tsx +0 -209
  48. package/__tests__/prefetch.spec.ts +0 -156
  49. package/__tests__/router.spec.tsx +0 -82
  50. package/__tests__/setupTests.ts +0 -8
  51. package/__tests__/util.ts +0 -36
  52. package/dist/index.esm-BWaKho-8.js +0 -491
  53. package/dist/index.esm-CPwSeCvw.mjs +0 -492
  54. package/dist/prefetch-J3x-_5zT.js +0 -1272
  55. package/dist/prefetch-lrSPKiuu.mjs +0 -1273
  56. package/jest.config.ts +0 -21
  57. package/project.json +0 -23
  58. package/src/base.ts +0 -50
  59. package/src/index.ts +0 -50
  60. package/src/lazy/AwaitDataFetch.tsx +0 -215
  61. package/src/lazy/constant.ts +0 -30
  62. package/src/lazy/createLazyComponent.tsx +0 -411
  63. package/src/lazy/data-fetch/cache.ts +0 -291
  64. package/src/lazy/data-fetch/call-data-fetch.ts +0 -13
  65. package/src/lazy/data-fetch/data-fetch-server-middleware.ts +0 -196
  66. package/src/lazy/data-fetch/index.ts +0 -16
  67. package/src/lazy/data-fetch/inject-data-fetch.ts +0 -109
  68. package/src/lazy/data-fetch/prefetch.ts +0 -112
  69. package/src/lazy/data-fetch/runtime-plugin.ts +0 -115
  70. package/src/lazy/index.ts +0 -35
  71. package/src/lazy/logger.ts +0 -6
  72. package/src/lazy/types.ts +0 -75
  73. package/src/lazy/utils.ts +0 -372
  74. package/src/lazy/wrapNoSSR.tsx +0 -10
  75. package/src/modern-app-env.d.ts +0 -2
  76. package/src/plugins/lazy-load-component-plugin.spec.ts +0 -21
  77. package/src/plugins/lazy-load-component-plugin.ts +0 -57
  78. package/src/provider/context.tsx +0 -4
  79. package/src/provider/plugin.ts +0 -22
  80. package/src/provider/versions/bridge-base.tsx +0 -150
  81. package/src/provider/versions/legacy.ts +0 -87
  82. package/src/provider/versions/v18.ts +0 -47
  83. package/src/provider/versions/v19.ts +0 -48
  84. package/src/remote/RemoteAppWrapper.tsx +0 -108
  85. package/src/remote/base-component/component.tsx +0 -2
  86. package/src/remote/base-component/create.tsx +0 -23
  87. package/src/remote/base-component/index.tsx +0 -10
  88. package/src/remote/createHelpers.tsx +0 -130
  89. package/src/remote/router-component/component.tsx +0 -104
  90. package/src/remote/router-component/create.tsx +0 -23
  91. package/src/remote/router-component/index.tsx +0 -10
  92. package/src/router/default.tsx +0 -73
  93. package/src/router/v5.tsx +0 -43
  94. package/src/router/v6.tsx +0 -74
  95. package/src/router/v7.tsx +0 -75
  96. package/src/types.ts +0 -147
  97. package/src/utils/index.ts +0 -44
  98. package/src/v18.ts +0 -9
  99. package/src/v19.ts +0 -9
  100. package/tsconfig.json +0 -42
  101. package/tsconfig.node.json +0 -11
  102. package/tsconfig.spec.json +0 -26
  103. package/vite.config.ts +0 -112
  104. package/vitest.config.ts +0 -27
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-B_L612IN.js");
4
- const lazyLoadComponentPlugin = require("./lazy-load-component-plugin-Dr5VV1mu.js");
5
- const lazyUtils = require("./utils-tM9yE73c.js");
3
+ const createHelpers = require("./createHelpers-9B0ttrN_.js");
4
+ const lazyLoadComponentPlugin = require("./lazy-load-component-plugin-KDXBEQue.js");
5
+ const lazyUtils = require("./utils-CFTy4LVE.js");
6
6
  const dataFetchUtils = require("./data-fetch-utils.cjs.js");
7
- const prefetch = require("./prefetch-J3x-_5zT.js");
7
+ const prefetch = require("./prefetch-CzQ0E8Fz.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 createDeprecatedRemoteComponentFactory, a as createRemoteAppComponentFactory, R as RemoteAppWrapper } from "./createHelpers-Ui5pt7je.mjs";
2
- import { b } from "./createHelpers-Ui5pt7je.mjs";
3
- import { b as b2, a, c, l } from "./lazy-load-component-plugin-CNyT62wB.mjs";
4
- import { C, a as a2, E, b as b3, d, c as c2, g, r, s } from "./utils-dUgb9Jkm.mjs";
1
+ import { c as createRemoteAppComponentFactory, a as createDeprecatedRemoteComponentFactory, R as RemoteAppWrapper } from "./createHelpers-D77sECmY.mjs";
2
+ import { b } from "./createHelpers-D77sECmY.mjs";
3
+ import { a, c, b as b2, l } from "./lazy-load-component-plugin-Dcx_Gz4P.mjs";
4
+ import { C, a as a2, E, c as c2, b as b3, d, g, r, s } from "./utils-DGS4pYp8.mjs";
5
5
  import { callDataFetch } from "./data-fetch-utils.es.js";
6
- import { p } from "./prefetch-lrSPKiuu.mjs";
6
+ import { p } from "./prefetch-BWCJr9-2.mjs";
7
7
  const createRemoteAppComponent = createRemoteAppComponentFactory(RemoteAppWrapper);
8
8
  const createRemoteComponent = createDeprecatedRemoteComponentFactory(
9
9
  createRemoteAppComponent
@@ -12,14 +12,14 @@ export {
12
12
  C as CacheSize,
13
13
  a2 as CacheTime,
14
14
  E as ERROR_TYPE,
15
- b2 as autoFetchDataPlugin,
16
- b3 as cache,
15
+ a as autoFetchDataPlugin,
16
+ c2 as cache,
17
17
  callDataFetch,
18
- d as clearStore,
19
- a as collectSSRAssets,
20
- c2 as configureCache,
18
+ b3 as clearStore,
19
+ c as collectSSRAssets,
20
+ d as configureCache,
21
21
  b as createBridgeComponent,
22
- c as createLazyComponent,
22
+ b2 as createLazyComponent,
23
23
  createRemoteAppComponent,
24
24
  createRemoteComponent,
25
25
  g as generateKey,
@@ -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-DyQNwY2M.mjs";
3
+ import { L as LoggerInstance, R as RouterContext } from "./index-Bs2NxD2z.mjs";
4
4
  import { federationRuntime } from "./plugin.es.js";
5
5
  const ErrorBoundaryContext = createContext(null);
6
6
  const initialState = {
@@ -122,13 +122,14 @@ function createBaseBridgeComponent({
122
122
  ));
123
123
  };
124
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 ErrorBoundaryComponent = ErrorBoundary;
125
126
  const BridgeWrapper = ({
126
127
  basename,
127
128
  moduleName,
128
129
  memoryRoute,
129
130
  propsInfo,
130
131
  fallback
131
- }) => /* @__PURE__ */ React.createElement(ErrorBoundary, { FallbackComponent: fallback || DefaultFallback }, /* @__PURE__ */ React.createElement(
132
+ }) => /* @__PURE__ */ React.createElement(ErrorBoundaryComponent, { FallbackComponent: fallback || DefaultFallback }, /* @__PURE__ */ React.createElement(
132
133
  RawComponent,
133
134
  {
134
135
  appInfo: {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  const React = require("react");
3
- const index = require("./index-DRSBaSu3.js");
3
+ const index = require("./index-DbjGCKOr.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" } });
@@ -139,13 +139,14 @@ function createBaseBridgeComponent({
139
139
  ));
140
140
  };
141
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 ErrorBoundaryComponent = ErrorBoundary;
142
143
  const BridgeWrapper = ({
143
144
  basename,
144
145
  moduleName,
145
146
  memoryRoute,
146
147
  propsInfo,
147
148
  fallback
148
- }) => /* @__PURE__ */ React__namespace.createElement(ErrorBoundary, { FallbackComponent: fallback || DefaultFallback }, /* @__PURE__ */ React__namespace.createElement(
149
+ }) => /* @__PURE__ */ React__namespace.createElement(ErrorBoundaryComponent, { FallbackComponent: fallback || DefaultFallback }, /* @__PURE__ */ React__namespace.createElement(
149
150
  RawComponent,
150
151
  {
151
152
  appInfo: {
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
- const bridgeBase = require("./bridge-base-RStDxH71.js");
2
+ const bridgeBase = require("./bridge-base-IlvdqYIj.js");
3
3
  const ReactDOM = require("react-dom");
4
- const index = require("./index-DRSBaSu3.js");
4
+ const index = require("./index-DbjGCKOr.js");
5
5
  const React = require("react");
6
6
  const plugin = require("./plugin.cjs.js");
7
7
  function createReact16Or17Root(container) {
@@ -162,12 +162,13 @@ function createLazyRemoteComponentFactory(RemoteApp) {
162
162
  };
163
163
  }
164
164
  function createRemoteAppComponentFactory(RemoteApp) {
165
+ const ErrorBoundaryComponent = bridgeBase.ErrorBoundary;
165
166
  const createLazyRemoteComponent = createLazyRemoteComponentFactory(RemoteApp);
166
167
  return function createRemoteAppComponent(info) {
167
168
  const LazyComponent = createLazyRemoteComponent(info);
168
169
  return React.forwardRef((props, ref) => {
169
170
  return /* @__PURE__ */ React.createElement(
170
- bridgeBase.ErrorBoundary,
171
+ ErrorBoundaryComponent,
171
172
  {
172
173
  FallbackComponent: info.fallback
173
174
  },
@@ -1,6 +1,6 @@
1
- import { c as createBaseBridgeComponent, E as ErrorBoundary } from "./bridge-base-CPSTBjEp.mjs";
1
+ import { c as createBaseBridgeComponent, E as ErrorBoundary } from "./bridge-base-EnVXD4Hr.mjs";
2
2
  import ReactDOM from "react-dom";
3
- import { L as LoggerInstance, g as getRootDomDefaultClassName } from "./index-DyQNwY2M.mjs";
3
+ import { L as LoggerInstance, g as getRootDomDefaultClassName } from "./index-Bs2NxD2z.mjs";
4
4
  import React__default, { forwardRef, useRef, useState, useEffect } from "react";
5
5
  import { federationRuntime } from "./plugin.es.js";
6
6
  function createReact16Or17Root(container) {
@@ -161,12 +161,13 @@ function createLazyRemoteComponentFactory(RemoteApp) {
161
161
  };
162
162
  }
163
163
  function createRemoteAppComponentFactory(RemoteApp) {
164
+ const ErrorBoundaryComponent = ErrorBoundary;
164
165
  const createLazyRemoteComponent = createLazyRemoteComponentFactory(RemoteApp);
165
166
  return function createRemoteAppComponent(info) {
166
167
  const LazyComponent = createLazyRemoteComponent(info);
167
168
  return forwardRef((props, ref) => {
168
169
  return /* @__PURE__ */ React__default.createElement(
169
- ErrorBoundary,
170
+ ErrorBoundaryComponent,
170
171
  {
171
172
  FallbackComponent: info.fallback
172
173
  },
@@ -185,7 +186,7 @@ function createDeprecatedRemoteComponentFactory(createFn) {
185
186
  }
186
187
  export {
187
188
  RemoteAppWrapper as R,
188
- createRemoteAppComponentFactory as a,
189
+ createDeprecatedRemoteComponentFactory as a,
189
190
  createBridgeComponent as b,
190
- createDeprecatedRemoteComponentFactory as c
191
+ createRemoteAppComponentFactory as c
191
192
  };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
- const lazyUtils = require("./utils-tM9yE73c.js");
3
- const index_esm = require("./index.esm-BWaKho-8.js");
2
+ const lazyUtils = require("./utils-CFTy4LVE.js");
3
+ const logger = require("./logger-Dxblx6P-.js");
4
4
  function wrapSetTimeout(targetPromise, delay = 2e4, id) {
5
5
  if (targetPromise && typeof targetPromise.then === "function") {
6
6
  return new Promise((resolve, reject) => {
@@ -98,7 +98,7 @@ const dataFetchServerMiddleware = async (ctx, next) => {
98
98
  entryGlobalName: remoteInfo.globalName
99
99
  }
100
100
  ]);
101
- } else if (!("entry" in remote) || !remote.entry.includes(index_esm.MANIFEST_EXT)) {
101
+ } else if (!("entry" in remote) || !remote.entry.includes(logger.MANIFEST_EXT)) {
102
102
  const { hostGlobalSnapshot, remoteSnapshot } = hostInstance2.snapshotHandler.getGlobalRemoteInfo(remoteInfo);
103
103
  lazyUtils.logger.debug(
104
104
  "find hostGlobalSnapshot: ",
@@ -140,7 +140,7 @@ const dataFetchServerMiddleware = async (ctx, next) => {
140
140
  return ctx.json(res);
141
141
  }
142
142
  }
143
- const remoteId = dataFetchKey.split(index_esm.SEPARATOR)[0];
143
+ const remoteId = dataFetchKey.split(logger.SEPARATOR)[0];
144
144
  const hostInstance = globalThis.__FEDERATION__.__INSTANCES__[0];
145
145
  if (!hostInstance) {
146
146
  throw new Error("host instance not found!");
@@ -1,5 +1,5 @@
1
- import { D as DATA_FETCH_QUERY, l as logger, e as getDataFetchMap, i as initDataFetchMap, M as MF_DATA_FETCH_STATUS, f as fetchData, h as loadDataFetchModule } from "./utils-dUgb9Jkm.mjs";
2
- import { M as MANIFEST_EXT, S as SEPARATOR } from "./index.esm-CPwSeCvw.mjs";
1
+ import { D as DATA_FETCH_QUERY, l as logger, e as getDataFetchMap, i as initDataFetchMap, M as MF_DATA_FETCH_STATUS, h as fetchData, j as loadDataFetchModule } from "./utils-DGS4pYp8.mjs";
2
+ import { M as MANIFEST_EXT, S as SEPARATOR } from "./logger-DwWkXsWl.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-tM9yE73c.js");
4
- const prefetch = require("./prefetch-J3x-_5zT.js");
3
+ const lazyUtils = require("./utils-CFTy4LVE.js");
4
+ const prefetch = require("./prefetch-CzQ0E8Fz.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-dUgb9Jkm.mjs";
2
- import { C, a, b, d, c, g, r } from "./utils-dUgb9Jkm.mjs";
3
- import { d as dataFetchFunction } from "./prefetch-lrSPKiuu.mjs";
4
- import { i, p } from "./prefetch-lrSPKiuu.mjs";
1
+ import { y as DATA_FETCH_FUNCTION } from "./utils-DGS4pYp8.mjs";
2
+ import { C, a, c, b, d, g, r } from "./utils-DGS4pYp8.mjs";
3
+ import { d as dataFetchFunction } from "./prefetch-BWCJr9-2.mjs";
4
+ import { i, p } from "./prefetch-BWCJr9-2.mjs";
5
5
  async function callDataFetch() {
6
6
  const dataFetch = globalThis[DATA_FETCH_FUNCTION];
7
7
  if (dataFetch) {
@@ -15,10 +15,10 @@ async function callDataFetch() {
15
15
  export {
16
16
  C as CacheSize,
17
17
  a as CacheTime,
18
- b as cache,
18
+ c as cache,
19
19
  callDataFetch,
20
- d as clearStore,
21
- c as configureCache,
20
+ b as clearStore,
21
+ d as configureCache,
22
22
  g as generateKey,
23
23
  i as injectDataFetch,
24
24
  p as prefetch,
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const lazyLoadComponentPlugin = require("./lazy-load-component-plugin-KDXBEQue.js");
4
+ const lazyUtils = require("./utils-CFTy4LVE.js");
5
+ const dataFetchUtils = require("./data-fetch-utils.cjs.js");
6
+ const prefetch = require("./prefetch-CzQ0E8Fz.js");
7
+ exports.autoFetchDataPlugin = lazyLoadComponentPlugin.autoFetchData;
8
+ exports.collectSSRAssets = lazyLoadComponentPlugin.collectSSRAssets;
9
+ exports.createLazyComponent = lazyLoadComponentPlugin.createLazyComponent;
10
+ exports.lazyLoadComponentPlugin = lazyLoadComponentPlugin.lazyLoadComponentPlugin;
11
+ exports.CacheSize = lazyUtils.CacheSize;
12
+ exports.CacheTime = lazyUtils.CacheTime;
13
+ exports.ERROR_TYPE = lazyUtils.ERROR_TYPE;
14
+ exports.cache = lazyUtils.cache;
15
+ exports.clearStore = lazyUtils.clearStore;
16
+ exports.configureCache = lazyUtils.configureCache;
17
+ exports.flushDataFetch = lazyUtils.flushDataFetch;
18
+ exports.generateKey = lazyUtils.generateKey;
19
+ exports.revalidateTag = lazyUtils.revalidateTag;
20
+ exports.setSSREnv = lazyUtils.setSSREnv;
21
+ exports.callDataFetch = dataFetchUtils.callDataFetch;
22
+ exports.prefetch = prefetch.prefetch;
@@ -0,0 +1,140 @@
1
+ import { default as default_2 } from 'react';
2
+ import { getInstance } from '@module-federation/runtime';
3
+ import { ModuleFederationRuntimePlugin } from '@module-federation/runtime';
4
+ import { ReactNode } from 'react';
5
+
6
+ export declare const autoFetchDataPlugin: () => ModuleFederationRuntimePlugin;
7
+
8
+ export declare function cache<T>(fn: DataFetch<T>, options?: CacheOptions): DataFetch<T>;
9
+
10
+ declare interface CacheConfig {
11
+ maxSize?: number;
12
+ unstable_shouldDisable?: ({ request, }: {
13
+ request: Request;
14
+ }) => boolean | Promise<boolean>;
15
+ }
16
+
17
+ declare interface CacheOptions {
18
+ tag?: string | string[];
19
+ maxAge?: number;
20
+ revalidate?: number;
21
+ getKey?: <Args extends any[]>(...args: Args) => string;
22
+ onCache?: (info: CacheStatsInfo) => boolean;
23
+ }
24
+
25
+ export declare const CacheSize: {
26
+ readonly KB: 1024;
27
+ readonly MB: number;
28
+ readonly GB: number;
29
+ };
30
+
31
+ export declare interface CacheStatsInfo {
32
+ status: CacheStatus;
33
+ key: string | symbol;
34
+ params: DataFetchParams;
35
+ result: any;
36
+ }
37
+
38
+ export declare type CacheStatus = 'hit' | 'stale' | 'miss';
39
+
40
+ export declare const CacheTime: {
41
+ readonly SECOND: 1000;
42
+ readonly MINUTE: number;
43
+ readonly HOUR: number;
44
+ readonly DAY: number;
45
+ readonly WEEK: number;
46
+ readonly MONTH: number;
47
+ };
48
+
49
+ export declare function callDataFetch(): Promise<void>;
50
+
51
+ export declare function clearStore(): void;
52
+
53
+ export declare function collectSSRAssets(options: CollectSSRAssetsOptions): default_2.ReactNode[];
54
+
55
+ export declare type CollectSSRAssetsOptions = {
56
+ id: string;
57
+ instance: ReturnType<typeof getInstance>;
58
+ injectScript?: boolean;
59
+ injectLink?: boolean;
60
+ };
61
+
62
+ export declare function configureCache(config: CacheConfig): void;
63
+
64
+ 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) => default_2.JSX.Element;
65
+
66
+ export declare type CreateLazyComponentOptions<T, E extends keyof T> = {
67
+ loader: () => Promise<T>;
68
+ instance: ReturnType<typeof getInstance>;
69
+ loading: default_2.ReactNode;
70
+ delayLoading?: number;
71
+ fallback: ReactNode | ((errorInfo: ErrorInfo) => ReactNode);
72
+ export?: E;
73
+ dataFetchParams?: DataFetchParams;
74
+ noSSR?: boolean;
75
+ injectScript?: boolean;
76
+ injectLink?: boolean;
77
+ };
78
+
79
+ declare type DataFetch<T> = (params: DataFetchParams) => Promise<T>;
80
+
81
+ export declare type DataFetchParams = {
82
+ isDowngrade: boolean;
83
+ _id?: string;
84
+ } & Record<string, unknown>;
85
+
86
+ export declare const ERROR_TYPE: {
87
+ DATA_FETCH: number;
88
+ LOAD_REMOTE: number;
89
+ UNKNOWN: number;
90
+ };
91
+
92
+ declare type ErrorInfo = {
93
+ error: Error;
94
+ errorType: number;
95
+ dataFetchMapKey?: string;
96
+ };
97
+
98
+ export declare const flushDataFetch: () => void;
99
+
100
+ export declare function generateKey(dataFetchOptions: DataFetchParams): string;
101
+
102
+ export declare function lazyLoadComponentPlugin(): ModuleFederationRuntimePlugin;
103
+
104
+ export declare type NoSSRRemoteInfo = {
105
+ name: string;
106
+ version: string;
107
+ ssrPublicPath: string;
108
+ ssrRemoteEntry: string;
109
+ globalName: string;
110
+ };
111
+
112
+ export declare function prefetch(options: PrefetchOptions): Promise<void>;
113
+
114
+ export declare type PrefetchOptions = {
115
+ id: string;
116
+ instance: ReturnType<typeof getInstance>;
117
+ dataFetchParams?: DataFetchParams;
118
+ preloadComponentResource?: boolean;
119
+ };
120
+
121
+ declare type ReactKey = {
122
+ key?: default_2.Key | null;
123
+ };
124
+
125
+ export declare function revalidateTag(tag: string): void;
126
+
127
+ export declare function setSSREnv({ fetchServerQuery, }: {
128
+ fetchServerQuery?: Record<string, unknown>;
129
+ }): void;
130
+
131
+ export { }
132
+
133
+
134
+ declare module '@module-federation/runtime-core' {
135
+ interface ModuleFederation {
136
+ createLazyComponent<T, E extends keyof T>(options: Omit<CreateLazyComponentOptions<T, E>, 'instance'>): ReturnType<typeof createLazyComponent<T, E>>;
137
+ prefetch(options: Omit<PrefetchOptions, 'instance'>): ReturnType<typeof prefetch>;
138
+ collectSSRAssets(options: Omit<Parameters<typeof collectSSRAssets>[0], 'instance'>): ReturnType<typeof collectSSRAssets>;
139
+ }
140
+ }
@@ -0,0 +1,22 @@
1
+ import { a, c, b, l } from "./lazy-load-component-plugin-Dcx_Gz4P.mjs";
2
+ import { C, a as a2, E, c as c2, b as b2, d, f, g, r, s } from "./utils-DGS4pYp8.mjs";
3
+ import { callDataFetch } from "./data-fetch-utils.es.js";
4
+ import { p } from "./prefetch-BWCJr9-2.mjs";
5
+ export {
6
+ C as CacheSize,
7
+ a2 as CacheTime,
8
+ E as ERROR_TYPE,
9
+ a as autoFetchDataPlugin,
10
+ c2 as cache,
11
+ callDataFetch,
12
+ b2 as clearStore,
13
+ c as collectSSRAssets,
14
+ d as configureCache,
15
+ b as createLazyComponent,
16
+ f as flushDataFetch,
17
+ g as generateKey,
18
+ l as lazyLoadComponentPlugin,
19
+ p as prefetch,
20
+ r as revalidateTag,
21
+ s as setSSREnv
22
+ };
@@ -1,5 +1,5 @@
1
1
  import React__default from "react";
2
- import { c as createLogger } from "./index.esm-CPwSeCvw.mjs";
2
+ import { c as createLogger } from "./logger-DwWkXsWl.mjs";
3
3
  const RouterContext = React__default.createContext(null);
4
4
  const LoggerInstance = createLogger(
5
5
  "[ Module Federation Bridge React ]"
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  const React = require("react");
3
- const index_esm = require("./index.esm-BWaKho-8.js");
3
+ const logger = require("./logger-Dxblx6P-.js");
4
4
  const RouterContext = React.createContext(null);
5
- const LoggerInstance = index_esm.createLogger(
5
+ const LoggerInstance = logger.createLogger(
6
6
  "[ Module Federation Bridge React ]"
7
7
  );
8
8
  function pathJoin(...args) {
package/dist/index.cjs.js CHANGED
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const createHelpers = require("./createHelpers-B_L612IN.js");
4
- const lazyLoadComponentPlugin = require("./lazy-load-component-plugin-Dr5VV1mu.js");
3
+ const createHelpers = require("./createHelpers-9B0ttrN_.js");
4
+ const lazyLoadComponentPlugin = require("./lazy-load-component-plugin-KDXBEQue.js");
5
+ const lazyUtils = require("./utils-CFTy4LVE.js");
6
+ const dataFetchUtils = require("./data-fetch-utils.cjs.js");
5
7
  const React = require("react");
6
8
  const ReactRouterDOM = require("react-router-dom");
7
- const index = require("./index-DRSBaSu3.js");
8
- const lazyUtils = require("./utils-tM9yE73c.js");
9
- const dataFetchUtils = require("./data-fetch-utils.cjs.js");
10
- const prefetch = require("./prefetch-J3x-_5zT.js");
9
+ const index = require("./index-DbjGCKOr.js");
10
+ const prefetch = require("./prefetch-CzQ0E8Fz.js");
11
11
  function _interopNamespaceDefault(e2) {
12
12
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
13
13
  if (e2) {
package/dist/index.es.js CHANGED
@@ -1,12 +1,12 @@
1
- import { R as RemoteAppWrapper, c as createDeprecatedRemoteComponentFactory, a as createRemoteAppComponentFactory } from "./createHelpers-Ui5pt7je.mjs";
2
- import { b } from "./createHelpers-Ui5pt7je.mjs";
3
- import { b as b2, a, c, l } from "./lazy-load-component-plugin-CNyT62wB.mjs";
1
+ import { R as RemoteAppWrapper, c as createRemoteAppComponentFactory, a as createDeprecatedRemoteComponentFactory } from "./createHelpers-D77sECmY.mjs";
2
+ import { b } from "./createHelpers-D77sECmY.mjs";
3
+ import { a, c, b as b2, l } from "./lazy-load-component-plugin-Dcx_Gz4P.mjs";
4
+ import { C, a as a2, E, c as c2, b as b3, d, g, r, s } from "./utils-DGS4pYp8.mjs";
5
+ import { callDataFetch } from "./data-fetch-utils.es.js";
4
6
  import React__default, { forwardRef, useContext, useState, useEffect } from "react";
5
7
  import * as ReactRouterDOM from "react-router-dom";
6
- import { p as pathJoin, L as LoggerInstance } from "./index-DyQNwY2M.mjs";
7
- import { C, a as a2, E, b as b3, d, c as c2, g, r, s } from "./utils-dUgb9Jkm.mjs";
8
- import { callDataFetch } from "./data-fetch-utils.es.js";
9
- import { p } from "./prefetch-lrSPKiuu.mjs";
8
+ import { p as pathJoin, L as LoggerInstance } from "./index-Bs2NxD2z.mjs";
9
+ import { p } from "./prefetch-BWCJr9-2.mjs";
10
10
  function e() {
11
11
  const t = new PopStateEvent("popstate", { state: window.history.state });
12
12
  window.dispatchEvent(t);
@@ -91,14 +91,14 @@ export {
91
91
  C as CacheSize,
92
92
  a2 as CacheTime,
93
93
  E as ERROR_TYPE,
94
- b2 as autoFetchDataPlugin,
95
- b3 as cache,
94
+ a as autoFetchDataPlugin,
95
+ c2 as cache,
96
96
  callDataFetch,
97
- d as clearStore,
98
- a as collectSSRAssets,
99
- c2 as configureCache,
97
+ b3 as clearStore,
98
+ c as collectSSRAssets,
99
+ d as configureCache,
100
100
  b as createBridgeComponent,
101
- c as createLazyComponent,
101
+ b2 as createLazyComponent,
102
102
  createRemoteAppComponent,
103
103
  createRemoteComponent,
104
104
  g as generateKey,
@@ -1,5 +1,5 @@
1
- import { i as injectDataFetch, p as prefetch } from "./prefetch-lrSPKiuu.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, h as loadDataFetchModule, M as MF_DATA_FETCH_STATUS, e 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-dUgb9Jkm.mjs";
1
+ import { i as injectDataFetch, p as prefetch } from "./prefetch-BWCJr9-2.mjs";
2
+ import { i as initDataFetchMap, k as isDataLoaderExpose, m as getDataFetchInfo, n as getDataFetchMapKey, l as logger, o as getDataFetchItem, p as DATA_FETCH_CLIENT_SUFFIX, q as MF_DATA_FETCH_TYPE, t as isCSROnly, M as MF_DATA_FETCH_STATUS, j as loadDataFetchModule, e as getDataFetchMap, u as isServerEnv, v as getDataFetchIdWithErrorMsgs, w as DATA_FETCH_ERROR_PREFIX, E as ERROR_TYPE, x as wrapDataFetchId, L as LOAD_REMOTE_ERROR_PREFIX, y as DATA_FETCH_FUNCTION, z as getLoadedRemoteInfos, h as fetchData$1, A as setDataFetchItemLoadedStatus, F as FS_HREF } from "./utils-DGS4pYp8.mjs";
3
3
  import React__default, { useRef, useState, Suspense, useEffect } from "react";
4
4
  const autoFetchData = () => {
5
5
  initDataFetchMap();
@@ -515,8 +515,8 @@ function lazyLoadComponentPlugin() {
515
515
  };
516
516
  }
517
517
  export {
518
- collectSSRAssets as a,
519
- autoFetchData as b,
520
- createLazyComponent as c,
518
+ autoFetchData as a,
519
+ createLazyComponent as b,
520
+ collectSSRAssets as c,
521
521
  lazyLoadComponentPlugin as l
522
522
  };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
- const prefetch = require("./prefetch-J3x-_5zT.js");
3
- const lazyUtils = require("./utils-tM9yE73c.js");
2
+ const prefetch = require("./prefetch-CzQ0E8Fz.js");
3
+ const lazyUtils = require("./utils-CFTy4LVE.js");
4
4
  const React = require("react");
5
5
  const autoFetchData = () => {
6
6
  lazyUtils.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-Dr5VV1mu.js");
4
- require("./prefetch-J3x-_5zT.js");
3
+ const lazyLoadComponentPlugin = require("./lazy-load-component-plugin-KDXBEQue.js");
4
+ require("./prefetch-CzQ0E8Fz.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-CNyT62wB.mjs";
2
- import "./prefetch-lrSPKiuu.mjs";
1
+ import { l, l as l2 } from "./lazy-load-component-plugin-Dcx_Gz4P.mjs";
2
+ import "./prefetch-BWCJr9-2.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-BWaKho-8.js");
4
- const lazyUtils = require("./utils-tM9yE73c.js");
3
+ require("./logger-Dxblx6P-.js");
4
+ const lazyUtils = require("./utils-CFTy4LVE.js");
5
5
  exports.callAllDowngrade = lazyUtils.callAllDowngrade;
6
6
  exports.callDowngrade = lazyUtils.callDowngrade;
7
7
  exports.fetchData = lazyUtils.fetchData;
@@ -1,24 +1,24 @@
1
- import "./index.esm-CPwSeCvw.mjs";
2
- import { G, H, f, J, I, u, k, n, e, m, B, y, i, q, j, t, h, z, s, w } from "./utils-dUgb9Jkm.mjs";
1
+ import "./logger-DwWkXsWl.mjs";
2
+ import { H, I, h, f, N, v, m, o, e, n, J, z, i, t, k, u, j, A, s, x } from "./utils-DGS4pYp8.mjs";
3
3
  export {
4
- G as callAllDowngrade,
5
- H as callDowngrade,
6
- f as fetchData,
7
- J as flushDataFetch,
8
- I as getDataFetchCache,
9
- u as getDataFetchIdWithErrorMsgs,
10
- k as getDataFetchInfo,
11
- n as getDataFetchItem,
4
+ H as callAllDowngrade,
5
+ I as callDowngrade,
6
+ h as fetchData,
7
+ f as flushDataFetch,
8
+ N as getDataFetchCache,
9
+ v as getDataFetchIdWithErrorMsgs,
10
+ m as getDataFetchInfo,
11
+ o as getDataFetchItem,
12
12
  e as getDataFetchMap,
13
- m as getDataFetchMapKey,
14
- B as getDowngradeTag,
15
- y as getLoadedRemoteInfos,
13
+ n as getDataFetchMapKey,
14
+ J as getDowngradeTag,
15
+ z as getLoadedRemoteInfos,
16
16
  i as initDataFetchMap,
17
- q as isCSROnly,
18
- j as isDataLoaderExpose,
19
- t as isServerEnv,
20
- h as loadDataFetchModule,
21
- z as setDataFetchItemLoadedStatus,
17
+ t as isCSROnly,
18
+ k as isDataLoaderExpose,
19
+ u as isServerEnv,
20
+ j as loadDataFetchModule,
21
+ A as setDataFetchItemLoadedStatus,
22
22
  s as setSSREnv,
23
- w as wrapDataFetchId
23
+ x as wrapDataFetchId
24
24
  };