Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@module-federation/bridge-vue3

Package Overview
Dependencies
Maintainers
0
Versions
339
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@module-federation/bridge-vue3 - npm Package Compare versions

Comparing version 0.7.3 to 0.7.5

18

CHANGELOG.md
# @module-federation/bridge-vue3
## 0.7.5
### Patch Changes
- @module-federation/runtime@0.7.5
- @module-federation/sdk@0.7.5
- @module-federation/bridge-shared@0.7.5
## 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

@@ -4,0 +22,0 @@

7

package.json

@@ -10,3 +10,3 @@ {

},
"version": "0.7.3",
"version": "0.7.5",
"publishConfig": {

@@ -36,4 +36,5 @@ "access": "public"

"dependencies": {
"@module-federation/bridge-shared": "0.7.3",
"@module-federation/sdk": "0.7.3"
"@module-federation/bridge-shared": "0.7.5",
"@module-federation/sdk": "0.7.5",
"@module-federation/runtime": "0.7.5"
},

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc