@module-federation/bridge-vue3
Advanced tools
Comparing version 0.0.0-next-20240822063818 to 0.0.0-next-20240822090000
# @module-federation/bridge-vue3 | ||
## 0.0.0-next-20240822063818 | ||
## 0.0.0-next-20240822090000 | ||
### Patch Changes | ||
- @module-federation/bridge-shared@0.0.0-next-20240822063818 | ||
- 3082116: feat: support module isolated reported | ||
- @module-federation/bridge-shared@0.0.0-next-20240822090000 | ||
## 0.5.0 | ||
### Patch Changes | ||
- 49d6135: feat(@module-federation/bridge): enhance Bridge capabilities and fix some issues | ||
- Updated dependencies [49d6135] | ||
- @module-federation/bridge-shared@0.5.0 | ||
## 0.4.0 | ||
@@ -18,0 +11,0 @@ |
{ | ||
"name": "@module-federation/bridge-vue3", | ||
"author": "zhouxiao <codingzx@gmail.com>", | ||
"version": "0.0.0-next-20240822063818", | ||
"version": "0.0.0-next-20240822090000", | ||
"publishConfig": { | ||
@@ -9,17 +9,5 @@ "access": "public" | ||
"type": "module", | ||
"main": "./dist/index.cjs.js", | ||
"main": "./dist/index.umd.js", | ||
"module": "./dist/index.es.js", | ||
"types": "./dist/index.d.ts", | ||
"files": [ | ||
"dist/", | ||
"src/", | ||
"CHANGELOG.md", | ||
"LICENSE", | ||
"package.json", | ||
"project.json", | ||
"README.md", | ||
"tsconfig.json", | ||
"tsconfig.node.json", | ||
"vite.config.ts" | ||
], | ||
"peerDependencies": { | ||
@@ -30,3 +18,3 @@ "vue": "=3", | ||
"dependencies": { | ||
"@module-federation/bridge-shared": "0.0.0-next-20240822063818" | ||
"@module-federation/bridge-shared": "0.0.0-next-20240822090000" | ||
}, | ||
@@ -33,0 +21,0 @@ "devDependencies": { |
@@ -7,48 +7,57 @@ import * as Vue from 'vue'; | ||
declare const __APP_VERSION__: string; | ||
interface Provider { | ||
__APP_VERSION__: string; | ||
render(info: RenderFnParams): void; | ||
destroy(info: { dom: HTMLElement }): void; | ||
} | ||
export function createBridgeComponent(bridgeInfo: any) { | ||
let provider: Provider; | ||
const rootMap = new Map(); | ||
return () => { | ||
return { | ||
__APP_VERSION__, | ||
render(info: RenderFnParams) { | ||
LoggerInstance.log(`createBridgeComponent render Info`, info); | ||
const app = Vue.createApp(bridgeInfo.rootComponent); | ||
rootMap.set(info.dom, app); | ||
const appOptions = bridgeInfo.appOptions({ | ||
basename: info.basename, | ||
memoryRoute: info.memoryRoute, | ||
}); | ||
if (!provider) { | ||
provider = { | ||
__APP_VERSION__, | ||
render(info: RenderFnParams) { | ||
LoggerInstance.log(`createBridgeComponent render Info`, info); | ||
const app = Vue.createApp(bridgeInfo.rootComponent); | ||
rootMap.set(info.dom, app); | ||
const appOptions = bridgeInfo.appOptions({ | ||
basename: info.basename, | ||
memoryRoute: info.memoryRoute, | ||
}); | ||
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 history = info.memoryRoute | ||
? VueRouter.createMemoryHistory(info.basename) | ||
: VueRouter.createWebHistory(info.basename); | ||
const router = VueRouter.createRouter({ | ||
...appOptions.router.options, | ||
history, | ||
routes: appOptions.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(() => { | ||
LoggerInstance.log(`createBridgeComponent render router info>>>`, { | ||
name: info.name, | ||
router, | ||
}); | ||
// memory route Initializes the route | ||
if (info.memoryRoute) { | ||
router.push(info.memoryRoute.entryPath).then(() => { | ||
app.use(router); | ||
app.mount(info.dom); | ||
}); | ||
} else { | ||
app.use(router); | ||
app.mount(info.dom); | ||
}); | ||
} else { | ||
app.use(router); | ||
app.mount(info.dom); | ||
} | ||
}, | ||
destroy(info: { dom: HTMLElement }) { | ||
LoggerInstance.log(`createBridgeComponent destroy Info`, info); | ||
const root = rootMap.get(info?.dom); | ||
root?.unmount(); | ||
}, | ||
}; | ||
} | ||
}, | ||
destroy(info: { dom: HTMLElement }) { | ||
LoggerInstance.log(`createBridgeComponent destroy Info`, info); | ||
const root = rootMap.get(info?.dom); | ||
root?.unmount(); | ||
}, | ||
}; | ||
} | ||
return provider; | ||
}; | ||
} |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
2
1
16371
18
349
+ Added@module-federation/bridge-shared@0.0.0-next-20240822090000(transitive)
- Removed@module-federation/bridge-shared@0.0.0-next-20240822063818(transitive)
Updated@module-federation/bridge-shared@0.0.0-next-20240822090000