@module-federation/bridge-react 2.1.0 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +85 -0
- package/CHANGELOG.md +21 -3
- package/dist/base.cjs.js +4 -4
- package/dist/base.es.js +5 -5
- package/dist/{bridge-base-B7EKIpJ7.mjs → bridge-base-EnVXD4Hr.mjs} +1 -1
- package/dist/{bridge-base-BLno0Ytr.js → bridge-base-IlvdqYIj.js} +1 -1
- package/dist/{createHelpers-DVr-JIwn.js → createHelpers-9B0ttrN_.js} +2 -2
- package/dist/{createHelpers-4fOvXdyD.mjs → createHelpers-D77sECmY.mjs} +2 -2
- package/dist/data-fetch-server-middleware.cjs.js +2 -2
- package/dist/data-fetch-server-middleware.es.js +2 -2
- package/dist/data-fetch-utils.cjs.js +2 -2
- package/dist/data-fetch-utils.es.js +4 -4
- package/dist/{index-CafhxM-l.mjs → index-Bs2NxD2z.mjs} +1 -1
- package/dist/{index-Cmp3JjCw.js → index-DbjGCKOr.js} +1 -1
- package/dist/index.cjs.js +5 -5
- package/dist/index.es.js +6 -6
- package/dist/{lazy-load-component-plugin-B0jL1C-H.js → lazy-load-component-plugin-0-2dETvt.js} +2 -2
- package/dist/{lazy-load-component-plugin-CXfIn_mH.mjs → lazy-load-component-plugin-ChXiUL6x.mjs} +2 -2
- package/dist/lazy-load-component-plugin.cjs.js +2 -2
- package/dist/lazy-load-component-plugin.es.js +2 -2
- package/dist/lazy-utils.cjs.js +2 -2
- package/dist/lazy-utils.es.js +2 -2
- package/dist/{logger-BWq2gts-.mjs → logger-DwWkXsWl.mjs} +3 -2
- package/dist/{logger-DT66A_Pv.js → logger-Dxblx6P-.js} +3 -2
- package/dist/{prefetch-CvCACzJH.js → prefetch-BIuiJePI.js} +56 -32
- package/dist/{prefetch-CmkSilpl.mjs → prefetch-DLfc6h__.mjs} +56 -32
- package/dist/router-v5.cjs.js +1 -1
- package/dist/router-v5.es.js +1 -1
- package/dist/router-v6.cjs.js +1 -1
- package/dist/router-v6.es.js +1 -1
- package/dist/router-v7.cjs.js +1 -1
- package/dist/router-v7.es.js +1 -1
- package/dist/router.cjs.js +1 -1
- package/dist/router.es.js +1 -1
- package/dist/{utils-BelRTG4G.js → utils-CFTy4LVE.js} +2 -2
- package/dist/{utils-DYUQLv_v.mjs → utils-D4k5eixv.mjs} +2 -2
- package/dist/v18.cjs.js +1 -1
- package/dist/v18.es.js +1 -1
- package/dist/v19.cjs.js +1 -1
- package/dist/v19.es.js +1 -1
- package/package.json +14 -8
- package/src/lazy/AwaitDataFetch.tsx +4 -2
- package/src/lazy/utils.ts +5 -2
- package/vitest.config.ts +2 -2
- package/project.json +0 -23
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
|
|
2
|
+
> @module-federation/bridge-react@2.2.1 build /home/runner/work/core/core/packages/bridge/bridge-react
|
|
3
|
+
> vite build
|
|
4
|
+
|
|
5
|
+
[33mThe CJS build of Vite's Node API is deprecated. See https://vite.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.[39m
|
|
6
|
+
[36mvite v5.4.21 [32mbuilding for production...[36m[39m
|
|
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
|
+
[32m✓[39m 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
|
+
[32m
|
|
14
|
+
[36m[vite:dts][32m Start generate declaration files...[39m
|
|
15
|
+
computing gzip size...
|
|
16
|
+
[2mdist/[22m[36mlazy-load-component-plugin.cjs.js [39m[1m[2m 0.39 kB[22m[1m[22m[2m │ gzip: 0.23 kB[22m
|
|
17
|
+
[2mdist/[22m[36mplugin.cjs.js [39m[1m[2m 0.43 kB[22m[1m[22m[2m │ gzip: 0.27 kB[22m
|
|
18
|
+
[2mdist/[22m[36mv18.cjs.js [39m[1m[2m 0.54 kB[22m[1m[22m[2m │ gzip: 0.29 kB[22m
|
|
19
|
+
[2mdist/[22m[36mv19.cjs.js [39m[1m[2m 0.54 kB[22m[1m[22m[2m │ gzip: 0.29 kB[22m
|
|
20
|
+
[2mdist/[22m[36mdata-fetch-utils.cjs.js [39m[1m[2m 0.87 kB[22m[1m[22m[2m │ gzip: 0.41 kB[22m
|
|
21
|
+
[2mdist/[22m[36mindex-DbjGCKOr.js [39m[1m[2m 1.22 kB[22m[1m[22m[2m │ gzip: 0.53 kB[22m
|
|
22
|
+
[2mdist/[22m[36mlazy-utils.cjs.js [39m[1m[2m 1.27 kB[22m[1m[22m[2m │ gzip: 0.40 kB[22m
|
|
23
|
+
[2mdist/[22m[36mbase.cjs.js [39m[1m[2m 1.58 kB[22m[1m[22m[2m │ gzip: 0.51 kB[22m
|
|
24
|
+
[2mdist/[22m[36mrouter-v5.cjs.js [39m[1m[2m 1.98 kB[22m[1m[22m[2m │ gzip: 0.73 kB[22m
|
|
25
|
+
[2mdist/[22m[36mrouter.cjs.js [39m[1m[2m 3.13 kB[22m[1m[22m[2m │ gzip: 0.90 kB[22m
|
|
26
|
+
[2mdist/[22m[36mrouter-v7.cjs.js [39m[1m[2m 3.27 kB[22m[1m[22m[2m │ gzip: 0.95 kB[22m
|
|
27
|
+
[2mdist/[22m[36mrouter-v6.cjs.js [39m[1m[2m 3.28 kB[22m[1m[22m[2m │ gzip: 0.95 kB[22m
|
|
28
|
+
[2mdist/[22m[36mlogger-Dxblx6P-.js [39m[1m[2m 3.78 kB[22m[1m[22m[2m │ gzip: 1.22 kB[22m
|
|
29
|
+
[2mdist/[22m[36mindex.cjs.js [39m[1m[2m 5.25 kB[22m[1m[22m[2m │ gzip: 1.51 kB[22m
|
|
30
|
+
[2mdist/[22m[36mdata-fetch-server-middleware.cjs.js [39m[1m[2m 5.79 kB[22m[1m[22m[2m │ gzip: 1.73 kB[22m
|
|
31
|
+
[2mdist/[22m[36mcreateHelpers-9B0ttrN_.js [39m[1m[2m 7.32 kB[22m[1m[22m[2m │ gzip: 1.95 kB[22m
|
|
32
|
+
[2mdist/[22m[36mbridge-base-IlvdqYIj.js [39m[1m[2m 7.70 kB[22m[1m[22m[2m │ gzip: 2.11 kB[22m
|
|
33
|
+
[2mdist/[22m[36mlazy-load-component-plugin-0-2dETvt.js [39m[1m[2m17.65 kB[22m[1m[22m[2m │ gzip: 4.20 kB[22m
|
|
34
|
+
[2mdist/[22m[36mprefetch-BIuiJePI.js [39m[1m[2m31.61 kB[22m[1m[22m[2m │ gzip: 7.73 kB[22m
|
|
35
|
+
[2mdist/[22m[36mutils-CFTy4LVE.js [39m[1m[2m72.53 kB[22m[1m[22m[2m │ gzip: 15.19 kB[22m
|
|
36
|
+
[32m[36m[vite:dts][32m Start rollup declaration files...[39m
|
|
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
|
+
[32m[36m[vite:dts][32m Declaration files built in 47933ms.
|
|
64
|
+
[39m
|
|
65
|
+
[2mdist/[22m[36mlazy-load-component-plugin.es.js [39m[1m[2m 0.17 kB[22m[1m[22m[2m │ gzip: 0.15 kB[22m
|
|
66
|
+
[2mdist/[22m[36mplugin.es.js [39m[1m[2m 0.29 kB[22m[1m[22m[2m │ gzip: 0.18 kB[22m
|
|
67
|
+
[2mdist/[22m[36mv18.es.js [39m[1m[2m 0.44 kB[22m[1m[22m[2m │ gzip: 0.23 kB[22m
|
|
68
|
+
[2mdist/[22m[36mv19.es.js [39m[1m[2m 0.44 kB[22m[1m[22m[2m │ gzip: 0.23 kB[22m
|
|
69
|
+
[2mdist/[22m[36mlazy-utils.es.js [39m[1m[2m 0.64 kB[22m[1m[22m[2m │ gzip: 0.34 kB[22m
|
|
70
|
+
[2mdist/[22m[36mdata-fetch-utils.es.js [39m[1m[2m 0.68 kB[22m[1m[22m[2m │ gzip: 0.35 kB[22m
|
|
71
|
+
[2mdist/[22m[36mbase.es.js [39m[1m[2m 1.07 kB[22m[1m[22m[2m │ gzip: 0.46 kB[22m
|
|
72
|
+
[2mdist/[22m[36mindex-Bs2NxD2z.mjs [39m[1m[2m 1.16 kB[22m[1m[22m[2m │ gzip: 0.54 kB[22m
|
|
73
|
+
[2mdist/[22m[36mrouter-v5.es.js [39m[1m[2m 1.18 kB[22m[1m[22m[2m │ gzip: 0.45 kB[22m
|
|
74
|
+
[2mdist/[22m[36mrouter.es.js [39m[1m[2m 2.35 kB[22m[1m[22m[2m │ gzip: 0.63 kB[22m
|
|
75
|
+
[2mdist/[22m[36mrouter-v6.es.js [39m[1m[2m 2.45 kB[22m[1m[22m[2m │ gzip: 0.67 kB[22m
|
|
76
|
+
[2mdist/[22m[36mrouter-v7.es.js [39m[1m[2m 2.52 kB[22m[1m[22m[2m │ gzip: 0.69 kB[22m
|
|
77
|
+
[2mdist/[22m[36mlogger-DwWkXsWl.mjs [39m[1m[2m 3.71 kB[22m[1m[22m[2m │ gzip: 1.22 kB[22m
|
|
78
|
+
[2mdist/[22m[36mindex.es.js [39m[1m[2m 4.23 kB[22m[1m[22m[2m │ gzip: 1.33 kB[22m
|
|
79
|
+
[2mdist/[22m[36mdata-fetch-server-middleware.es.js [39m[1m[2m 5.73 kB[22m[1m[22m[2m │ gzip: 1.76 kB[22m
|
|
80
|
+
[2mdist/[22m[36mbridge-base-EnVXD4Hr.mjs [39m[1m[2m 7.11 kB[22m[1m[22m[2m │ gzip: 1.92 kB[22m
|
|
81
|
+
[2mdist/[22m[36mcreateHelpers-D77sECmY.mjs [39m[1m[2m 7.27 kB[22m[1m[22m[2m │ gzip: 1.96 kB[22m
|
|
82
|
+
[2mdist/[22m[36mlazy-load-component-plugin-ChXiUL6x.mjs [39m[1m[2m17.79 kB[22m[1m[22m[2m │ gzip: 4.33 kB[22m
|
|
83
|
+
[2mdist/[22m[36mprefetch-DLfc6h__.mjs [39m[1m[2m31.63 kB[22m[1m[22m[2m │ gzip: 7.80 kB[22m
|
|
84
|
+
[2mdist/[22m[36mutils-D4k5eixv.mjs [39m[1m[2m71.78 kB[22m[1m[22m[2m │ gzip: 15.18 kB[22m
|
|
85
|
+
[32m✓ built in 50.52s[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @module-federation/bridge-react
|
|
2
2
|
|
|
3
|
+
## 2.2.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- @module-federation/sdk@2.2.1
|
|
8
|
+
- @module-federation/bridge-shared@2.2.1
|
|
9
|
+
|
|
10
|
+
## 2.2.0
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- c856ec1: Add `isBrowserEnvValue` as a tree-shakable ENV_TARGET-aware constant while
|
|
15
|
+
preserving the `isBrowserEnv()` function. Internal runtime and bridge callers
|
|
16
|
+
use the constant to enable bundler dead-code elimination without breaking the
|
|
17
|
+
public API.
|
|
18
|
+
- Updated dependencies [c856ec1]
|
|
19
|
+
- Updated dependencies [12240bb]
|
|
20
|
+
- Updated dependencies [e5dd6ef]
|
|
21
|
+
- @module-federation/sdk@2.2.0
|
|
22
|
+
- @module-federation/bridge-shared@2.2.0
|
|
23
|
+
|
|
3
24
|
## 2.1.0
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
|
@@ -96,7 +117,6 @@
|
|
|
96
117
|
- dc103ee: fix: support React Router v6 in peer dependencies
|
|
97
118
|
|
|
98
119
|
Update react-router peer dependency from "^7" to "^6 || ^7" to fix npm install failures for projects using React Router v6.
|
|
99
|
-
|
|
100
120
|
- @module-federation/sdk@0.21.2
|
|
101
121
|
- @module-federation/bridge-shared@0.21.2
|
|
102
122
|
|
|
@@ -190,7 +210,6 @@
|
|
|
190
210
|
|
|
191
211
|
- 65aa038: chore(bridge-react): set sideEffects false
|
|
192
212
|
- a7cf276: chore: upgrade NX to 21.2.3, Storybook to 9.0.9, and TypeScript to 5.8.3
|
|
193
|
-
|
|
194
213
|
- Upgraded NX from 21.0.3 to 21.2.3 with workspace configuration updates
|
|
195
214
|
- Migrated Storybook from 8.3.5 to 9.0.9 with updated configurations and automigrations
|
|
196
215
|
- Upgraded TypeScript from 5.7.3 to 5.8.3 with compatibility fixes
|
|
@@ -199,7 +218,6 @@
|
|
|
199
218
|
- Updated build configurations and dependencies to support latest versions
|
|
200
219
|
|
|
201
220
|
- d31a326: refactor: sink React packages from root to individual packages
|
|
202
|
-
|
|
203
221
|
- Removed React dependencies from root package.json and moved them to packages that actually need them
|
|
204
222
|
- Fixed rsbuild-plugin configuration to match workspace patterns
|
|
205
223
|
- 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-
|
|
4
|
-
const lazyLoadComponentPlugin = require("./lazy-load-component-plugin-
|
|
5
|
-
const lazyUtils = require("./utils-
|
|
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-
|
|
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-
|
|
2
|
-
import { b } from "./createHelpers-
|
|
3
|
-
import { a, c, b as b2, l } from "./lazy-load-component-plugin-
|
|
4
|
-
import { C, a as a2, E, c as c2, b as b3, d, g, r, s } from "./utils-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
2
|
+
const bridgeBase = require("./bridge-base-IlvdqYIj.js");
|
|
3
3
|
const ReactDOM = require("react-dom");
|
|
4
|
-
const index = require("./index-
|
|
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-
|
|
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-
|
|
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-
|
|
3
|
-
const logger = require("./logger-
|
|
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-
|
|
2
|
-
import { M as MANIFEST_EXT, S as SEPARATOR } from "./logger-
|
|
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-
|
|
4
|
-
const prefetch = require("./prefetch-
|
|
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-
|
|
2
|
-
import { C, a, c, b, d, g, r } from "./utils-
|
|
3
|
-
import { d as dataFetchFunction } from "./prefetch-
|
|
4
|
-
import { i, p } from "./prefetch-
|
|
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-
|
|
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-
|
|
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-
|
|
4
|
-
const lazyLoadComponentPlugin = require("./lazy-load-component-plugin-
|
|
5
|
-
const lazyUtils = require("./utils-
|
|
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-
|
|
10
|
-
const prefetch = require("./prefetch-
|
|
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-
|
|
2
|
-
import { b } from "./createHelpers-
|
|
3
|
-
import { a, c, b as b2, l } from "./lazy-load-component-plugin-
|
|
4
|
-
import { C, a as a2, E, c as c2, b as b3, d, g, r, s } from "./utils-
|
|
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-
|
|
9
|
-
import { p } from "./prefetch-
|
|
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);
|
package/dist/{lazy-load-component-plugin-B0jL1C-H.js → lazy-load-component-plugin-0-2dETvt.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const prefetch = require("./prefetch-
|
|
3
|
-
const lazyUtils = require("./utils-
|
|
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();
|
package/dist/{lazy-load-component-plugin-CXfIn_mH.mjs → lazy-load-component-plugin-ChXiUL6x.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as injectDataFetch, p as prefetch } from "./prefetch-
|
|
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-
|
|
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-
|
|
4
|
-
require("./prefetch-
|
|
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-
|
|
2
|
-
import "./prefetch-
|
|
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
|
package/dist/lazy-utils.cjs.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
require("./logger-
|
|
4
|
-
const lazyUtils = require("./utils-
|
|
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;
|
package/dist/lazy-utils.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./logger-
|
|
2
|
-
import { G, H, f, K, N, u, k, n, e, m, I, y, i, q, j, t, h, z, s, w } from "./utils-
|
|
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
|
|
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
|
-
|
|
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
|
|
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.
|
|
138
|
+
exports.isBrowserEnvValue = isBrowserEnvValue;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const lazyUtils = require("./utils-
|
|
3
|
-
const logger = require("./logger-
|
|
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")
|
|
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
|
|
353
|
-
|
|
354
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
548
|
+
const url = getEntryUrl ? getEntryUrl(entry) : entry;
|
|
549
|
+
return loadScript(url, {
|
|
527
550
|
attrs: {},
|
|
528
|
-
createScriptHook: (
|
|
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
|
-
}
|
|
540
|
-
|
|
562
|
+
}, (loadError) => {
|
|
563
|
+
const originalMsg = loadError instanceof Error ? loadError.message : String(loadError);
|
|
564
|
+
error(RUNTIME_008, runtimeDescMap, {
|
|
541
565
|
remoteName: name,
|
|
542
|
-
resourceUrl:
|
|
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
|
-
|
|
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.
|
|
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
|
-
|
|
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-
|
|
2
|
-
import { i as
|
|
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")
|
|
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
|
|
352
|
-
|
|
353
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
547
|
+
const url = getEntryUrl ? getEntryUrl(entry) : entry;
|
|
548
|
+
return loadScript(url, {
|
|
526
549
|
attrs: {},
|
|
527
|
-
createScriptHook: (
|
|
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
|
-
}
|
|
539
|
-
|
|
561
|
+
}, (loadError) => {
|
|
562
|
+
const originalMsg = loadError instanceof Error ? loadError.message : String(loadError);
|
|
563
|
+
error(RUNTIME_008, runtimeDescMap, {
|
|
540
564
|
remoteName: name,
|
|
541
|
-
resourceUrl:
|
|
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
|
-
|
|
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" :
|
|
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
|
-
|
|
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,
|
package/dist/router-v5.cjs.js
CHANGED
|
@@ -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-
|
|
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" } });
|
package/dist/router-v5.es.js
CHANGED
|
@@ -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-
|
|
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;
|
package/dist/router-v6.cjs.js
CHANGED
|
@@ -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-
|
|
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" } });
|
package/dist/router-v6.es.js
CHANGED
|
@@ -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-
|
|
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;
|
package/dist/router-v7.cjs.js
CHANGED
|
@@ -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-
|
|
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-v7.es.js
CHANGED
|
@@ -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-
|
|
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) || {};
|
package/dist/router.cjs.js
CHANGED
|
@@ -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-
|
|
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-
|
|
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-
|
|
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.
|
|
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
|
|
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 (
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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
|
|
3
|
+
"version": "2.2.1",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -129,14 +129,15 @@
|
|
|
129
129
|
"dependencies": {
|
|
130
130
|
"react-error-boundary": "^4.1.2",
|
|
131
131
|
"lru-cache": "^10.4.3",
|
|
132
|
-
"@module-federation/
|
|
133
|
-
"@module-federation/
|
|
132
|
+
"@module-federation/sdk": "2.2.1",
|
|
133
|
+
"@module-federation/bridge-shared": "2.2.1"
|
|
134
134
|
},
|
|
135
135
|
"peerDependencies": {
|
|
136
136
|
"react": ">=16.9.0",
|
|
137
137
|
"react-dom": ">=16.9.0",
|
|
138
138
|
"react-router-dom": "^4 || ^5 || ^6 || ^7",
|
|
139
|
-
"react-router": "^6 || ^7"
|
|
139
|
+
"react-router": "^6 || ^7",
|
|
140
|
+
"hono": "^4.12.7"
|
|
140
141
|
},
|
|
141
142
|
"peerDependenciesMeta": {
|
|
142
143
|
"react-router-dom": {
|
|
@@ -144,6 +145,9 @@
|
|
|
144
145
|
},
|
|
145
146
|
"react-router": {
|
|
146
147
|
"optional": true
|
|
148
|
+
},
|
|
149
|
+
"hono": {
|
|
150
|
+
"optional": true
|
|
147
151
|
}
|
|
148
152
|
},
|
|
149
153
|
"devDependencies": {
|
|
@@ -161,13 +165,15 @@
|
|
|
161
165
|
"typescript": "^5.2.2",
|
|
162
166
|
"vite": "^5.4.21",
|
|
163
167
|
"vite-plugin-dts": "^4.3.0",
|
|
164
|
-
"hono": "4.
|
|
165
|
-
"
|
|
166
|
-
"@module-federation/runtime
|
|
168
|
+
"hono": "4.12.7",
|
|
169
|
+
"vitest": "1.6.0",
|
|
170
|
+
"@module-federation/runtime": "2.2.1",
|
|
171
|
+
"@module-federation/runtime-core": "2.2.1"
|
|
167
172
|
},
|
|
168
173
|
"scripts": {
|
|
169
174
|
"dev": "vite",
|
|
170
175
|
"build": "vite build",
|
|
171
|
-
"preview": "vite preview"
|
|
176
|
+
"preview": "vite preview",
|
|
177
|
+
"test": "pnpm exec jest --config jest.config.ts --passWithNoTests"
|
|
172
178
|
}
|
|
173
179
|
}
|
|
@@ -75,8 +75,10 @@ export interface AwaitProps<T> {
|
|
|
75
75
|
params?: DataFetchParams;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
export interface AwaitErrorHandlerProps<T = any>
|
|
79
|
-
|
|
78
|
+
export interface AwaitErrorHandlerProps<T = any> extends Omit<
|
|
79
|
+
AwaitProps<T>,
|
|
80
|
+
'resolve'
|
|
81
|
+
> {
|
|
80
82
|
resolve: () => T | string;
|
|
81
83
|
}
|
|
82
84
|
|
package/src/lazy/utils.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import {
|
|
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 (
|
|
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
|
|
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(),
|
|
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
|
-
}
|