This bugfix release fixes issues with "TS type portability" errors, improves build artifact tree shaking behavior, and exports some additional TS types.
Changelog
TS Type Portability
We've had a slew of issues reported around "TS type portability" errors, such as:
The error messages are typically along the lines of:
Type error: The inferred type of 'configureStore' cannot be named without a reference to '@reduxjs/toolkit/node_modules/redux'. This is likely not portable. A type annotation is necessary.
@aryaemami59 did some deep investigation and concluded these were due to a mixture of using interface instead of type in most places, not pre-bundling our TS typedefs, and not exporting some of the unique symbols we use internally.
Arya put together a highly detailed writeup and set of fixes in [ #4467: Fix: TypeScript Type Portability Issues](#4467), and that appears to resolve all of those issues we've seen. Thank you!
Other Changes
Arya also did significant work to improve RTK's treeshaking, tweaking internal definitions to let bundlers better separate out unused code.
We've exported additional types like UpdateDefinitions and RetryOptions, per request.
listenerMiddleware.withTypes() methods now allow passing in an ExtraArgument generic.
You can trigger a rebase of this PR by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Note
Automatic rebases have been disabled on this pull request as it has been open for over 30 days.
Bumps @reduxjs/toolkit from 1.9.7 to 2.2.7.
Release notes
Sourced from
@reduxjs/toolkit
's releases.... (truncated)
Commits
75b4f69
Release 2.2.7dd3ef70
Merge pull request #4529 from reduxjs/feature/2.3.0-types-exports70f627d
Export RetryOptions6a3de08
Merge pull request #4435 from aryaemami59/improve-treeshakeability8be6e5f
Merge branch 'master' of https://github.com/reduxjs/redux-toolkit into improv...9e7e6f6
Merge branch 'master' of https://github.com/reduxjs/redux-toolkit into improv...ee51d76
Bumptsup
to version 8.2.3ff6db42
Bumptsup
to version 8.2.220f579b
Bumptsup
to version 8.2.0a1b4e80
Bumptsup
andesbuild
You can trigger a rebase of this PR by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show