@module-federation/bridge-react 2.1.0 → 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 (44) hide show
  1. package/.turbo/turbo-build.log +85 -0
  2. package/CHANGELOG.md +14 -3
  3. package/dist/base.cjs.js +4 -4
  4. package/dist/base.es.js +5 -5
  5. package/dist/{bridge-base-B7EKIpJ7.mjs → bridge-base-EnVXD4Hr.mjs} +1 -1
  6. package/dist/{bridge-base-BLno0Ytr.js → bridge-base-IlvdqYIj.js} +1 -1
  7. package/dist/{createHelpers-DVr-JIwn.js → createHelpers-9B0ttrN_.js} +2 -2
  8. package/dist/{createHelpers-4fOvXdyD.mjs → createHelpers-D77sECmY.mjs} +2 -2
  9. package/dist/data-fetch-server-middleware.cjs.js +2 -2
  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-CafhxM-l.mjs → index-Bs2NxD2z.mjs} +1 -1
  14. package/dist/{index-Cmp3JjCw.js → index-DbjGCKOr.js} +1 -1
  15. package/dist/index.cjs.js +5 -5
  16. package/dist/index.es.js +6 -6
  17. package/dist/{lazy-load-component-plugin-B0jL1C-H.js → lazy-load-component-plugin-0-2dETvt.js} +2 -2
  18. package/dist/{lazy-load-component-plugin-CXfIn_mH.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 +2 -2
  23. package/dist/{logger-BWq2gts-.mjs → logger-DwWkXsWl.mjs} +3 -2
  24. package/dist/{logger-DT66A_Pv.js → logger-Dxblx6P-.js} +3 -2
  25. package/dist/{prefetch-CvCACzJH.js → prefetch-BIuiJePI.js} +56 -32
  26. package/dist/{prefetch-CmkSilpl.mjs → prefetch-DLfc6h__.mjs} +56 -32
  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-BelRTG4G.js → utils-CFTy4LVE.js} +2 -2
  36. package/dist/{utils-DYUQLv_v.mjs → utils-D4k5eixv.mjs} +2 -2
  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/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,19 @@
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
+
3
17
  ## 2.1.0
4
18
 
5
19
  ### Patch Changes
@@ -96,7 +110,6 @@
96
110
  - dc103ee: fix: support React Router v6 in peer dependencies
97
111
 
98
112
  Update react-router peer dependency from "^7" to "^6 || ^7" to fix npm install failures for projects using React Router v6.
99
-
100
113
  - @module-federation/sdk@0.21.2
101
114
  - @module-federation/bridge-shared@0.21.2
102
115
 
@@ -190,7 +203,6 @@
190
203
 
191
204
  - 65aa038: chore(bridge-react): set sideEffects false
192
205
  - a7cf276: chore: upgrade NX to 21.2.3, Storybook to 9.0.9, and TypeScript to 5.8.3
193
-
194
206
  - Upgraded NX from 21.0.3 to 21.2.3 with workspace configuration updates
195
207
  - Migrated Storybook from 8.3.5 to 9.0.9 with updated configurations and automigrations
196
208
  - Upgraded TypeScript from 5.7.3 to 5.8.3 with compatibility fixes
@@ -199,7 +211,6 @@
199
211
  - Updated build configurations and dependencies to support latest versions
200
212
 
201
213
  - d31a326: refactor: sink React packages from root to individual packages
202
-
203
214
  - Removed React dependencies from root package.json and moved them to packages that actually need them
204
215
  - Fixed rsbuild-plugin configuration to match workspace patterns
205
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-DVr-JIwn.js");
4
- const lazyLoadComponentPlugin = require("./lazy-load-component-plugin-B0jL1C-H.js");
5
- const lazyUtils = require("./utils-BelRTG4G.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-CvCACzJH.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-4fOvXdyD.mjs";
2
- import { b } from "./createHelpers-4fOvXdyD.mjs";
3
- import { a, c, b as b2, l } from "./lazy-load-component-plugin-CXfIn_mH.mjs";
4
- import { C, a as a2, E, c as c2, b as b3, d, g, r, s } from "./utils-DYUQLv_v.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-CmkSilpl.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-CafhxM-l.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-Cmp3JjCw.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-BLno0Ytr.js");
2
+ const bridgeBase = require("./bridge-base-IlvdqYIj.js");
3
3
  const ReactDOM = require("react-dom");
