Przejdź do treści
Biblioteka skilli
Programowanie · Budowanie i kod

micro-frontends-module-federation

/micro-frontends-module-federation

Pomaga składać niezależnie wdrażane aplikacje frontendowe w czasie działania za pomocą Module Federation w Webpack lub Vite.

Licencja
MIT
Ostatnia zmiana repozytorium
28.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 28.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Pomaga składać niezależnie wdrażane aplikacje frontendowe w czasie działania za pomocą Module Federation w Webpack lub Vite.

Oryginalny opis (EN)

Use this skill when orchestrating independently deployed frontend applications at runtime using Webpack or Vite Module Federation.

Jak działa

  1. When to use
  2. Prerequisites
  3. Step-by-step workflow
  4. Commands / code examples
  5. Common mistakes & pitfalls
  6. Verification checklist
  7. Related skills
Sekcje z nagłówków SKILL.md, w oryginale · 72 linii, 360 słów
Podgląd SKILL.md
---
name: micro-frontends-module-federation
description: Use this skill when orchestrating independently deployed frontend applications at runtime using Webpack or Vite Module Federation.
---
# Micro-Frontends & Module Federation

## When to use
Use this skill when scaling large frontend engineering teams, decoupling deploy pipelines across autonomous domain teams, or sharing runtime dependencies.

## Prerequisites
- Node.js 18+ with Webpack 5+ or Vite with `@originjs/vite-plugin-federation`.
- Thorough understanding of single-spa or container/remote micro-frontend paradigms.

## Step-by-step workflow
1. **Establish host and remote roles**: Define container hosts (shell applications) and autonomous remote applications (domain feature suites).
2. **Configure remote federation**: Expose shared component entry points in the remote configuration using `exposes`.
3. **Configure host remotes**: Register remote URL endpoints inside the host configuration under the `remotes` block.
4. **Define shared singleton dependencies**: Declare shared runtime libraries (`react`, `react-dom`, design system tokens) with strict version constraints.
5. **Implement fallback error boundaries**: Wrap remote component imports in React `Suspense` and error boundaries to prevent total shell crashes.

## Commands / code examples
```ts
// remote/webpack.config.js
const { ModuleFederationPlugin } = require('webpack').container;

module.exports = {
  plugins: [
    new ModuleFederationPlugin({
      name: 'billing_app',
      filename: 'remoteEntry.js',
      exposes: {
        './InvoiceWidget': './src/components/InvoiceWidget.tsx',
      },
      shared: {
        react: { singleton: true, requiredVersion: '^18.2.0', eager: false },
        'react-dom': { singleton: true, requiredVersion: '^18.2.0', eager: false },
      },
    }),
  ],
};

// host/src/App.tsx
import React, { Suspense, lazy } from 'react';

// Dynamic runtime import of remote federated module
const RemoteInvoiceWidget = lazy(() => import('billing_app/InvoiceWidget'));

export function HostDashboard() {
  return (
    <div class="dashboard-shell">
      <header>Enterprise Shell</header>
      <Suspense fallback={<div>Loading remote billing module...</div>}>
        <RemoteInvoiceWidget customerId="cust_12345" />
      </Suspense>
    </div>
  );
}
```

## Common mistakes & pitfalls
- Mismatched shared dependency versions without `singleton: true`, leading to multiple React instances running concurrently.
- Omitting error boundaries around remote components, causing the entire shell to crash if a single remote fails.
- Hardcoding static remote URLs instead of supporting dynamic environment-based injection at runtime.

## Verification checklist
- [ ] Shared singletons (like React) resolve to exactly one runtime instance.
- [ ] Remote failures are caught gracefully by local host error boundaries.
- [ ] Remotes can be built and deployed independently without rebuilding the host.
- [ ] Network bundles load asynchronously only when the remote route is accessed.

## Related skills
- react-fundamentals
- monorepo-management-turborepo-nx
- bundlers-vite-esbuild-webpack-swc
- ci-cd-github-actions-workflows

Wersje

W bazie nie ma innych skilli o nazwie micro-frontends-module-federation.

Migawka bazy z 13.11.2026 · wersja paczki 8cadab8fd104 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 1 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 95module-federation-runtime-sharing
    Konfiguruje Module Federation w Webpack 5, Rspack lub Vite: wspólne zależności, dynamiczne zdalne moduły i współdzielenie typów.
  • 95web-micro-frontends-import-maps
    Składa mikrofrontendy z natywnych modułów ES i import maps (single-spa lub Native Federation), definiując cykl życia i wersjonowanie.
  • 100micro-frontends
    Opisuje architekturę micro-frontendów: podejścia do kompozycji, Module Federation, single-spa, web components, współdzielony stan i komunikację między aplikacjami.
  • 100micro-frontends
    Ocenia, czy mikrofrontendy się opłacają, i projektuje podział dużego frontendu na zespoły, z kompozycją, routingiem i CI/CD.
  • 100webpack
    Pomaga w pracy z Webpack 5: bundlowanie zasobów, code splitting, loadery, pluginy, strategie cache, optymalizacja webpack.config.js i rozmiaru bundli, loadery Babel i TypeScript oraz Module Federation.
  • 100rsbuild
    Pomaga skonfigurować Rsbuild, narzędzie budowania aplikacji webowych oparte na Rspack, dla React, Vue i Svelte, migrować z webpack, Create React App lub Vite oraz skonfigurować serwer deweloperski i Module Federation.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.