Skip to content
Projetos

Sobre

Framework de micro frontends baseado em Web Components e iframe — custo ultrabaixo, renderização rápida e isolamento nativo.

Desenvolvimento web e de aplicativos

Como estes números são medidos

O que você pode fazer

  • 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

Crescimento medido de estrelas

em 24 h
+2
em 7 dias
+3
em 15 dias
+4
em 1 mês
+13

Variações líquidas em períodos sobrepostos, não totais diários. Medições ausentes ficam em branco. Estrelas indicam interesse, não qualidade.

README.md

Original

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.

Explore projetos relacionados

Carregando…