@module-federation/bridge-vue3
Advanced tools
Comparing version 0.0.0-next-20241114091142 to 0.0.0-next-20241114094904
# @module-federation/bridge-vue3 | ||
## 0.0.0-next-20241114091142 | ||
## 0.0.0-next-20241114094904 | ||
### Patch Changes | ||
- @module-federation/sdk@0.0.0-next-20241114091142 | ||
- @module-federation/bridge-shared@0.0.0-next-20241114091142 | ||
- @module-federation/runtime@0.0.0-next-20241114094904 | ||
- @module-federation/sdk@0.0.0-next-20241114094904 | ||
- @module-federation/bridge-shared@0.0.0-next-20241114094904 | ||
## 0.7.4 | ||
### Patch Changes | ||
- ff8ce29: feat: feat: support lifecycyle hooks in module-deferation bridge | ||
- Updated dependencies [ff8ce29] | ||
- @module-federation/runtime@0.7.4 | ||
- @module-federation/sdk@0.7.4 | ||
- @module-federation/bridge-shared@0.7.4 | ||
## 0.7.3 | ||
@@ -11,0 +22,0 @@ |
@@ -10,3 +10,3 @@ { | ||
}, | ||
"version": "0.0.0-next-20241114091142", | ||
"version": "0.0.0-next-20241114094904", | ||
"publishConfig": { | ||
@@ -36,4 +36,5 @@ "access": "public" | ||
"dependencies": { | ||
"@module-federation/bridge-shared": "0.0.0-next-20241114091142", | ||
"@module-federation/sdk": "0.0.0-next-20241114091142" | ||
"@module-federation/bridge-shared": "0.0.0-next-20241114094904", | ||
"@module-federation/sdk": "0.0.0-next-20241114094904", | ||
"@module-federation/runtime": "0.0.0-next-20241114094904" | ||
}, | ||
@@ -40,0 +41,0 @@ "devDependencies": { |
import { defineAsyncComponent, h } from 'vue'; | ||
import { useRoute } from 'vue-router'; | ||
import RemoteApp from './remoteApp.jsx'; | ||
import { LoggerInstance } from './utils.js'; | ||
import { useRoute } from 'vue-router'; | ||
@@ -6,0 +6,0 @@ declare const __APP_VERSION__: string; |
@@ -5,2 +5,3 @@ import * as Vue from 'vue'; | ||
import { LoggerInstance } from './utils'; | ||
import { getInstance } from '@module-federation/runtime'; | ||
@@ -11,2 +12,3 @@ declare const __APP_VERSION__: string; | ||
const rootMap = new Map(); | ||
const instance = getInstance(); | ||
return () => { | ||
@@ -19,5 +21,17 @@ return { | ||
rootMap.set(info.dom, app); | ||
const beforeBridgeRenderRes = | ||
instance?.bridgeHook?.lifecycle?.beforeBridgeRender?.emit(info) || {}; | ||
const extraProps = | ||
beforeBridgeRenderRes && | ||
typeof beforeBridgeRenderRes === 'object' && | ||
beforeBridgeRenderRes?.extraProps | ||
? beforeBridgeRenderRes?.extraProps | ||
: {}; | ||
const appOptions = bridgeInfo.appOptions({ | ||
basename: info.basename, | ||
memoryRoute: info.memoryRoute, | ||
...extraProps, | ||
}); | ||
@@ -28,2 +42,3 @@ | ||
: VueRouter.createWebHistory(info.basename); | ||
const router = VueRouter.createRouter({ | ||
@@ -49,2 +64,4 @@ ...appOptions.router.options, | ||
} | ||
instance?.bridgeHook?.lifecycle?.afterBridgeRender?.emit(info) || {}; | ||
}, | ||
@@ -54,3 +71,6 @@ destroy(info: { dom: HTMLElement }) { | ||
const root = rootMap.get(info?.dom); | ||
instance?.bridgeHook?.lifecycle?.beforeBridgeDestroy?.emit(info); | ||
root?.unmount(); | ||
instance?.bridgeHook?.lifecycle?.afterBridgeDestroy?.emit(info); | ||
}, | ||
@@ -57,0 +77,0 @@ }; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 2 instances in 1 package
174948
3253
5
21
+ Added@module-federation/bridge-shared@0.0.0-next-20241114094904(transitive)
+ Added@module-federation/error-codes@0.0.0-next-20241114094904(transitive)
+ Added@module-federation/runtime@0.0.0-next-20241114094904(transitive)
+ Added@module-federation/sdk@0.0.0-next-20241114094904(transitive)
- Removed@module-federation/bridge-shared@0.0.0-next-20241114091142(transitive)
- Removed@module-federation/sdk@0.0.0-next-20241114091142(transitive)
Updated@module-federation/bridge-shared@0.0.0-next-20241114094904