@module-federation/bridge-react 2.0.1 → 2.2.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 (48) hide show
  1. package/.turbo/turbo-build.log +85 -0
  2. package/CHANGELOG.md +22 -3
  3. package/dist/base.cjs.js +4 -4
  4. package/dist/base.es.js +5 -5
  5. package/dist/{bridge-base-BVX0EbsV.mjs → bridge-base-EnVXD4Hr.mjs} +1 -1
  6. package/dist/{bridge-base-vSCG9ebE.js → bridge-base-IlvdqYIj.js} +1 -1
  7. package/dist/{createHelpers-12yCVhCu.js → createHelpers-9B0ttrN_.js} +2 -2
  8. package/dist/{createHelpers-CGhHhtAd.mjs → createHelpers-D77sECmY.mjs} +2 -2
  9. package/dist/data-fetch-server-middleware.cjs.js +4 -4
  10. package/dist/data-fetch-server-middleware.es.js +2 -2
  11. package/dist/data-fetch-utils.cjs.js +2 -2
  12. package/dist/data-fetch-utils.es.js +4 -4
  13. package/dist/{index-DtXhorFI.mjs → index-Bs2NxD2z.mjs} +1 -1
  14. package/dist/{index-DhFNWacm.js → index-DbjGCKOr.js} +2 -2
  15. package/dist/index.cjs.js +5 -5
  16. package/dist/index.es.js +6 -6
  17. package/dist/{lazy-load-component-plugin-C7jasFos.js → lazy-load-component-plugin-0-2dETvt.js} +2 -2
  18. package/dist/{lazy-load-component-plugin-CrSLH5YP.mjs → lazy-load-component-plugin-ChXiUL6x.mjs} +2 -2
  19. package/dist/lazy-load-component-plugin.cjs.js +2 -2
  20. package/dist/lazy-load-component-plugin.es.js +2 -2
  21. package/dist/lazy-utils.cjs.js +2 -2
  22. package/dist/lazy-utils.es.js +7 -7
  23. package/dist/logger-DwWkXsWl.mjs +139 -0
  24. package/dist/logger-Dxblx6P-.js +138 -0
  25. package/dist/prefetch-BIuiJePI.js +884 -0
  26. package/dist/prefetch-DLfc6h__.mjs +885 -0
  27. package/dist/router-v5.cjs.js +1 -1
  28. package/dist/router-v5.es.js +1 -1
  29. package/dist/router-v6.cjs.js +1 -1
  30. package/dist/router-v6.es.js +1 -1
  31. package/dist/router-v7.cjs.js +1 -1
  32. package/dist/router-v7.es.js +1 -1
  33. package/dist/router.cjs.js +1 -1
  34. package/dist/router.es.js +1 -1
  35. package/dist/{utils-TDonIHDD.js → utils-CFTy4LVE.js} +18 -4
  36. package/dist/{utils-DpoLOH_j.mjs → utils-D4k5eixv.mjs} +22 -8
  37. package/dist/v18.cjs.js +1 -1
  38. package/dist/v18.es.js +1 -1
  39. package/dist/v19.cjs.js +1 -1
  40. package/dist/v19.es.js +1 -1
  41. package/package.json +8 -7
  42. package/src/lazy/utils.ts +5 -2
  43. package/vitest.config.ts +2 -2
  44. package/dist/index.esm-BvTtsZnu.mjs +0 -491
  45. package/dist/index.esm-CYiGJfQW.js +0 -490
  46. package/dist/prefetch-CFRpPfZQ.js +0 -632
  47. package/dist/prefetch-DMJyBeIs.mjs +0 -633
  48. package/project.json +0 -23
