@module-federation/bridge-react 0.0.0-perf-devtools-20260107043700 → 0.0.0-pre-release-2-5-20260518135705
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.es.js +11 -11
- package/dist/{bridge-base-CPSTBjEp.mjs → bridge-base-EnVXD4Hr.mjs} +3 -2
- package/dist/{bridge-base-RStDxH71.js → bridge-base-IlvdqYIj.js} +3 -2
- package/dist/{createHelpers-B_L612IN.js → createHelpers-9B0ttrN_.js} +4 -3
- package/dist/{createHelpers-Ui5pt7je.mjs → createHelpers-D77sECmY.mjs} +6 -5
- 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 +7 -7
- package/dist/data-fetch.cjs.js +22 -0
- package/dist/data-fetch.d.ts +140 -0
- package/dist/data-fetch.es.js +22 -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 +6 -6
- package/dist/index.es.js +13 -13
- package/dist/{lazy-load-component-plugin-CNyT62wB.mjs → lazy-load-component-plugin-Dcx_Gz4P.mjs} +5 -5
- package/dist/{lazy-load-component-plugin-Dr5VV1mu.js → lazy-load-component-plugin-KDXBEQue.js} +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 +19 -19
- package/dist/logger-DwWkXsWl.mjs +139 -0
- package/dist/logger-Dxblx6P-.js +138 -0
- package/dist/prefetch-BWCJr9-2.mjs +924 -0
- package/dist/prefetch-CzQ0E8Fz.js +923 -0
- package/dist/router-v5.cjs.js +5 -3
- package/dist/router-v5.d.ts +1 -2
- package/dist/router-v5.es.js +5 -3
- package/dist/router-v6.cjs.js +1 -1
- package/dist/router-v6.es.js +1 -1
- package/dist/router-v7.cjs.js +5 -3
- package/dist/router-v7.d.ts +2 -3
- package/dist/router-v7.es.js +5 -3
- package/dist/router.cjs.js +1 -1
- package/dist/router.es.js +1 -1
- package/dist/{utils-tM9yE73c.js → utils-CFTy4LVE.js} +18 -4
- package/dist/{utils-dUgb9Jkm.mjs → utils-DGS4pYp8.mjs} +41 -27
- 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 +25 -11
- 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/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/index.ts +0 -16
- 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/component.tsx +0 -2
- 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/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-KDXBEQue.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-CzQ0E8Fz.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
|
|
2
|
-
import { b } from "./createHelpers-
|
|
3
|
-
import { b as b2,
|
|
4
|
-
import { C, a as a2, E, b as b3, d,
|
|
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-Dcx_Gz4P.mjs";
|
|
4
|
+
import { C, a as a2, E, c as c2, b as b3, d, g, r, s } from "./utils-DGS4pYp8.mjs";
|
|
5
5
|
import { callDataFetch } from "./data-fetch-utils.es.js";
|
|
6
|
-
import { p } from "./prefetch-
|
|
6
|
+
import { p } from "./prefetch-BWCJr9-2.mjs";
|
|
7
7
|
const createRemoteAppComponent = createRemoteAppComponentFactory(RemoteAppWrapper);
|
|
8
8
|
const createRemoteComponent = createDeprecatedRemoteComponentFactory(
|
|
9
9
|
createRemoteAppComponent
|
|
@@ -12,14 +12,14 @@ export {
|
|
|
12
12
|
C as CacheSize,
|
|
13
13
|
a2 as CacheTime,
|
|
14
14
|
E as ERROR_TYPE,
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
a as autoFetchDataPlugin,
|
|
16
|
+
c2 as cache,
|
|
17
17
|
callDataFetch,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
b3 as clearStore,
|
|
19
|
+
c as collectSSRAssets,
|
|
20
|
+
d as configureCache,
|
|
21
21
|
b as createBridgeComponent,
|
|
22
|
-
|
|
22
|
+
b2 as createLazyComponent,
|
|
23
23
|
createRemoteAppComponent,
|
|
24
24
|
createRemoteComponent,
|
|
25
25
|
g as generateKey,
|
|
@@ -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 = {
|
|
@@ -122,13 +122,14 @@ function createBaseBridgeComponent({
|
|
|
122
122
|
));
|
|
123
123
|
};
|
|
124
124
|
const DefaultFallback = ({ error }) => /* @__PURE__ */ React.createElement("div", { role: "alert" }, /* @__PURE__ */ React.createElement("p", null, "Something went wrong:"), /* @__PURE__ */ React.createElement("pre", { style: { color: "red" } }, error.message));
|
|
125
|
+
const ErrorBoundaryComponent = ErrorBoundary;
|
|
125
126
|
const BridgeWrapper = ({
|
|
126
127
|
basename,
|
|
127
128
|
moduleName,
|
|
128
129
|
memoryRoute,
|
|
129
130
|
propsInfo,
|
|
130
131
|
fallback
|
|
131
|
-
}) => /* @__PURE__ */ React.createElement(
|
|
132
|
+
}) => /* @__PURE__ */ React.createElement(ErrorBoundaryComponent, { FallbackComponent: fallback || DefaultFallback }, /* @__PURE__ */ React.createElement(
|
|
132
133
|
RawComponent,
|
|
133
134
|
{
|
|
134
135
|
appInfo: {
|
|
@@ -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" } });
|
|
@@ -139,13 +139,14 @@ function createBaseBridgeComponent({
|
|
|
139
139
|
));
|
|
140
140
|
};
|
|
141
141
|
const DefaultFallback = ({ error }) => /* @__PURE__ */ React__namespace.createElement("div", { role: "alert" }, /* @__PURE__ */ React__namespace.createElement("p", null, "Something went wrong:"), /* @__PURE__ */ React__namespace.createElement("pre", { style: { color: "red" } }, error.message));
|
|
142
|
+
const ErrorBoundaryComponent = ErrorBoundary;
|
|
142
143
|
const BridgeWrapper = ({
|
|
143
144
|
basename,
|
|
144
145
|
moduleName,
|
|
145
146
|
memoryRoute,
|
|
146
147
|
propsInfo,
|
|
147
148
|
fallback
|
|
148
|
-
}) => /* @__PURE__ */ React__namespace.createElement(
|
|
149
|
+
}) => /* @__PURE__ */ React__namespace.createElement(ErrorBoundaryComponent, { FallbackComponent: fallback || DefaultFallback }, /* @__PURE__ */ React__namespace.createElement(
|
|
149
150
|
RawComponent,
|
|
150
151
|
{
|
|
151
152
|
appInfo: {
|
|
@@ -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) {
|
|
@@ -162,12 +162,13 @@ function createLazyRemoteComponentFactory(RemoteApp) {
|
|
|
162
162
|
};
|
|
163
163
|
}
|
|
164
164
|
function createRemoteAppComponentFactory(RemoteApp) {
|
|
165
|
+
const ErrorBoundaryComponent = bridgeBase.ErrorBoundary;
|
|
165
166
|
const createLazyRemoteComponent = createLazyRemoteComponentFactory(RemoteApp);
|
|
166
167
|
return function createRemoteAppComponent(info) {
|
|
167
168
|
const LazyComponent = createLazyRemoteComponent(info);
|
|
168
169
|
return React.forwardRef((props, ref) => {
|
|
169
170
|
return /* @__PURE__ */ React.createElement(
|
|
170
|
-
|
|
171
|
+
ErrorBoundaryComponent,
|
|
171
172
|
{
|
|
172
173
|
FallbackComponent: info.fallback
|
|
173
174
|
},
|
|
@@ -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) {
|
|
@@ -161,12 +161,13 @@ function createLazyRemoteComponentFactory(RemoteApp) {
|
|
|
161
161
|
};
|
|
162
162
|
}
|
|
163
163
|
function createRemoteAppComponentFactory(RemoteApp) {
|
|
164
|
+
const ErrorBoundaryComponent = ErrorBoundary;
|
|
164
165
|
const createLazyRemoteComponent = createLazyRemoteComponentFactory(RemoteApp);
|
|
165
166
|
return function createRemoteAppComponent(info) {
|
|
166
167
|
const LazyComponent = createLazyRemoteComponent(info);
|
|
167
168
|
return forwardRef((props, ref) => {
|
|
168
169
|
return /* @__PURE__ */ React__default.createElement(
|
|
169
|
-
|
|
170
|
+
ErrorBoundaryComponent,
|
|
170
171
|
{
|
|
171
172
|
FallbackComponent: info.fallback
|
|
172
173
|
},
|
|
@@ -185,7 +186,7 @@ function createDeprecatedRemoteComponentFactory(createFn) {
|
|
|
185
186
|
}
|
|
186
187
|
export {
|
|
187
188
|
RemoteAppWrapper as R,
|
|
188
|
-
|
|
189
|
+
createDeprecatedRemoteComponentFactory as a,
|
|
189
190
|
createBridgeComponent as b,
|
|
190
|
-
|
|
191
|
+
createRemoteAppComponentFactory as c
|
|
191
192
|
};
|
|
@@ -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,
|
|
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, h as fetchData, j as loadDataFetchModule } from "./utils-DGS4pYp8.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-CzQ0E8Fz.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 {
|
|
2
|
-
import { C, a, b, d,
|
|
3
|
-
import { d as dataFetchFunction } from "./prefetch-
|
|
4
|
-
import { i, p } from "./prefetch-
|
|
1
|
+
import { y as DATA_FETCH_FUNCTION } from "./utils-DGS4pYp8.mjs";
|
|
2
|
+
import { C, a, c, b, d, g, r } from "./utils-DGS4pYp8.mjs";
|
|
3
|
+
import { d as dataFetchFunction } from "./prefetch-BWCJr9-2.mjs";
|
|
4
|
+
import { i, p } from "./prefetch-BWCJr9-2.mjs";
|
|
5
5
|
async function callDataFetch() {
|
|
6
6
|
const dataFetch = globalThis[DATA_FETCH_FUNCTION];
|
|
7
7
|
if (dataFetch) {
|
|
@@ -15,10 +15,10 @@ async function callDataFetch() {
|
|
|
15
15
|
export {
|
|
16
16
|
C as CacheSize,
|
|
17
17
|
a as CacheTime,
|
|
18
|
-
|
|
18
|
+
c as cache,
|
|
19
19
|
callDataFetch,
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
b as clearStore,
|
|
21
|
+
d as configureCache,
|
|
22
22
|
g as generateKey,
|
|
23
23
|
i as injectDataFetch,
|
|
24
24
|
p as prefetch,
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const lazyLoadComponentPlugin = require("./lazy-load-component-plugin-KDXBEQue.js");
|
|
4
|
+
const lazyUtils = require("./utils-CFTy4LVE.js");
|
|
5
|
+
const dataFetchUtils = require("./data-fetch-utils.cjs.js");
|
|
6
|
+
const prefetch = require("./prefetch-CzQ0E8Fz.js");
|
|
7
|
+
exports.autoFetchDataPlugin = lazyLoadComponentPlugin.autoFetchData;
|
|
8
|
+
exports.collectSSRAssets = lazyLoadComponentPlugin.collectSSRAssets;
|
|
9
|
+
exports.createLazyComponent = lazyLoadComponentPlugin.createLazyComponent;
|
|
10
|
+
exports.lazyLoadComponentPlugin = lazyLoadComponentPlugin.lazyLoadComponentPlugin;
|
|
11
|
+
exports.CacheSize = lazyUtils.CacheSize;
|
|
12
|
+
exports.CacheTime = lazyUtils.CacheTime;
|
|
13
|
+
exports.ERROR_TYPE = lazyUtils.ERROR_TYPE;
|
|
14
|
+
exports.cache = lazyUtils.cache;
|
|
15
|
+
exports.clearStore = lazyUtils.clearStore;
|
|
16
|
+
exports.configureCache = lazyUtils.configureCache;
|
|
17
|
+
exports.flushDataFetch = lazyUtils.flushDataFetch;
|
|
18
|
+
exports.generateKey = lazyUtils.generateKey;
|
|
19
|
+
exports.revalidateTag = lazyUtils.revalidateTag;
|
|
20
|
+
exports.setSSREnv = lazyUtils.setSSREnv;
|
|
21
|
+
exports.callDataFetch = dataFetchUtils.callDataFetch;
|
|
22
|
+
exports.prefetch = prefetch.prefetch;
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { default as default_2 } from 'react';
|
|
2
|
+
import { getInstance } from '@module-federation/runtime';
|
|
3
|
+
import { ModuleFederationRuntimePlugin } from '@module-federation/runtime';
|
|
4
|
+
import { ReactNode } from 'react';
|
|
5
|
+
|
|
6
|
+
export declare const autoFetchDataPlugin: () => ModuleFederationRuntimePlugin;
|
|
7
|
+
|
|
8
|
+
export declare function cache<T>(fn: DataFetch<T>, options?: CacheOptions): DataFetch<T>;
|
|
9
|
+
|
|
10
|
+
declare interface CacheConfig {
|
|
11
|
+
maxSize?: number;
|
|
12
|
+
unstable_shouldDisable?: ({ request, }: {
|
|
13
|
+
request: Request;
|
|
14
|
+
}) => boolean | Promise<boolean>;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
declare interface CacheOptions {
|
|
18
|
+
tag?: string | string[];
|
|
19
|
+
maxAge?: number;
|
|
20
|
+
revalidate?: number;
|
|
21
|
+
getKey?: <Args extends any[]>(...args: Args) => string;
|
|
22
|
+
onCache?: (info: CacheStatsInfo) => boolean;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export declare const CacheSize: {
|
|
26
|
+
readonly KB: 1024;
|
|
27
|
+
readonly MB: number;
|
|
28
|
+
readonly GB: number;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export declare interface CacheStatsInfo {
|
|
32
|
+
status: CacheStatus;
|
|
33
|
+
key: string | symbol;
|
|
34
|
+
params: DataFetchParams;
|
|
35
|
+
result: any;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export declare type CacheStatus = 'hit' | 'stale' | 'miss';
|
|
39
|
+
|
|
40
|
+
export declare const CacheTime: {
|
|
41
|
+
readonly SECOND: 1000;
|
|
42
|
+
readonly MINUTE: number;
|
|
43
|
+
readonly HOUR: number;
|
|
44
|
+
readonly DAY: number;
|
|
45
|
+
readonly WEEK: number;
|
|
46
|
+
readonly MONTH: number;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export declare function callDataFetch(): Promise<void>;
|
|
50
|
+
|
|
51
|
+
export declare function clearStore(): void;
|
|
52
|
+
|
|
53
|
+
export declare function collectSSRAssets(options: CollectSSRAssetsOptions): default_2.ReactNode[];
|
|
54
|
+
|
|
55
|
+
export declare type CollectSSRAssetsOptions = {
|
|
56
|
+
id: string;
|
|
57
|
+
instance: ReturnType<typeof getInstance>;
|
|
58
|
+
injectScript?: boolean;
|
|
59
|
+
injectLink?: boolean;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export declare function configureCache(config: CacheConfig): void;
|
|
63
|
+
|
|
64
|
+
export declare function createLazyComponent<T, E extends keyof T>(options: CreateLazyComponentOptions<T, E>): (props: T[E] extends (...args: any) => any ? Parameters<T[E]>[0] extends undefined ? ReactKey : Parameters<T[E]>[0] & ReactKey : ReactKey) => default_2.JSX.Element;
|
|
65
|
+
|
|
66
|
+
export declare type CreateLazyComponentOptions<T, E extends keyof T> = {
|
|
67
|
+
loader: () => Promise<T>;
|
|
68
|
+
instance: ReturnType<typeof getInstance>;
|
|
69
|
+
loading: default_2.ReactNode;
|
|
70
|
+
delayLoading?: number;
|
|
71
|
+
fallback: ReactNode | ((errorInfo: ErrorInfo) => ReactNode);
|
|
72
|
+
export?: E;
|
|
73
|
+
dataFetchParams?: DataFetchParams;
|
|
74
|
+
noSSR?: boolean;
|
|
75
|
+
injectScript?: boolean;
|
|
76
|
+
injectLink?: boolean;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
declare type DataFetch<T> = (params: DataFetchParams) => Promise<T>;
|
|
80
|
+
|
|
81
|
+
export declare type DataFetchParams = {
|
|
82
|
+
isDowngrade: boolean;
|
|
83
|
+
_id?: string;
|
|
84
|
+
} & Record<string, unknown>;
|
|
85
|
+
|
|
86
|
+
export declare const ERROR_TYPE: {
|
|
87
|
+
DATA_FETCH: number;
|
|
88
|
+
LOAD_REMOTE: number;
|
|
89
|
+
UNKNOWN: number;
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
declare type ErrorInfo = {
|
|
93
|
+
error: Error;
|
|
94
|
+
errorType: number;
|
|
95
|
+
dataFetchMapKey?: string;
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
export declare const flushDataFetch: () => void;
|
|
99
|
+
|
|
100
|
+
export declare function generateKey(dataFetchOptions: DataFetchParams): string;
|
|
101
|
+
|
|
102
|
+
export declare function lazyLoadComponentPlugin(): ModuleFederationRuntimePlugin;
|
|
103
|
+
|
|
104
|
+
export declare type NoSSRRemoteInfo = {
|
|
105
|
+
name: string;
|
|
106
|
+
version: string;
|
|
107
|
+
ssrPublicPath: string;
|
|
108
|
+
ssrRemoteEntry: string;
|
|
109
|
+
globalName: string;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
export declare function prefetch(options: PrefetchOptions): Promise<void>;
|
|
113
|
+
|
|
114
|
+
export declare type PrefetchOptions = {
|
|
115
|
+
id: string;
|
|
116
|
+
instance: ReturnType<typeof getInstance>;
|
|
117
|
+
dataFetchParams?: DataFetchParams;
|
|
118
|
+
preloadComponentResource?: boolean;
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
declare type ReactKey = {
|
|
122
|
+
key?: default_2.Key | null;
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
export declare function revalidateTag(tag: string): void;
|
|
126
|
+
|
|
127
|
+
export declare function setSSREnv({ fetchServerQuery, }: {
|
|
128
|
+
fetchServerQuery?: Record<string, unknown>;
|
|
129
|
+
}): void;
|
|
130
|
+
|
|
131
|
+
export { }
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
declare module '@module-federation/runtime-core' {
|
|
135
|
+
interface ModuleFederation {
|
|
136
|
+
createLazyComponent<T, E extends keyof T>(options: Omit<CreateLazyComponentOptions<T, E>, 'instance'>): ReturnType<typeof createLazyComponent<T, E>>;
|
|
137
|
+
prefetch(options: Omit<PrefetchOptions, 'instance'>): ReturnType<typeof prefetch>;
|
|
138
|
+
collectSSRAssets(options: Omit<Parameters<typeof collectSSRAssets>[0], 'instance'>): ReturnType<typeof collectSSRAssets>;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { a, c, b, l } from "./lazy-load-component-plugin-Dcx_Gz4P.mjs";
|
|
2
|
+
import { C, a as a2, E, c as c2, b as b2, d, f, g, r, s } from "./utils-DGS4pYp8.mjs";
|
|
3
|
+
import { callDataFetch } from "./data-fetch-utils.es.js";
|
|
4
|
+
import { p } from "./prefetch-BWCJr9-2.mjs";
|
|
5
|
+
export {
|
|
6
|
+
C as CacheSize,
|
|
7
|
+
a2 as CacheTime,
|
|
8
|
+
E as ERROR_TYPE,
|
|
9
|
+
a as autoFetchDataPlugin,
|
|
10
|
+
c2 as cache,
|
|
11
|
+
callDataFetch,
|
|
12
|
+
b2 as clearStore,
|
|
13
|
+
c as collectSSRAssets,
|
|
14
|
+
d as configureCache,
|
|
15
|
+
b as createLazyComponent,
|
|
16
|
+
f as flushDataFetch,
|
|
17
|
+
g as generateKey,
|
|
18
|
+
l as lazyLoadComponentPlugin,
|
|
19
|
+
p as prefetch,
|
|
20
|
+
r as revalidateTag,
|
|
21
|
+
s as setSSREnv
|
|
22
|
+
};
|
|
@@ -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-
|
|
3
|
+
const createHelpers = require("./createHelpers-9B0ttrN_.js");
|
|
4
|
+
const lazyLoadComponentPlugin = require("./lazy-load-component-plugin-KDXBEQue.js");
|
|
5
|
+
const lazyUtils = require("./utils-CFTy4LVE.js");
|
|
6
|
+
const dataFetchUtils = require("./data-fetch-utils.cjs.js");
|
|
5
7
|
const React = require("react");
|
|
6
8
|
const ReactRouterDOM = require("react-router-dom");
|
|
7
|
-
const index = require("./index-
|
|
8
|
-
const
|
|
9
|
-
const dataFetchUtils = require("./data-fetch-utils.cjs.js");
|
|
10
|
-
const prefetch = require("./prefetch-J3x-_5zT.js");
|
|
9
|
+
const index = require("./index-DbjGCKOr.js");
|
|
10
|
+
const prefetch = require("./prefetch-CzQ0E8Fz.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
|
|
2
|
-
import { b } from "./createHelpers-
|
|
3
|
-
import { b as b2,
|
|
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-Dcx_Gz4P.mjs";
|
|
4
|
+
import { C, a as a2, E, c as c2, b as b3, d, g, r, s } from "./utils-DGS4pYp8.mjs";
|
|
5
|
+
import { callDataFetch } from "./data-fetch-utils.es.js";
|
|
4
6
|
import React__default, { forwardRef, useContext, useState, useEffect } from "react";
|
|
5
7
|
import * as ReactRouterDOM from "react-router-dom";
|
|
6
|
-
import { p as pathJoin, L as LoggerInstance } from "./index-
|
|
7
|
-
import {
|
|
8
|
-
import { callDataFetch } from "./data-fetch-utils.es.js";
|
|
9
|
-
import { p } from "./prefetch-lrSPKiuu.mjs";
|
|
8
|
+
import { p as pathJoin, L as LoggerInstance } from "./index-Bs2NxD2z.mjs";
|
|
9
|
+
import { p } from "./prefetch-BWCJr9-2.mjs";
|
|
10
10
|
function e() {
|
|
11
11
|
const t = new PopStateEvent("popstate", { state: window.history.state });
|
|
12
12
|
window.dispatchEvent(t);
|
|
@@ -91,14 +91,14 @@ export {
|
|
|
91
91
|
C as CacheSize,
|
|
92
92
|
a2 as CacheTime,
|
|
93
93
|
E as ERROR_TYPE,
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
a as autoFetchDataPlugin,
|
|
95
|
+
c2 as cache,
|
|
96
96
|
callDataFetch,
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
97
|
+
b3 as clearStore,
|
|
98
|
+
c as collectSSRAssets,
|
|
99
|
+
d as configureCache,
|
|
100
100
|
b as createBridgeComponent,
|
|
101
|
-
|
|
101
|
+
b2 as createLazyComponent,
|
|
102
102
|
createRemoteAppComponent,
|
|
103
103
|
createRemoteComponent,
|
|
104
104
|
g as generateKey,
|
package/dist/{lazy-load-component-plugin-CNyT62wB.mjs → lazy-load-component-plugin-Dcx_Gz4P.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as injectDataFetch, p as prefetch } from "./prefetch-
|
|
2
|
-
import { i as initDataFetchMap,
|
|
1
|
+
import { i as injectDataFetch, p as prefetch } from "./prefetch-BWCJr9-2.mjs";
|
|
2
|
+
import { i as initDataFetchMap, k as isDataLoaderExpose, m as getDataFetchInfo, n as getDataFetchMapKey, l as logger, o as getDataFetchItem, p as DATA_FETCH_CLIENT_SUFFIX, q as MF_DATA_FETCH_TYPE, t as isCSROnly, M as MF_DATA_FETCH_STATUS, j as loadDataFetchModule, e as getDataFetchMap, u as isServerEnv, v as getDataFetchIdWithErrorMsgs, w as DATA_FETCH_ERROR_PREFIX, E as ERROR_TYPE, x as wrapDataFetchId, L as LOAD_REMOTE_ERROR_PREFIX, y as DATA_FETCH_FUNCTION, z as getLoadedRemoteInfos, h as fetchData$1, A as setDataFetchItemLoadedStatus, F as FS_HREF } from "./utils-DGS4pYp8.mjs";
|
|
3
3
|
import React__default, { useRef, useState, Suspense, useEffect } from "react";
|
|
4
4
|
const autoFetchData = () => {
|
|
5
5
|
initDataFetchMap();
|
|
@@ -515,8 +515,8 @@ function lazyLoadComponentPlugin() {
|
|
|
515
515
|
};
|
|
516
516
|
}
|
|
517
517
|
export {
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
518
|
+
autoFetchData as a,
|
|
519
|
+
createLazyComponent as b,
|
|
520
|
+
collectSSRAssets as c,
|
|
521
521
|
lazyLoadComponentPlugin as l
|
|
522
522
|
};
|
package/dist/{lazy-load-component-plugin-Dr5VV1mu.js → lazy-load-component-plugin-KDXBEQue.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-CzQ0E8Fz.js");
|
|
3
|
+
const lazyUtils = require("./utils-CFTy4LVE.js");
|
|
4
4
|
const React = require("react");
|
|
5
5
|
const autoFetchData = () => {
|
|
6
6
|
lazyUtils.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-KDXBEQue.js");
|
|
4
|
+
require("./prefetch-CzQ0E8Fz.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-Dcx_Gz4P.mjs";
|
|
2
|
+
import "./prefetch-BWCJr9-2.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,24 +1,24 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import {
|
|
1
|
+
import "./logger-DwWkXsWl.mjs";
|
|
2
|
+
import { H, I, h, f, N, v, m, o, e, n, J, z, i, t, k, u, j, A, s, x } from "./utils-DGS4pYp8.mjs";
|
|
3
3
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
H as callAllDowngrade,
|
|
5
|
+
I as callDowngrade,
|
|
6
|
+
h as fetchData,
|
|
7
|
+
f as flushDataFetch,
|
|
8
|
+
N as getDataFetchCache,
|
|
9
|
+
v as getDataFetchIdWithErrorMsgs,
|
|
10
|
+
m as getDataFetchInfo,
|
|
11
|
+
o as getDataFetchItem,
|
|
12
12
|
e as getDataFetchMap,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
n as getDataFetchMapKey,
|
|
14
|
+
J as getDowngradeTag,
|
|
15
|
+
z as getLoadedRemoteInfos,
|
|
16
16
|
i as initDataFetchMap,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
t as isCSROnly,
|
|
18
|
+
k as isDataLoaderExpose,
|
|
19
|
+
u as isServerEnv,
|
|
20
|
+
j as loadDataFetchModule,
|
|
21
|
+
A as setDataFetchItemLoadedStatus,
|
|
22
22
|
s as setSSREnv,
|
|
23
|
-
|
|
23
|
+
x as wrapDataFetchId
|
|
24
24
|
};
|