أساليب تركيب الواجهات الأمامية المصغّرة
استكشف الطرق الأساسية لتركيب الواجهات الأمامية المصغّرة معًا — أثناء البناء، ومن جهة الخادم، ومن جهة العميل — وتعلّم متى تستخدم كل طريقة.
أساليب تركيب الواجهات الأمامية المصغّرة درس مجاني في Micro Frontends Architecture with Module Federation على CoddyKit. هذا هو الدرس 4 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في Micro Frontends Architecture with Module Federation، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة Micro Frontends Architecture with Module Federation 4 دروس في المجموع.
بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.
What Is Composition?
Composition is how independently built micro frontends combine into the single page a user sees — and your choice shapes performance and deployment.
Three Families of Composition
Composition strategies fall into three families: build-time, server-side, and client-side (run-time). Real systems often mix them.
Build-Time Composition
Build-time composition publishes each MFE as an npm package pulled into a container app. Simple, but it couples deploys — one change rebuilds the whole shell.
{
"dependencies": {
"@team/cart-mfe": "1.2.0",
"@team/search-mfe": "0.9.1"
}
}Server-Side Composition
Server-side composition stitches MFE fragments into one HTML response, giving fast first paint and strong SEO since the browser gets a complete page.
Server-Side Includes (SSI)
A classic technique is Server-Side Includes: include directives the web server replaces with each MFE fragment before sending the page.
<!--#include virtual="/header-mfe" -->
<main><!--#include virtual="/catalog-mfe" --></main>
<!--#include virtual="/footer-mfe" -->Edge-Side Composition
Edge-side composition assembles fragments at the CDN edge (via Edge Side Includes), pairing low latency with centralized stitching close to users.
Client-Side Composition
Client-side composition loads a thin shell, then fetches and mounts each MFE at run time. It is the most flexible approach and the base of Module Federation.
Client-Side with Web Components
One client-side technique wraps each MFE in a custom element (web component). The shell just places the tags and each MFE bootstraps itself.
<app-shell>
<product-list></product-list>
<shopping-cart></shopping-cart>
</app-shell>Trade-offs at a Glance
Each approach trades off: build-time is simplest but weak on independence, server-side nails first load and SEO, client-side maximizes team autonomy.
Choosing an Approach
Choose by priority: server-side when SEO and first paint dominate, client-side for independent deploys and dynamic loading, build-time only for slow-changing teams.
Mixing Strategies
Mature systems mix strategies: server-side render the shell and above-the-fold content, then hydrate or lazy-load interactive MFEs client-side.
Quick Check
Test your understanding of composition.
Recap
Recap: composition can be build-time (coupled), server- or edge-side (great first paint and SEO), or client-side (max independence) — and real systems blend them.
الأسئلة الشائعة
هل درس «أساليب تركيب الواجهات الأمامية المصغّرة» مجاني؟
نعم — نص درس «أساليب تركيب الواجهات الأمامية المصغّرة» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة Micro Frontends Architecture with Module Federation، انتقل إلى CoddyKit PRO. تتضمن دورة Micro Frontends Architecture with Module Federation 4 دروس في المجموع.
ماذا ستتعلم في «أساليب تركيب الواجهات الأمامية المصغّرة»؟
استكشف الطرق الأساسية لتركيب الواجهات الأمامية المصغّرة معًا — أثناء البناء، ومن جهة الخادم، ومن جهة العميل — وتعلّم متى تستخدم كل طريقة. تتمرن على Micro Frontends Architecture with Module Federation مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.
هل أحتاج إلى خبرة سابقة لأبدأ Micro Frontends Architecture with Module Federation؟
لا تُشترط خبرة سابقة. Micro Frontends Architecture with Module Federation على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 4 من أصل 4.
كم من الوقت يستغرق درس «أساليب تركيب الواجهات الأمامية المصغّرة»؟
معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.
هل يمكنني كتابة وتشغيل أكواد في درس Micro Frontends Architecture with Module Federation هذا؟
نعم. كل درس في Micro Frontends Architecture with Module Federation يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.
جميع الدروس في هذه الدورة
- ما هي Micro Frontends؟
- استكشاف الفوائد والتحديات
- المفاهيم والمبادئ الأساسية
- أساليب تركيب الواجهات الأمامية المصغّرة