@module-federation/bridge-react 2.0.0 → 2.1.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.
Files changed (44) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/base.cjs.js +4 -4
  3. package/dist/base.es.js +5 -5
  4. package/dist/{bridge-base-CIgEZf8X.mjs → bridge-base-B7EKIpJ7.mjs} +1 -1
  5. package/dist/{bridge-base-1Grpgans.js → bridge-base-BLno0Ytr.js} +1 -1
  6. package/dist/{createHelpers-C9qvVTND.mjs → createHelpers-4fOvXdyD.mjs} +2 -2
  7. package/dist/{createHelpers-2UBGLdcA.js → createHelpers-DVr-JIwn.js} +2 -2
  8. package/dist/data-fetch-server-middleware.cjs.js +4 -4
  9. package/dist/data-fetch-server-middleware.es.js +2 -2
  10. package/dist/data-fetch-utils.cjs.js +2 -2
  11. package/dist/data-fetch-utils.es.js +4 -4
  12. package/dist/{index-DyQNwY2M.mjs → index-CafhxM-l.mjs} +1 -1
  13. package/dist/{index-DRSBaSu3.js → index-Cmp3JjCw.js} +2 -2
  14. package/dist/index.cjs.js +5 -5
  15. package/dist/index.es.js +6 -6
  16. package/dist/{lazy-load-component-plugin-9KkACgWW.js → lazy-load-component-plugin-B0jL1C-H.js} +2 -2
  17. package/dist/{lazy-load-component-plugin-GtenP5tG.mjs → lazy-load-component-plugin-CXfIn_mH.mjs} +2 -2
  18. package/dist/lazy-load-component-plugin.cjs.js +2 -2
  19. package/dist/lazy-load-component-plugin.es.js +2 -2
  20. package/dist/lazy-utils.cjs.js +2 -2
  21. package/dist/lazy-utils.es.js +7 -7
  22. package/dist/logger-BWq2gts-.mjs +138 -0
  23. package/dist/logger-DT66A_Pv.js +137 -0
  24. package/dist/prefetch-CmkSilpl.mjs +861 -0
  25. package/dist/prefetch-CvCACzJH.js +860 -0
  26. package/dist/router-v5.cjs.js +1 -1
  27. package/dist/router-v5.es.js +1 -1
  28. package/dist/router-v6.cjs.js +1 -1
  29. package/dist/router-v6.es.js +1 -1
  30. package/dist/router-v7.cjs.js +1 -1
  31. package/dist/router-v7.es.js +1 -1
  32. package/dist/router.cjs.js +1 -1
  33. package/dist/router.es.js +1 -1
  34. package/dist/{utils-tM9yE73c.js → utils-BelRTG4G.js} +18 -4
  35. package/dist/{utils--qTri1IN.mjs → utils-DYUQLv_v.mjs} +21 -7
  36. package/dist/v18.cjs.js +1 -1
  37. package/dist/v18.es.js +1 -1
  38. package/dist/v19.cjs.js +1 -1
  39. package/dist/v19.es.js +1 -1
  40. package/package.json +6 -6
  41. package/dist/index.esm-BWaKho-8.js +0 -491
  42. package/dist/index.esm-CPwSeCvw.mjs +0 -492
  43. package/dist/prefetch-BvksZRMd.js +0 -1390
  44. package/dist/prefetch-Cj92jrl5.mjs +0 -1391
