Skip to content
プロジェクト

概要

Web Componentsとiframeをベースにしたマイクロフロントエンドフレームワーク。極めて低コストで、高速なレンダリングとネイティブな分離を実現します。

Web・アプリ開発

この数値の測り方

できること

  • Minimal setup in the main app
  • Little to zero adaptation needed in sub-apps
  • Fast first-screen rendering with preloading and pre-execution
  • Native-level runtime performance without with(proxy) overhead

計測したスター増加

24時間
+2
7日間
+3
15日間
+4
1か月
+13

期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。

Wujie logo

Wujie

The Ultimate Micro-Frontend Framework powered by Web Components + iframe

npm version npm downloads MIT license

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

  1. Low Adoption Cost
    • Minimal setup in the main app
    • Little to zero adaptation needed in sub-apps
  2. High Performance
    • Fast first-screen rendering with preloading and pre-execution
    • Native-level runtime performance without with(proxy) overhead
  3. Native Isolation
    • Strict CSS isolation via Web Components (Shadow DOM)
    • Strict JavaScript isolation inside a same-origin iframe
  4. 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

Package Description npm
wujie Framework-agnostic core runtime npm
wujie-vue2 Vue 2 wrapper component npm
wujie-vue3 Vue 3 wrapper component npm
wujie-react React wrapper component npm

Quick Start

Vanilla JS / Framework-Agnostic

  • Install
npm install wujie
  • Usage
import { startApp } from "wujie";

startApp({ name: "unique-id", url: "https://sub-app-url/", el: "#container", sync: true });

Vue

  • Install
# Vue 2
npm install wujie-vue2
# Vue 3
npm install wujie-vue3
  • Register
// Vue 2
import WujieVue from "wujie-vue2";
Vue.use(WujieVue);

// Vue 3
import WujieVue from "wujie-vue3";
app.use(WujieVue);
  • Usage
<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

  • Install
npm install wujie-react
  • Import
import WujieReact from "wujie-react";
  • Usage
<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.

関連プロジェクトを探す

読み込み中…