Releases: single-spa/single-spa-react
Releases · single-spa/single-spa-react
v4.0.0
Breaking Changes
Only typescript users are affected by the breaking changes
single-spa-react
now includes typescript declarations. You no longer need to use@types/single-spa-react
. (#101)
Migrating
When using typescript, single-spa-react@4 requires single-spa@>=5.9.1
npm uninstall @types/single-spa-react
npm install single-spa-react@^4.0.0
npm install single-spa@^5.9.1
Features
<Parcel />
now has typescript definitions (#101)- Improved typescript definitions for
singleSpaReact()
, including generics (#101)
Maintenance
v3.2.0
Features
- Add support for
unstable_createRoot
andunstable_createBlockingRoot
(#94 via @rolandfung)
v3.1.0
Features
- Add
wrapClassName
prop to<Parcel>
component (@alanquigley-toast #92)
v3.0.1
v3.0.0
Breaking changes
- This breaking change impacts webpack users who import the single-spa-react Parcel component. It does not impact webpack users that do not use parcels. The import path for the Parcel component has changed for environments that do not support package.json exports (#78 via @madeofsun).
// For webpack users
// single-spa-react@2
import singleSpaReact from 'single-spa-react';
import Parcel from 'single-spa-react/parcel';
// single-spa-react@3 + webpack@<5.0.0-beta.18
import singleSpaReact from 'single-spa-react';
import Parcel from 'single-spa-react/lib/esm/parcel';
// single-spa-react@3 + webpack@>=5.0.0-beta.18
// See https://github.com/webpack/webpack/pull/10953
// and https://github.com/webpack/webpack/releases/tag/v5.0.0-beta.18
import singleSpaReact from 'single-spa-react';
import Parcel from 'single-spa-react/parcel';
Migration path
npm install --save single-spa-react@^3.0.0
yarn add single-spa-react@^3.0.0
For webpack@<5.0.0-beta.18, you'll have to update some code when upgrading single-spa-react
Option 1: change import paths
Update each file that imports Parcel to use the new path.
Option 2: add webpack alias
module.exports = {
resolve: {
alias: {
'single-spa-react/parcel': 'single-spa-react/lib/esm/parcel.js'
}
}
}
Features
- Add
System.register
version of single-spa-react to published code. Fixes #76 - Add CJS version of single-spa-react to published code (#78)
- Add
es2015
version of single-spa-react to published code, which is smaller than theesm
bundle but only works in browsers that support ES modules (not IE11) (#78) - Added package.json
module
field, for bundlers to use the ESM version of single-spa-react. (#78) - Set package.json
type
field to"module"
(#78) - Reduce tarball size published to npm (#79 via @joeldenning)
Maintenance
- Add funding and sponsorship information (5999526)
v2.14.0
Features
- New
opts.errorBoundary
that allows for easy implementation of error boundary (#75)
const lifecycles = singleSpaReact({
React,
ReactDOM,
rootComponent: Root,
errorBoundary(err, info, props) {
return <div>An error occurred</div>
}
})
Maintenance
- Switch to minified rollup bundles, which reduced library size from 9.4kb to 5.6kb (#75)
v2.13.0
Features
- single-spa props are now passed as an argument to domElementGetter (#72)
singleSpaReact({
React,
ReactDOM,
rootComponent: Root,
domElementGetter(props) {
console.log('accessing single-spa props inside of domElementGetter is new', props)
}
})
Maintenance
- Using prettier for code formatting (#73)
v2.12.0
v2.11.1
v2.11.0
Features
- single-spa custom props are now passed to the loadRootComponent function (#60 via @adamjmcgrath)