Motivation
single-spa@5 is focused on performance and developer experience. The bundle size for single-spa has gone down from ~25kb to ~15kb ungzipped (6kb to 5kb gzipped). We have created new error pages which give in-depth information about console errors, and link to those pages in both development and production builds. We now publish single-spa.dev.js files for easier debugging of single-spa itself. And we have removed all of our deprecated APIs (that have been deprecated and not documented for about two years).
Migration path
99% of single-spa users can simply upgrade to single-spa@5.0.0-beta.0 without any changes to their code and everything will work exactly as it was before. You'll just benefit from a smaller bundle size and better DX for errors. See the breaking changes below for the few breaking changes that exist. We encourage early-adopters to try out single-spa@5 and let us know if they notice anything broken in it. In our testing so far, we have seen no problems with it.
Installation
npm install --save single-spa@beta
CDN url: https://cdn.jsdelivr.net/npm/single-spa@beta/
Breaking changes
- Removing the
declareChildApplication
andunloadChildApplication
apis that have been deprecated for two years (#390). You can use theregisterApplication
andunloadApplication
apis instead. - Removing
err.name
anderr.appName
from errors passed to single-spa error handlers (#404)
Features
- Switching to "error codes" to communicate what went wrong with single-spa applications. The error codes link to pages such as https://single-spa.js.org/error/?code=1 which give in-depth explanations of what is happening.
- Adding support for
warningMillis
timeout configuration. This lets you configure or turn off the "application's mount lifecycle did not resolve or reject in 1000 milliseconds" console warnings. (#389)
Fixes
- Fixing link to the new error code documentation pages (#406)
- Fixing error debugging info for parcel-related messages (#407)
Perf
- Reducing bundle size with babel/rollup changes (#392)
- Reducing bundle size by removing class syntax (#393)
- Reducing bundle size with various refactors (#396)
- Reducing bundle size by switching from object spread syntax to a manual object assign (#401)