@@ -0,0 +1,85 @@
1
+
2
+ > @module-federation/bridge-react@2.2.0 build /home/runner/work/core/core/packages/bridge/bridge-react
3
+ > vite build
4
+
5
+ The CJS build of Vite's Node API is deprecated. See https://vite.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.
6
+ vite v5.4.21 building for production...
7
+ transforming...
8
+ ../../../node_modules/.pnpm/react-error-boundary@4.1.2_react@18.3.1/node_modules/react-error-boundary/dist/react-error-boundary.esm.js (1:0): Module level directives cause errors when bundled, "use client" in "../../../node_modules/.pnpm/react-error-boundary@4.1.2_react@18.3.1/node_modules/react-error-boundary/dist/react-error-boundary.esm.js" was ignored.
9
+ ✓ 98 modules transformed.
10
+ Entry module "src/provider/plugin.ts" is using named and default exports together. Consumers of your bundle will have to use `chunk.default` to access the default export, which may not be what you want. Use `output.exports: "named"` to disable this warning.
11
+ Entry module "src/plugins/lazy-load-component-plugin.ts" is using named and default exports together. Consumers of your bundle will have to use `chunk.default` to access the default export, which may not be what you want. Use `output.exports: "named"` to disable this warning.
12
+ rendering chunks...
13
+ 
14
+ [vite:dts] Start generate declaration files...
15
+ computing gzip size...
16
+ dist/lazy-load-component-plugin.cjs.js  0.39 kB │ gzip: 0.23 kB
17
+ dist/plugin.cjs.js  0.43 kB │ gzip: 0.27 kB
18
+ dist/v18.cjs.js  0.54 kB │ gzip: 0.29 kB
19
+ dist/v19.cjs.js  0.54 kB │ gzip: 0.29 kB
20
+ dist/data-fetch-utils.cjs.js  0.87 kB │ gzip: 0.41 kB
21
+ dist/index-DbjGCKOr.js  1.22 kB │ gzip: 0.53 kB
22
+ dist/lazy-utils.cjs.js  1.27 kB │ gzip: 0.40 kB
23
+ dist/base.cjs.js  1.58 kB │ gzip: 0.51 kB
24
+ dist/router-v5.cjs.js  1.98 kB │ gzip: 0.73 kB
25
+ dist/router.cjs.js  3.13 kB │ gzip: 0.90 kB
26
+ dist/router-v7.cjs.js  3.27 kB │ gzip: 0.95 kB
27
+ dist/router-v6.cjs.js  3.28 kB │ gzip: 0.95 kB
28
+ dist/logger-Dxblx6P-.js  3.78 kB │ gzip: 1.22 kB
29
+ dist/index.cjs.js  5.25 kB │ gzip: 1.51 kB
30
+ dist/data-fetch-server-middleware.cjs.js  5.79 kB │ gzip: 1.73 kB
31
+ dist/createHelpers-9B0ttrN_.js  7.32 kB │ gzip: 1.95 kB
32
+ dist/bridge-base-IlvdqYIj.js  7.70 kB │ gzip: 2.11 kB
33
+ dist/lazy-load-component-plugin-0-2dETvt.js 17.65 kB │ gzip: 4.20 kB
34
+ dist/prefetch-BIuiJePI.js 31.61 kB │ gzip: 7.73 kB
35
+ dist/utils-CFTy4LVE.js 72.53 kB │ gzip: 15.19 kB
36
+ [vite:dts] Start rollup declaration files...
37
+ Analysis will use the bundled TypeScript version 5.8.2
38
+ *** The target project appears to use TypeScript 5.9.3 which is newer than the bundled compiler engine; consider upgrading API Extractor.
39
+ Analysis will use the bundled TypeScript version 5.8.2
40
+ *** The target project appears to use TypeScript 5.9.3 which is newer than the bundled compiler engine; consider upgrading API Extractor.
41
+ Analysis will use the bundled TypeScript version 5.8.2
42
+ *** The target project appears to use TypeScript 5.9.3 which is newer than the bundled compiler engine; consider upgrading API Extractor.
43
+ Analysis will use the bundled TypeScript version 5.8.2
44
+ *** The target project appears to use TypeScript 5.9.3 which is newer than the bundled compiler engine; consider upgrading API Extractor.
45
+ Analysis will use the bundled TypeScript version 5.8.2
46
+ *** The target project appears to use TypeScript 5.9.3 which is newer than the bundled compiler engine; consider upgrading API Extractor.
47
+ Analysis will use the bundled TypeScript version 5.8.2
48
+ *** The target project appears to use TypeScript 5.9.3 which is newer than the bundled compiler engine; consider upgrading API Extractor.
49
+ Analysis will use the bundled TypeScript version 5.8.2
50
+ *** The target project appears to use TypeScript 5.9.3 which is newer than the bundled compiler engine; consider upgrading API Extractor.
51
+ Analysis will use the bundled TypeScript version 5.8.2
52
+ *** The target project appears to use TypeScript 5.9.3 which is newer than the bundled compiler engine; consider upgrading API Extractor.
53
+ Analysis will use the bundled TypeScript version 5.8.2
54
+ *** The target project appears to use TypeScript 5.9.3 which is newer than the bundled compiler engine; consider upgrading API Extractor.
55
+ Analysis will use the bundled TypeScript version 5.8.2
56
+ *** The target project appears to use TypeScript 5.9.3 which is newer than the bundled compiler engine; consider upgrading API Extractor.
57
+ Analysis will use the bundled TypeScript version 5.8.2
58
+ *** The target project appears to use TypeScript 5.9.3 which is newer than the bundled compiler engine; consider upgrading API Extractor.
59
+ Analysis will use the bundled TypeScript version 5.8.2
60
+ *** The target project appears to use TypeScript 5.9.3 which is newer than the bundled compiler engine; consider upgrading API Extractor.
61
+ Analysis will use the bundled TypeScript version 5.8.2
62
+ *** The target project appears to use TypeScript 5.9.3 which is newer than the bundled compiler engine; consider upgrading API Extractor.
63
+ [vite:dts] Declaration files built in 46107ms.
64
+ 
65
+ dist/lazy-load-component-plugin.es.js  0.17 kB │ gzip: 0.15 kB
66
+ dist/plugin.es.js  0.29 kB │ gzip: 0.18 kB
67
+ dist/v18.es.js  0.44 kB │ gzip: 0.23 kB
68
+ dist/v19.es.js  0.44 kB │ gzip: 0.23 kB
69
+ dist/lazy-utils.es.js  0.64 kB │ gzip: 0.34 kB
70
+ dist/data-fetch-utils.es.js  0.68 kB │ gzip: 0.35 kB
71
+ dist/base.es.js  1.07 kB │ gzip: 0.46 kB
72
+ dist/index-Bs2NxD2z.mjs  1.16 kB │ gzip: 0.54 kB
73
+ dist/router-v5.es.js  1.18 kB │ gzip: 0.45 kB
74
+ dist/router.es.js  2.35 kB │ gzip: 0.63 kB
75
+ dist/router-v6.es.js  2.45 kB │ gzip: 0.67 kB
76
+ dist/router-v7.es.js  2.52 kB │ gzip: 0.69 kB
77
+ dist/logger-DwWkXsWl.mjs  3.71 kB │ gzip: 1.22 kB
78
+ dist/index.es.js  4.23 kB │ gzip: 1.33 kB
79
+ dist/data-fetch-server-middleware.es.js  5.73 kB │ gzip: 1.76 kB
80
+ dist/bridge-base-EnVXD4Hr.mjs  7.11 kB │ gzip: 1.92 kB
81
+ dist/createHelpers-D77sECmY.mjs  7.27 kB │ gzip: 1.96 kB
82
+ dist/lazy-load-component-plugin-ChXiUL6x.mjs 17.79 kB │ gzip: 4.33 kB
83
+ dist/prefetch-DLfc6h__.mjs 31.63 kB │ gzip: 7.80 kB
84
+ dist/utils-D4k5eixv.mjs 71.78 kB │ gzip: 15.18 kB
85
+ ✓ built in 48.42s
package/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # @module-federation/bridge-react
2
2
 
