BASE

single-spa

single-spa

Web framework / library · Free

A microfrontend framework: it connects multiple web applications' lifecycles and helps independently develop parts of a large interface.

Also known as: single-spa/single-spa; microfrontend-router

Resource illustration: single-spa

Open resource ↗

What you can use for free

Code and local use under MIT.

Paid features and costs

Computing resources, self-hosting, and external services are paid for separately if used.

Access and limitations

Code and local use under MIT. Computing resources, self-hosting, and external services are paid for separately if used.

Use cases

  • Connect multiple web applications into a shared interface
  • Register application lifecycles and test switching between them

Example workflow

A possible workflow; this is not a report of hands-on testing.

Connect multiple web applications into a shared interface.

Before you start

  • Web application source code and the intended workflow.
  • The project's framework and runtime version.

Steps

  1. Define microfrontend boundaries and activation conditions.
  2. Register application lifecycles and test switching between them.
  3. Add real data and error handling; check the production build.

Check your result

  • The workflow works after a page refresh and with invalid data.
  • The bundle, server rendering, and supported browsers suit the project.

Choosing single-spa

Connect multiple web applications into a shared interface

Choose this when

  • Connect multiple web applications into a shared interface
  • Register application lifecycles and test switching between them

Requirements

  • A registered application exports bootstrap, mount, and unmount; each lifecycle returns a Promise or is async.

Things to consider

  • Costs and limits of free use: Computing resources, self-hosting, and external services are paid for separately if used.
  • Terms of use: MIT for the code; dependencies have separate licenses.
  • Unmount must remove created DOM, listeners, globals, and subscriptions; single-spa does not automatically release every part of your application.

Frequently asked questions

What can you use for free in single-spa?

Code and local use under MIT.

What additional costs might arise with single-spa?

Computing resources, self-hosting, and external services are paid for separately if used.

What terms of use matter for single-spa?

MIT for the code; dependencies have separate licenses.

How do you get started with single-spa?

Define microfrontend boundaries and activation conditions. Register application lifecycles and test switching between them. Add real data and error handling; check the production build.

Must I use different frameworks?

No. The README permits multiple frameworks on one page but does not require them. A new application can be added gradually without completely rewriting the existing one.

How can I avoid extra handlers when switching applications?

In unmount, remove everything created during mount, including DOM and subscriptions. Bootstrap runs once; the mounted application handles subsequent routing itself.

License

MIT for the code; dependencies have separate licenses.

MIT — permissive license

You can use, modify, distribute, and sell the code, including in a closed-source commercial product. When sharing copies or substantial portions of the code, retain the license text and copyright notice. You do not need to open-source your entire project; the author provides no warranties.

License terms

Technologies and topics

  • single-spa
  • web
  • Development

Sources

Other resources