@module-federation/bridge-react 0.0.0-perf-devtools-20260108034446 → 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-BvnyaA6i.js → lazy-load-component-plugin-DSURjnZ0.js} +170 -44
- package/dist/{lazy-load-component-plugin-CVcFMRce.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-CK3EZdY4.mjs +0 -1273
- package/dist/prefetch-MiXeF8KH.js +0 -1272
- 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
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ModuleFederationRuntimePlugin, ModuleFederation } from '@module-federation/runtime';
|
|
2
|
+
export type FederationRuntimeType = {
|
|
3
|
+
instance: ModuleFederation | null;
|
|
4
|
+
};
|
|
5
|
+
export declare const federationRuntime: FederationRuntimeType;
|
|
6
|
+
declare function BridgeReactPlugin(): ModuleFederationRuntimePlugin;
|
|
7
|
+
export default BridgeReactPlugin;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ProviderFnParams, DestroyParams, RenderParams } from '../../types';
|
|
2
|
+
export declare function createBaseBridgeComponent<T>({ createRoot, defaultRootOptions, ...bridgeInfo }: ProviderFnParams<T>): () => {
|
|
3
|
+
render(info: RenderParams): Promise<void>;
|
|
4
|
+
destroy(info: DestroyParams): void;
|
|
5
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Entry point for React 16/17 (legacy) specific bridge components
|
|
3
|
+
* This file provides support for React 16 and 17 versions, using the traditional ReactDOM.render API
|
|
4
|
+
*/
|
|
5
|
+
import type { ProviderFnParams } from '../../types';
|
|
6
|
+
export interface CreateRootOptions {
|
|
7
|
+
identifierPrefix?: string;
|
|
8
|
+
onRecoverableError?: (error: unknown, errorInfo: unknown) => void;
|
|
9
|
+
}
|
|
10
|
+
export interface Root {
|
|
11
|
+
render(children: React.ReactNode): void;
|
|
12
|
+
unmount(): void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Default createRoot function that automatically detects React version and uses the appropriate API(only support React 16/17, 18)
|
|
16
|
+
*
|
|
17
|
+
* Note: Users can also directly import version-specific bridge components:
|
|
18
|
+
* - import { createBridgeComponent } from '@module-federation/bridge-react'
|
|
19
|
+
* - import { createBridgeComponent } from '@module-federation/bridge-react/v18'
|
|
20
|
+
* - import { createBridgeComponent } from '@module-federation/bridge-react/v19'
|
|
21
|
+
*/
|
|
22
|
+
export declare function createReact16Or17Root(container: Element | DocumentFragment): Root;
|
|
23
|
+
export declare function createBridgeComponent<T = any>(bridgeInfo: Omit<ProviderFnParams<T>, 'createRoot'>): () => {
|
|
24
|
+
render(info: import("../..").RenderParams): Promise<void>;
|
|
25
|
+
destroy(info: import("../..").DestroyParams): void;
|
|
26
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Entry point for React 18 specific bridge components
|
|
3
|
+
*/
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import type { ProviderFnParams } from '../../types';
|
|
6
|
+
export interface CreateRootOptions {
|
|
7
|
+
identifierPrefix?: string;
|
|
8
|
+
onRecoverableError?: (error: unknown, errorInfo: unknown) => void;
|
|
9
|
+
}
|
|
10
|
+
export interface Root {
|
|
11
|
+
render(children: React.ReactNode): void;
|
|
12
|
+
unmount(): void;
|
|
13
|
+
}
|
|
14
|
+
export declare function createReact18Root(container: Element | DocumentFragment, options?: CreateRootOptions): Root;
|
|
15
|
+
export declare function hydrateReact18Root(container: Element | DocumentFragment, initialChildren: React.ReactNode, options?: CreateRootOptions): import("node_modules/@types/react-dom/client").Root;
|
|
16
|
+
export declare function createBridgeComponent<T = any>(bridgeInfo: Omit<ProviderFnParams<T>, 'createRoot'>): () => {
|
|
17
|
+
render(info: import("../..").RenderParams): Promise<void>;
|
|
18
|
+
destroy(info: import("../..").DestroyParams): void;
|
|
19
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Entry point for React 19 specific bridge components
|
|
3
|
+
* This file provides support for React 19 version, using the new ReactDOM.createRoot API
|
|
4
|
+
*/
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import type { ProviderFnParams } from '../../types';
|
|
7
|
+
export interface CreateRootOptions {
|
|
8
|
+
identifierPrefix?: string;
|
|
9
|
+
onRecoverableError?: (error: unknown, errorInfo: unknown) => void;
|
|
10
|
+
transitionCallbacks?: unknown;
|
|
11
|
+
}
|
|
12
|
+
export interface Root {
|
|
13
|
+
render(children: React.ReactNode): void;
|
|
14
|
+
unmount(): void;
|
|
15
|
+
}
|
|
16
|
+
export declare function createReact19Root(container: Element | DocumentFragment, options?: CreateRootOptions): Root;
|
|
17
|
+
export declare function hydrateReact19Root(container: Element | DocumentFragment, initialChildren: React.ReactNode, options?: CreateRootOptions): Root;
|
|
18
|
+
export declare function createBridgeComponent<T = any>(bridgeInfo: Omit<ProviderFnParams<T>, 'createRoot'>): () => {
|
|
19
|
+
render(info: import("../..").RenderParams): Promise<void>;
|
|
20
|
+
destroy(info: import("../..").DestroyParams): void;
|
|
21
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared RemoteAppWrapper component used by both base and router versions
|
|
3
|
+
* This component handles the lifecycle of remote Module Federation apps
|
|
4
|
+
*/
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { RemoteComponentProps, RemoteAppParams } from '../types';
|
|
7
|
+
export declare const RemoteAppWrapper: React.ForwardRefExoticComponent<Omit<RemoteAppParams & RemoteComponentProps<Record<string, unknown>>, "ref"> & React.RefAttributes<unknown>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type LazyRemoteComponentInfo } from '../createHelpers';
|
|
2
|
+
export type { LazyRemoteComponentInfo };
|
|
3
|
+
declare const createLazyRemoteComponent: <T = Record<string, unknown>, E extends keyof T = keyof T>(info: LazyRemoteComponentInfo<T, E>) => import("node_modules/@types/react").LazyExoticComponent<import("node_modules/@types/react").ForwardRefExoticComponent<Omit<import("../..").RemoteComponentProps<Record<string, unknown>>, "ref"> & import("node_modules/@types/react").RefAttributes<HTMLDivElement>>>;
|
|
4
|
+
export declare const createRemoteAppComponent: <T = Record<string, unknown>, E extends keyof T = keyof T>(info: LazyRemoteComponentInfo<T, E>) => import("node_modules/@types/react").ForwardRefExoticComponent<Omit<import("../..").RemoteComponentProps<Record<string, unknown>>, "ref"> & import("node_modules/@types/react").RefAttributes<HTMLDivElement>>;
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated createRemoteComponent is deprecated, please use createRemoteAppComponent instead!
|
|
7
|
+
*/
|
|
8
|
+
export declare const createRemoteComponent: <T = Record<string, unknown>, E extends keyof T = keyof T>(info: LazyRemoteComponentInfo<T, E>) => any;
|
|
9
|
+
export { createLazyRemoteComponent };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { RemoteComponentParams, RemoteComponentProps } from '../types';
|
|
3
|
+
export type LazyRemoteComponentInfo<T, _E extends keyof T> = RemoteComponentParams<T>;
|
|
4
|
+
/**
|
|
5
|
+
* Creates a factory function for creating lazy remote components
|
|
6
|
+
* @param RemoteApp The RemoteAppWrapper component to use (with or without router)
|
|
7
|
+
*/
|
|
8
|
+
export declare function createLazyRemoteComponentFactory(RemoteApp: React.ComponentType<any>): <T = Record<string, unknown>, E extends keyof T = keyof T>(info: LazyRemoteComponentInfo<T, E>) => React.LazyExoticComponent<React.ForwardRefExoticComponent<Omit<RemoteComponentProps<Record<string, unknown>>, "ref"> & React.RefAttributes<HTMLDivElement>>>;
|
|
9
|
+
/**
|
|
10
|
+
* Creates a factory function for creating remote app components
|
|
11
|
+
* @param RemoteApp The RemoteAppWrapper component to use (with or without router)
|
|
12
|
+
*/
|
|
13
|
+
export declare function createRemoteAppComponentFactory(RemoteApp: React.ComponentType<any>): <T = Record<string, unknown>, E extends keyof T = keyof T>(info: LazyRemoteComponentInfo<T, E>) => React.ForwardRefExoticComponent<Omit<RemoteComponentProps<Record<string, unknown>>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
/**
|
|
15
|
+
* Creates the deprecated createRemoteComponent function
|
|
16
|
+
*/
|
|
17
|
+
export declare function createDeprecatedRemoteComponentFactory<T = Record<string, unknown>, E extends keyof T = keyof T>(createFn: (info: LazyRemoteComponentInfo<T, E>) => any): (info: LazyRemoteComponentInfo<T, E>) => any;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { RemoteAppWrapper } from '../RemoteAppWrapper';
|
|
3
|
+
interface ExtraDataProps {
|
|
4
|
+
basename?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function withRouterData<P extends Parameters<typeof RemoteAppWrapper>[0]>(WrappedComponent: React.ComponentType<P & ExtraDataProps>): React.FC<Omit<P, keyof ExtraDataProps>>;
|
|
7
|
+
declare const _default: React.FC<Omit<Omit<import("../../types").RemoteAppParams & import("../..").RemoteComponentProps<Record<string, unknown>>, "ref"> & React.RefAttributes<unknown>, "basename">>;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type LazyRemoteComponentInfo } from '../createHelpers';
|
|
2
|
+
export type { LazyRemoteComponentInfo };
|
|
3
|
+
declare const createLazyRemoteComponent: <T = Record<string, unknown>, E extends keyof T = keyof T>(info: LazyRemoteComponentInfo<T, E>) => import("node_modules/@types/react").LazyExoticComponent<import("node_modules/@types/react").ForwardRefExoticComponent<Omit<import("../..").RemoteComponentProps<Record<string, unknown>>, "ref"> & import("node_modules/@types/react").RefAttributes<HTMLDivElement>>>;
|
|
4
|
+
export declare const createRemoteAppComponent: <T = Record<string, unknown>, E extends keyof T = keyof T>(info: LazyRemoteComponentInfo<T, E>) => import("node_modules/@types/react").ForwardRefExoticComponent<Omit<import("../..").RemoteComponentProps<Record<string, unknown>>, "ref"> & import("node_modules/@types/react").RefAttributes<HTMLDivElement>>;
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated createRemoteComponent is deprecated, please use createRemoteAppComponent instead!
|
|
7
|
+
*/
|
|
8
|
+
export declare const createRemoteComponent: <T = Record<string, unknown>, E extends keyof T = keyof T>(info: LazyRemoteComponentInfo<T, E>) => any;
|
|
9
|
+
export { createLazyRemoteComponent };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import * as ReactRouterDom from 'react-router-dom/';
|
|
3
|
+
declare function WrapperRouter(props: Parameters<typeof ReactRouterDom.BrowserRouter>[0] | Parameters<typeof ReactRouterDom.MemoryRouter>[0]): React.JSX.Element;
|
|
4
|
+
declare function WrapperRouterProvider(props: Parameters<typeof ReactRouterDom.RouterProvider>[0]): React.JSX.Element;
|
|
5
|
+
export * from 'react-router-dom/';
|
|
6
|
+
export { WrapperRouter as BrowserRouter };
|
|
7
|
+
export { WrapperRouterProvider as RouterProvider };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import * as ReactRouterDom from 'react-router-dom/dist/index.js';
|
|
3
|
+
declare function WraperRouter(props: Parameters<typeof ReactRouterDom.BrowserRouter>[0] | Parameters<typeof ReactRouterDom.MemoryRouter>[0]): React.JSX.Element;
|
|
4
|
+
declare function WraperRouterProvider(props: Parameters<typeof ReactRouterDom.RouterProvider>[0]): React.JSX.Element;
|
|
5
|
+
export * from 'react-router-dom/';
|
|
6
|
+
export { WraperRouter as BrowserRouter };
|
|
7
|
+
export { WraperRouterProvider as RouterProvider };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare function WraperRouter(props: Record<string, unknown>): React.JSX.Element;
|
|
3
|
+
declare function WraperRouterProvider(props: Record<string, unknown>): React.JSX.Element;
|
|
4
|
+
export * from 'react-router';
|
|
5
|
+
export { WraperRouter as BrowserRouter };
|
|
6
|
+
export { WraperRouterProvider as RouterProvider };
|
package/dist/router-v5.cjs.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const React = require("react");
|
|
4
4
|
const ReactRouterDom$1 = require("react-router-dom/index.js");
|
|
5
|
-
const index = require("./index-
|
|
5
|
+
const index = require("./index-DbjGCKOr.js");
|
|
6
6
|
const ReactRouterDom = require("react-router-dom/index.js");
|
|
7
7
|
function _interopNamespaceDefault(e) {
|
|
8
8
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
@@ -24,6 +24,8 @@ const ReactRouterDom__namespace = /* @__PURE__ */ _interopNamespaceDefault(React
|
|
|
24
24
|
function WraperRouter(props) {
|
|
25
25
|
const { basename, ...propsRes } = props;
|
|
26
26
|
const routerContextProps = React.useContext(index.RouterContext) || {};
|
|
27
|
+
const MemoryRouter = ReactRouterDom__namespace.MemoryRouter;
|
|
28
|
+
const BrowserRouter = ReactRouterDom__namespace.BrowserRouter;
|
|
27
29
|
index.LoggerInstance.debug(`WraperRouter info >>>`, {
|
|
28
30
|
...routerContextProps,
|
|
29
31
|
routerContextProps,
|
|
@@ -31,7 +33,7 @@ function WraperRouter(props) {
|
|
|
31
33
|
});
|
|
32
34
|
if (routerContextProps == null ? void 0 : routerContextProps.memoryRoute) {
|
|
33
35
|
return /* @__PURE__ */ React.createElement(
|
|
34
|
-
|
|
36
|
+
MemoryRouter,
|
|
35
37
|
{
|
|
36
38
|
...props,
|
|
37
39
|
initialEntries: [routerContextProps == null ? void 0 : routerContextProps.memoryRoute.entryPath]
|
|
@@ -39,7 +41,7 @@ function WraperRouter(props) {
|
|
|
39
41
|
);
|
|
40
42
|
}
|
|
41
43
|
return /* @__PURE__ */ React.createElement(
|
|
42
|
-
|
|
44
|
+
BrowserRouter,
|
|
43
45
|
{
|
|
44
46
|
...propsRes,
|
|
45
47
|
basename: (routerContextProps == null ? void 0 : routerContextProps.basename) || basename
|
package/dist/router-v5.d.ts
CHANGED
|
@@ -1,18 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import * as ReactRouterDom from 'react-router-dom/index.js';
|
|
3
|
-
|
|
4
|
-
export declare function BrowserRouter(props: Parameters<typeof ReactRouterDom.BrowserRouter>[0] | Parameters<typeof ReactRouterDom.MemoryRouter>[0]): default_2.JSX.Element;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export * from "react-router-dom/";
|
|
8
|
-
|
|
9
|
-
export { }
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
declare module '@module-federation/runtime-core' {
|
|
13
|
-
interface ModuleFederation {
|
|
14
|
-
createLazyComponent<T, E extends keyof T>(options: Omit<CreateLazyComponentOptions<T, E>, 'instance'>): ReturnType<typeof createLazyComponent<T, E>>;
|
|
15
|
-
prefetch(options: Omit<PrefetchOptions, 'instance'>): ReturnType<typeof prefetch>;
|
|
16
|
-
collectSSRAssets(options: Omit<Parameters<typeof collectSSRAssets>[0], 'instance'>): ReturnType<typeof collectSSRAssets>;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
1
|
+
export * from './router/v5';
|
package/dist/router-v5.es.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import React__default, { useContext } from "react";
|
|
2
2
|
import * as ReactRouterDom$1 from "react-router-dom/index.js";
|
|
3
|
-
import { R as RouterContext, L as LoggerInstance } from "./index-
|
|
3
|
+
import { R as RouterContext, L as LoggerInstance } from "./index-Bs2NxD2z.mjs";
|
|
4
4
|
export * from "react-router-dom/index.js";
|
|
5
5
|
function WraperRouter(props) {
|
|
6
6
|
const { basename, ...propsRes } = props;
|
|
7
7
|
const routerContextProps = useContext(RouterContext) || {};
|
|
8
|
+
const MemoryRouter = ReactRouterDom$1.MemoryRouter;
|
|
9
|
+
const BrowserRouter = ReactRouterDom$1.BrowserRouter;
|
|
8
10
|
LoggerInstance.debug(`WraperRouter info >>>`, {
|
|
9
11
|
...routerContextProps,
|
|
10
12
|
routerContextProps,
|
|
@@ -12,7 +14,7 @@ function WraperRouter(props) {
|
|
|
12
14
|
});
|
|
13
15
|
if (routerContextProps == null ? void 0 : routerContextProps.memoryRoute) {
|
|
14
16
|
return /* @__PURE__ */ React__default.createElement(
|
|
15
|
-
|
|
17
|
+
MemoryRouter,
|
|
16
18
|
{
|
|
17
19
|
...props,
|
|
18
20
|
initialEntries: [routerContextProps == null ? void 0 : routerContextProps.memoryRoute.entryPath]
|
|
@@ -20,7 +22,7 @@ function WraperRouter(props) {
|
|
|
20
22
|
);
|
|
21
23
|
}
|
|
22
24
|
return /* @__PURE__ */ React__default.createElement(
|
|
23
|
-
|
|
25
|
+
BrowserRouter,
|
|
24
26
|
{
|
|
25
27
|
...propsRes,
|
|
26
28
|
basename: (routerContextProps == null ? void 0 : routerContextProps.basename) || basename
|
package/dist/router-v6.cjs.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const React = require("react");
|
|
4
4
|
const ReactRouterDom$1 = require("react-router-dom/dist/index.js");
|
|
5
|
-
const index = require("./index-
|
|
5
|
+
const index = require("./index-DbjGCKOr.js");
|
|
6
6
|
const ReactRouterDom = require("react-router-dom/dist/index.js");
|
|
7
7
|
function _interopNamespaceDefault(e) {
|
|
8
8
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
package/dist/router-v6.d.ts
CHANGED
|
@@ -1,20 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import * as ReactRouterDom from 'react-router-dom/dist/index.js';
|
|
3
|
-
|
|
4
|
-
export declare function BrowserRouter(props: Parameters<typeof ReactRouterDom.BrowserRouter>[0] | Parameters<typeof ReactRouterDom.MemoryRouter>[0]): default_2.JSX.Element;
|
|
5
|
-
|
|
6
|
-
export declare function RouterProvider(props: Parameters<typeof ReactRouterDom.RouterProvider>[0]): default_2.JSX.Element;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export * from "react-router-dom/";
|
|
10
|
-
|
|
11
|
-
export { }
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
declare module '@module-federation/runtime-core' {
|
|
15
|
-
interface ModuleFederation {
|
|
16
|
-
createLazyComponent<T, E extends keyof T>(options: Omit<CreateLazyComponentOptions<T, E>, 'instance'>): ReturnType<typeof createLazyComponent<T, E>>;
|
|
17
|
-
prefetch(options: Omit<PrefetchOptions, 'instance'>): ReturnType<typeof prefetch>;
|
|
18
|
-
collectSSRAssets(options: Omit<Parameters<typeof collectSSRAssets>[0], 'instance'>): ReturnType<typeof collectSSRAssets>;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
1
|
+
export * from './router/v6';
|
package/dist/router-v6.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React__default, { useContext } from "react";
|
|
2
2
|
import * as ReactRouterDom$1 from "react-router-dom/dist/index.js";
|
|
3
|
-
import { R as RouterContext, L as LoggerInstance } from "./index-
|
|
3
|
+
import { R as RouterContext, L as LoggerInstance } from "./index-Bs2NxD2z.mjs";
|
|
4
4
|
export * from "react-router-dom/dist/index.js";
|
|
5
5
|
function WraperRouter(props) {
|
|
6
6
|
const { basename, ...propsRes } = props;
|
package/dist/router-v7.cjs.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const React = require("react");
|
|
4
4
|
const ReactRouterDom = require("react-router");
|
|
5
|
-
const index = require("./index-
|
|
5
|
+
const index = require("./index-DbjGCKOr.js");
|
|
6
6
|
function _interopNamespaceDefault(e) {
|
|
7
7
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
8
8
|
if (e) {
|
|
@@ -23,6 +23,8 @@ const ReactRouterDom__namespace = /* @__PURE__ */ _interopNamespaceDefault(React
|
|
|
23
23
|
function WraperRouter(props) {
|
|
24
24
|
const { basename, ...propsRes } = props;
|
|
25
25
|
const routerContextProps = React.useContext(index.RouterContext) || {};
|
|
26
|
+
const MemoryRouter = ReactRouterDom__namespace.MemoryRouter;
|
|
27
|
+
const BrowserRouter = ReactRouterDom__namespace.BrowserRouter;
|
|
26
28
|
index.LoggerInstance.debug(`WraperRouter info >>>`, {
|
|
27
29
|
...routerContextProps,
|
|
28
30
|
routerContextProps,
|
|
@@ -30,7 +32,7 @@ function WraperRouter(props) {
|
|
|
30
32
|
});
|
|
31
33
|
if (routerContextProps == null ? void 0 : routerContextProps.memoryRoute) {
|
|
32
34
|
return /* @__PURE__ */ React.createElement(
|
|
33
|
-
|
|
35
|
+
MemoryRouter,
|
|
34
36
|
{
|
|
35
37
|
...props,
|
|
36
38
|
initialEntries: [routerContextProps == null ? void 0 : routerContextProps.memoryRoute.entryPath]
|
|
@@ -38,7 +40,7 @@ function WraperRouter(props) {
|
|
|
38
40
|
);
|
|
39
41
|
}
|
|
40
42
|
return /* @__PURE__ */ React.createElement(
|
|
41
|
-
|
|
43
|
+
BrowserRouter,
|
|
42
44
|
{
|
|
43
45
|
...propsRes,
|
|
44
46
|
basename: (routerContextProps == null ? void 0 : routerContextProps.basename) || basename
|
package/dist/router-v7.d.ts
CHANGED
|
@@ -1,20 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import * as ReactRouterDom from 'react-router';
|
|
3
|
-
|
|
4
|
-
export declare function BrowserRouter(props: Parameters<typeof ReactRouterDom.BrowserRouter>[0] | Parameters<typeof ReactRouterDom.MemoryRouter>[0]): default_2.JSX.Element;
|
|
5
|
-
|
|
6
|
-
export declare function RouterProvider(props: Parameters<typeof ReactRouterDom.RouterProvider>[0]): default_2.JSX.Element;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export * from "react-router";
|
|
10
|
-
|
|
11
|
-
export { }
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
declare module '@module-federation/runtime-core' {
|
|
15
|
-
interface ModuleFederation {
|
|
16
|
-
createLazyComponent<T, E extends keyof T>(options: Omit<CreateLazyComponentOptions<T, E>, 'instance'>): ReturnType<typeof createLazyComponent<T, E>>;
|
|
17
|
-
prefetch(options: Omit<PrefetchOptions, 'instance'>): ReturnType<typeof prefetch>;
|
|
18
|
-
collectSSRAssets(options: Omit<Parameters<typeof collectSSRAssets>[0], 'instance'>): ReturnType<typeof collectSSRAssets>;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
1
|
+
export * from './router/v7';
|
package/dist/router-v7.es.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import React__default, { useContext } from "react";
|
|
2
2
|
import * as ReactRouterDom from 'react-router/dist/production/index.js';
|
|
3
3
|
export * from 'react-router/dist/production/index.js';
|
|
4
|
-
import { R as RouterContext, L as LoggerInstance } from "./index-
|
|
4
|
+
import { R as RouterContext, L as LoggerInstance } from "./index-Bs2NxD2z.mjs";
|
|
5
5
|
function WraperRouter(props) {
|
|
6
6
|
const { basename, ...propsRes } = props;
|
|
7
7
|
const routerContextProps = useContext(RouterContext) || {};
|
|
8
|
+
const MemoryRouter = ReactRouterDom.MemoryRouter;
|
|
9
|
+
const BrowserRouter = ReactRouterDom.BrowserRouter;
|
|
8
10
|
LoggerInstance.debug(`WraperRouter info >>>`, {
|
|
9
11
|
...routerContextProps,
|
|
10
12
|
routerContextProps,
|
|
@@ -12,7 +14,7 @@ function WraperRouter(props) {
|
|
|
12
14
|
});
|
|
13
15
|
if (routerContextProps == null ? void 0 : routerContextProps.memoryRoute) {
|
|
14
16
|
return /* @__PURE__ */ React__default.createElement(
|
|
15
|
-
|
|
17
|
+
MemoryRouter,
|
|
16
18
|
{
|
|
17
19
|
...props,
|
|
18
20
|
initialEntries: [routerContextProps == null ? void 0 : routerContextProps.memoryRoute.entryPath]
|
|
@@ -20,7 +22,7 @@ function WraperRouter(props) {
|
|
|
20
22
|
);
|
|
21
23
|
}
|
|
22
24
|
return /* @__PURE__ */ React__default.createElement(
|
|
23
|
-
|
|
25
|
+
BrowserRouter,
|
|
24
26
|
{
|
|
25
27
|
...propsRes,
|
|
26
28
|
basename: (routerContextProps == null ? void 0 : routerContextProps.basename) || basename
|
package/dist/router.cjs.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const React = require("react");
|
|
4
4
|
const ReactRouterDom = require("react-router-dom/");
|
|
5
|
-
const index = require("./index-
|
|
5
|
+
const index = require("./index-DbjGCKOr.js");
|
|
6
6
|
function _interopNamespaceDefault(e) {
|
|
7
7
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
8
8
|
if (e) {
|
package/dist/router.d.ts
CHANGED
|
@@ -1,20 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import * as ReactRouterDom from 'react-router-dom/';
|
|
3
|
-
|
|
4
|
-
export declare function BrowserRouter(props: Parameters<typeof ReactRouterDom.BrowserRouter>[0] | Parameters<typeof ReactRouterDom.MemoryRouter>[0]): default_2.JSX.Element;
|
|
5
|
-
|
|
6
|
-
export declare function RouterProvider(props: Parameters<typeof ReactRouterDom.RouterProvider>[0]): default_2.JSX.Element;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export * from "react-router-dom/";
|
|
10
|
-
|
|
11
|
-
export { }
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
declare module '@module-federation/runtime-core' {
|
|
15
|
-
interface ModuleFederation {
|
|
16
|
-
createLazyComponent<T, E extends keyof T>(options: Omit<CreateLazyComponentOptions<T, E>, 'instance'>): ReturnType<typeof createLazyComponent<T, E>>;
|
|
17
|
-
prefetch(options: Omit<PrefetchOptions, 'instance'>): ReturnType<typeof prefetch>;
|
|
18
|
-
collectSSRAssets(options: Omit<Parameters<typeof collectSSRAssets>[0], 'instance'>): ReturnType<typeof collectSSRAssets>;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
1
|
+
export * from './router/default';
|
package/dist/router.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React__default, { useContext } from "react";
|
|
2
2
|
import * as ReactRouterDom from "react-router-dom/";
|
|
3
3
|
export * from "react-router-dom/";
|
|
4
|
-
import { R as RouterContext, L as LoggerInstance } from "./index-
|
|
4
|
+
import { R as RouterContext, L as LoggerInstance } from "./index-Bs2NxD2z.mjs";
|
|
5
5
|
function WrapperRouter(props) {
|
|
6
6
|
const { basename, ...propsRes } = props;
|
|
7
7
|
const routerContextProps = useContext(RouterContext) || {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface SizeLimitedCacheOptions<K, V> {
|
|
2
|
+
maxSize: number;
|
|
3
|
+
sizeCalculation?: (value: V, key: K) => number;
|
|
4
|
+
}
|
|
5
|
+
export interface SizeLimitedCacheSetOptions {
|
|
6
|
+
size?: number;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* A small, size-aware least-recently-used cache.
|
|
10
|
+
*
|
|
11
|
+
* This intentionally implements only the operations used by federation
|
|
12
|
+
* packages. Reading or checking an entry refreshes its recency.
|
|
13
|
+
*/
|
|
14
|
+
export declare class SizeLimitedCache<K, V> {
|
|
15
|
+
readonly maxSize: number;
|
|
16
|
+
private readonly entries;
|
|
17
|
+
private readonly sizeCalculation?;
|
|
18
|
+
private currentSize;
|
|
19
|
+
constructor(options: SizeLimitedCacheOptions<K, V>);
|
|
20
|
+
get size(): number;
|
|
21
|
+
get calculatedSize(): number;
|
|
22
|
+
get(key: K): V | undefined;
|
|
23
|
+
has(key: K): boolean;
|
|
24
|
+
set(key: K, value: V, options?: SizeLimitedCacheSetOptions): this;
|
|
25
|
+
delete(key: K): boolean;
|
|
26
|
+
clear(): void;
|
|
27
|
+
private refresh;
|
|
28
|
+
private evictUntilWithinLimit;
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
6
|
+
class SizeLimitedCache {
|
|
7
|
+
constructor(options) {
|
|
8
|
+
__publicField(this, "maxSize");
|
|
9
|
+
__publicField(this, "entries", /* @__PURE__ */ new Map());
|
|
10
|
+
__publicField(this, "sizeCalculation");
|
|
11
|
+
__publicField(this, "currentSize", 0);
|
|
12
|
+
if (!Number.isInteger(options.maxSize) || options.maxSize <= 0) {
|
|
13
|
+
throw new TypeError("maxSize must be a positive integer");
|
|
14
|
+
}
|
|
15
|
+
this.maxSize = options.maxSize;
|
|
16
|
+
this.sizeCalculation = options.sizeCalculation;
|
|
17
|
+
}
|
|
18
|
+
get size() {
|
|
19
|
+
return this.entries.size;
|
|
20
|
+
}
|
|
21
|
+
get calculatedSize() {
|
|
22
|
+
return this.currentSize;
|
|
23
|
+
}
|
|
24
|
+
get(key) {
|
|
25
|
+
const entry = this.entries.get(key);
|
|
26
|
+
if (!entry) {
|
|
27
|
+
return void 0;
|
|
28
|
+
}
|
|
29
|
+
this.refresh(key, entry);
|
|
30
|
+
return entry.value;
|
|
31
|
+
}
|
|
32
|
+
has(key) {
|
|
33
|
+
const entry = this.entries.get(key);
|
|
34
|
+
if (!entry) {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
this.refresh(key, entry);
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
set(key, value, options = {}) {
|
|
41
|
+
var _a;
|
|
42
|
+
const entrySize = options.size ?? ((_a = this.sizeCalculation) == null ? void 0 : _a.call(this, value, key)) ?? 1;
|
|
43
|
+
if (!Number.isInteger(entrySize) || entrySize <= 0) {
|
|
44
|
+
throw new TypeError("entry size must be a positive integer");
|
|
45
|
+
}
|
|
46
|
+
this.delete(key);
|
|
47
|
+
if (entrySize > this.maxSize) {
|
|
48
|
+
return this;
|
|
49
|
+
}
|
|
50
|
+
this.entries.set(key, { value, size: entrySize });
|
|
51
|
+
this.currentSize += entrySize;
|
|
52
|
+
this.evictUntilWithinLimit();
|
|
53
|
+
return this;
|
|
54
|
+
}
|
|
55
|
+
delete(key) {
|
|
56
|
+
const entry = this.entries.get(key);
|
|
57
|
+
if (!entry) {
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
this.currentSize -= entry.size;
|
|
61
|
+
return this.entries.delete(key);
|
|
62
|
+
}
|
|
63
|
+
clear() {
|
|
64
|
+
this.entries.clear();
|
|
65
|
+
this.currentSize = 0;
|
|
66
|
+
}
|
|
67
|
+
refresh(key, entry) {
|
|
68
|
+
this.entries.delete(key);
|
|
69
|
+
this.entries.set(key, entry);
|
|
70
|
+
}
|
|
71
|
+
evictUntilWithinLimit() {
|
|
72
|
+
while (this.currentSize > this.maxSize) {
|
|
73
|
+
const oldest = this.entries.keys().next();
|
|
74
|
+
if (oldest.done) {
|
|
75
|
+
this.currentSize = 0;
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
this.delete(oldest.value);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
exports.SizeLimitedCache = SizeLimitedCache;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './shared/size-limited-cache';
|