@@ -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-DRSBaSu3.js");
5
+ const index = require("./index-Cmp3JjCw.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-DyQNwY2M.mjs";
3
+ import { R as RouterContext, L as LoggerInstance } from "./index-CafhxM-l.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-DRSBaSu3.js");
5
+ const index = require("./index-Cmp3JjCw.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-DyQNwY2M.mjs";
3
+ import { R as RouterContext, L as LoggerInstance } from "./index-CafhxM-l.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-DRSBaSu3.js");
5
+ const index = require("./index-Cmp3JjCw.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-DyQNwY2M.mjs";
4
+ import { R as RouterContext, L as LoggerInstance } from "./index-CafhxM-l.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-DRSBaSu3.js");
5
+ const index = require("./index-Cmp3JjCw.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-DyQNwY2M.mjs";
4
+ import { R as RouterContext, L as LoggerInstance } from "./index-CafhxM-l.mjs";
5
5
  function WrapperRouter(props) {
6
6
  const { basename, ...propsRes } = props;
7
7
  const routerContextProps = useContext(RouterContext) || {};
@@ -19,7 +19,19 @@ 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-BWaKho-8.js");
22
+ const logger$1 = require("./logger-DT66A_Pv.js");
23
+ const LOG_CATEGORY = "[ Federation Runtime ]";
24
+ const composeKeyWithSeparator = function(...args) {
25
+ if (!args.length) return "";
26
+ return args.reduce((sum, cur) => {
27
+ if (!cur) return sum;
28
+ if (!sum) return cur;
29
+ return `${sum}${logger$1.SEPARATOR}${cur}`;
30
+ }, "");
31
+ };
32
+ const warn = (msg) => {
33
+ console.warn(`${LOG_CATEGORY}: ${msg}`);
34
+ };
23
35
  const PLUGIN_IDENTIFIER = "[ Module Federation React ]";
24
36
  const DOWNGRADE_KEY = "_mfSSRDowngrade";
25
37
  const DATA_FETCH_FUNCTION = "_mfDataFetch";
@@ -47,7 +59,7 @@ const DATA_FETCH_CLIENT_SUFFIX = ".client";
47
59
  const DATA_FETCH_QUERY = "x-mf-data-fetch";
48
60
  const DATA_FETCH_ERROR_PREFIX = "caught the following error during dataFetch: ";
49
61
  const LOAD_REMOTE_ERROR_PREFIX = "caught the following error during loadRemote: ";
50
- const logger = index_esm.createLogger(PLUGIN_IDENTIFIER);
62
+ const logger = logger$1.createLogger(PLUGIN_IDENTIFIER);
51
63
  const perf = typeof performance === "object" && performance && typeof performance.now === "function" ? performance : Date;
52
64
  const warned = /* @__PURE__ */ new Set();
53
65
  const PROCESS = typeof process === "object" && !!process ? process : {};
@@ -1803,7 +1815,7 @@ async function fetchData(id, params, remoteInfo) {
1803
1815
  _id: id
1804
1816
  });
1805
1817
  };
