@module-federation/bridge-vue3 0.7.7 → 0.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/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "url": "https://github.com/module-federation/core",
8
8
  "directory": "packages/vue3-bridge"
9
9
  },
10
- "version": "0.7.7",
10
+ "version": "0.8.0",
11
11
  "publishConfig": {
12
12
  "access": "public"
13
13
  },
@@ -32,9 +32,9 @@
32
32
  "vue-router": "=3"
33
33
  },
34
34
  "dependencies": {
35
- "@module-federation/bridge-shared": "0.7.7",
36
- "@module-federation/sdk": "0.7.7",
37
- "@module-federation/runtime": "0.7.7"
35
+ "@module-federation/bridge-shared": "0.8.0",
36
+ "@module-federation/sdk": "0.8.0",
37
+ "@module-federation/runtime": "0.8.0"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@vitejs/plugin-vue": "^5.0.4",
package/src/create.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { defineAsyncComponent, h } from 'vue';
1
+ import { type AsyncComponentOptions, defineAsyncComponent, h } from 'vue';
2
2
  import { useRoute } from 'vue-router';
3
3
  import RemoteApp from './remoteApp.jsx';
4
4
  import { LoggerInstance } from './utils.js';
@@ -8,9 +8,11 @@ declare const __APP_VERSION__: string;
8
8
  export function createRemoteComponent(info: {
9
9
  loader: () => Promise<any>;
10
10
  export?: string;
11
+ asyncComponentOptions?: Omit<AsyncComponentOptions, 'loader'>;
11
12
  }) {
12
13
  return defineAsyncComponent({
13
14
  __APP_VERSION__,
15
+ ...info.asyncComponentOptions,
14
16
  //@ts-ignore
15
17
  loader: async () => {
16
18
  const route = useRoute();
@@ -45,7 +47,6 @@ export function createRemoteComponent(info: {
45
47
  render() {
46
48
  return h(RemoteApp, {
47
49
  moduleName,
48
- ...info,
49
50
  providerInfo: exportFn,
50
51
  basename,
51
52
  });
@@ -54,13 +55,5 @@ export function createRemoteComponent(info: {
54
55
  }
55
56
  throw new Error('module not found');
56
57
  },
57
- loadingComponent: {
58
- template: '<div>Loading...</div>',
59
- },
60
- errorComponent: {
61
- template: '<div>Error loading component</div>',
62
- },
63
- delay: 200,
64
- timeout: 3000,
65
58
  });
66
59
  }