@module-federation/bridge-react 0.21.0 → 0.21.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/CHANGELOG.md +7 -0
- package/dist/data-fetch-utils.cjs.js +1 -1
- package/dist/data-fetch-utils.es.js +2 -2
- package/dist/index.cjs.js +2 -2
- package/dist/index.d.ts +26 -3
- package/dist/index.es.js +2 -2
- package/dist/{lazy-load-component-plugin-B-nqmULm.js → lazy-load-component-plugin-IOan5uEb.js} +1 -1
- package/dist/{lazy-load-component-plugin-D_--Azke.mjs → lazy-load-component-plugin-ZkRCYTos.mjs} +1 -1
- package/dist/lazy-load-component-plugin.cjs.js +2 -2
- package/dist/lazy-load-component-plugin.es.js +2 -2
- package/dist/{prefetch-C8kORtvg.js → prefetch-CTmmXyx-.js} +1 -1
- package/dist/{prefetch-Cxo6GKct.mjs → prefetch-D6cu5QUG.mjs} +1 -1
- package/package.json +5 -5
- package/src/index.ts +5 -0
- package/src/remote/create.tsx +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const lazyUtils = require("./utils-tM9yE73c.js");
|
|
4
|
-
const prefetch = require("./prefetch-
|
|
4
|
+
const prefetch = require("./prefetch-CTmmXyx-.js");
|
|
5
5
|
async function callDataFetch() {
|
|
6
6
|
const dataFetch = globalThis[lazyUtils.DATA_FETCH_FUNCTION];
|
|
7
7
|
if (dataFetch) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { x as DATA_FETCH_FUNCTION } from "./utils-Bx_8GGd-.mjs";
|
|
2
2
|
import { C, b, e, h, c, d, r } from "./utils-Bx_8GGd-.mjs";
|
|
3
|
-
import { d as dataFetchFunction } from "./prefetch-
|
|
4
|
-
import { i, p } from "./prefetch-
|
|
3
|
+
import { d as dataFetchFunction } from "./prefetch-D6cu5QUG.mjs";
|
|
4
|
+
import { i, p } from "./prefetch-D6cu5QUG.mjs";
|
|
5
5
|
async function callDataFetch() {
|
|
6
6
|
const dataFetch = globalThis[DATA_FETCH_FUNCTION];
|
|
7
7
|
if (dataFetch) {
|
package/dist/index.cjs.js
CHANGED
|
@@ -6,10 +6,10 @@ const index = require("./index-DRSBaSu3.js");
|
|
|
6
6
|
const React = require("react");
|
|
7
7
|
const ReactRouterDOM = require("react-router-dom");
|
|
8
8
|
const plugin = require("./plugin.cjs.js");
|
|
9
|
-
const lazyLoadComponentPlugin = require("./lazy-load-component-plugin-
|
|
9
|
+
const lazyLoadComponentPlugin = require("./lazy-load-component-plugin-IOan5uEb.js");
|
|
10
10
|
const lazyUtils = require("./utils-tM9yE73c.js");
|
|
11
11
|
const dataFetchUtils = require("./data-fetch-utils.cjs.js");
|
|
12
|
-
const prefetch = require("./prefetch-
|
|
12
|
+
const prefetch = require("./prefetch-CTmmXyx-.js");
|
|
13
13
|
function _interopNamespaceDefault(e2) {
|
|
14
14
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
15
15
|
if (e2) {
|
package/dist/index.d.ts
CHANGED
|
@@ -134,7 +134,7 @@ export declare function generateKey(dataFetchOptions: DataFetchParams): string;
|
|
|
134
134
|
|
|
135
135
|
export declare function lazyLoadComponentPlugin(): ModuleFederationRuntimePlugin;
|
|
136
136
|
|
|
137
|
-
declare type LazyRemoteComponentInfo<T, _E extends keyof T> = RemoteComponentParams<T>;
|
|
137
|
+
export declare type LazyRemoteComponentInfo<T, _E extends keyof T> = RemoteComponentParams<T>;
|
|
138
138
|
|
|
139
139
|
export declare type NoSSRRemoteInfo = {
|
|
140
140
|
name: string;
|
|
@@ -193,7 +193,7 @@ declare type ReactKey = {
|
|
|
193
193
|
/**
|
|
194
194
|
* Parameters for the remote component loader
|
|
195
195
|
*/
|
|
196
|
-
declare interface RemoteComponentParams<T = Record<string, unknown>, E extends keyof T = keyof T> {
|
|
196
|
+
export declare interface RemoteComponentParams<T = Record<string, unknown>, E extends keyof T = keyof T> {
|
|
197
197
|
loader: () => Promise<T>;
|
|
198
198
|
loading: React_2.ReactNode;
|
|
199
199
|
fallback: React_2.ComponentType<{
|
|
@@ -206,7 +206,7 @@ declare interface RemoteComponentParams<T = Record<string, unknown>, E extends k
|
|
|
206
206
|
/**
|
|
207
207
|
* Parameters for the remote component
|
|
208
208
|
*/
|
|
209
|
-
declare interface RemoteComponentProps<T = Record<string, unknown>> {
|
|
209
|
+
export declare interface RemoteComponentProps<T = Record<string, unknown>> {
|
|
210
210
|
props?: T;
|
|
211
211
|
fallback?: React_2.ComponentType<{
|
|
212
212
|
error: Error;
|
|
@@ -215,6 +215,29 @@ declare interface RemoteComponentProps<T = Record<string, unknown>> {
|
|
|
215
215
|
[key: string]: unknown;
|
|
216
216
|
}
|
|
217
217
|
|
|
218
|
+
/**
|
|
219
|
+
* Interface for a remote module provider
|
|
220
|
+
*/
|
|
221
|
+
export declare interface RemoteModule {
|
|
222
|
+
provider: () => {
|
|
223
|
+
render: (info: RenderFnParams) => void;
|
|
224
|
+
destroy: (info: {
|
|
225
|
+
dom: any;
|
|
226
|
+
}) => void;
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Parameters for the render function, extending ProviderParams
|
|
232
|
+
*/
|
|
233
|
+
export declare interface RenderFnParams extends ProviderParams {
|
|
234
|
+
dom: HTMLElement;
|
|
235
|
+
fallback?: React_2.ComponentType<{
|
|
236
|
+
error: Error;
|
|
237
|
+
}>;
|
|
238
|
+
[key: string]: unknown;
|
|
239
|
+
}
|
|
240
|
+
|
|
218
241
|
/**
|
|
219
242
|
* Parameters for the render function
|
|
220
243
|
*/
|
package/dist/index.es.js
CHANGED
|
@@ -4,10 +4,10 @@ import { L as LoggerInstance, p as pathJoin, g as getRootDomDefaultClassName } f
|
|
|
4
4
|
import React__default, { forwardRef, useContext, useState, useEffect, useRef } from "react";
|
|
5
5
|
import * as ReactRouterDOM from "react-router-dom";
|
|
6
6
|
import { federationRuntime } from "./plugin.es.js";
|
|
7
|
-
import { b, a, c, l } from "./lazy-load-component-plugin-
|
|
7
|
+
import { b, a, c, l } from "./lazy-load-component-plugin-ZkRCYTos.mjs";
|
|
8
8
|
import { C, b as b2, E, e, h, c as c2, d, r, s } from "./utils-Bx_8GGd-.mjs";
|
|
9
9
|
import { callDataFetch } from "./data-fetch-utils.es.js";
|
|
10
|
-
import { p } from "./prefetch-
|
|
10
|
+
import { p } from "./prefetch-D6cu5QUG.mjs";
|
|
11
11
|
function createReact16Or17Root(container) {
|
|
12
12
|
return {
|
|
13
13
|
render(children) {
|
package/dist/{lazy-load-component-plugin-D_--Azke.mjs → lazy-load-component-plugin-ZkRCYTos.mjs}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as injectDataFetch, p as prefetch } from "./prefetch-
|
|
1
|
+
import { i as injectDataFetch, p as prefetch } from "./prefetch-D6cu5QUG.mjs";
|
|
2
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, a as loadDataFetchModule, M as MF_DATA_FETCH_STATUS, g 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-Bx_8GGd-.mjs";
|
|
3
3
|
import React__default, { useRef, useState, Suspense, useEffect } from "react";
|
|
4
4
|
const autoFetchData = () => {
|
|
@@ -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-IOan5uEb.js");
|
|
4
|
+
require("./prefetch-CTmmXyx-.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-ZkRCYTos.mjs";
|
|
2
|
+
import "./prefetch-D6cu5QUG.mjs";
|
|
3
3
|
export {
|
|
4
4
|
l as default,
|
|
5
5
|
l2 as lazyLoadComponentPlugin
|
|
@@ -211,7 +211,7 @@ function getGlobalFederationConstructor() {
|
|
|
211
211
|
function setGlobalFederationConstructor(FederationConstructor, isDebug = index_esm.isDebugMode()) {
|
|
212
212
|
if (isDebug) {
|
|
213
213
|
CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = FederationConstructor;
|
|
214
|
-
CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.21.
|
|
214
|
+
CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.21.1";
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
217
|
function getInfoWithoutType(target, key) {
|
|
@@ -210,7 +210,7 @@ function getGlobalFederationConstructor() {
|
|
|
210
210
|
function setGlobalFederationConstructor(FederationConstructor, isDebug = isDebugMode()) {
|
|
211
211
|
if (isDebug) {
|
|
212
212
|
CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = FederationConstructor;
|
|
213
|
-
CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.21.
|
|
213
|
+
CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.21.1";
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
216
|
function getInfoWithoutType(target, key) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@module-federation/bridge-react",
|
|
3
|
-
"version": "0.21.
|
|
3
|
+
"version": "0.21.1",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -100,8 +100,8 @@
|
|
|
100
100
|
"dependencies": {
|
|
101
101
|
"react-error-boundary": "^4.1.2",
|
|
102
102
|
"lru-cache": "^10.4.3",
|
|
103
|
-
"@module-federation/
|
|
104
|
-
"@module-federation/
|
|
103
|
+
"@module-federation/sdk": "0.21.1",
|
|
104
|
+
"@module-federation/bridge-shared": "0.21.1"
|
|
105
105
|
},
|
|
106
106
|
"peerDependencies": {
|
|
107
107
|
"react": ">=16.9.0",
|
|
@@ -133,8 +133,8 @@
|
|
|
133
133
|
"vite": "^5.4.20",
|
|
134
134
|
"vite-plugin-dts": "^4.3.0",
|
|
135
135
|
"hono": "3.12.12",
|
|
136
|
-
"@module-federation/runtime": "0.21.
|
|
137
|
-
"@module-federation/runtime
|
|
136
|
+
"@module-federation/runtime-core": "0.21.1",
|
|
137
|
+
"@module-federation/runtime": "0.21.1"
|
|
138
138
|
},
|
|
139
139
|
"scripts": {
|
|
140
140
|
"dev": "vite",
|
package/src/index.ts
CHANGED
|
@@ -7,6 +7,7 @@ export {
|
|
|
7
7
|
createRemoteComponent,
|
|
8
8
|
createRemoteAppComponent,
|
|
9
9
|
} from './remote/create';
|
|
10
|
+
export type { LazyRemoteComponentInfo } from './remote/create';
|
|
10
11
|
export {
|
|
11
12
|
ERROR_TYPE,
|
|
12
13
|
createLazyComponent,
|
|
@@ -34,6 +35,10 @@ export type {
|
|
|
34
35
|
RootType,
|
|
35
36
|
DestroyParams,
|
|
36
37
|
RenderParams,
|
|
38
|
+
RemoteComponentParams,
|
|
39
|
+
RenderFnParams,
|
|
40
|
+
RemoteComponentProps,
|
|
41
|
+
RemoteModule,
|
|
37
42
|
} from './types';
|
|
38
43
|
export type {
|
|
39
44
|
DataFetchParams,
|
package/src/remote/create.tsx
CHANGED
|
@@ -8,7 +8,10 @@ import {
|
|
|
8
8
|
RemoteModule,
|
|
9
9
|
} from '../types';
|
|
10
10
|
|
|
11
|
-
type LazyRemoteComponentInfo<
|
|
11
|
+
export type LazyRemoteComponentInfo<
|
|
12
|
+
T,
|
|
13
|
+
_E extends keyof T,
|
|
14
|
+
> = RemoteComponentParams<T>;
|
|
12
15
|
|
|
13
16
|
function createLazyRemoteComponent<
|
|
14
17
|
T = Record<string, unknown>,
|