3
+ ## 2.2.0
4
+
5
+ ### Patch Changes
6
+
7
+ - c856ec1: Add `isBrowserEnvValue` as a tree-shakable ENV_TARGET-aware constant while
8
+ preserving the `isBrowserEnv()` function. Internal runtime and bridge callers
9
+ use the constant to enable bundler dead-code elimination without breaking the
10
+ public API.
11
+ - Updated dependencies [c856ec1]
12
+ - Updated dependencies [12240bb]
13
+ - Updated dependencies [e5dd6ef]
14
+ - @module-federation/sdk@2.2.0
15
+ - @module-federation/bridge-shared@2.2.0
16
+
17
+ ## 2.1.0
18
+
19
+ ### Patch Changes
20
+
21
+ - Updated dependencies [918294f]
22
+ - @module-federation/sdk@2.1.0
23
+ - @module-federation/bridge-shared@2.1.0
24
+
3
25
  ## 2.0.1
4
26
 
5
27
  ### Patch Changes
@@ -88,7 +110,6 @@
88
110
  - dc103ee: fix: support React Router v6 in peer dependencies
89
111
 
90
112
  Update react-router peer dependency from "^7" to "^6 || ^7" to fix npm install failures for projects using React Router v6.
91
-
92
113
  - @module-federation/sdk@0.21.2
