@module-federation/bridge-react 2.6.0 → 2.8.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/dist/base.cjs.js +4 -4
- package/dist/base.d.ts +8 -311
- package/dist/base.es.js +5 -5
- package/dist/{bridge-base-CIOXqUYV.mjs → bridge-base-BaKy6CY_.mjs} +25 -92
- package/dist/{bridge-base-HLp3d7aF.js → bridge-base-Ch33UJuN.js} +25 -91
- package/dist/{createHelpers-DNBacpxb.js → createHelpers-19BP0xtB.js} +2 -3
- package/dist/{createHelpers-BY5Uj9_Z.mjs → createHelpers-BSHeKyd-.mjs} +2 -3
- package/dist/data-fetch-server-middleware.cjs.js +1 -1
- package/dist/data-fetch-server-middleware.d.ts +1 -15
- package/dist/data-fetch-server-middleware.es.js +1 -1
- 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 +4 -4
- package/dist/data-fetch.cjs.js +3 -3
- package/dist/data-fetch.d.ts +4 -140
- package/dist/data-fetch.es.js +3 -3
- package/dist/error-boundary.d.ts +17 -0
- package/dist/error-boundary.spec.d.ts +1 -0
- package/dist/index.cjs.js +4 -4
- package/dist/index.d.ts +12 -299
- package/dist/index.es.js +5 -5
- package/dist/lazy/AwaitDataFetch.d.ts +24 -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/dist/lazy/data-fetch/index.d.ts +6 -0
- 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-BYI941I2.mjs → lazy-load-component-plugin-DEu-DfZt.mjs} +2 -2
- package/dist/{lazy-load-component-plugin-DG4e3Tib.js → lazy-load-component-plugin-FKp6nQa-.js} +2 -2
- 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 +1 -1
- package/dist/lazy-utils.d.ts +1 -149
- package/dist/lazy-utils.es.js +2 -2
- 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-DzO9_QQ-.mjs → prefetch-CTZuFBqh.mjs} +387 -16
- package/dist/{prefetch-CG2l-06N.js → prefetch-D66kL1aM.js} +387 -16
- 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/component.d.ts +2 -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.d.ts +1 -17
- package/dist/router-v6.d.ts +1 -20
- package/dist/router-v7.d.ts +1 -19
- package/dist/router.d.ts +1 -20
- 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 +20 -13
- package/dist/utils-CFTy4LVE.js +0 -2029
- package/dist/utils-DGS4pYp8.mjs +0 -2030
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-BaKy6CY_.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-Ch33UJuN.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-BaKy6CY_.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.
|
|
3
|
+
"version": "2.8.0",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -90,6 +90,11 @@
|
|
|
90
90
|
"import": "./dist/lazy-load-component-plugin.es.js",
|
|
91
91
|
"require": "./dist/lazy-load-component-plugin.cjs.js"
|
|
92
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
|
+
},
|
|
93
98
|
"./*": "./*"
|
|
94
99
|
},
|
|
95
100
|
"typesVersions": {
|
|
@@ -135,12 +140,14 @@
|
|
|
135
140
|
],
|
|
136
141
|
"data-fetch-server-middleware": [
|
|
137
142
|
"./dist/data-fetch-server-middleware.d.ts"
|
|
143
|
+
],
|
|
144
|
+
"size-limited-cache": [
|
|
145
|
+
"./dist/size-limited-cache.d.ts"
|
|
138
146
|
]
|
|
139
147
|
}
|
|
140
148
|
},
|
|
141
149
|
"dependencies": {
|
|
142
|
-
"
|
|
143
|
-
"@module-federation/sdk": "2.6.0"
|
|
150
|
+
"@module-federation/sdk": "2.8.0"
|
|
144
151
|
},
|
|
145
152
|
"peerDependencies": {
|
|
146
153
|
"react": ">=16.9.0",
|
|
@@ -157,7 +164,7 @@
|
|
|
157
164
|
}
|
|
158
165
|
},
|
|
159
166
|
"devDependencies": {
|
|
160
|
-
"react
|
|
167
|
+
"@rsbuild/plugin-react": "2.1.0",
|
|
161
168
|
"@testing-library/react": "15.0.7",
|
|
162
169
|
"@testing-library/jest-dom": "6.6.3",
|
|
163
170
|
"@types/react": "18.2.79",
|
|
@@ -169,19 +176,19 @@
|
|
|
169
176
|
"react-dom": "18.3.1",
|
|
170
177
|
"react-router-dom": "6.30.3",
|
|
171
178
|
"react-router": "7.16.0",
|
|
172
|
-
"typescript": "
|
|
179
|
+
"typescript": "7.0.2",
|
|
173
180
|
"vite": "^5.4.21",
|
|
174
|
-
"
|
|
175
|
-
"
|
|
176
|
-
"
|
|
177
|
-
"@module-federation/
|
|
178
|
-
"@module-federation/runtime": "2.6.0",
|
|
179
|
-
"@module-federation/runtime-core": "2.6.0"
|
|
181
|
+
"hono": "4.12.26",
|
|
182
|
+
"@module-federation/bridge-shared": "2.8.0",
|
|
183
|
+
"@module-federation/runtime": "2.8.0",
|
|
184
|
+
"@module-federation/runtime-core": "2.8.0"
|
|
180
185
|
},
|
|
181
186
|
"scripts": {
|
|
182
187
|
"dev": "vite",
|
|
183
|
-
"build": "vite build",
|
|
188
|
+
"build": "vite build && tsc -p tsconfig.json && node scripts/write-dts-entrypoints.mjs",
|
|
184
189
|
"preview": "vite preview",
|
|
185
|
-
"test": "pnpm
|
|
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"
|
|
186
193
|
}
|
|
187
194
|
}
|