- Upgrade
redux
dependency to^5.0.1
(#66966)
- Increase the minimum required Node.js version to v18.12.0 matching long-term support releases (#31270). Learn more about Node.js releases.
- Add new
createSelector
function for creating memoized store selectors (#60370).
- Deprecate the
getIsResolved
meta-selector (#59679).
- Fix
combineReducers()
types (#55321).
- Change implementation of
combineReducers
so that it doesn't useeval
internally, and can run with a CSP policy that doesn't allowunsafe-eval
(#54606).
- Warn if the
useSelect
hook returns different values when called with the same state and parameters (#53666).
- Update the type definitions for dispatched actions by accounting for Promisified return values and thunks. Previously, a dispatched action's return type was the same as the return type of the original action creator, which did not account for how dispatch works internally. (Plain actions get wrapped in a Promise, and thunk actions ultimately resolve to the innermost function's return type).
- Update the type definition for dispatch() to handle string store descriptors correctly.
- The
registry.register
function will no longer register a store if another instance is registered with the same name.
- Updated dependencies to require React 18 (45235)
- The
registry.subscribe
function can now subscribe to updates only from one specific store, with a new optional parameter.
– Add TypeScript types to the built package (via "types": "build-types" in the package.json)
- Packages: Replace
is-plain-obj
withis-plain-object
(#43511).
- Use
useDebugValue
inuseSelect
to better display data in React DevTools (#42225).
- Enabled thunks by default for all stores and removed the
__experimentalUseThunks
flag. - Store the resolution errors in store metadata and expose them using
hasResolutionFailed
thegetResolutionError
meta-selectors (#38669). - Expose the resolution status (undefined, resolving, finished, error) via the
getResolutionState
meta-selector (#38669).
- Removed unused
memize
dependency (#38388).
- Corrected expect type of action creators and selectors in Redux store configuration type
- Move
redux
to regular dependencies and update it to version^4.1.2
.
- Changed names of store-related types to better reflect their use and role.
- Changed "storeDefinition" to "storeDescriptor" to better reflect its use and role.
- Added a
batch
registry method to batch dispatch calls for performance reasons. - Add a new migration for the persistence plugin to migrate edit-widgets preferences to the interface package. As part of this change deprecated migrations for the persistence plugin have been removed (#33774).
- Update data controls to accept a data store definition as their first param in addition to a string-based store name value (#34170).
- Upgraded React components to work with v17.0 (#29118). There are no new features in React v17.0 as explained in the blog post.
- Drop support for Internet Explorer 11 (#31110). Learn more at https://make.wordpress.org/core/2021/04/22/ie-11-support-phase-out-plan/.
- Increase the minimum Node.js version to v12 matching Long Term Support releases (#31270). Learn more at https://nodejs.org/en/about/releases/.
- Added new
startResolutions
andfinishResolutions
actions as batched variants ofstartResolution
andfinishResolutions
actions.
- Updated
redux
dependency from requiring^4.0.0
to^4.1.0
(see changes at https://github.com/reduxjs/redux/releases/tag/v4.1.0).
- Added new
resolveSelect
registry method to initiate and wait for selector resolution
- Added new
register
function for registering a standard@wordpress/data
store definition (#26655). - Added new
createReduxStore
factory function that creates a data store definition for the provided Redux store options to use withregister
function (#26655). - Extended
select
anddispatch
functions to accept a data store definition as their first param in addition to a string-based store name value #26655). - Extended
useDispatch
hook to accept a data store definition as their first param in addition to a string-based store name value #26655).
registerGenericStore
has been deprecated. Useregister
instead.registerStore
has been deprecated. Useregister
instead.
- Expose
useSelect
hook for usage in functional components. (#15737) - Expose
useDispatch
hook for usage in functional components. (#15896)
withSelect
internally uses the newuseSelect
hook. (#15737. Note: This could impact performance of code usingwithSelect
in edge-cases. To avoid impact, memoize passed inmapSelectToProps
callbacks or implementuseSelect
directly with dependencies.withDispatch
internally uses a newuseDispatchWithMap
hook (an internal only api) (#15896)
- Restore functionality of action-generators returning a Promise. Clarify intent and behaviour for
dispatch
behaviour. Dispatch actions now always return a promise (#14830
- Expose
hasResolver
property on returned selectors indicating whether the selector has a corresponding resolver.
- The
registerStore
function now accepts an optionalinitialState
option value. - Introduce new
invalidateResolutionForStore
dispatch action for signalling to invalidate the resolution cache for an entire given store. - Introduce new
invalidateResolutionForStoreSelector
dispatch action for signalling to invalidate the resolution cache for a store selector (and all variations of arguments on that selector).
- Resolves issue in the persistence plugin where passing
persist
as an array of reducer keys would wrongly replace state values for the unpersisted reducer keys. - Restores a behavior in the persistence plugin where a default state provided as an object will be deeply merged as a base for the persisted value. This allows for a developer to include additional new keys in a persisted value default in future iterations of their store.
- Optimized performance of selector execution (~511% improvement)
withDispatch
'smapDispatchToProps
function takes theregistry
object as the 3rd param (#11851).withSelect
'smapSelectToProps
function takes theregistry
object as the 3rd param (#11851).
registry.registerReducer
has been removed. Useregistry.registerStore
instead.registry.registerSelectors
has been removed. Useregistry.registerStore
instead.registry.registerActions
has been removed. Useregistry.registerStore
instead.registry.registerResolvers
has been removed. Useregistry.registerStore
instead.
- Resolve an issue where
withSelect
'smapSelectToProps
would not be rerun if the wrapped component had incurred a store change during its mount lifecycle.
registry.registerGenericStore
has been added to support integration with existing data systems.
registry.registerReducer
has been deprecated. Useregistry.registerStore
instead.registry.registerSelectors
has been deprecated. Useregistry.registerStore
instead.registry.registerActions
has been deprecated. Useregistry.registerStore
instead.registry.registerResolvers
has been deprecated. Useregistry.registerStore
instead.
- Replace Redux implementation of
combineReducers
with in-place-compatibleturbo-combine-reducers
.
- Writing resolvers as async generators has been removed. Use the controls plugin instead.
- Adding support for using controls in resolvers using the controls plugin.
- Updated
redux
dependency to the latest version.
- Writing resolvers as async generators has been deprecated. Use the controls plugin instead.
- Fix the promise middleware in Firefox.
- The
withRehdyration
function is removed. Use the persistence plugin instead. - The
loadAndPersist
function is removed. Use the persistence plugin instead. restrictPersistence
,setPersistenceStorage
andsetupPersistence
functions have been removed. Please use the data persistence plugin instead.- Change how required built-ins are polyfilled with Babel 7 (#9171). If you're using an environment that has limited or no support for ES2015+ such as lower versions of IE then using core-js or @babel/polyfill will add support for these methods.