@module-federation/modern-js 0.0.0-next-20240909083238 → 0.0.0-next-20240909101028
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/cjs/{runtime/withMFRouteId.js → cli/constant.js} +6 -9
- package/dist/cjs/cli/index.js +1 -6
- package/dist/cjs/cli/mfRuntimePlugins/inject-node-fetch.js +10 -7
- package/dist/cjs/cli/mfRuntimePlugins/resolve-entry-ipv4.js +38 -40
- package/dist/cjs/cli/ssrPlugin.js +1 -1
- package/dist/cjs/cli/utils.js +4 -8
- package/dist/cjs/cli/utils.spec.js +1 -1
- package/dist/cjs/constant.js +2 -32
- package/dist/cjs/runtime/index.js +1 -4
- package/dist/cjs/ssr-runtime/plugin.js +7 -7
- package/dist/esm/cli/constant.js +4 -0
- package/dist/esm/cli/index.js +1 -6
- package/dist/esm/cli/mfRuntimePlugins/inject-node-fetch.js +10 -7
- package/dist/esm/cli/ssrPlugin.js +1 -1
- package/dist/esm/cli/utils.js +3 -6
- package/dist/esm/cli/utils.spec.js +1 -1
- package/dist/esm/constant.js +1 -21
- package/dist/esm/runtime/index.js +1 -3
- package/dist/esm/ssr-runtime/plugin.js +10 -7
- package/dist/esm-node/cli/constant.js +4 -0
- package/dist/esm-node/cli/index.js +1 -6
- package/dist/esm-node/cli/mfRuntimePlugins/inject-node-fetch.js +10 -7
- package/dist/esm-node/cli/mfRuntimePlugins/resolve-entry-ipv4.js +38 -40
- package/dist/esm-node/cli/ssrPlugin.js +1 -1
- package/dist/esm-node/cli/utils.js +3 -6
- package/dist/esm-node/cli/utils.spec.js +1 -1
- package/dist/esm-node/constant.js +1 -21
- package/dist/esm-node/runtime/index.js +1 -3
- package/dist/esm-node/ssr-runtime/plugin.js +7 -7
- package/dist/types/cli/constant.d.ts +1 -0
- package/dist/types/cli/mfRuntimePlugins/inject-node-fetch.d.ts +2 -2
- package/dist/types/cli/utils.d.ts +0 -2
- package/dist/types/constant.d.ts +0 -10
- package/dist/types/runtime/index.d.ts +0 -1
- package/dist/types/types/index.d.ts +0 -10
- package/package.json +11 -40
- package/dist/cjs/cli/dataLoader/ast/constant.js +0 -49
- package/dist/cjs/cli/dataLoader/ast/generateRoutes.js +0 -142
- package/dist/cjs/cli/dataLoader/ast/generateSelfRoutes.js +0 -48
- package/dist/cjs/cli/dataLoader/ast/generateSerializableRoutes.js +0 -90
- package/dist/cjs/cli/dataLoader/ast/generateSlimRoutes.js +0 -104
- package/dist/cjs/cli/dataLoader/ast/index.js +0 -37
- package/dist/cjs/cli/dataLoader/generateRouteFile.js +0 -143
- package/dist/cjs/cli/dataLoader/patchMFConfig.js +0 -137
- package/dist/cjs/cli/dataLoader/plugin.js +0 -205
- package/dist/cjs/cli/mfRuntimePlugins/node.js +0 -44
- package/dist/cjs/cli/server/dataLoaderPlugin.js +0 -82
- package/dist/cjs/cli/server/fetchRemoteFullRoutesMap.js +0 -68
- package/dist/cjs/interfaces/route.js +0 -16
- package/dist/cjs/runtime/dataLoader/plugin.js +0 -73
- package/dist/cjs/runtime/dataLoader/utils.js +0 -89
- package/dist/cjs/runtime/utils.js +0 -38
- package/dist/esm/cli/dataLoader/ast/constant.js +0 -18
- package/dist/esm/cli/dataLoader/ast/generateRoutes.js +0 -109
- package/dist/esm/cli/dataLoader/ast/generateSelfRoutes.js +0 -17
- package/dist/esm/cli/dataLoader/ast/generateSerializableRoutes.js +0 -57
- package/dist/esm/cli/dataLoader/ast/generateSlimRoutes.js +0 -73
- package/dist/esm/cli/dataLoader/ast/index.js +0 -10
- package/dist/esm/cli/dataLoader/generateRouteFile.js +0 -293
- package/dist/esm/cli/dataLoader/patchMFConfig.js +0 -103
- package/dist/esm/cli/dataLoader/plugin.js +0 -216
- package/dist/esm/cli/mfRuntimePlugins/node.js +0 -16
- package/dist/esm/cli/server/dataLoaderPlugin.js +0 -105
- package/dist/esm/cli/server/fetchRemoteFullRoutesMap.js +0 -86
- package/dist/esm/interfaces/route.js +0 -0
- package/dist/esm/runtime/dataLoader/plugin.js +0 -92
- package/dist/esm/runtime/dataLoader/utils.js +0 -63
- package/dist/esm/runtime/utils.js +0 -13
- package/dist/esm/runtime/withMFRouteId.js +0 -7
- package/dist/esm-node/cli/dataLoader/ast/constant.js +0 -18
- package/dist/esm-node/cli/dataLoader/ast/generateRoutes.js +0 -108
- package/dist/esm-node/cli/dataLoader/ast/generateSelfRoutes.js +0 -14
- package/dist/esm-node/cli/dataLoader/ast/generateSerializableRoutes.js +0 -56
- package/dist/esm-node/cli/dataLoader/ast/generateSlimRoutes.js +0 -70
- package/dist/esm-node/cli/dataLoader/ast/index.js +0 -10
- package/dist/esm-node/cli/dataLoader/generateRouteFile.js +0 -108
- package/dist/esm-node/cli/dataLoader/patchMFConfig.js +0 -103
- package/dist/esm-node/cli/dataLoader/plugin.js +0 -169
- package/dist/esm-node/cli/mfRuntimePlugins/node.js +0 -14
- package/dist/esm-node/cli/server/dataLoaderPlugin.js +0 -62
- package/dist/esm-node/cli/server/fetchRemoteFullRoutesMap.js +0 -43
- package/dist/esm-node/interfaces/route.js +0 -0
- package/dist/esm-node/runtime/dataLoader/plugin.js +0 -49
- package/dist/esm-node/runtime/dataLoader/utils.js +0 -63
- package/dist/esm-node/runtime/utils.js +0 -13
- package/dist/esm-node/runtime/withMFRouteId.js +0 -7
- package/dist/types/cli/dataLoader/ast/constant.d.ts +0 -8
- package/dist/types/cli/dataLoader/ast/generateRoutes.d.ts +0 -7
- package/dist/types/cli/dataLoader/ast/generateSelfRoutes.d.ts +0 -7
- package/dist/types/cli/dataLoader/ast/generateSerializableRoutes.d.ts +0 -5
- package/dist/types/cli/dataLoader/ast/generateSlimRoutes.d.ts +0 -7
- package/dist/types/cli/dataLoader/ast/index.d.ts +0 -4
- package/dist/types/cli/dataLoader/generateRouteFile.d.ts +0 -7
- package/dist/types/cli/dataLoader/patchMFConfig.d.ts +0 -11
- package/dist/types/cli/dataLoader/plugin.d.ts +0 -6
- package/dist/types/cli/mfRuntimePlugins/node.d.ts +0 -3
- package/dist/types/cli/server/dataLoaderPlugin.d.ts +0 -10
- package/dist/types/cli/server/fetchRemoteFullRoutesMap.d.ts +0 -10
- package/dist/types/interfaces/route.d.ts +0 -13
- package/dist/types/runtime/dataLoader/plugin.d.ts +0 -2
- package/dist/types/runtime/dataLoader/utils.d.ts +0 -19
- package/dist/types/runtime/utils.d.ts +0 -2
- package/dist/types/runtime/withMFRouteId.d.ts +0 -1
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { type moduleFederationPlugin } from '@module-federation/sdk';
|
|
2
|
-
type PatchMFConfigOptions = {
|
|
3
|
-
mfConfig: moduleFederationPlugin.ModuleFederationPluginOptions;
|
|
4
|
-
baseName: string;
|
|
5
|
-
metaName: string;
|
|
6
|
-
isServer: boolean;
|
|
7
|
-
internalDirectory: string;
|
|
8
|
-
entries: Set<string>;
|
|
9
|
-
};
|
|
10
|
-
export declare function patchMFConfig(options: PatchMFConfigOptions): void;
|
|
11
|
-
export {};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { CliPlugin, AppTools } from '@modern-js/app-tools';
|
|
2
|
-
import type { DataLoaderOptions, InternalModernPluginOptions } from '../../types';
|
|
3
|
-
import { generateRoutes, generateSlimRoutes } from './ast';
|
|
4
|
-
export declare const moduleFederationDataLoaderPlugin: (enable: boolean, internalOptions: InternalModernPluginOptions, userConfig: DataLoaderOptions) => CliPlugin<AppTools>;
|
|
5
|
-
export default moduleFederationDataLoaderPlugin;
|
|
6
|
-
export { generateRoutes, generateSlimRoutes };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { ServerPlugin } from '@modern-js/server-core';
|
|
2
|
-
import { init } from '@module-federation/enhanced/runtime';
|
|
3
|
-
type MFRuntimeOptions = Parameters<typeof init>[0];
|
|
4
|
-
export type DataLoaderServerPluginOptions = {
|
|
5
|
-
runtimeOptions: MFRuntimeOptions;
|
|
6
|
-
partialSSRRemotes: string[];
|
|
7
|
-
ssrByRouteIdsMap: Record<string, string>;
|
|
8
|
-
};
|
|
9
|
-
declare const _default: ({ runtimeOptions, partialSSRRemotes, ssrByRouteIdsMap, }: DataLoaderServerPluginOptions) => ServerPlugin;
|
|
10
|
-
export default _default;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { FederationHost } from '@module-federation/enhanced/runtime';
|
|
2
|
-
import type { RouteObject } from '@modern-js/runtime/router';
|
|
3
|
-
export type RemoteRoutesMap = Record<string, {
|
|
4
|
-
routes: RouteObject[];
|
|
5
|
-
}>;
|
|
6
|
-
export declare function fetchRemoteFullRoutesMap(options: {
|
|
7
|
-
remotePath: string;
|
|
8
|
-
instance: FederationHost;
|
|
9
|
-
}): Promise<RemoteRoutesMap>;
|
|
10
|
-
export declare function getSSRByRouteIds(partialSSRRemotes: string[], remoteRoutesMap: RemoteRoutesMap): undefined | string[];
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export type Route = {
|
|
2
|
-
id: string;
|
|
3
|
-
type: string;
|
|
4
|
-
loader?: boolean;
|
|
5
|
-
index?: boolean;
|
|
6
|
-
isRoot?: boolean;
|
|
7
|
-
children?: Route[];
|
|
8
|
-
};
|
|
9
|
-
export type MFModernRouteJson = {
|
|
10
|
-
baseName: string;
|
|
11
|
-
routes: Record<string, Route[]>;
|
|
12
|
-
prefix: string;
|
|
13
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { RouteObject } from '@modern-js/runtime/router';
|
|
2
|
-
export type RemoteRoutesMap = Record<string, {
|
|
3
|
-
routes: RouteObject[];
|
|
4
|
-
}>;
|
|
5
|
-
export type LoaderBundlesRoutes = {
|
|
6
|
-
[entryName: string]: {
|
|
7
|
-
routes: RouteObject[];
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
|
-
export type NestedRoutes = {
|
|
11
|
-
[entryName: string]: RouteObject[];
|
|
12
|
-
};
|
|
13
|
-
export declare function getRemoteRoutesInfos(route: RouteObject, remoteRoutesMap: RemoteRoutesMap): {
|
|
14
|
-
routes: RouteObject;
|
|
15
|
-
name: string;
|
|
16
|
-
pathName: string | undefined;
|
|
17
|
-
} | undefined;
|
|
18
|
-
export declare function getRemoteLayoutId(remoteName: string): string;
|
|
19
|
-
export declare function injectRemoteRoutes(initialRoutes: LoaderBundlesRoutes | NestedRoutes, remoteRoutesMap: RemoteRoutesMap): void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function withMFRouteId(id: string): string;
|