A Single-SPA (single-spa) application is a micro-frontend framework that enables you to build and manage multiple independent micro-frontend applications within a single frontend. It lets you work with multiple frameworks (such as Angular, React, Vue) in one application, allowing each micro-frontend to operate independently, yet function cohesively as a unified app.
Key Features of Single-SPA
- Framework Agnostic: You can use Angular, React, Vue, or any other framework, or even multiple frameworks, in a single application.
- Independent Deployment: Each micro-frontend can be independently deployed and updated without impacting the others.
- Improved Scalability and Maintainability: Since each application or module is isolated, managing and scaling applications is easier.
- Performance Optimization: Single-SPA loads applications only when they’re needed, optimizing resources.
How Single-SPA Works
- Root Config: Single-SPA has a root configuration that registers each micro-frontend application and determines when each should be loaded based on route matching.
- Applications and Parcels: Applications are complete micro-frontends, while parcels are more like independent widgets.
- Lifecycle Management: Single-SPA handles the lifecycle of each micro-frontend (mounting, updating, and unmounting), making it seamless for end users.