包
Tuvix.js 由 15 个包组成:13 个带作用域的 @tuvix.js/* 库、tuvix.js 聚合包和 create-tuvix-app 脚手架工具。安装你的应用导入的那些包即可。
核心包
@tuvix.js/core
Core
The orchestrator — registers, mounts, and manages all micro app lifecycles.
@tuvix.js/router
Router
URL-based micro app routing with history and hash mode support.
@tuvix.js/event-bus
Event Bus
Typed inter-app communication. Publish and subscribe across micro apps.
@tuvix.js/loader
Loader
Dynamic module loading with caching, retry and error boundary support.
@tuvix.js/sandbox
Sandbox
CSS and JS isolation using Shadow DOM and JS Proxy. Prevent style leakage.
框架绑定
@tuvix.js/react
React
React 18+ bindings with hooks — useMicroApp, useTuvixEvent.
@tuvix.js/vue
Vue
Vue 3 bindings with composables — useMicroApp, useTuvixEvent.
@tuvix.js/svelte
Svelte
Svelte 3/4/5 bindings with reactive stores and lifecycle integration.
@tuvix.js/angular
Angular
Angular 15+ module, service and directive bindings for micro apps.
工具
@tuvix.js/devtools
DevTools
In-browser debug panel. Inspect registered apps, events and loader state.
@tuvix.js/server
Server
Server-side composition — pre-render and stitch micro app HTML on the server.
@tuvix.js/module-federation
Module Federation
Webpack 5 Module Federation integration for sharing remote micro apps.
@tuvix.js/vite
Vite
Vite plugin that puts island CSS and modulepreload links into the SSR head, so server-rendered micro apps are styled on first paint.
create-tuvix-app
create-tuvix-app
CLI scaffolding tool. Instantly bootstrap a Tuvix.js micro app project.
安装全部
bash
npm install tuvix.jstuvix.js 聚合包重新导出 core、router、event bus、loader 和 sandbox。它不包含框架适配器、@tuvix.js/server、@tuvix.js/vite、@tuvix.js/devtools 和 @tuvix.js/module-federation;这些需要单独安装。
单独安装
bash
# Core
npm install @tuvix.js/core
npm install @tuvix.js/router
npm install @tuvix.js/event-bus
npm install @tuvix.js/loader
npm install @tuvix.js/sandbox
# 框架适配器(安装每个微应用所用的那个)
npm install @tuvix.js/react
npm install @tuvix.js/vue
npm install @tuvix.js/svelte
npm install @tuvix.js/angular
# 服务端渲染和构建工具
npm install @tuvix.js/server
npm install -D @tuvix.js/vite
npm install @tuvix.js/module-federation
npm install @tuvix.js/devtools
# 创建新项目脚手架
npx create-tuvix-app my-app使用 pnpm 时,把 npm install 换成 pnpm add。