v1.6.0-alpha.0
Pre-releaseThis initial pre-1.6 alpha release reworks our build tooling to enable upcoming changes, updates dependencies, adds new entity adapter CRUD methods, and tweaks async thunk options.
We have several major improvements planned for later pre-1.6 alphas, including merging the "RTK Query" APIs back into RTK itself and making those available as subpackages.
Changelog
Build Tooling Updates
We've replaced our existing TSDX build setup with a new custom setup based on ESBuild + TypeScript (thanks to @hardfist for doing all the work on that!). In theory, we should have all of the same build artifacts we had before, targeting the same browser and ES spec levels. We did add a new set of "modern" build artifacts that target ES2017, with builds for bundlers and browwsers. However, we can't officially list those in package.json
yet, as apparently defining an exports
key can break Node and is considered a breaking change. We'll look at flipping that on in a future 2.0 release.
Please let us know if you see any bugs that may be related to the build tooling and bundling changes!
Dependency Updates
We've updated Immer to 9.0.x. Also, we've updated Redux to the hot-off-the-presses 4.1.0-alpha.0, which shrinks bundle size by extracted error messages in production. Again, please report any problems you run into.
New Entity Adapter Replace Methods
createEntityAdapter
already had methods to add, upsert, and update items. We've added setOne
and setMany
, which let you add or entirely replace existing items.
Async Thunk Improvements
createAsyncThunk
promises now have a .unwrap()
method that returns a promise for the actual result payload, or throws an error if the promise was rejected. This simplifies the use case of working with the thunk result in components.
createAsyncThunk
also now accepts an idGenerator
option to let you swap out the default nanoid()
ID generation utility for your own, such as uuid4
.
Other Updates
We've done a bit of internal cleanup in a few functions to simplify and shorten implementations.
configureStore
now checks for accidentally returning undefined
for a middleware array, or undefined
entries in the array.
The PreloadedState
type should now work better with TS 4.3+.
Changes
- Bump Redux to 4.1.0-alpha.0 0169356
- Update immer to v9.0.1 (#977) 087d4b6
- Add idGenerator option to createAsyncThunk (#743) (#976) 309c4bd
- Add simpler unwrapping of createAsyncThunk promises (#970) 8301370
- Merge branch 'next' 247f9fe
- Remove unnecessary condition (#846) 37d22c4
- Add check for undefined middleware in configureStore (#959) 86f7eea
- chore(build): move tsdx to esbuild (#957) cb0535d
- Add setOne and setMany to entity adapter (#969) 795af40
- Removed unnecessary sort in sorted_state_adapter.ts#merge() (#960) 4462647
- Extract common utils from both adapter files (#952) 61ec24c
- export AsyncThunkOptions (#950) 7db3e48
- fix PreloadedState type for TS 4.3 (#949) 9abaec4