93
114
  - @module-federation/bridge-shared@0.21.2
94
115
 
@@ -182,7 +203,6 @@
182
203
 
183
204
  - 65aa038: chore(bridge-react): set sideEffects false
184
205
  - a7cf276: chore: upgrade NX to 21.2.3, Storybook to 9.0.9, and TypeScript to 5.8.3
185
-
186
206
  - Upgraded NX from 21.0.3 to 21.2.3 with workspace configuration updates
187
207
  - Migrated Storybook from 8.3.5 to 9.0.9 with updated configurations and automigrations
188
208
  - Upgraded TypeScript from 5.7.3 to 5.8.3 with compatibility fixes
@@ -191,7 +211,6 @@
191
211
  - Updated build configurations and dependencies to support latest versions
192
212
 
193
213
  - d31a326: refactor: sink React packages from root to individual packages
194
-
195
214
  - Removed React dependencies from root package.json and moved them to packages that actually need them
196
215
  - Fixed rsbuild-plugin configuration to match workspace patterns
197
216
  - Updated tests to handle platform-specific files
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-12yCVhCu.js");
4
- const lazyLoadComponentPlugin = require("./lazy-load-component-plugin-C7jasFos.js");
5
- const lazyUtils = require("./utils-TDonIHDD.js");
3
+ const createHelpers = require("./createHelpers-9B0ttrN_.js");
4
+ const lazyLoadComponentPlugin = require("./lazy-load-component-plugin-0-2dETvt.js");
5
+ const lazyUtils = require("./utils-CFTy4LVE.js");
6
6
  const dataFetchUtils = require("./data-fetch-utils.cjs.js");
