{"id":13457610,"url":"https://github.com/Tencent/wujie","last_synced_at":"2025-03-24T14:32:09.640Z","repository":{"id":41285440,"uuid":"508576019","full_name":"Tencent/wujie","owner":"Tencent","description":"极致的微前端框架","archived":false,"fork":false,"pushed_at":"2025-03-12T03:20:54.000Z","size":986,"stargazers_count":4380,"open_issues_count":416,"forks_count":616,"subscribers_count":31,"default_branch":"master","last_synced_at":"2025-03-16T12:36:15.560Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://wujie-micro.github.io/doc/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Tencent.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-29T06:40:13.000Z","updated_at":"2025-03-15T16:20:46.000Z","dependencies_parsed_at":"2023-12-27T09:30:19.915Z","dependency_job_id":"c34ebd8c-5421-444e-877f-9c303b8620f0","html_url":"https://github.com/Tencent/wujie","commit_stats":{"total_commits":253,"total_committers":70,"mean_commits":"3.6142857142857143","dds":0.6086956521739131,"last_synced_commit":"be705d672416daa8ebba4bfa988de7dd92c49eb4"},"previous_names":[],"tags_count":53,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tencent%2Fwujie","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tencent%2Fwujie/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tencent%2Fwujie/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tencent%2Fwujie/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tencent","download_url":"https://codeload.github.com/Tencent/wujie/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245289608,"owners_count":20591101,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T09:00:31.499Z","updated_at":"2025-03-24T14:32:09.266Z","avatar_url":"https://github.com/Tencent.png","language":"TypeScript","funding_links":[],"categories":["TypeScript","Puppeteer"],"sub_categories":["Tencent/wujie"],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://wujie-micro.github.io/doc/\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://vfiles.gtimg.cn/wuji_dashboard/xy/test_wuji_damy/phFSuhUC.png\" width=\"100\" height=\"100\" alt=\"logo\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n# wujie（无界）\n\n无界微前端是一款基于 Web Components + iframe 微前端框架，具备成本低、速度快、原生隔离、功能强等一系列优点。\n\n## 文档\n\n动机：[动机](https://zhuanlan.zhihu.com/p/551206945)\n\n文档详见：[文档](https://wujie-micro.github.io/doc/)\n\n演示详见：[demo](https://wujie-micro.github.io/demo-main-vue/home)\n\n## 背景\n\n微前端已经是一个非常成熟的领域了，但开发者不管采用哪个现有方案，在适配成本、样式隔离、运行性能、页面白屏、子应用通信、子应用保活、多应用激活、vite 框架支持、应用共享等用户核心诉求都或存在问题、或无法提供支持。\n\nWeb Components 是一个浏览器原生支持的组件封装技术，可以有效隔离元素之间的样式，iframe 可以给子应用提供一个原生隔离的运行环境，相比自行构造的沙箱 iframe 提供了独立的 window、document、history、location，可以更好的和外部解耦。无界微前端采用 webcomponent + iframe 的沙箱模式，在实现原生隔离的前提下比较完善的解决了上述问题。\n\n## 特性\n\n1. 成本低\n   - 主应用使用成本低\n   - 子应用适配成本低\n2. 速度快\n   - 子应用首屏打开速度快\n   - 子应用运行速度快\n3. 原生隔离\n   - css 样式通过 Web Components 可以做到严格的原生隔离\n   - js 运行在 iframe 中做到严格的原生隔离\n4. 功能强大\n   - 支持子应用保活\n   - 支持子应用嵌套\n   - 支持多应用激活\n   - 支持应用共享\n   - 支持去中心化通信\n   - 支持生命周期钩子\n   - 支持插件系统\n   - 支持 vite 框架\n\n## 快速上手\n\n### 直接使用\n\n- 安装\n\n```bash\nnpm install wujie -S\n```\n\n- 使用\n\n```javascript\nimport { startApp } from \"wujie\";\n\nstartApp({ name: \"唯一id\", url: \"子应用路径\", el: \"容器\", sync: true });\n```\n\n### vue 框架\n\n- 安装\n\n```bash\n# vue2 框架\nnpm i wujie-vue2 -S\n# vue3 框架\nnpm i wujie-vue3 -S\n\n```\n\n- 引入\n\n```javascript\n// vue2\nimport WujieVue from \"wujie-vue2\";\nVue.use(WujieVue);\n// vue3\nimport WujieVue from \"wujie-vue3\";\napp.use(WujieVue);\n```\n\n- 使用\n\n```js\n\n\u003cWujieVue\n  width=\"100%\"\n  height=\"100%\"\n  name=\"xxx\"\n  :url=\"xxx\"\n  :sync=\"true\"\n  :fetch=\"fetch\"\n  :props=\"props\"\n  :beforeLoad=\"beforeLoad\"\n  :beforeMount=\"beforeMount\"\n  :afterMount=\"afterMount\"\n  :beforeUnmount=\"beforeUnmount\"\n  :afterUnmount=\"afterUnmount\"\n\u003e\u003c/WujieVue\u003e\n\n```\n\n### react 框架\n\n- 安装\n\n```bash\nnpm i wujie-react -S\n\n```\n\n- 引入\n\n```javascript\nimport WujieReact from \"wujie-react\";\n```\n\n- 使用\n\n```html\n\u003cWujieReact\n  width=\"100%\"\n  height=\"100%\"\n  name=\"xxx\"\n  url=\"{xxx}\"\n  sync=\"{true}\"\n  fetch=\"{fetch}\"\n  props=\"{props}\"\n  beforeLoad=\"{beforeLoad}\"\n  beforeMount=\"{beforeMount}\"\n  afterMount=\"{afterMount}\"\n  beforeUnmount=\"{beforeUnmount}\"\n  afterUnmount=\"{afterUnmount}\"\n\u003e\u003c/WujieReact\u003e\n```\n\n## 常见问题\n\n[详见文档](https://wujie-micro.github.io/doc/question/#_1%E3%80%81%E8%AF%B7%E6%B1%82%E8%B5%84%E6%BA%90%E6%8A%A5%E9%94%99)\n\n## 本地开发\n\n运行以下脚本，可以本地开发无界微前端框架，支持实时编译调试开发。\n\n```bash\npnpm i                  // 安装包依赖，务必使用pnpm\nnpm run start           // 启动所有应用\n```\n## One more thing\n\n无界微前端解决方案来源于团队的无极低代码平台，通过无界微前端，存量页面和低代码页面可以丝滑的互相内嵌，欢迎体验[【腾讯无极低代码】](https://wujicode.cn)。","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTencent%2Fwujie","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FTencent%2Fwujie","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTencent%2Fwujie/lists"}