@module-federation/bridge-react 0.0.0-perf-devtools-20260107043700 → 0.0.0-perf-website-code-usage-20260914033703
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/dist/base.cjs.js +4 -4
- package/dist/base.d.ts +8 -311
- package/dist/base.es.js +11 -11
- package/dist/{bridge-base-CPSTBjEp.mjs → bridge-base-CHnL6Q9P.mjs} +63 -103
- package/dist/{bridge-base-RStDxH71.js → bridge-base-DSYKAGGD.js} +63 -102
- package/dist/{createHelpers-Ui5pt7je.mjs → createHelpers-D3Sg5lKp.mjs} +32 -17
- package/dist/{createHelpers-B_L612IN.js → createHelpers-D6thyyLv.js} +30 -15
- package/dist/data-fetch-server-middleware.cjs.js +4 -4
- package/dist/data-fetch-server-middleware.d.ts +1 -15
- package/dist/data-fetch-server-middleware.es.js +2 -2
- package/dist/data-fetch-utils.cjs.js +2 -2
- package/dist/data-fetch-utils.d.ts +1 -81
- package/dist/data-fetch-utils.es.js +7 -7
- package/dist/data-fetch.cjs.js +22 -0
- package/dist/data-fetch.d.ts +4 -0
- package/dist/data-fetch.es.js +22 -0
- package/dist/error-boundary.d.ts +17 -0
- package/dist/error-boundary.spec.d.ts +1 -0
- package/dist/{index-DyQNwY2M.mjs → index-Bs2NxD2z.mjs} +1 -1
- package/dist/{index-DRSBaSu3.js → index-DbjGCKOr.js} +2 -2
- package/dist/index.cjs.js +27 -6
- package/dist/index.d.ts +12 -299
- package/dist/index.es.js +34 -13
- package/dist/lazy/AwaitDataFetch.d.ts +24 -0
- package/dist/lazy/HydratedStylesheetAssets.d.ts +4 -0
- package/dist/lazy/constant.d.ts +26 -0
- package/dist/lazy/createLazyComponent.d.ts +28 -0
- package/dist/lazy/data-fetch/cache.d.ts +34 -0
- package/dist/lazy/data-fetch/cache.spec.d.ts +1 -0
- package/dist/lazy/data-fetch/call-data-fetch.d.ts +1 -0
- package/dist/lazy/data-fetch/data-fetch-server-middleware.d.ts +3 -0
- package/{src/lazy/data-fetch/index.ts → dist/lazy/data-fetch/index.d.ts} +1 -11
- package/dist/lazy/data-fetch/inject-data-fetch.d.ts +4 -0
- package/dist/lazy/data-fetch/prefetch.d.ts +9 -0
- package/dist/lazy/data-fetch/runtime-plugin.d.ts +3 -0
- package/dist/lazy/index.d.ts +9 -0
- package/dist/lazy/logger.d.ts +2 -0
- package/dist/lazy/types.d.ts +60 -0
- package/dist/lazy/utils.d.ts +48 -0
- package/dist/lazy/wrapNoSSR.d.ts +9 -0
- package/dist/{lazy-load-component-plugin-Dr5VV1mu.js → lazy-load-component-plugin-DSURjnZ0.js} +170 -44
- package/dist/{lazy-load-component-plugin-CNyT62wB.mjs → lazy-load-component-plugin-NZphPG7_.mjs} +174 -48
- package/dist/lazy-load-component-plugin.cjs.js +2 -2
- package/dist/lazy-load-component-plugin.d.ts +2 -16
- package/dist/lazy-load-component-plugin.es.js +2 -2
- package/dist/lazy-utils.cjs.js +2 -2
- package/dist/lazy-utils.d.ts +1 -149
- package/dist/lazy-utils.es.js +19 -19
- package/dist/logger-DwWkXsWl.mjs +139 -0
- package/dist/logger-Dxblx6P-.js +138 -0
- package/dist/plugin.d.ts +2 -22
- package/dist/plugins/lazy-load-component-plugin.d.ts +12 -0
- package/dist/plugins/lazy-load-component-plugin.spec.d.ts +1 -0
- package/dist/prefetch-Bxf6DSx_.js +1477 -0
- package/dist/prefetch-TKq_EK_q.mjs +1478 -0
- package/dist/provider/context.d.ts +3 -0
- package/dist/provider/plugin.d.ts +7 -0
- package/dist/provider/versions/bridge-base.d.ts +5 -0
- package/dist/provider/versions/legacy.d.ts +26 -0
- package/dist/provider/versions/v18.d.ts +19 -0
- package/dist/provider/versions/v19.d.ts +21 -0
- package/dist/remote/RemoteAppWrapper.d.ts +7 -0
- package/dist/remote/base-component/create.d.ts +9 -0
- package/dist/remote/base-component/index.d.ts +5 -0
- package/dist/remote/createHelpers.d.ts +17 -0
- package/dist/remote/router-component/component.d.ts +8 -0
- package/dist/remote/router-component/create.d.ts +9 -0
- package/dist/remote/router-component/index.d.ts +5 -0
- package/dist/router/default.d.ts +7 -0
- package/dist/router/v5.d.ts +4 -0
- package/dist/router/v6.d.ts +7 -0
- package/dist/router/v7.d.ts +6 -0
- package/dist/router-v5.cjs.js +5 -3
- package/dist/router-v5.d.ts +1 -18
- package/dist/router-v5.es.js +5 -3
- package/dist/router-v6.cjs.js +1 -1
- package/dist/router-v6.d.ts +1 -20
- package/dist/router-v6.es.js +1 -1
- package/dist/router-v7.cjs.js +5 -3
- package/dist/router-v7.d.ts +1 -20
- package/dist/router-v7.es.js +5 -3
- package/dist/router.cjs.js +1 -1
- package/dist/router.d.ts +1 -20
- package/dist/router.es.js +1 -1
- package/dist/shared/size-limited-cache.d.ts +29 -0
- package/dist/shared/size-limited-cache.spec.d.ts +1 -0
- package/dist/size-limited-cache.cjs.js +82 -0
- package/dist/size-limited-cache.d.ts +1 -0
- package/dist/size-limited-cache.es.js +82 -0
- package/dist/types.d.ts +137 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils-5dGErM3C.js +588 -0
- package/dist/utils-BBP3hEeV.mjs +589 -0
- package/dist/v18.cjs.js +1 -1
- package/dist/v18.d.ts +3 -114
- package/dist/v18.es.js +1 -1
- package/dist/v19.cjs.js +1 -1
- package/dist/v19.d.ts +3 -115
- package/dist/v19.es.js +1 -1
- package/package.json +35 -14
- package/CHANGELOG.md +0 -735
- package/__tests__/bridge.spec.tsx +0 -160
- package/__tests__/createLazyComponent.spec.tsx +0 -209
- package/__tests__/prefetch.spec.ts +0 -156
- package/__tests__/router.spec.tsx +0 -82
- package/__tests__/setupTests.ts +0 -8
- package/__tests__/util.ts +0 -36
- package/dist/index.esm-BWaKho-8.js +0 -491
- package/dist/index.esm-CPwSeCvw.mjs +0 -492
- package/dist/prefetch-J3x-_5zT.js +0 -1272
- package/dist/prefetch-lrSPKiuu.mjs +0 -1273
- package/dist/utils-dUgb9Jkm.mjs +0 -2016
- package/dist/utils-tM9yE73c.js +0 -2015
- package/jest.config.ts +0 -21
- package/project.json +0 -23
- package/src/base.ts +0 -50
- package/src/index.ts +0 -50
- package/src/lazy/AwaitDataFetch.tsx +0 -215
- package/src/lazy/constant.ts +0 -30
- package/src/lazy/createLazyComponent.tsx +0 -411
- package/src/lazy/data-fetch/cache.ts +0 -291
- package/src/lazy/data-fetch/call-data-fetch.ts +0 -13
- package/src/lazy/data-fetch/data-fetch-server-middleware.ts +0 -196
- package/src/lazy/data-fetch/inject-data-fetch.ts +0 -109
- package/src/lazy/data-fetch/prefetch.ts +0 -112
- package/src/lazy/data-fetch/runtime-plugin.ts +0 -115
- package/src/lazy/index.ts +0 -35
- package/src/lazy/logger.ts +0 -6
- package/src/lazy/types.ts +0 -75
- package/src/lazy/utils.ts +0 -372
- package/src/lazy/wrapNoSSR.tsx +0 -10
- package/src/modern-app-env.d.ts +0 -2
- package/src/plugins/lazy-load-component-plugin.spec.ts +0 -21
- package/src/plugins/lazy-load-component-plugin.ts +0 -57
- package/src/provider/context.tsx +0 -4
- package/src/provider/plugin.ts +0 -22
- package/src/provider/versions/bridge-base.tsx +0 -150
- package/src/provider/versions/legacy.ts +0 -87
- package/src/provider/versions/v18.ts +0 -47
- package/src/provider/versions/v19.ts +0 -48
- package/src/remote/RemoteAppWrapper.tsx +0 -108
- package/src/remote/base-component/create.tsx +0 -23
- package/src/remote/base-component/index.tsx +0 -10
- package/src/remote/createHelpers.tsx +0 -130
- package/src/remote/router-component/component.tsx +0 -104
- package/src/remote/router-component/create.tsx +0 -23
- package/src/remote/router-component/index.tsx +0 -10
- package/src/router/default.tsx +0 -73
- package/src/router/v5.tsx +0 -43
- package/src/router/v6.tsx +0 -74
- package/src/router/v7.tsx +0 -75
- package/src/types.ts +0 -147
- package/src/utils/index.ts +0 -44
- package/src/v18.ts +0 -9
- package/src/v19.ts +0 -9
- package/tsconfig.json +0 -42
- package/tsconfig.node.json +0 -11
- package/tsconfig.spec.json +0 -26
- package/vite.config.ts +0 -112
- package/vitest.config.ts +0 -27
- /package/{src/remote/base-component/component.tsx → dist/remote/base-component/component.d.ts} +0 -0
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-CHnL6Q9P.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-DSYKAGGD.js");
|
|
5
5
|
function createReact19Root(container, options) {
|
|
6
6
|
return client.createRoot(container, options);
|
|
7
7
|
}
|
package/dist/v19.d.ts
CHANGED
|
@@ -1,115 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export declare function createBridgeComponent<T = any>(bridgeInfo: Omit<ProviderFnParams<T>, 'createRoot'>): () => {
|
|
5
|
-
render(info: RenderParams): Promise<void>;
|
|
6
|
-
destroy(info: DestroyParams): void;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export declare interface CreateRootOptions {
|
|
10
|
-
identifierPrefix?: string;
|
|
11
|
-
onRecoverableError?: (error: unknown, errorInfo: unknown) => void;
|
|
12
|
-
transitionCallbacks?: unknown;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Options for creating a React root
|
|
17
|
-
*/
|
|
18
|
-
declare interface CreateRootOptions_2 {
|
|
19
|
-
identifierPrefix?: string;
|
|
20
|
-
onRecoverableError?: (error: unknown) => void;
|
|
21
|
-
transitionCallbacks?: unknown;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Parameters for the destroy function
|
|
26
|
-
*/
|
|
27
|
-
export declare interface DestroyParams {
|
|
28
|
-
moduleName: string;
|
|
29
|
-
dom: HTMLElement;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Parameters for the provider function
|
|
34
|
-
*/
|
|
35
|
-
export declare interface ProviderFnParams<T> {
|
|
36
|
-
rootComponent: React_2.ComponentType<T>;
|
|
37
|
-
render?: (App: React_2.ReactElement, id?: HTMLElement | string) => RootType | Promise<RootType>;
|
|
38
|
-
createRoot?: (container: Element | DocumentFragment, options?: CreateRootOptions_2) => Root_2;
|
|
39
|
-
/**
|
|
40
|
-
* Default options to pass to createRoot for React 18 and 19
|
|
41
|
-
* These options will be used when creating a root unless overridden by rootOptions in render params
|
|
42
|
-
* @example
|
|
43
|
-
* {
|
|
44
|
-
* identifierPrefix: 'app-',
|
|
45
|
-
* onRecoverableError: (err) => console.error(err)
|
|
46
|
-
* }
|
|
47
|
-
*/
|
|
48
|
-
defaultRootOptions?: CreateRootOptions_2;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Parameters for the provider function
|
|
53
|
-
*/
|
|
54
|
-
export declare interface ProviderParams {
|
|
55
|
-
moduleName?: string;
|
|
56
|
-
basename?: string;
|
|
57
|
-
memoryRoute?: {
|
|
58
|
-
entryPath: string;
|
|
59
|
-
initialState?: Record<string, unknown>;
|
|
60
|
-
};
|
|
61
|
-
style?: React_2.CSSProperties;
|
|
62
|
-
className?: string;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Parameters for the render function
|
|
67
|
-
*/
|
|
68
|
-
export declare interface RenderParams {
|
|
69
|
-
moduleName?: string;
|
|
70
|
-
basename?: string;
|
|
71
|
-
memoryRoute?: {
|
|
72
|
-
entryPath: string;
|
|
73
|
-
initialState?: Record<string, unknown>;
|
|
74
|
-
};
|
|
75
|
-
dom: HTMLElement;
|
|
76
|
-
/**
|
|
77
|
-
* Options to pass to createRoot for React 18 and 19
|
|
78
|
-
* @example
|
|
79
|
-
* {
|
|
80
|
-
* identifierPrefix: 'app-',
|
|
81
|
-
* onRecoverableError: (err) => console.error(err)
|
|
82
|
-
* }
|
|
83
|
-
*/
|
|
84
|
-
rootOptions?: CreateRootOptions_2;
|
|
85
|
-
[key: string]: unknown;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
export declare interface Root {
|
|
89
|
-
render(children: default_2.ReactNode): void;
|
|
90
|
-
unmount(): void;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* Interface for a React root object
|
|
95
|
-
*/
|
|
96
|
-
declare interface Root_2 {
|
|
97
|
-
render(children: React_2.ReactNode): void;
|
|
98
|
-
unmount(): void;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* Type for a root element, which can be either an HTMLElement or a React root
|
|
103
|
-
*/
|
|
104
|
-
export declare type RootType = HTMLElement | Root_2;
|
|
105
|
-
|
|
106
|
-
export { }
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
declare module '@module-federation/runtime-core' {
|
|
110
|
-
interface ModuleFederation {
|
|
111
|
-
createLazyComponent<T, E extends keyof T>(options: Omit<CreateLazyComponentOptions<T, E>, 'instance'>): ReturnType<typeof createLazyComponent<T, E>>;
|
|
112
|
-
prefetch(options: Omit<PrefetchOptions, 'instance'>): ReturnType<typeof prefetch>;
|
|
113
|
-
collectSSRAssets(options: Omit<Parameters<typeof collectSSRAssets>[0], 'instance'>): ReturnType<typeof collectSSRAssets>;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
1
|
+
export { createBridgeComponent } from './provider/versions/v19';
|
|
2
|
+
export type { CreateRootOptions, Root } from './provider/versions/v19';
|
|
3
|
+
export type { ProviderParams, ProviderFnParams, RootType, DestroyParams, RenderParams, } from './types';
|
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-CHnL6Q9P.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": "0.0.0-perf-
|
|
3
|
+
"version": "0.0.0-perf-website-code-usage-20260914033703",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -12,6 +12,10 @@
|
|
|
12
12
|
"url": "git+https://github.com/module-federation/core.git",
|
|
13
13
|
"directory": "packages/bridge/bridge-react"
|
|
14
14
|
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist/",
|
|
17
|
+
"README.md"
|
|
18
|
+
],
|
|
15
19
|
"main": "./dist/index.cjs.js",
|
|
16
20
|
"module": "./dist/index.es.js",
|
|
17
21
|
"types": "./dist/index.d.ts",
|
|
@@ -71,6 +75,11 @@
|
|
|
71
75
|
"import": "./dist/data-fetch-utils.es.js",
|
|
72
76
|
"require": "./dist/data-fetch-utils.cjs.js"
|
|
73
77
|
},
|
|
78
|
+
"./data-fetch": {
|
|
79
|
+
"types": "./dist/data-fetch.d.ts",
|
|
80
|
+
"import": "./dist/data-fetch.es.js",
|
|
81
|
+
"require": "./dist/data-fetch.cjs.js"
|
|
82
|
+
},
|
|
74
83
|
"./data-fetch-server-middleware": {
|
|
75
84
|
"types": "./dist/data-fetch-server-middleware.d.ts",
|
|
76
85
|
"import": "./dist/data-fetch-server-middleware.es.js",
|
|
@@ -81,6 +90,11 @@
|
|
|
81
90
|
"import": "./dist/lazy-load-component-plugin.es.js",
|
|
82
91
|
"require": "./dist/lazy-load-component-plugin.cjs.js"
|
|
83
92
|
},
|
|
93
|
+
"./size-limited-cache": {
|
|
94
|
+
"types": "./dist/size-limited-cache.d.ts",
|
|
95
|
+
"import": "./dist/size-limited-cache.es.js",
|
|
96
|
+
"require": "./dist/size-limited-cache.cjs.js"
|
|
97
|
+
},
|
|
84
98
|
"./*": "./*"
|
|
85
99
|
},
|
|
86
100
|
"typesVersions": {
|
|
@@ -121,16 +135,19 @@
|
|
|
121
135
|
"data-fetch-utils": [
|
|
122
136
|
"./dist/data-fetch-utils.d.ts"
|
|
123
137
|
],
|
|
138
|
+
"data-fetch": [
|
|
139
|
+
"./dist/data-fetch.d.ts"
|
|
140
|
+
],
|
|
124
141
|
"data-fetch-server-middleware": [
|
|
125
142
|
"./dist/data-fetch-server-middleware.d.ts"
|
|
143
|
+
],
|
|
144
|
+
"size-limited-cache": [
|
|
145
|
+
"./dist/size-limited-cache.d.ts"
|
|
126
146
|
]
|
|
127
147
|
}
|
|
128
148
|
},
|
|
129
149
|
"dependencies": {
|
|
130
|
-
"
|
|
131
|
-
"lru-cache": "^10.4.3",
|
|
132
|
-
"@module-federation/bridge-shared": "0.0.0-perf-devtools-20260107043700",
|
|
133
|
-
"@module-federation/sdk": "0.0.0-perf-devtools-20260107043700"
|
|
150
|
+
"@module-federation/sdk": "0.0.0-perf-website-code-usage-20260914033703"
|
|
134
151
|
},
|
|
135
152
|
"peerDependencies": {
|
|
136
153
|
"react": ">=16.9.0",
|
|
@@ -147,6 +164,7 @@
|
|
|
147
164
|
}
|
|
148
165
|
},
|
|
149
166
|
"devDependencies": {
|
|
167
|
+
"@rsbuild/plugin-react": "2.1.0",
|
|
150
168
|
"@testing-library/react": "15.0.7",
|
|
151
169
|
"@testing-library/jest-dom": "6.6.3",
|
|
152
170
|
"@types/react": "18.2.79",
|
|
@@ -156,18 +174,21 @@
|
|
|
156
174
|
"@vitejs/plugin-vue-jsx": "^4.0.0",
|
|
157
175
|
"react": "18.3.1",
|
|
158
176
|
"react-dom": "18.3.1",
|
|
159
|
-
"react-router-dom": "6.
|
|
160
|
-
"react-router": "7.
|
|
161
|
-
"typescript": "
|
|
177
|
+
"react-router-dom": "6.30.3",
|
|
178
|
+
"react-router": "7.18.2",
|
|
179
|
+
"typescript": "7.0.2",
|
|
162
180
|
"vite": "^5.4.21",
|
|
163
|
-
"
|
|
164
|
-
"
|
|
165
|
-
"@module-federation/
|
|
166
|
-
"@module-federation/runtime": "0.0.0-perf-
|
|
181
|
+
"hono": "4.13.1",
|
|
182
|
+
"@module-federation/runtime": "0.0.0-perf-website-code-usage-20260914033703",
|
|
183
|
+
"@module-federation/bridge-shared": "0.0.0-perf-website-code-usage-20260914033703",
|
|
184
|
+
"@module-federation/runtime-core": "0.0.0-perf-website-code-usage-20260914033703"
|
|
167
185
|
},
|
|
168
186
|
"scripts": {
|
|
169
187
|
"dev": "vite",
|
|
170
|
-
"build": "vite build",
|
|
171
|
-
"preview": "vite preview"
|
|
188
|
+
"build": "vite build && tsc -p tsconfig.json && node scripts/write-dts-entrypoints.mjs",
|
|
189
|
+
"preview": "vite preview",
|
|
190
|
+
"test": "pnpm run test:jest && pnpm run test:rstest",
|
|
191
|
+
"test:jest": "pnpm exec jest --config jest.config.js --passWithNoTests",
|
|
192
|
+
"test:rstest": "pnpm exec rstest --passWithNoTests"
|
|
172
193
|
}
|
|
173
194
|
}
|