7
- const prefetch = require("./prefetch-CFRpPfZQ.js");
7
+ const prefetch = require("./prefetch-BIuiJePI.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-CGhHhtAd.mjs";
2
- import { b } from "./createHelpers-CGhHhtAd.mjs";
3
- import { a, c, b as b2, l } from "./lazy-load-component-plugin-CrSLH5YP.mjs";
4
- import { C, a as a2, E, c as c2, b as b3, d, g, r, s } from "./utils-DpoLOH_j.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-ChXiUL6x.mjs";
4
+ import { C, a as a2, E, c as c2, b as b3, d, g, r, s } from "./utils-D4k5eixv.mjs";
5
5
  import { callDataFetch } from "./data-fetch-utils.es.js";
6
- import { p } from "./prefetch-DMJyBeIs.mjs";
6
+ import { p } from "./prefetch-DLfc6h__.mjs";
7
7
  const createRemoteAppComponent = createRemoteAppComponentFactory(RemoteAppWrapper);
8
8
  const createRemoteComponent = createDeprecatedRemoteComponentFactory(
9
9
  createRemoteAppComponent
@@ -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-DtXhorFI.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 = {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  const React = require("react");
3
- const index = require("./index-DhFNWacm.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" } });
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
- const bridgeBase = require("./bridge-base-vSCG9ebE.js");
2
+ const bridgeBase = require("./bridge-base-IlvdqYIj.js");
3
3
  const ReactDOM = require("react-dom");
4
- const index = require("./index-DhFNWacm.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) {
@@ -1,6 +1,6 @@
1
- import { c as createBaseBridgeComponent, E as ErrorBoundary } from "./bridge-base-BVX0EbsV.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-DtXhorFI.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) {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
- const lazyUtils = require("./utils-TDonIHDD.js");
3
- const index_esm = require("./index.esm-CYiGJfQW.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-DpoLOH_j.mjs";
2
- import { M as MANIFEST_EXT, S as SEPARATOR } from "./index.esm-BvTtsZnu.mjs";
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-D4k5eixv.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-TDonIHDD.js");
4
- const prefetch = require("./prefetch-CFRpPfZQ.js");
3
+ const lazyUtils = require("./utils-CFTy4LVE.js");
4
+ const prefetch = require("./prefetch-BIuiJePI.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-DpoLOH_j.mjs";
2
- import { C, a, c, b, d, g, r } from "./utils-DpoLOH_j.mjs";
3
- import { d as dataFetchFunction } from "./prefetch-DMJyBeIs.mjs";
4
- import { i, p } from "./prefetch-DMJyBeIs.mjs";
1
+ import { x as DATA_FETCH_FUNCTION } from "./utils-D4k5eixv.mjs";
2
+ import { C, a, c, b, d, g, r } from "./utils-D4k5eixv.mjs";
3
+ import { d as dataFetchFunction } from "./prefetch-DLfc6h__.mjs";
4
+ import { i, p } from "./prefetch-DLfc6h__.mjs";
5
5
  async function callDataFetch() {
6
6
  const dataFetch = globalThis[DATA_FETCH_FUNCTION];
7
7
  if (dataFetch) {
@@ -1,5 +1,5 @@
1
1
  import React__default from "react";
2
- import { c as createLogger } from "./index.esm-BvTtsZnu.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-CYiGJfQW.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-12yCVhCu.js");
4
- const lazyLoadComponentPlugin = require("./lazy-load-component-plugin-C7jasFos.js");
5
- const lazyUtils = require("./utils-TDonIHDD.js");
3
+ const createHelpers = require("./createHelpers-9B0ttrN_.js");
4
+ const lazyLoadComponentPlugin = require("./lazy-load-component-plugin-0-2dETvt.js");
5
+ const lazyUtils = require("./utils-CFTy4LVE.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
- const index = require("./index-DhFNWacm.js");
10
- const prefetch = require("./prefetch-CFRpPfZQ.js");
9
+ const index = require("./index-DbjGCKOr.js");
10
+ const prefetch = require("./prefetch-BIuiJePI.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 createRemoteAppComponentFactory, a as createDeprecatedRemoteComponentFactory } from "./createHelpers-CGhHhtAd.mjs";
2
- import { b } from "./createHelpers-CGhHhtAd.mjs";
3
- import { a, c, b as b2, l } from "./lazy-load-component-plugin-CrSLH5YP.mjs";
4
- import { C, a as a2, E, c as c2, b as b3, d, g, r, s } from "./utils-DpoLOH_j.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-ChXiUL6x.mjs";
4
+ import { C, a as a2, E, c as c2, b as b3, d, g, r, s } from "./utils-D4k5eixv.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
- import { p as pathJoin, L as LoggerInstance } from "./index-DtXhorFI.mjs";
9
- import { p } from "./prefetch-DMJyBeIs.mjs";
8
+ import { p as pathJoin, L as LoggerInstance } from "./index-Bs2NxD2z.mjs";
9
+ import { p } from "./prefetch-DLfc6h__.mjs";
10
10
  function e() {
11
11
  const t = new PopStateEvent("popstate", { state: window.history.state });
12
12
  window.dispatchEvent(t);
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
- const prefetch = require("./prefetch-CFRpPfZQ.js");
3
- const lazyUtils = require("./utils-TDonIHDD.js");
2
+ const prefetch = require("./prefetch-BIuiJePI.js");
3
+ const lazyUtils = require("./utils-CFTy4LVE.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-DMJyBeIs.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, M as MF_DATA_FETCH_STATUS, h as loadDataFetchModule, 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-DpoLOH_j.mjs";
1
+ import { i as injectDataFetch, p as prefetch } from "./prefetch-DLfc6h__.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, M as MF_DATA_FETCH_STATUS, h as loadDataFetchModule, 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-D4k5eixv.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-C7jasFos.js");
4
- require("./prefetch-CFRpPfZQ.js");
3
+ const lazyLoadComponentPlugin = require("./lazy-load-component-plugin-0-2dETvt.js");
4
+ require("./prefetch-BIuiJePI.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-CrSLH5YP.mjs";
2
- import "./prefetch-DMJyBeIs.mjs";
1
+ import { l, l as l2 } from "./lazy-load-component-plugin-ChXiUL6x.mjs";
2
+ import "./prefetch-DLfc6h__.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-CYiGJfQW.js");
4
- const lazyUtils = require("./utils-TDonIHDD.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,17 +1,17 @@
1
- import "./index.esm-BvTtsZnu.mjs";
2
- import { B, G, f, I, J, u, k, n, e, m, H, y, i, q, j, t, h, z, s, w } from "./utils-DpoLOH_j.mjs";
1
+ import "./logger-DwWkXsWl.mjs";
2
+ import { G, H, f, K, N, u, k, n, e, m, I, y, i, q, j, t, h, z, s, w } from "./utils-D4k5eixv.mjs";
3
3
  export {
4
- B as callAllDowngrade,
5
- G as callDowngrade,
4
+ G as callAllDowngrade,
5
+ H as callDowngrade,
6
6
  f as fetchData,
7
- I as flushDataFetch,
8
- J as getDataFetchCache,
7
+ K as flushDataFetch,
8
+ N as getDataFetchCache,
9
9
  u as getDataFetchIdWithErrorMsgs,
10
10
  k as getDataFetchInfo,
11
11
  n as getDataFetchItem,
12
12
  e as getDataFetchMap,
13
13
  m as getDataFetchMapKey,
14
- H as getDowngradeTag,
14
+ I as getDowngradeTag,
15
15
  y as getLoadedRemoteInfos,
16
16
  i as initDataFetchMap,
17
17
  q as isCSROnly,
@@ -0,0 +1,139 @@
1
+ const MANIFEST_EXT = ".json";
2
+ const BROWSER_LOG_KEY = "FEDERATION_DEBUG";
3
+ const SEPARATOR = ":";
4
+ const isBrowserEnvValue = typeof ENV_TARGET !== "undefined" ? ENV_TARGET === "web" : typeof window !== "undefined" && typeof window.document !== "undefined";
5
+ function isBrowserEnv() {
6
+ return isBrowserEnvValue;
7
+ }
8
+ function isBrowserDebug() {
9
+ try {
10
+ if (isBrowserEnv() && window.localStorage) return Boolean(localStorage.getItem(BROWSER_LOG_KEY));
11
+ } catch (error) {
12
+ return false;
13
+ }
14
+ return false;
15
+ }
16
+ function isDebugMode() {
17
+ if (typeof process !== "undefined" && process.env && process.env["FEDERATION_DEBUG"]) return Boolean(process.env["FEDERATION_DEBUG"]);
18
+ if (typeof FEDERATION_DEBUG !== "undefined" && Boolean(FEDERATION_DEBUG)) return true;
19
+ return isBrowserDebug();
20
+ }
21
+ const PREFIX = "[ Module Federation ]";
22
+ const DEFAULT_DELEGATE = console;
23
+ const LOGGER_STACK_SKIP_TOKENS = [
24
+ "logger.ts",
25
+ "logger.js",
26
+ "captureStackTrace",
27
+ "Logger.emit",
28
+ "Logger.log",
29
+ "Logger.info",
30
+ "Logger.warn",
31
+ "Logger.error",
32
+ "Logger.debug"
33
+ ];
34
+ function captureStackTrace() {
35
+ try {
36
+ const stack = (/* @__PURE__ */ new Error()).stack;
37
+ if (!stack) return;
38
+ const [, ...rawLines] = stack.split("\n");
39
+ const filtered = rawLines.filter((line) => !LOGGER_STACK_SKIP_TOKENS.some((token) => line.includes(token)));
40
+ if (!filtered.length) return;
41
+ return `Stack trace:
42
+ ${filtered.slice(0, 5).join("\n")}`;
43
+ } catch {
44
+ return;
45
+ }
46
+ }
47
+ var Logger = class {
48
+ constructor(prefix, delegate = DEFAULT_DELEGATE) {
49
+ this.prefix = prefix;
50
+ this.delegate = delegate ?? DEFAULT_DELEGATE;
51
+ }
52
+ setPrefix(prefix) {
53
+ this.prefix = prefix;
54
+ }
55
+ setDelegate(delegate) {
56
+ this.delegate = delegate ?? DEFAULT_DELEGATE;
57
+ }
58
+ emit(method, args) {
59
+ const delegate = this.delegate;
60
+ const stackTrace = isDebugMode() ? captureStackTrace() : void 0;
61
+ const enrichedArgs = stackTrace ? [...args, stackTrace] : args;
62
+ const order = (() => {
63
+ switch (method) {
64
+ case "log":
65
+ return ["log", "info"];
66
+ case "info":
67
+ return ["info", "log"];
68
+ case "warn":
69
+ return [
70
+ "warn",
71
+ "info",
72
+ "log"
73
+ ];
74
+ case "error":
75
+ return [
76
+ "error",
77
+ "warn",
78
+ "log"
79
+ ];
80
+ default:
81
+ return ["debug", "log"];
82
+ }
83
+ })();
84
+ for (const candidate of order) {
85
+ const handler = delegate[candidate];
86
+ if (typeof handler === "function") {
87
+ handler.call(delegate, this.prefix, ...enrichedArgs);
88
+ return;
89
+ }
90
+ }
91
+ for (const candidate of order) {
92
+ const handler = DEFAULT_DELEGATE[candidate];
93
+ if (typeof handler === "function") {
94
+ handler.call(DEFAULT_DELEGATE, this.prefix, ...enrichedArgs);
95
+ return;
96
+ }
97
+ }
98
+ }
99
+ log(...args) {
100
+ this.emit("log", args);
101
+ }
102
+ warn(...args) {
103
+ this.emit("warn", args);
104
+ }
105
+ error(...args) {
106
+ this.emit("error", args);
107
+ }
108
+ success(...args) {
109
+ this.emit("info", args);
110
+ }
111
+ info(...args) {
112
+ this.emit("info", args);
113
+ }
114
+ ready(...args) {
115
+ this.emit("info", args);
116
+ }
117
+ debug(...args) {
118
+ if (isDebugMode()) this.emit("debug", args);
119
+ }
120
+ };
121
+ function createLogger(prefix) {
122
+ return new Logger(prefix);
123
+ }
124
+ function createInfrastructureLogger(prefix) {
125
+ const infrastructureLogger = new Logger(prefix);
126
+ Object.defineProperty(infrastructureLogger, "__mf_infrastructure_logger__", {
127
+ value: true,
128
+ enumerable: false,
129
+ configurable: false
130
+ });
131
+ return infrastructureLogger;
132
+ }
133
+ createInfrastructureLogger(PREFIX);
134
+ export {
135
+ MANIFEST_EXT as M,
136
+ SEPARATOR as S,
137
+ createLogger as c,
138
+ isBrowserEnvValue as i
139
+ };