How umijs/qiankun works
Project type and purpose
• Qiankun is an open-source micro-frontend framework (based on single-spa) designed to enable independent deployment, runtime sandboxing, style isolation, asset prefetching, and HTML-entry integration of multiple “micro-apps” within a single host (shell) application.
• It is organized as a monorepo containing multiple packages: the core runtime (qiankun), HTML & JS loader (@qiankunjs/loader), JS sandbox (@qiankunjs/sandbox), shared utilities (@qiankunjs/shared), UI-bindings for React & Vue (@qiankunjs/react, @qiankunjs/vue, @qiankunjs/ui-shared), a webpack plugin (@qiankunjs/webpack-plugin), and a scaffolding tool (create-qiankun).
File structure
• Top-level “packages” folder contains each logical component (core, loader, sandbox, shared, ui-bindings, webpack-plugin, create-qiankun).
• Each package has its own source code, build config (.fatherrc.js), tests, and README.
• “examples” folder demonstrates a shell app plus multiple framework-specific micro-apps (Angular, React, Vue, Vite, etc.) to showcase integration.
• “docs” folder holds documentation powered by VitePress/dumi.
• Monorepo is orchestrated via pnpm workspace, with linting, formatting, CI workflows, and release automation configured at the root.
README for additional insights
• Qiankun core exposes APIs: registerMicroApps, loadMicroApp, start, isRuntimeCompatible, and lifecycle hooks.
• Features: HTML-entry access mode (loader), JS sandbox (compartmentalized execution), style isolation.
• Integrations: Umi plugin, CLI scaffolder (create-qiankun), webpack plugin for auto-public-path.