Wujie
The Ultimate Micro-Frontend Framework powered by Web Components + iframe
English | 简体中文
Wujie is a micro-frontend framework built on Web Components and iframes, delivering low adoption cost, high performance, native isolation, and a rich feature set.
Documentation & Demos
Background
While micro-frontends have matured considerably, existing solutions still struggle with core developer requirements such as adaptation overhead, CSS isolation, runtime performance, blank-screen flickering, cross-app communication, sub-app keep-alive, activating multiple sub-apps simultaneously, Vite / ESM support, and dependency sharing.
Web Components (Shadow DOM) provide browser-native style encapsulation, while an iframe provides a browser-native JavaScript execution sandbox with its own window, document, history, and location. By combining a Web Component container with an iframe sandbox, Wujie achieves strict native isolation while addressing all of the challenges above.
Features
- Low Adoption Cost
- Minimal setup in the main app
- Little to zero adaptation needed in sub-apps
- High Performance
- Fast first-screen rendering with preloading and pre-execution
- Native-level runtime performance without
with(proxy) overhead
- Native Isolation
- Strict CSS isolation via Web Components (Shadow DOM)
- Strict JavaScript isolation inside a same-origin iframe
- Rich Capabilities
- App-level Keep-Alive mode
- Nested sub-apps
- Multiple active sub-apps on the same page with route synchronization
- Dependency sharing across apps
- Decentralized communication (
EventBus, props, window)
- Comprehensive lifecycle hooks
- Extensible plugin system
- First-class Vite & ESM support
Packages
Quick Start
Vanilla JS / Framework-Agnostic
npm install wujie
import { startApp } from "wujie";
startApp({ name: "unique-id", url: "https://sub-app-url/", el: "#container", sync: true });
Vue
# Vue 2
npm install wujie-vue2
# Vue 3
npm install wujie-vue3
import WujieVue from "wujie-vue2";
Vue.use(WujieVue);
import WujieVue from "wujie-vue3";
app.use(WujieVue);
<WujieVue
width="100%"
height="100%"
name="xxx"
:url="url"
:sync="true"
:fetch="fetch"
:props="props"
:beforeLoad="beforeLoad"
:beforeMount="beforeMount"
:afterMount="afterMount"
:beforeUnmount="beforeUnmount"
:afterUnmount="afterUnmount"
></WujieVue>
React
npm install wujie-react
import WujieReact from "wujie-react";
<WujieReact
width="100%"
height="100%"
name="xxx"
url={url}
sync={true}
fetch={fetch}
props={props}
beforeLoad={beforeLoad}
beforeMount={beforeMount}
afterMount={afterMount}
beforeUnmount={beforeUnmount}
afterUnmount={afterUnmount}
></WujieReact>
FAQ
See the FAQ documentation for common troubleshooting guides (CORS, cookies, Shadow DOM events, relative assets, Vite, Module Federation, etc.).
Local Development
Run the following commands to develop and debug Wujie locally with live reload:
pnpm install # Install workspace dependencies (pnpm is required)
pnpm run start # Start all packages and example apps
One More Thing
Wujie originated from Tencent Wuji Low-Code Platform, an enterprise-grade, all-in-one low-code solution widely used across Tencent. With Wujie, legacy pages and low-code pages can seamlessly embed one another, bridging existing and new systems. Explore Tencent Wuji Low-Code to learn more.
评论