4
- const index = require("./index-Cmp3JjCw.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-B7EKIpJ7.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-CafhxM-l.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-BelRTG4G.js");
3
- const logger = require("./logger-DT66A_Pv.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) => {
@@ -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-DYUQLv_v.mjs";
2
- import { M as MANIFEST_EXT, S as SEPARATOR } from "./logger-BWq2gts-.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-BelRTG4G.js");
4
- const prefetch = require("./prefetch-CvCACzJH.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-DYUQLv_v.mjs";
2
- import { C, a, c, b, d, g, r } from "./utils-DYUQLv_v.mjs";
3
- import { d as dataFetchFunction } from "./prefetch-CmkSilpl.mjs";
4
- import { i, p } from "./prefetch-CmkSilpl.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 "./logger-BWq2gts-.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,6 +1,6 @@
1
1
  "use strict";
2
2
  const React = require("react");
3
- const logger = require("./logger-DT66A_Pv.js");
3
+ const logger = require("./logger-Dxblx6P-.js");
4
4
  const RouterContext = React.createContext(null);
5
5
  const LoggerInstance = logger.createLogger(
6
6
  "[ Module Federation Bridge React ]"
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-DVr-JIwn.js");
4
- const lazyLoadComponentPlugin = require("./lazy-load-component-plugin-B0jL1C-H.js");
5
- const lazyUtils = require("./utils-BelRTG4G.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-Cmp3JjCw.js");
10
- const prefetch = require("./prefetch-CvCACzJH.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-4fOvXdyD.mjs";
2
- import { b } from "./createHelpers-4fOvXdyD.mjs";
3
- import { a, c, b as b2, l } from "./lazy-load-component-plugin-CXfIn_mH.mjs";
4
- import { C, a as a2, E, c as c2, b as b3, d, g, r, s } from "./utils-DYUQLv_v.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-CafhxM-l.mjs";
9
- import { p } from "./prefetch-CmkSilpl.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-CvCACzJH.js");
3
- const lazyUtils = require("./utils-BelRTG4G.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-CmkSilpl.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-DYUQLv_v.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-B0jL1C-H.js");
4
- require("./prefetch-CvCACzJH.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-CXfIn_mH.mjs";
2
- import "./prefetch-CmkSilpl.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("./logger-DT66A_Pv.js");
4
- const lazyUtils = require("./utils-BelRTG4G.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,5 +1,5 @@
1
- import "./logger-BWq2gts-.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-DYUQLv_v.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
4
  G as callAllDowngrade,
5
5
  H as callDowngrade,
@@ -1,8 +1,9 @@
1
1
  const MANIFEST_EXT = ".json";
2
2
  const BROWSER_LOG_KEY = "FEDERATION_DEBUG";
3
3
  const SEPARATOR = ":";
4
+ const isBrowserEnvValue = typeof ENV_TARGET !== "undefined" ? ENV_TARGET === "web" : typeof window !== "undefined" && typeof window.document !== "undefined";
4
5
  function isBrowserEnv() {
5
- return typeof window !== "undefined" && typeof window.document !== "undefined";
6
+ return isBrowserEnvValue;
6
7
  }
7
8
  function isBrowserDebug() {
8
9
  try {
@@ -134,5 +135,5 @@ export {
134
135
  MANIFEST_EXT as M,
135
136
  SEPARATOR as S,
136
137
  createLogger as c,
137
- isBrowserEnv as i
138
+ isBrowserEnvValue as i
138
139
  };
@@ -2,8 +2,9 @@
2
2
  const MANIFEST_EXT = ".json";
3
3
  const BROWSER_LOG_KEY = "FEDERATION_DEBUG";
4
4
  const SEPARATOR = ":";
5
+ const isBrowserEnvValue = typeof ENV_TARGET !== "undefined" ? ENV_TARGET === "web" : typeof window !== "undefined" && typeof window.document !== "undefined";
5
6
  function isBrowserEnv() {
6
- return typeof window !== "undefined" && typeof window.document !== "undefined";
7
+ return isBrowserEnvValue;
7
8
  }
8
9
  function isBrowserDebug() {
9
10
  try {
@@ -134,4 +135,4 @@ createInfrastructureLogger(PREFIX);
134
135
  exports.MANIFEST_EXT = MANIFEST_EXT;
135
136
  exports.SEPARATOR = SEPARATOR;
136
137
  exports.createLogger = createLogger;
137
- exports.isBrowserEnv = isBrowserEnv;
138
+ exports.isBrowserEnvValue = isBrowserEnvValue;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
- const lazyUtils = require("./utils-BelRTG4G.js");
3
- const logger = require("./logger-DT66A_Pv.js");
2
+ const lazyUtils = require("./utils-CFTy4LVE.js");
3
+ const logger = require("./logger-Dxblx6P-.js");
4
4
  async function safeWrapper(callback, disableWarn) {
5
5
  try {
6
6
  return await callback();
@@ -49,10 +49,24 @@ function createScript(info) {
49
49
  }
50
50
  });
51
51
  }
52
+ let executionError = null;
53
+ const executionErrorHandler = typeof window !== "undefined" ? (evt) => {
54
+ if (evt.filename && isStaticResourcesEqual(evt.filename, info.url)) {
55
+ const err = /* @__PURE__ */ new Error(`ScriptExecutionError: Script "${info.url}" loaded but threw a runtime error during execution: ${evt.message} (${evt.filename}:${evt.lineno}:${evt.colno})`);
56
+ err.name = "ScriptExecutionError";
57
+ executionError = err;
58
+ }
59
+ } : null;
60
+ if (executionErrorHandler) window.addEventListener("error", executionErrorHandler);
52
61
  const onScriptComplete = async (prev, event) => {
53
62
  clearTimeout(timeoutId);
63
+ if (executionErrorHandler) window.removeEventListener("error", executionErrorHandler);
54
64
  const onScriptCompleteCallback = () => {
55
- if ((event == null ? void 0 : event.type) === "error") (info == null ? void 0 : info.onErrorCallback) && (info == null ? void 0 : info.onErrorCallback(event));
65
+ if ((event == null ? void 0 : event.type) === "error") {
66
+ const networkError = /* @__PURE__ */ new Error(`ScriptNetworkError: Failed to load script "${info.url}" - the script URL is unreachable or the server returned an error (network failure, 404, CORS, etc.)`);
67
+ networkError.name = "ScriptNetworkError";
68
+ (info == null ? void 0 : info.onErrorCallback) && (info == null ? void 0 : info.onErrorCallback(networkError));
69
+ } else if (executionError) (info == null ? void 0 : info.onErrorCallback) && (info == null ? void 0 : info.onErrorCallback(executionError));
56
70
  else (info == null ? void 0 : info.cb) && (info == null ? void 0 : info.cb());
57
71
  };
58
72
  if (script) {
@@ -349,11 +363,26 @@ function injectDataFetch() {
349
363
  globalThis[lazyUtils.FS_HREF] = window.location.href;
350
364
  dataFetch.push = dataFetchFunction;
351
365
  }
352
- const LOG_CATEGORY = "[ Federation Runtime ]";
353
- function assert(condition, msg) {
354
- if (!condition) error(msg);
366
+ const getDocsUrl = (errorCode) => {
367
+ return `View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${errorCode.split("-")[0].toLowerCase()}#${errorCode.toLowerCase()}`;
368
+ };
369
+ const getShortErrorMsg = (errorCode, errorDescMap, args, originalErrorMsg) => {
370
+ const msg = [`${[errorDescMap[errorCode]]} #${errorCode}`];
371
+ args && msg.push(`args: ${JSON.stringify(args)}`);
372
+ msg.push(getDocsUrl(errorCode));
373
+ originalErrorMsg && msg.push(`Original Error Message:
374
+ ${originalErrorMsg}`);
375
+ return msg.join("\n");
376
+ };
377
+ function logAndReport(code, descMap, args, logger2, originalErrorMsg, context) {
378
+ return logger2(getShortErrorMsg(code, descMap, args, originalErrorMsg));
355
379
  }
356
- function error(msg) {
380
+ const LOG_CATEGORY = "[ Federation Runtime ]";
381
+ function error(msgOrCode, descMap, args, originalErrorMsg, context) {
382
+ if (descMap !== void 0) return logAndReport(msgOrCode, descMap, args ?? {}, (msg2) => {
383
+ throw new Error(`${LOG_CATEGORY}: ${msg2}`);
384
+ }, originalErrorMsg);
385
+ const msg = msgOrCode;
357
386
  if (msg instanceof Error) {
358
387
  if (!msg.message.startsWith(LOG_CATEGORY)) msg.message = `${LOG_CATEGORY}: ${msg.message}`;
359
388
  throw msg;
@@ -460,15 +489,7 @@ const RUNTIME_007 = "RUNTIME-007";
460
489
  const RUNTIME_008 = "RUNTIME-008";
461
490
  const RUNTIME_009 = "RUNTIME-009";
462
491
  const RUNTIME_010 = "RUNTIME-010";
463
- const getDocsUrl = (errorCode) => {
464
- return `View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${errorCode.split("-")[0].toLowerCase()}#${errorCode.toLowerCase()}`;
465
- };
466
- const getShortErrorMsg = (errorCode, errorDescMap, args, originalErrorMsg) => {
467
- const msg = [`${[errorDescMap[errorCode]]} #${errorCode}`];
468
- args && msg.push(`args: ${JSON.stringify(args)}`);
469
- msg.push(getDocsUrl(errorCode));
470
- return msg.join("\n");
471
- };
492
+ const RUNTIME_011 = "RUNTIME-011";
472
493
  const runtimeDescMap = {
473
494
  [RUNTIME_001]: "Failed to get remoteEntry exports.",
474
495
  [RUNTIME_002]: 'The remote entry interface does not contain "init"',
@@ -479,7 +500,8 @@ const runtimeDescMap = {
479
500
  [RUNTIME_007]: "Failed to get remote snapshot.",
480
501
  [RUNTIME_008]: "Failed to load script resources.",
481
502
  [RUNTIME_009]: "Please call createInstance first.",
482
- [RUNTIME_010]: 'The name option cannot be changed after initialization. If you want to create a new instance with a different name, please use "createInstance" api.'
503
+ [RUNTIME_010]: 'The name option cannot be changed after initialization. If you want to create a new instance with a different name, please use "createInstance" api.',
504
+ [RUNTIME_011]: "The remoteEntry URL is missing from the remote snapshot."
483
505
  };
484
506
  ({
485
507
  ...runtimeDescMap
@@ -496,7 +518,7 @@ async function loadEsmEntry({ entry, remoteEntryExports }) {
496
518
  ).then(resolve).catch(reject);
497
519
  else resolve(remoteEntryExports);
498
520
  } catch (e) {
499
- reject(e);
521
+ error(`Failed to load ESM entry from "${entry}". ${e instanceof Error ? e.message : String(e)}`);
500
522
  }
501
523
  });
502
524
  }
@@ -507,27 +529,28 @@ async function loadSystemJsEntry({ entry, remoteEntryExports }) {
507
529
  else new Function("callbacks", `System.import("${entry}")${importCallback}`)([resolve, reject]);
508
530
  else resolve(remoteEntryExports);
509
531
  } catch (e) {
510
- reject(e);
532
+ error(`Failed to load SystemJS entry from "${entry}". ${e instanceof Error ? e.message : String(e)}`);
511
533
  }
512
534
  });
513
535
  }
514
536
  function handleRemoteEntryLoaded(name, globalName, entry) {
515
537
  const { remoteEntryKey, entryExports } = getRemoteEntryExports(name, globalName);
516
- assert(entryExports, getShortErrorMsg(RUNTIME_001, runtimeDescMap, {
538
+ if (!entryExports) error(RUNTIME_001, runtimeDescMap, {
517
539
  remoteName: name,
518
540
  remoteEntryUrl: entry,
519
541
  remoteEntryKey
520
- }));
542
+ });
521
543
  return entryExports;
522
544
  }
523
545
  async function loadEntryScript({ name, globalName, entry, loaderHook, getEntryUrl }) {
524
546
  const { entryExports: remoteEntryExports } = getRemoteEntryExports(name, globalName);
525
547
  if (remoteEntryExports) return remoteEntryExports;
526
- return loadScript(getEntryUrl ? getEntryUrl(entry) : entry, {
548
+ const url = getEntryUrl ? getEntryUrl(entry) : entry;
549
+ return loadScript(url, {
527
550
  attrs: {},
528
- createScriptHook: (url, attrs) => {
551
+ createScriptHook: (url2, attrs) => {
529
552
  const res = loaderHook.lifecycle.createScript.emit({
530
- url,
553
+ url: url2,
531
554
  attrs
532
555
  });
533
556
  if (!res) return;
@@ -536,12 +559,12 @@ async function loadEntryScript({ name, globalName, entry, loaderHook, getEntryUr
536
559
  }
537
560
  }).then(() => {
538
561
  return handleRemoteEntryLoaded(name, globalName, entry);
539
- }).catch((e) => {
540
- assert(void 0, getShortErrorMsg(RUNTIME_008, runtimeDescMap, {
562
+ }, (loadError) => {
563
+ const originalMsg = loadError instanceof Error ? loadError.message : String(loadError);
564
+ error(RUNTIME_008, runtimeDescMap, {
541
565
  remoteName: name,
542
- resourceUrl: entry
543
- }));
544
- throw e;
566
+ resourceUrl: url
567
+ }, originalMsg);
545
568
  });
546
569
  }
547
570
  async function loadEntryDom({ remoteInfo, remoteEntryExports, loaderHook, getEntryUrl }) {
@@ -589,7 +612,7 @@ async function loadEntryNode({ remoteInfo, loaderHook }) {
589
612
  }).then(() => {
590
613
  return handleRemoteEntryLoaded(name, globalName, entry);
591
614
  }).catch((e) => {
592
- throw e;
615
+ error(`Failed to load Node.js entry for remote "${name}" from "${entry}". ${e instanceof Error ? e.message : String(e)}`);
593
616
  });
594
617
  }
595
618
  function getRemoteEntryUniqueKey(remoteInfo) {
@@ -609,7 +632,7 @@ async function getRemoteEntry(params) {
609
632
  remoteEntryExports
610
633
  }).then((res) => {
611
634
  if (res) return res;
612
- return (typeof ENV_TARGET !== "undefined" ? ENV_TARGET === "web" : logger.isBrowserEnv()) ? loadEntryDom({
635
+ return (typeof ENV_TARGET !== "undefined" ? ENV_TARGET === "web" : logger.isBrowserEnvValue) ? loadEntryDom({
613
636
  remoteInfo,
614
637
  remoteEntryExports,
615
638
  loaderHook,
@@ -620,7 +643,8 @@ async function getRemoteEntry(params) {
620
643
  });
621
644
  }).catch(async (err) => {
622
645
  const uniqueKey2 = getRemoteEntryUniqueKey(remoteInfo);
623
- if (err instanceof Error && err.message.includes(RUNTIME_008) && !_inErrorHandling) {
646
+ const isScriptExecutionError = err instanceof Error && err.message.includes("ScriptExecutionError");
647
+ if (err instanceof Error && err.message.includes(RUNTIME_008) && !isScriptExecutionError && !_inErrorHandling) {
624
648
  const wrappedGetRemoteEntry = (params2) => {
625
649
  return getRemoteEntry({
626
650
  ...params2,
@@ -1,5 +1,5 @@
1
- import { A as warn, x as DATA_FETCH_FUNCTION, F as FS_HREF, l as logger, e as getDataFetchMap, i as initDataFetchMap, n as getDataFetchItem, M as MF_DATA_FETCH_STATUS, p as MF_DATA_FETCH_TYPE, B as DOWNGRADE_KEY, G as callAllDowngrade, H as callDowngrade, I as getDowngradeTag, J as composeKeyWithSeparator, k as getDataFetchInfo, m as getDataFetchMapKey } from "./utils-DYUQLv_v.mjs";
2
- import { i as isBrowserEnv } from "./logger-BWq2gts-.mjs";
1
+ import { A as warn, x as DATA_FETCH_FUNCTION, F as FS_HREF, l as logger, e as getDataFetchMap, i as initDataFetchMap, n as getDataFetchItem, M as MF_DATA_FETCH_STATUS, p as MF_DATA_FETCH_TYPE, B as DOWNGRADE_KEY, G as callAllDowngrade, H as callDowngrade, I as getDowngradeTag, J as composeKeyWithSeparator, k as getDataFetchInfo, m as getDataFetchMapKey } from "./utils-D4k5eixv.mjs";
2
+ import { i as isBrowserEnvValue } from "./logger-DwWkXsWl.mjs";
3
3
  async function safeWrapper(callback, disableWarn) {
4
4
  try {
5
5
  return await callback();
@@ -48,10 +48,24 @@ function createScript(info) {
48
48
  }
49
49
  });
50
50
  }
51
+ let executionError = null;
52
+ const executionErrorHandler = typeof window !== "undefined" ? (evt) => {
53
+ if (evt.filename && isStaticResourcesEqual(evt.filename, info.url)) {
54
+ const err = /* @__PURE__ */ new Error(`ScriptExecutionError: Script "${info.url}" loaded but threw a runtime error during execution: ${evt.message} (${evt.filename}:${evt.lineno}:${evt.colno})`);
55
+ err.name = "ScriptExecutionError";
56
+ executionError = err;
57
+ }
58
+ } : null;
59
+ if (executionErrorHandler) window.addEventListener("error", executionErrorHandler);
51
60
  const onScriptComplete = async (prev, event) => {
52
61
  clearTimeout(timeoutId);
62
+ if (executionErrorHandler) window.removeEventListener("error", executionErrorHandler);
53
63
  const onScriptCompleteCallback = () => {
54
- if ((event == null ? void 0 : event.type) === "error") (info == null ? void 0 : info.onErrorCallback) && (info == null ? void 0 : info.onErrorCallback(event));
64
+ if ((event == null ? void 0 : event.type) === "error") {
65
+ const networkError = /* @__PURE__ */ new Error(`ScriptNetworkError: Failed to load script "${info.url}" - the script URL is unreachable or the server returned an error (network failure, 404, CORS, etc.)`);
66
+ networkError.name = "ScriptNetworkError";
67
+ (info == null ? void 0 : info.onErrorCallback) && (info == null ? void 0 : info.onErrorCallback(networkError));
68
+ } else if (executionError) (info == null ? void 0 : info.onErrorCallback) && (info == null ? void 0 : info.onErrorCallback(executionError));
55
69
  else (info == null ? void 0 : info.cb) && (info == null ? void 0 : info.cb());
56
70
  };
57
71
  if (script) {
@@ -348,11 +362,26 @@ function injectDataFetch() {
348
362
  globalThis[FS_HREF] = window.location.href;
349
363
  dataFetch.push = dataFetchFunction;
350
364
  }
351
- const LOG_CATEGORY = "[ Federation Runtime ]";
352
- function assert(condition, msg) {
353
- if (!condition) error(msg);
365
+ const getDocsUrl = (errorCode) => {
366
+ return `View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${errorCode.split("-")[0].toLowerCase()}#${errorCode.toLowerCase()}`;
367
+ };
368
+ const getShortErrorMsg = (errorCode, errorDescMap, args, originalErrorMsg) => {
369
+ const msg = [`${[errorDescMap[errorCode]]} #${errorCode}`];
370
+ args && msg.push(`args: ${JSON.stringify(args)}`);
371
+ msg.push(getDocsUrl(errorCode));
372
+ originalErrorMsg && msg.push(`Original Error Message:
373
+ ${originalErrorMsg}`);
374
+ return msg.join("\n");
375
+ };
376
+ function logAndReport(code, descMap, args, logger2, originalErrorMsg, context) {
377
+ return logger2(getShortErrorMsg(code, descMap, args, originalErrorMsg));
354
378
  }
355
- function error(msg) {
379
+ const LOG_CATEGORY = "[ Federation Runtime ]";
380
+ function error(msgOrCode, descMap, args, originalErrorMsg, context) {
381
+ if (descMap !== void 0) return logAndReport(msgOrCode, descMap, args ?? {}, (msg2) => {
382
+ throw new Error(`${LOG_CATEGORY}: ${msg2}`);
383
+ }, originalErrorMsg);
384
+ const msg = msgOrCode;
356
385
  if (msg instanceof Error) {
357
386
  if (!msg.message.startsWith(LOG_CATEGORY)) msg.message = `${LOG_CATEGORY}: ${msg.message}`;
358
387
  throw msg;
@@ -459,15 +488,7 @@ const RUNTIME_007 = "RUNTIME-007";
459
488
  const RUNTIME_008 = "RUNTIME-008";
460
489
  const RUNTIME_009 = "RUNTIME-009";
461
490
  const RUNTIME_010 = "RUNTIME-010";
462
- const getDocsUrl = (errorCode) => {
463
- return `View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${errorCode.split("-")[0].toLowerCase()}#${errorCode.toLowerCase()}`;
464
- };
465
- const getShortErrorMsg = (errorCode, errorDescMap, args, originalErrorMsg) => {
466
- const msg = [`${[errorDescMap[errorCode]]} #${errorCode}`];
467
- args && msg.push(`args: ${JSON.stringify(args)}`);
468
- msg.push(getDocsUrl(errorCode));
469
- return msg.join("\n");
470
- };
491
+ const RUNTIME_011 = "RUNTIME-011";
471
492
  const runtimeDescMap = {
472
493
  [RUNTIME_001]: "Failed to get remoteEntry exports.",
473
494
  [RUNTIME_002]: 'The remote entry interface does not contain "init"',
@@ -478,7 +499,8 @@ const runtimeDescMap = {
478
499
  [RUNTIME_007]: "Failed to get remote snapshot.",
479
500
  [RUNTIME_008]: "Failed to load script resources.",
480
501
  [RUNTIME_009]: "Please call createInstance first.",
481
- [RUNTIME_010]: 'The name option cannot be changed after initialization. If you want to create a new instance with a different name, please use "createInstance" api.'
502
+ [RUNTIME_010]: 'The name option cannot be changed after initialization. If you want to create a new instance with a different name, please use "createInstance" api.',
503
+ [RUNTIME_011]: "The remoteEntry URL is missing from the remote snapshot."
482
504
  };
483
505
  ({
484
506
  ...runtimeDescMap
@@ -495,7 +517,7 @@ async function loadEsmEntry({ entry, remoteEntryExports }) {
495
517
  ).then(resolve).catch(reject);
496
518
  else resolve(remoteEntryExports);
497
519
  } catch (e) {
498
- reject(e);
520
+ error(`Failed to load ESM entry from "${entry}". ${e instanceof Error ? e.message : String(e)}`);
499
521
  }
500
522
  });
501
523
  }
@@ -506,27 +528,28 @@ async function loadSystemJsEntry({ entry, remoteEntryExports }) {
506
528
  else new Function("callbacks", `System.import("${entry}")${importCallback}`)([resolve, reject]);
507
529
  else resolve(remoteEntryExports);
508
530
  } catch (e) {
509
- reject(e);
531
+ error(`Failed to load SystemJS entry from "${entry}". ${e instanceof Error ? e.message : String(e)}`);
510
532
  }
511
533
  });
512
534
  }
513
535
  function handleRemoteEntryLoaded(name, globalName, entry) {
514
536
  const { remoteEntryKey, entryExports } = getRemoteEntryExports(name, globalName);
515
- assert(entryExports, getShortErrorMsg(RUNTIME_001, runtimeDescMap, {
537
+ if (!entryExports) error(RUNTIME_001, runtimeDescMap, {
516
538
  remoteName: name,
517
539
  remoteEntryUrl: entry,
518
540
  remoteEntryKey
519
- }));
541
+ });
520
542
  return entryExports;
521
543
  }
522
544
  async function loadEntryScript({ name, globalName, entry, loaderHook, getEntryUrl }) {
523
545
  const { entryExports: remoteEntryExports } = getRemoteEntryExports(name, globalName);
524
546
  if (remoteEntryExports) return remoteEntryExports;
525
- return loadScript(getEntryUrl ? getEntryUrl(entry) : entry, {
547
+ const url = getEntryUrl ? getEntryUrl(entry) : entry;
548
+ return loadScript(url, {
526
549
  attrs: {},
527
- createScriptHook: (url, attrs) => {
550
+ createScriptHook: (url2, attrs) => {
528
551
  const res = loaderHook.lifecycle.createScript.emit({
529
- url,
552
+ url: url2,
530
553
  attrs
531
554
  });
532
555
  if (!res) return;
@@ -535,12 +558,12 @@ async function loadEntryScript({ name, globalName, entry, loaderHook, getEntryUr
535
558
  }
536
559
  }).then(() => {
537
560
  return handleRemoteEntryLoaded(name, globalName, entry);
538
- }).catch((e) => {
539
- assert(void 0, getShortErrorMsg(RUNTIME_008, runtimeDescMap, {
561
+ }, (loadError) => {
562
+ const originalMsg = loadError instanceof Error ? loadError.message : String(loadError);
563
+ error(RUNTIME_008, runtimeDescMap, {
540
564
  remoteName: name,
541
- resourceUrl: entry
542
- }));
543
- throw e;
565
+ resourceUrl: url
566
+ }, originalMsg);
544
567
  });
545
568
  }
546
569
  async function loadEntryDom({ remoteInfo, remoteEntryExports, loaderHook, getEntryUrl }) {
@@ -588,7 +611,7 @@ async function loadEntryNode({ remoteInfo, loaderHook }) {
588
611
  }).then(() => {
589
612
  return handleRemoteEntryLoaded(name, globalName, entry);
590
613
  }).catch((e) => {
591
- throw e;
614
+ error(`Failed to load Node.js entry for remote "${name}" from "${entry}". ${e instanceof Error ? e.message : String(e)}`);
592
615
  });
593
616
  }
594
617
  function getRemoteEntryUniqueKey(remoteInfo) {
@@ -608,7 +631,7 @@ async function getRemoteEntry(params) {
608
631
  remoteEntryExports
609
632
  }).then((res) => {
610
633
  if (res) return res;
611
- return (typeof ENV_TARGET !== "undefined" ? ENV_TARGET === "web" : isBrowserEnv()) ? loadEntryDom({
634
+ return (typeof ENV_TARGET !== "undefined" ? ENV_TARGET === "web" : isBrowserEnvValue) ? loadEntryDom({
612
635
  remoteInfo,
613
636
  remoteEntryExports,
614
637
  loaderHook,
@@ -619,7 +642,8 @@ async function getRemoteEntry(params) {
619
642
  });
620
643
  }).catch(async (err) => {
621
644
  const uniqueKey2 = getRemoteEntryUniqueKey(remoteInfo);
622
- if (err instanceof Error && err.message.includes(RUNTIME_008) && !_inErrorHandling) {
645
+ const isScriptExecutionError = err instanceof Error && err.message.includes("ScriptExecutionError");
646
+ if (err instanceof Error && err.message.includes(RUNTIME_008) && !isScriptExecutionError && !_inErrorHandling) {
623
647
  const wrappedGetRemoteEntry = (params2) => {
624
648
  return getRemoteEntry({
625
649
  ...params2,
@@ -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-Cmp3JjCw.js");
5
+ const index = require("./index-DbjGCKOr.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-CafhxM-l.mjs";
3
+ import { R as RouterContext, L as LoggerInstance } from "./index-Bs2NxD2z.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-Cmp3JjCw.js");
5
+ const index = require("./index-DbjGCKOr.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-CafhxM-l.mjs";
3
+ import { R as RouterContext, L as LoggerInstance } from "./index-Bs2NxD2z.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-Cmp3JjCw.js");
5
+ const index = require("./index-DbjGCKOr.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-CafhxM-l.mjs";
4
+ import { R as RouterContext, L as LoggerInstance } from "./index-Bs2NxD2z.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-Cmp3JjCw.js");
5
+ const index = require("./index-DbjGCKOr.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-CafhxM-l.mjs";
4
+ import { R as RouterContext, L as LoggerInstance } from "./index-Bs2NxD2z.mjs";
5
5
  function WrapperRouter(props) {
6
6
  const { basename, ...propsRes } = props;
7
7
  const routerContextProps = useContext(RouterContext) || {};
@@ -19,7 +19,7 @@ var __privateWrapper = (obj, member, setter, getter) => ({
19
19
  }
20
20
  });
21
21
  var _a, _constructing, _b, _c, _max, _maxSize, _dispose, _disposeAfter, _fetchMethod, _memoMethod, _size, _calculatedSize, _keyMap, _keyList, _valList, _next, _prev, _head, _tail, _free, _disposed, _sizes, _starts, _ttls, _hasDispose, _hasFetchMethod, _hasDisposeAfter, _LRUCache_instances, initializeTTLTracking_fn, _updateItemAge, _statusTTL, _setItemTTL, _isStale, initializeSizeTracking_fn, _removeItemSize, _addItemSize, _requireSize, indexes_fn, rindexes_fn, isValidIndex_fn, evict_fn, backgroundFetch_fn, isBackgroundFetch_fn, connect_fn, moveToTail_fn, delete_fn, clear_fn;
22
- const logger$1 = require("./logger-DT66A_Pv.js");
22
+ const logger$1 = require("./logger-Dxblx6P-.js");
23
23
  const LOG_CATEGORY = "[ Federation Runtime ]";
24
24
  const composeKeyWithSeparator = function(...args) {
25
25
  if (!args.length) return "";
@@ -1815,7 +1815,7 @@ async function fetchData(id, params, remoteInfo) {
1815
1815
  _id: id
1816
1816
  });
1817
1817
  };
1818
- if (logger$1.isBrowserEnv()) {
1818
+ if (logger$1.isBrowserEnvValue) {
1819
1819
  const dataFetchItem = getDataFetchItem(id);
1820
1820
  if (!dataFetchItem) {
1821
1821
  throw new Error(`dataFetchItem not found, id: ${id}`);
@@ -18,7 +18,7 @@ var __privateWrapper = (obj, member, setter, getter) => ({
18
18
  }
19
19
  });
20
20
  var _a, _constructing, _b, _c, _max, _maxSize, _dispose, _disposeAfter, _fetchMethod, _memoMethod, _size, _calculatedSize, _keyMap, _keyList, _valList, _next, _prev, _head, _tail, _free, _disposed, _sizes, _starts, _ttls, _hasDispose, _hasFetchMethod, _hasDisposeAfter, _LRUCache_instances, initializeTTLTracking_fn, _updateItemAge, _statusTTL, _setItemTTL, _isStale, initializeSizeTracking_fn, _removeItemSize, _addItemSize, _requireSize, indexes_fn, rindexes_fn, isValidIndex_fn, evict_fn, backgroundFetch_fn, isBackgroundFetch_fn, connect_fn, moveToTail_fn, delete_fn, clear_fn;
21
- import { S as SEPARATOR, c as createLogger, i as isBrowserEnv } from "./logger-BWq2gts-.mjs";
21
+ import { S as SEPARATOR, c as createLogger, i as isBrowserEnvValue } from "./logger-DwWkXsWl.mjs";
22
22
  const LOG_CATEGORY = "[ Federation Runtime ]";
23
23
  const composeKeyWithSeparator = function(...args) {
24
24
  if (!args.length) return "";
@@ -1814,7 +1814,7 @@ async function fetchData(id, params, remoteInfo) {
1814
1814
  _id: id
1815
1815
  });
1816
1816
  };
1817
- if (isBrowserEnv()) {
1817
+ if (isBrowserEnvValue) {
1818
1818
  const dataFetchItem = getDataFetchItem(id);
1819
1819
  if (!dataFetchItem) {
1820
1820
  throw new Error(`dataFetchItem not found, id: ${id}`);
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-BLno0Ytr.js");
4
+ const bridgeBase = require("./bridge-base-IlvdqYIj.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-B7EKIpJ7.mjs";
2
+ import { c as createBaseBridgeComponent } from "./bridge-base-EnVXD4Hr.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-BLno0Ytr.js");
4
+ const bridgeBase = require("./bridge-base-IlvdqYIj.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-B7EKIpJ7.mjs";
2
+ import { c as createBaseBridgeComponent } from "./bridge-base-EnVXD4Hr.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.1.0",
3
+ "version": "2.2.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.1.0",
133
- "@module-federation/sdk": "2.1.0"
132
+ "@module-federation/bridge-shared": "2.2.0",
133
+ "@module-federation/sdk": "2.2.0"
134
134
  },
135
135
  "peerDependencies": {
136
136
  "react": ">=16.9.0",
@@ -161,13 +161,14 @@
161
161
  "typescript": "^5.2.2",
162
162
  "vite": "^5.4.21",
163
163
  "vite-plugin-dts": "^4.3.0",
164
- "hono": "4.11.10",
165
- "@module-federation/runtime": "2.1.0",
166
- "@module-federation/runtime-core": "2.1.0"
164
+ "hono": "4.12.7",
165
+ "@module-federation/runtime": "2.2.0",
166
+ "@module-federation/runtime-core": "2.2.0"
167
167
  },
168
168
  "scripts": {
169
169
  "dev": "vite",
170
170
  "build": "vite build",
171
- "preview": "vite preview"
171
+ "preview": "vite preview",
172
+ "test": "pnpm exec jest --config jest.config.ts --passWithNoTests"
172
173
  }
173
174
  }
package/src/lazy/utils.ts CHANGED
@@ -1,4 +1,7 @@
1
- import { isBrowserEnv, composeKeyWithSeparator } from '@module-federation/sdk';
1
+ import {
2
+ isBrowserEnvValue,
3
+ composeKeyWithSeparator,
4
+ } from '@module-federation/sdk';
2
5
  import logger from './logger';
3
6
  import {
4
7
  DOWNGRADE_KEY,
@@ -153,7 +156,7 @@ export async function fetchData(
153
156
  _id: id,
154
157
  });
155
158
  };
156
- if (isBrowserEnv()) {
159
+ if (isBrowserEnvValue) {
157
160
  const dataFetchItem = getDataFetchItem(id);
158
161
  if (!dataFetchItem) {
159
162
  throw new Error(`dataFetchItem not found, id: ${id}`);
package/vitest.config.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { defineConfig } from 'vitest/config';
2
- import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
2
+ import tsconfigPaths from 'vite-tsconfig-paths';
3
3
  import react from '@vitejs/plugin-react';
4
4
  import path from 'path';
5
5
  export default defineConfig({
@@ -13,7 +13,7 @@ export default defineConfig({
13
13
  resolve: {
14
14
  extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json'],
15
15
  },
16
- plugins: [react(), nxViteTsPaths()],
16
+ plugins: [react(), tsconfigPaths()],
17
17
  test: {
18
18
  environment: 'jsdom',
19
19
  include: [
package/project.json DELETED
@@ -1,23 +0,0 @@
1
- {
2
- "name": "bridge-react",
3
- "$schema": "../../node_modules/nx/schemas/project-schema.json",
4
- "sourceRoot": "packages/bridge/bridge-react/src",
5
- "projectType": "library",
6
- "tags": ["type:pkg"],
7
- "targets": {
8
- "build": {
9
- "executor": "nx:run-commands",
10
- "options": {
11
- "commands": ["npm run build --prefix packages/bridge/bridge-react"]
12
- }
13
- },
14
- "test": {
15
- "executor": "@nx/jest:jest",
16
- "outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
17
- "options": {
18
- "jestConfig": "packages/bridge/bridge-react/jest.config.ts",
19
- "passWithNoTests": true
20
- }
21
- }
22
- }
23
- }