qiankun
ما الذي تفعله
توضح هذه المهارة كيفية بناء تطبيق مضيف وتطبيقات فرعية أصغر تُحمَّل داخله أثناء التشغيل باستخدام qiankun. وهي موجهة إلى مطوري الويب الذين يريدون تقسيم واجهة أمامية كبيرة إلى أجزاء.
متى تستخدمها
- ✓عندما تريد إنشاء تطبيق رئيسي يحمّل عدة تطبيقات واجهة أمامية منفصلة.
- ✓عندما تريد تحويل تطبيق Vite موجود إلى تطبيق فرعي مصغّر.
- ✓عندما تُعد تحميل الواجهات المصغّرة مع React أو Vue.
رابط المهارة
https://github.com/umijs/qiankun/blob/next/skills/qiankun/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“ساعدني في تحويل تطبيق Vite React الموجود لدي إلى تطبيق فرعي لـ qiankun يستطيع الغلاف الرئيسي تحميله.”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
يقرأ وكيلك الدليل المناسب للمهمة، ثم يتبع الخطوات الخاصة بالتطبيق المضيف أو الفرعي. ويستخدم منافذ ثابتة وأسماء تطبيقات متطابقة حتى تجد القطع بعضها بعضاً.
المحتوى التقني (ملف SKILL.md الأصلي)
النص الأصلي من المؤلف، مباشرة من GitHub.
qiankun
qiankun is a micro-frontend framework: a main (host) app loads sub (micro) apps from their HTML entries at runtime, each inside a JS sandbox, with opt-in CSS isolation. This skill is the agent-facing manual for qiankun 3.x.
Task routing
Read only the reference file(s) the task at hand needs:
| Task | Read |
|---|---|
| Create a micro (sub) app, or convert an existing Vite app | references/create-micro-app.md |
| Create a main (host) app | references/create-main-app.md |
| Anything else — migration, style isolation, sandbox, debugging | https://qiankun.umijs.org and examples/ in https://github.com/umijs/qiankun |
Before you start
Determine these, asking the user only when not inferable from context:
- App type — main (host/shell) or sub (micro app).
- App name — lowercase letters, numbers, hyphens. The name the host registers must exactly match the name the sub app uses in its classic-mode fallback.
- Framework — React or Vue; TypeScript or JavaScript. Templates in the references are TS; strip types for JS.
- Dev port — must be fixed and unique per app, because the host hard-references it in
entry. Convention: main app7099, sub apps7101,7102, …
Package versions — until qiankun 3.0 stable ships, rc is the dist-tag for the core packages:
| Package | Dist-tag | Goes in |
|---|---|---|
qiankun |
rc |
main app dependencies |
@qiankunjs/react / @qiankunjs/vue |
rc |
main app dependencies (optional UI binding) |
@qiankunjs/bundler-plugin |
rc |
sub app devDependencies |
Key facts
These invariants shape every task below:
- Vite sub apps need no dedicated build mode. qiankun 3 loads
<script type="module">natively through its ESM sandbox — regularvite dev/vite buildoutput is qiankun-ready as-is. - The JS sandbox is on by default. CSS isolation is opt-in per app via
styleIsolation: true(runtime CSS@scope). - A sub app must stay runnable standalone: when not loaded by qiankun (
window.__POWERED_BY_QIANKUN__is undefined) it renders itself directly. - Always unmount what you mount.
loadMicroAppreturns a handle whose.unmount()must be called when the app leaves; theMicroAppcomponent bindings do this automatically on component unmount. Unmounted instances stay cached for reuse by app name; only.unload()/unloadMicroApp(name)releases them, and the bindings never call those. - Webpack sub apps use
@qiankunjs/bundler-plugin/webpackinstead of the Vite plugin; see the docs.
After any creation task
Verify the result following the checklist at the end of the reference you used. If a browser tool is available, perform the checks yourself instead of asking the user to.
الأسئلة الشائعة
ما الإصدار الذي تغطيه؟
هو دليل لـ qiankun 3.x، ويوضح أن بعض الحزم الأساسية تستخدم وسم rc حتى يصدر الإصدار 3.0 المستقر.
هل تدعم Vue كما تدعم React؟
نعم. تغطي المهارة React وVue، وقوالبها مكتوبة بـ TypeScript.
ماذا عن الترحيل أو تصحيح الأخطاء؟
للمواضيع التي تتجاوز إنشاء التطبيقات الرئيسية والفرعية، توجهك المهارة إلى الموقع الرسمي لـ qiankun وأمثلته.
التفاصيل
الوصف الأصلي من المؤلف
Usage manual for building micro-frontend projects with qiankun 3.x. Use when the user wants to create a qiankun main (host) app or sub (micro) app, convert an existing Vite app into a qiankun micro app, or wire up micro-frontend loading with React/Vue.
repo: umijs/qiankun
الشعبية
- نجوم GitHub
- 17k
- الترتيب
- #10799
- الترخيص
- MIT
- آخر تحديث
- 31/10/2026
التعليقات
- …
مهارات مشابهة
angular-developer
280kيساعد وكيلك على كتابة شيفرة Angular وتقديم نصائح لبنية المشروع، ويفيد في بدء المشاريع الجديدة وإنشاء المكونات وتحسين الأداء وإمكانية الوصول.
frontend-a11y
280kيساعد وكيلك على جعل واجهات الويب متاحة للجميع، فيضمن أن المواقع والتطبيقات تعمل جيدًا مع قارئات الشاشة والتنقل بلوحة المفاتيح.
frontend-patterns
280kيطبّق وكيلك أنماط تطوير الواجهات الحديثة، فيحسّن الأداء ويدير الحالة ويتبع أفضل الممارسات في React وNext.js.