1806
- if (index_esm.isBrowserEnv()) {
1818
+ if (logger$1.isBrowserEnv()) {
1807
1819
  const dataFetchItem = getDataFetchItem(id);
1808
1820
  if (!dataFetchItem) {
1809
1821
  throw new Error(`dataFetchItem not found, id: ${id}`);
@@ -1839,7 +1851,7 @@ function getDataFetchMapKey(dataFetchInfo, hostInfo) {
1839
1851
  return;
1840
1852
  }
1841
1853
  const { dataFetchKey } = dataFetchInfo;
1842
- return index_esm.composeKeyWithSeparator(dataFetchKey, hostInfo.name, hostInfo.version);
1854
+ return composeKeyWithSeparator(dataFetchKey, hostInfo.name, hostInfo.version);
1843
1855
  }
1844
1856
  async function loadDataFetchModule(instance, id) {
1845
1857
  return instance.loadRemote(id).then((m) => {
@@ -1991,6 +2003,7 @@ exports.cache = cache;
1991
2003
  exports.callAllDowngrade = callAllDowngrade;
1992
2004
  exports.callDowngrade = callDowngrade;
1993
2005
  exports.clearStore = clearStore;
2006
+ exports.composeKeyWithSeparator = composeKeyWithSeparator;
1994
2007
  exports.configureCache = configureCache;
1995
2008
  exports.fetchData = fetchData;
1996
2009
  exports.flushDataFetch = flushDataFetch;
@@ -2012,4 +2025,5 @@ exports.logger = logger;
2012
2025
  exports.revalidateTag = revalidateTag;
2013
2026
  exports.setDataFetchItemLoadedStatus = setDataFetchItemLoadedStatus;
2014
2027
  exports.setSSREnv = setSSREnv;
2028
+ exports.warn = warn;
2015
2029
  exports.wrapDataFetchId = wrapDataFetchId;
@@ -18,7 +18,19 @@ 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-CPwSeCvw.mjs";
21
+ import { S as SEPARATOR, c as createLogger, i as isBrowserEnv } from "./logger-BWq2gts-.mjs";
22
+ const LOG_CATEGORY = "[ Federation Runtime ]";
23
+ const composeKeyWithSeparator = function(...args) {
24
+ if (!args.length) return "";
25
+ return args.reduce((sum, cur) => {
26
+ if (!cur) return sum;
27
+ if (!sum) return cur;
28
+ return `${sum}${SEPARATOR}${cur}`;
29
+ }, "");
30
+ };
31
+ const warn = (msg) => {
32
+ console.warn(`${LOG_CATEGORY}: ${msg}`);
33
+ };
22
34
  const PLUGIN_IDENTIFIER = "[ Module Federation React ]";
23
35
  const DOWNGRADE_KEY = "_mfSSRDowngrade";
24
36
  const DATA_FETCH_FUNCTION = "_mfDataFetch";
@@ -1975,18 +1987,20 @@ function getLoadedRemoteInfos(id, instance) {
1975
1987
  };
1976
1988
  }
1977
1989
  export {
1978
- DOWNGRADE_KEY as A,
1979
- callAllDowngrade as B,
1990
+ warn as A,
1991
+ DOWNGRADE_KEY as B,
1980
1992
  CacheSize as C,
1981
1993
  DATA_FETCH_QUERY as D,
1982
1994
  ERROR_TYPE as E,
1983
1995
  FS_HREF as F,
1984
- callDowngrade as G,
1985
- getDowngradeTag as H,
1986
- flushDataFetch as I,
1987
- getDataFetchCache as J,
1996
+ callAllDowngrade as G,
1997
+ callDowngrade as H,
1998
+ getDowngradeTag as I,
1999
+ composeKeyWithSeparator as J,
2000
+ flushDataFetch as K,
1988
2001
  LOAD_REMOTE_ERROR_PREFIX as L,
1989
2002
  MF_DATA_FETCH_STATUS as M,
2003
+ getDataFetchCache as N,
1990
2004
  CacheTime as a,
1991
2005
  clearStore as b,
1992
2006
  cache as c,
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-1Grpgans.js");
4
+ const bridgeBase = require("./bridge-base-BLno0Ytr.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-CIgEZf8X.mjs";
2
+ import { c as createBaseBridgeComponent } from "./bridge-base-B7EKIpJ7.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-1Grpgans.js");
4
+ const bridgeBase = require("./bridge-base-BLno0Ytr.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-CIgEZf8X.mjs";
2
+ import { c as createBaseBridgeComponent } from "./bridge-base-B7EKIpJ7.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": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "sideEffects": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -129,8 +129,8 @@
129
129
  "dependencies": {
130
130
  "react-error-boundary": "^4.1.2",
131
131
  "lru-cache": "^10.4.3",
132
- "@module-federation/bridge-shared": "2.0.0",
133
- "@module-federation/sdk": "2.0.0"
132
+ "@module-federation/bridge-shared": "2.1.0",
133
+ "@module-federation/sdk": "2.1.0"
134
134
  },
135
135
  "peerDependencies": {
136
136
  "react": ">=16.9.0",
@@ -161,9 +161,9 @@
161
161
  "typescript": "^5.2.2",
162
162
  "vite": "^5.4.21",
163
163
  "vite-plugin-dts": "^4.3.0",
164
- "hono": "4.11.7",
165
- "@module-federation/runtime-core": "2.0.0",
166
- "@module-federation/runtime": "2.0.0"
164
+ "hono": "4.11.10",
165
+ "@module-federation/runtime": "2.1.0",
166
+ "@module-federation/runtime-core": "2.1.0"
167
167
  },
168
168
  "scripts": {
169
169
  "dev": "vite",