@module-federation/bridge-react 2.0.1 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +85 -0
- package/CHANGELOG.md +22 -3
- package/dist/base.cjs.js +4 -4
- package/dist/base.es.js +5 -5
- package/dist/{bridge-base-BVX0EbsV.mjs → bridge-base-EnVXD4Hr.mjs} +1 -1
- package/dist/{bridge-base-vSCG9ebE.js → bridge-base-IlvdqYIj.js} +1 -1
- package/dist/{createHelpers-12yCVhCu.js → createHelpers-9B0ttrN_.js} +2 -2
- package/dist/{createHelpers-CGhHhtAd.mjs → createHelpers-D77sECmY.mjs} +2 -2
- package/dist/data-fetch-server-middleware.cjs.js +4 -4
- 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-DtXhorFI.mjs → index-Bs2NxD2z.mjs} +1 -1
- package/dist/{index-DhFNWacm.js → index-DbjGCKOr.js} +2 -2
- package/dist/index.cjs.js +5 -5
- package/dist/index.es.js +6 -6
- package/dist/{lazy-load-component-plugin-C7jasFos.js → lazy-load-component-plugin-0-2dETvt.js} +2 -2
- package/dist/{lazy-load-component-plugin-CrSLH5YP.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 +7 -7
- package/dist/logger-DwWkXsWl.mjs +139 -0
- package/dist/logger-Dxblx6P-.js +138 -0
- package/dist/prefetch-BIuiJePI.js +884 -0
- package/dist/prefetch-DLfc6h__.mjs +885 -0
- 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-TDonIHDD.js → utils-CFTy4LVE.js} +18 -4
- package/dist/{utils-DpoLOH_j.mjs → utils-D4k5eixv.mjs} +22 -8
- 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 +8 -7
- package/src/lazy/utils.ts +5 -2
- package/vitest.config.ts +2 -2
- package/dist/index.esm-BvTtsZnu.mjs +0 -491
- package/dist/index.esm-CYiGJfQW.js +0 -490
- package/dist/prefetch-CFRpPfZQ.js +0 -632
- package/dist/prefetch-DMJyBeIs.mjs +0 -633
- 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
|
+
[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 46107ms.
|
|
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 48.42s[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @module-federation/bridge-react
|
|
2
2
|
|
|
3
|
+
## 2.2.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- c856ec1: Add `isBrowserEnvValue` as a tree-shakable ENV_TARGET-aware constant while
|
|
8
|
+
preserving the `isBrowserEnv()` function. Internal runtime and bridge callers
|
|
9
|
+
use the constant to enable bundler dead-code elimination without breaking the
|
|
10
|
+
public API.
|
|
11
|
+
- Updated dependencies [c856ec1]
|
|
12
|
+
- Updated dependencies [12240bb]
|
|
13
|
+
- Updated dependencies [e5dd6ef]
|
|
14
|
+
- @module-federation/sdk@2.2.0
|
|
15
|
+
- @module-federation/bridge-shared@2.2.0
|
|
16
|
+
|
|
17
|
+
## 2.1.0
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- Updated dependencies [918294f]
|
|
22
|
+
- @module-federation/sdk@2.1.0
|
|
23
|
+
- @module-federation/bridge-shared@2.1.0
|
|
24
|
+
|
|
3
25
|
## 2.0.1
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
|
@@ -88,7 +110,6 @@
|
|
|
88
110
|
- dc103ee: fix: support React Router v6 in peer dependencies
|
|
89
111
|
|
|
90
112
|
Update react-router peer dependency from "^7" to "^6 || ^7" to fix npm install failures for projects using React Router v6.
|
|
91
|
-
|
|
92
113
|
- @module-federation/sdk@0.21.2
|
|
93
114
|
- @module-federation/bridge-shared@0.21.2
|
|
94
115
|
|
|
@@ -182,7 +203,6 @@
|
|
|
182
203
|
|
|
183
204
|
- 65aa038: chore(bridge-react): set sideEffects false
|
|
184
205
|
- a7cf276: chore: upgrade NX to 21.2.3, Storybook to 9.0.9, and TypeScript to 5.8.3
|
|
185
|
-
|
|
186
206
|
- Upgraded NX from 21.0.3 to 21.2.3 with workspace configuration updates
|
|
187
207
|
- Migrated Storybook from 8.3.5 to 9.0.9 with updated configurations and automigrations
|
|
188
208
|
- Upgraded TypeScript from 5.7.3 to 5.8.3 with compatibility fixes
|
|
@@ -191,7 +211,6 @@
|
|
|
191
211
|
- Updated build configurations and dependencies to support latest versions
|
|
192
212
|
|
|
193
213
|
- d31a326: refactor: sink React packages from root to individual packages
|
|
194
|
-
|
|
195
214
|
- Removed React dependencies from root package.json and moved them to packages that actually need them
|
|
196
215
|
- Fixed rsbuild-plugin configuration to match workspace patterns
|
|
197
216
|
- Updated tests to handle platform-specific files
|
package/dist/base.cjs.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const createHelpers = require("./createHelpers-
|
|
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
|
|
2
|
+
const lazyUtils = require("./utils-CFTy4LVE.js");
|
|
3
|
+
const logger = require("./logger-Dxblx6P-.js");
|
|
4
4
|
function wrapSetTimeout(targetPromise, delay = 2e4, id) {
|
|
5
5
|
if (targetPromise && typeof targetPromise.then === "function") {
|
|
6
6
|
return new Promise((resolve, reject) => {
|
|
@@ -98,7 +98,7 @@ const dataFetchServerMiddleware = async (ctx, next) => {
|
|
|
98
98
|
entryGlobalName: remoteInfo.globalName
|
|
99
99
|
}
|
|
100
100
|
]);
|
|
101
|
-
} else if (!("entry" in remote) || !remote.entry.includes(
|
|
101
|
+
} else if (!("entry" in remote) || !remote.entry.includes(logger.MANIFEST_EXT)) {
|
|
102
102
|
const { hostGlobalSnapshot, remoteSnapshot } = hostInstance2.snapshotHandler.getGlobalRemoteInfo(remoteInfo);
|
|
103
103
|
lazyUtils.logger.debug(
|
|
104
104
|
"find hostGlobalSnapshot: ",
|
|
@@ -140,7 +140,7 @@ const dataFetchServerMiddleware = async (ctx, next) => {
|
|
|
140
140
|
return ctx.json(res);
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
|
-
const remoteId = dataFetchKey.split(
|
|
143
|
+
const remoteId = dataFetchKey.split(logger.SEPARATOR)[0];
|
|
144
144
|
const hostInstance = globalThis.__FEDERATION__.__INSTANCES__[0];
|
|
145
145
|
if (!hostInstance) {
|
|
146
146
|
throw new Error("host instance not found!");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as DATA_FETCH_QUERY, l as logger, e as getDataFetchMap, i as initDataFetchMap, M as MF_DATA_FETCH_STATUS, f as fetchData, h as loadDataFetchModule } from "./utils-
|
|
2
|
-
import { M as MANIFEST_EXT, S as SEPARATOR } from "./
|
|
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 "./
|
|
2
|
+
import { c as createLogger } from "./logger-DwWkXsWl.mjs";
|
|
3
3
|
const RouterContext = React__default.createContext(null);
|
|
4
4
|
const LoggerInstance = createLogger(
|
|
5
5
|
"[ Module Federation Bridge React ]"
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const React = require("react");
|
|
3
|
-
const
|
|
3
|
+
const logger = require("./logger-Dxblx6P-.js");
|
|
4
4
|
const RouterContext = React.createContext(null);
|
|
5
|
-
const LoggerInstance =
|
|
5
|
+
const LoggerInstance = logger.createLogger(
|
|
6
6
|
"[ Module Federation Bridge React ]"
|
|
7
7
|
);
|
|
8
8
|
function pathJoin(...args) {
|
package/dist/index.cjs.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const createHelpers = require("./createHelpers-
|
|
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-C7jasFos.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-CrSLH5YP.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("./
|
|
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,17 +1,17 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import {
|
|
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
|
-
|
|
5
|
-
|
|
4
|
+
G as callAllDowngrade,
|
|
5
|
+
H as callDowngrade,
|
|
6
6
|
f as fetchData,
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
K as flushDataFetch,
|
|
8
|
+
N as getDataFetchCache,
|
|
9
9
|
u as getDataFetchIdWithErrorMsgs,
|
|
10
10
|
k as getDataFetchInfo,
|
|
11
11
|
n as getDataFetchItem,
|
|
12
12
|
e as getDataFetchMap,
|
|
13
13
|
m as getDataFetchMapKey,
|
|
14
|
-
|
|
14
|
+
I as getDowngradeTag,
|
|
15
15
|
y as getLoadedRemoteInfos,
|
|
16
16
|
i as initDataFetchMap,
|
|
17
17
|
q as isCSROnly,
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
const MANIFEST_EXT = ".json";
|
|
2
|
+
const BROWSER_LOG_KEY = "FEDERATION_DEBUG";
|
|
3
|
+
const SEPARATOR = ":";
|
|
4
|
+
const isBrowserEnvValue = typeof ENV_TARGET !== "undefined" ? ENV_TARGET === "web" : typeof window !== "undefined" && typeof window.document !== "undefined";
|
|
5
|
+
function isBrowserEnv() {
|
|
6
|
+
return isBrowserEnvValue;
|
|
7
|
+
}
|
|
8
|
+
function isBrowserDebug() {
|
|
9
|
+
try {
|
|
10
|
+
if (isBrowserEnv() && window.localStorage) return Boolean(localStorage.getItem(BROWSER_LOG_KEY));
|
|
11
|
+
} catch (error) {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
function isDebugMode() {
|
|
17
|
+
if (typeof process !== "undefined" && process.env && process.env["FEDERATION_DEBUG"]) return Boolean(process.env["FEDERATION_DEBUG"]);
|
|
18
|
+
if (typeof FEDERATION_DEBUG !== "undefined" && Boolean(FEDERATION_DEBUG)) return true;
|
|
19
|
+
return isBrowserDebug();
|
|
20
|
+
}
|
|
21
|
+
const PREFIX = "[ Module Federation ]";
|
|
22
|
+
const DEFAULT_DELEGATE = console;
|
|
23
|
+
const LOGGER_STACK_SKIP_TOKENS = [
|
|
24
|
+
"logger.ts",
|
|
25
|
+
"logger.js",
|
|
26
|
+
"captureStackTrace",
|
|
27
|
+
"Logger.emit",
|
|
28
|
+
"Logger.log",
|
|
29
|
+
"Logger.info",
|
|
30
|
+
"Logger.warn",
|
|
31
|
+
"Logger.error",
|
|
32
|
+
"Logger.debug"
|
|
33
|
+
];
|
|
34
|
+
function captureStackTrace() {
|
|
35
|
+
try {
|
|
36
|
+
const stack = (/* @__PURE__ */ new Error()).stack;
|
|
37
|
+
if (!stack) return;
|
|
38
|
+
const [, ...rawLines] = stack.split("\n");
|
|
39
|
+
const filtered = rawLines.filter((line) => !LOGGER_STACK_SKIP_TOKENS.some((token) => line.includes(token)));
|
|
40
|
+
if (!filtered.length) return;
|
|
41
|
+
return `Stack trace:
|
|
42
|
+
${filtered.slice(0, 5).join("\n")}`;
|
|
43
|
+
} catch {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
var Logger = class {
|
|
48
|
+
constructor(prefix, delegate = DEFAULT_DELEGATE) {
|
|
49
|
+
this.prefix = prefix;
|
|
50
|
+
this.delegate = delegate ?? DEFAULT_DELEGATE;
|
|
51
|
+
}
|
|
52
|
+
setPrefix(prefix) {
|
|
53
|
+
this.prefix = prefix;
|
|
54
|
+
}
|
|
55
|
+
setDelegate(delegate) {
|
|
56
|
+
this.delegate = delegate ?? DEFAULT_DELEGATE;
|
|
57
|
+
}
|
|
58
|
+
emit(method, args) {
|
|
59
|
+
const delegate = this.delegate;
|
|
60
|
+
const stackTrace = isDebugMode() ? captureStackTrace() : void 0;
|
|
61
|
+
const enrichedArgs = stackTrace ? [...args, stackTrace] : args;
|
|
62
|
+
const order = (() => {
|
|
63
|
+
switch (method) {
|
|
64
|
+
case "log":
|
|
65
|
+
return ["log", "info"];
|
|
66
|
+
case "info":
|
|
67
|
+
return ["info", "log"];
|
|
68
|
+
case "warn":
|
|
69
|
+
return [
|
|
70
|
+
"warn",
|
|
71
|
+
"info",
|
|
72
|
+
"log"
|
|
73
|
+
];
|
|
74
|
+
case "error":
|
|
75
|
+
return [
|
|
76
|
+
"error",
|
|
77
|
+
"warn",
|
|
78
|
+
"log"
|
|
79
|
+
];
|
|
80
|
+
default:
|
|
81
|
+
return ["debug", "log"];
|
|
82
|
+
}
|
|
83
|
+
})();
|
|
84
|
+
for (const candidate of order) {
|
|
85
|
+
const handler = delegate[candidate];
|
|
86
|
+
if (typeof handler === "function") {
|
|
87
|
+
handler.call(delegate, this.prefix, ...enrichedArgs);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
for (const candidate of order) {
|
|
92
|
+
const handler = DEFAULT_DELEGATE[candidate];
|
|
93
|
+
if (typeof handler === "function") {
|
|
94
|
+
handler.call(DEFAULT_DELEGATE, this.prefix, ...enrichedArgs);
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
log(...args) {
|
|
100
|
+
this.emit("log", args);
|
|
101
|
+
}
|
|
102
|
+
warn(...args) {
|
|
103
|
+
this.emit("warn", args);
|
|
104
|
+
}
|
|
105
|
+
error(...args) {
|
|
106
|
+
this.emit("error", args);
|
|
107
|
+
}
|
|
108
|
+
success(...args) {
|
|
109
|
+
this.emit("info", args);
|
|
110
|
+
}
|
|
111
|
+
info(...args) {
|
|
112
|
+
this.emit("info", args);
|
|
113
|
+
}
|
|
114
|
+
ready(...args) {
|
|
115
|
+
this.emit("info", args);
|
|
116
|
+
}
|
|
117
|
+
debug(...args) {
|
|
118
|
+
if (isDebugMode()) this.emit("debug", args);
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
function createLogger(prefix) {
|
|
122
|
+
return new Logger(prefix);
|
|
123
|
+
}
|
|
124
|
+
function createInfrastructureLogger(prefix) {
|
|
125
|
+
const infrastructureLogger = new Logger(prefix);
|
|
126
|
+
Object.defineProperty(infrastructureLogger, "__mf_infrastructure_logger__", {
|
|
127
|
+
value: true,
|
|
128
|
+
enumerable: false,
|
|
129
|
+
configurable: false
|
|
130
|
+
});
|
|
131
|
+
return infrastructureLogger;
|
|
132
|
+
}
|
|
133
|
+
createInfrastructureLogger(PREFIX);
|
|
134
|
+
export {
|
|
135
|
+
MANIFEST_EXT as M,
|
|
136
|
+
SEPARATOR as S,
|
|
137
|
+
createLogger as c,
|
|
138
|
+
isBrowserEnvValue as i
|
|
139
|
+
};
|