New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@module-federation/bridge-vue3

Package Overview
Dependencies
Maintainers
0
Versions
372
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.0.0-next-20241216131539 to 0.0.0-next-20241218082038

18

CHANGELOG.md
# @module-federation/bridge-vue3
## 0.0.0-next-20241216131539
## 0.0.0-next-20241218082038
### Patch Changes
- @module-federation/runtime@0.0.0-next-20241216131539
- @module-federation/sdk@0.0.0-next-20241216131539
- @module-federation/bridge-shared@0.0.0-next-20241216131539
- Updated dependencies [b7905dc]
- @module-federation/sdk@0.0.0-next-20241218082038
- @module-federation/runtime@0.0.0-next-20241218082038
- @module-federation/bridge-shared@0.0.0-next-20241218082038
## 0.8.5
### Patch Changes
- d161cbe: 1. Added type annotations for the argument in the `createBridgeComponent` function. 2. Added passing the instance of the created Vue-application to `appOptions` so that necessary plugins can be registered in this callback. 3. Made `router` returned from `appOptions` optional. 4. Fixed issues reported by TypeScript and ESLint, including allowing `beforeBridgeRenderRes` to be a promise. 5. Updated the documentation.
- @module-federation/runtime@0.8.5
- @module-federation/sdk@0.8.5
- @module-federation/bridge-shared@0.8.5
## 0.8.4

@@ -12,0 +22,0 @@

import { AsyncComponentOptions } from 'vue';
import { ComponentPublicInstance } from 'vue';
import * as Vue from 'vue';
import * as VueRouter from 'vue-router';
export declare function createBridgeComponent(bridgeInfo: any): () => {
declare type AddOptionsFnParams = {
app: Vue.App<Vue.Component>;
basename: RenderFnParams['basename'];
memoryRoute: RenderFnParams['memoryRoute'];
[key: string]: any;
};
export declare function createBridgeComponent(bridgeInfo: ProviderFnParams): () => {
__APP_VERSION__: string;
render(info: RenderFnParams): void;
render(info: RenderFnParams): Promise<void>;
destroy(info: {

@@ -18,2 +27,9 @@ dom: HTMLElement;

declare type ProviderFnParams = {
rootComponent: Vue.Component;
appOptions: (params: AddOptionsFnParams) => {
router?: VueRouter.Router;
} | void;
};
declare interface ProviderParams {

@@ -20,0 +36,0 @@ moduleName?: string;

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

},
"version": "0.0.0-next-20241216131539",
"version": "0.0.0-next-20241218082038",
"publishConfig": {

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

"dependencies": {
"@module-federation/bridge-shared": "0.0.0-next-20241216131539",
"@module-federation/sdk": "0.0.0-next-20241216131539",
"@module-federation/runtime": "0.0.0-next-20241216131539"
"@module-federation/bridge-shared": "0.0.0-next-20241218082038",
"@module-federation/sdk": "0.0.0-next-20241218082038",
"@module-federation/runtime": "0.0.0-next-20241218082038"
},

@@ -41,0 +41,0 @@ "devDependencies": {

@@ -9,3 +9,17 @@ import * as Vue from 'vue';

export function createBridgeComponent(bridgeInfo: any) {
type AddOptionsFnParams = {
app: Vue.App<Vue.Component>;
basename: RenderFnParams['basename'];
memoryRoute: RenderFnParams['memoryRoute'];
[key: string]: any;
};
export type ProviderFnParams = {
rootComponent: Vue.Component;
appOptions: (
params: AddOptionsFnParams,
) => { router?: VueRouter.Router } | void;
};
export function createBridgeComponent(bridgeInfo: ProviderFnParams) {
const rootMap = new Map();

@@ -16,3 +30,3 @@ const instance = getInstance();

__APP_VERSION__,
render(info: RenderFnParams) {
async render(info: RenderFnParams) {
LoggerInstance.log(`createBridgeComponent render Info`, info);

@@ -23,3 +37,3 @@ const app = Vue.createApp(bridgeInfo.rootComponent);

const beforeBridgeRenderRes =
instance?.bridgeHook?.lifecycle?.beforeBridgeRender?.emit(info) || {};
await instance?.bridgeHook?.lifecycle?.beforeBridgeRender?.emit(info);

@@ -33,3 +47,4 @@ const extraProps =

const appOptions = bridgeInfo.appOptions({
const bridgeOptions = bridgeInfo.appOptions({
app,
basename: info.basename,

@@ -40,28 +55,27 @@ memoryRoute: info.memoryRoute,

const history = info.memoryRoute
? VueRouter.createMemoryHistory(info.basename)
: VueRouter.createWebHistory(info.basename);
if (bridgeOptions?.router) {
const history = info.memoryRoute
? VueRouter.createMemoryHistory(info.basename)
: VueRouter.createWebHistory(info.basename);
const router = VueRouter.createRouter({
...appOptions.router.options,
history,
routes: appOptions.router.getRoutes(),
});
const router = VueRouter.createRouter({
...bridgeOptions.router.options,
history,
routes: bridgeOptions.router.getRoutes(),
});
LoggerInstance.log(`createBridgeComponent render router info>>>`, {
name: info.moduleName,
router,
});
// memory route Initializes the route
if (info.memoryRoute) {
router.push(info.memoryRoute.entryPath).then(() => {
app.use(router);
app.mount(info.dom);
LoggerInstance.log(`createBridgeComponent render router info>>>`, {
name: info.moduleName,
router,
});
} else {
// memory route Initializes the route
if (info.memoryRoute) {
await router.push(info.memoryRoute.entryPath);
}
app.use(router);
app.mount(info.dom);
}
instance?.bridgeHook?.lifecycle?.afterBridgeRender?.emit(info) || {};
app.mount(info.dom);
instance?.bridgeHook?.lifecycle?.afterBridgeRender?.emit(info);
},

@@ -68,0 +82,0 @@ destroy(info: { dom: HTMLElement }) {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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