Skip to content

Releases: single-spa/single-spa-react

v4.0.0

29 Jan 18:39
Compare
Choose a tag to compare

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

  • Removing dead code and adding tests (#95)
  • Upgrade all dependencies. (#102)
  • Switch to react testing library (#102)
  • Switch to pnpm (#102)

v3.2.0

09 Nov 19:00
Compare
Choose a tag to compare

Features

  • Add support for unstable_createRoot and unstable_createBlockingRoot (#94 via @rolandfung)

v3.1.0

29 Sep 16:12
Compare
Choose a tag to compare

Features

v3.0.1

23 Jul 16:53
Compare
Choose a tag to compare

Fixes

  • Fixing issue with customProps prop. Resolves #82. (#83)

Maintenance

  • Add watch-build script for debugging (#84)
  • Bump lodash from 4.17.15 to 4.17.19 (#81)

v3.0.0

26 Jun 17:55
Compare
Choose a tag to compare

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 the esm 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

20 Apr 17:45
Compare
Choose a tag to compare

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

03 Apr 19:14
Compare
Choose a tag to compare

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

20 Mar 04:06
Compare
Choose a tag to compare

Features

  • Add wrapStyle prop to <Parcel /> component, for styling the container element (#70 @alijs)

v2.11.1

02 Mar 18:14
Compare
Choose a tag to compare

Fix for instances with using single-spa-react to generate a single config for multiple parcels (#67)

v2.11.0

17 Dec 14:54
Compare
Choose a tag to compare