@module-federation/bridge-vue3 2.7.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/create.d.ts +28 -0
- package/dist/index.cjs +6 -6
- package/dist/index.d.ts +4 -1
- package/dist/index.js +751 -698
- package/dist/provider.d.ts +27 -0
- package/dist/remoteApp.d.ts +18 -0
- package/dist/routeUtils.d.ts +21 -0
- package/dist/utils.d.ts +1 -0
- package/package.json +6 -7
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as Vue from 'vue';
|
|
2
|
+
import * as VueRouter from 'vue-router';
|
|
3
|
+
import { RenderFnParams } from '@module-federation/bridge-shared';
|
|
4
|
+
type AddOptionsFnParams = {
|
|
5
|
+
app: Vue.App<Vue.Component>;
|
|
6
|
+
basename: RenderFnParams['basename'];
|
|
7
|
+
memoryRoute: RenderFnParams['memoryRoute'];
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
};
|
|
10
|
+
export type ProviderFnParams = {
|
|
11
|
+
rootComponent: Vue.Component;
|
|
12
|
+
appOptions: (params: AddOptionsFnParams) => {
|
|
13
|
+
router?: VueRouter.Router;
|
|
14
|
+
/** Called with the bridge's internal router after creation but before navigation.
|
|
15
|
+
* Use this to register global guards (beforeEach, afterEach, etc.) that would
|
|
16
|
+
* otherwise be lost when the bridge recreates the router. */
|
|
17
|
+
afterRouterCreate?: (router: VueRouter.Router) => void;
|
|
18
|
+
} | void;
|
|
19
|
+
};
|
|
20
|
+
export declare function createBridgeComponent(bridgeInfo: ProviderFnParams): () => {
|
|
21
|
+
__APP_VERSION__: string;
|
|
22
|
+
render(info: RenderFnParams): Promise<void>;
|
|
23
|
+
destroy(info: {
|
|
24
|
+
dom: HTMLElement;
|
|
25
|
+
}): void;
|
|
26
|
+
};
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
moduleName: StringConstructor;
|
|
3
|
+
basename: StringConstructor;
|
|
4
|
+
memoryRoute: ObjectConstructor;
|
|
5
|
+
hashRoute: BooleanConstructor;
|
|
6
|
+
providerInfo: FunctionConstructor;
|
|
7
|
+
rootAttrs: ObjectConstructor;
|
|
8
|
+
}>, () => import("node_modules/vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
9
|
+
moduleName: StringConstructor;
|
|
10
|
+
basename: StringConstructor;
|
|
11
|
+
memoryRoute: ObjectConstructor;
|
|
12
|
+
hashRoute: BooleanConstructor;
|
|
13
|
+
providerInfo: FunctionConstructor;
|
|
14
|
+
rootAttrs: ObjectConstructor;
|
|
15
|
+
}>> & Readonly<{}>, {
|
|
16
|
+
hashRoute: boolean;
|
|
17
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as VueRouter from 'vue-router';
|
|
2
|
+
export interface RouteProcessingOptions {
|
|
3
|
+
router: VueRouter.Router;
|
|
4
|
+
basename?: string;
|
|
5
|
+
memoryRoute?: boolean | {
|
|
6
|
+
entryPath: string;
|
|
7
|
+
};
|
|
8
|
+
hashRoute?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface RouteProcessingResult {
|
|
11
|
+
history: VueRouter.RouterHistory;
|
|
12
|
+
routes: VueRouter.RouteRecordNormalized[];
|
|
13
|
+
patchRouter?: (router: VueRouter.Router) => void;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Route processing solution based on path analysis
|
|
17
|
+
*
|
|
18
|
+
* @param options - route processing options
|
|
19
|
+
* @returns processed history and routes
|
|
20
|
+
*/
|
|
21
|
+
export declare function processRoutes(options: RouteProcessingOptions): RouteProcessingResult;
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const LoggerInstance: import("@module-federation/sdk").Logger;
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"url": "git+https://github.com/module-federation/core.git",
|
|
8
8
|
"directory": "packages/bridge/vue3-bridge"
|
|
9
9
|
},
|
|
10
|
-
"version": "2.
|
|
10
|
+
"version": "2.8.0",
|
|
11
11
|
"publishConfig": {
|
|
12
12
|
"access": "public"
|
|
13
13
|
},
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"vue-router": "=4"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@module-federation/bridge-shared": "2.
|
|
29
|
-
"@module-federation/runtime": "2.
|
|
30
|
-
"@module-federation/sdk": "2.
|
|
28
|
+
"@module-federation/bridge-shared": "2.8.0",
|
|
29
|
+
"@module-federation/runtime": "2.8.0",
|
|
30
|
+
"@module-federation/sdk": "2.8.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@rsbuild/plugin-babel": "2.0.1",
|
|
@@ -35,16 +35,15 @@
|
|
|
35
35
|
"@types/react": "^18.3.11",
|
|
36
36
|
"@vitejs/plugin-vue": "^5.0.4",
|
|
37
37
|
"@vitejs/plugin-vue-jsx": "^4.0.0",
|
|
38
|
-
"typescript": "
|
|
38
|
+
"typescript": "7.0.2",
|
|
39
39
|
"vite": "^5.4.21",
|
|
40
|
-
"vite-plugin-dts": "^4.5.4",
|
|
41
40
|
"vue": "^3.5.30",
|
|
42
41
|
"vue-router": "4.4.5",
|
|
43
42
|
"vue-tsc": "^2.2.12"
|
|
44
43
|
},
|
|
45
44
|
"scripts": {
|
|
46
45
|
"dev": "vite",
|
|
47
|
-
"build": "vite build",
|
|
46
|
+
"build": "vite build && tsc -p tsconfig.json",
|
|
48
47
|
"preview": "vite preview",
|
|
49
48
|
"test": "rstest"
|
|
50
49
|
}
|