@module-federation/bridge-vue3 0.0.0-next-20240620060503 → 0.0.0-next-20240625025206
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 +19 -2
- package/package.json +2 -2
- package/project.json +0 -6
- package/src/create.ts +6 -7
- package/index.html +0 -13
- package/src/App.vue +0 -30
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,24 @@
|
|
|
1
1
|
# @module-federation/bridge-vue3
|
|
2
2
|
|
|
3
|
-
## 0.0.0-next-
|
|
3
|
+
## 0.0.0-next-20240625025206
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
-
- @module-federation/bridge-shared@0.0.0-next-
|
|
7
|
+
- @module-federation/bridge-shared@0.0.0-next-20240625025206
|
|
8
|
+
|
|
9
|
+
## 0.2.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- @module-federation/bridge-shared@0.2.1
|
|
14
|
+
|
|
15
|
+
## 0.2.0
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
19
|
+
- d2ab821: feat(bridge): Supports exporting and loading of application-level modules (with routing), currently supports react and vue3
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- Updated dependencies [d2ab821]
|
|
24
|
+
- @module-federation/bridge-shared@0.2.0
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@module-federation/bridge-vue3",
|
|
3
3
|
"author": "zhouxiao <codingzx@gmail.com>",
|
|
4
|
-
"version": "0.0.0-next-
|
|
4
|
+
"version": "0.0.0-next-20240625025206",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"vue-router": "=3"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@module-federation/bridge-shared": "0.0.0-next-
|
|
17
|
+
"@module-federation/bridge-shared": "0.0.0-next-20240625025206"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"@vitejs/plugin-vue": "^5.0.4",
|
package/project.json
CHANGED
|
@@ -9,12 +9,6 @@
|
|
|
9
9
|
"options": {
|
|
10
10
|
"commands": ["npm run build --prefix packages/bridge/vue3-bridge"]
|
|
11
11
|
}
|
|
12
|
-
},
|
|
13
|
-
"test": {
|
|
14
|
-
"executor": "nx:run-commands",
|
|
15
|
-
"options": {
|
|
16
|
-
"commands": ["npm run test --prefix packages/bridge/vue3-bridge"]
|
|
17
|
-
}
|
|
18
12
|
}
|
|
19
13
|
},
|
|
20
14
|
"tags": ["type:pkg"]
|
package/src/create.ts
CHANGED
|
@@ -5,10 +5,10 @@ import { useRoute } from 'vue-router';
|
|
|
5
5
|
|
|
6
6
|
declare const __APP_VERSION__: string;
|
|
7
7
|
|
|
8
|
-
export function createRemoteComponent(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
) {
|
|
8
|
+
export function createRemoteComponent(info: {
|
|
9
|
+
loader: () => Promise<any>;
|
|
10
|
+
export?: string;
|
|
11
|
+
}) {
|
|
12
12
|
return defineAsyncComponent({
|
|
13
13
|
__APP_VERSION__,
|
|
14
14
|
//@ts-ignore
|
|
@@ -28,11 +28,10 @@ export function createRemoteComponent(
|
|
|
28
28
|
const exportName = info?.export || 'default';
|
|
29
29
|
LoggerInstance.log(`createRemoteComponent LazyComponent create >>>`, {
|
|
30
30
|
basename,
|
|
31
|
-
|
|
32
|
-
exportName,
|
|
31
|
+
info,
|
|
33
32
|
});
|
|
34
33
|
|
|
35
|
-
const module: any = await
|
|
34
|
+
const module: any = await info.loader();
|
|
36
35
|
const moduleName = module && module[Symbol.for('mf_module_id')];
|
|
37
36
|
const exportFn = module[exportName];
|
|
38
37
|
|
package/index.html
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
-
<title>Vite + Vue + TS</title>
|
|
8
|
-
</head>
|
|
9
|
-
<body>
|
|
10
|
-
<div id="app"></div>
|
|
11
|
-
<script type="module" src="/src/main.ts"></script>
|
|
12
|
-
</body>
|
|
13
|
-
</html>
|
package/src/App.vue
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import HelloWorld from './components/HelloWorld.vue';
|
|
3
|
-
</script>
|
|
4
|
-
|
|
5
|
-
<template>
|
|
6
|
-
<div>
|
|
7
|
-
<a href="https://vitejs.dev" target="_blank">
|
|
8
|
-
<img src="/vite.svg" class="logo" alt="Vite logo" />
|
|
9
|
-
</a>
|
|
10
|
-
<a href="https://vuejs.org/" target="_blank">
|
|
11
|
-
<img src="./assets/vue.svg" class="logo vue" alt="Vue logo" />
|
|
12
|
-
</a>
|
|
13
|
-
</div>
|
|
14
|
-
<HelloWorld msg="Vite + Vue" />
|
|
15
|
-
</template>
|
|
16
|
-
|
|
17
|
-
<style scoped>
|
|
18
|
-
.logo {
|
|
19
|
-
height: 6em;
|
|
20
|
-
padding: 1.5em;
|
|
21
|
-
will-change: filter;
|
|
22
|
-
transition: filter 300ms;
|
|
23
|
-
}
|
|
24
|
-
.logo:hover {
|
|
25
|
-
filter: drop-shadow(0 0 2em #646cffaa);
|
|
26
|
-
}
|
|
27
|
-
.logo.vue:hover {
|
|
28
|
-
filter: drop-shadow(0 0 2em #42b883aa);
|
|
29
|
-
}
|
|
30
|
-
</style>
|