- Add support for private selectors to
resolveSelectandsuspendSelect(#52036).
- Upgrade
reduxdependency 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
createSelectorfunction for creating memoized store selectors (#60370).
- Deprecate the
getIsResolvedmeta-selector (#59679).
- Fix
combineReducers()types (#55321).
- Change implementation of
combineReducersso that it doesn't useevalinternally, and can run with a CSP policy that doesn't allowunsafe-eval(#54606).
- Warn if the
useSelecthook 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.registerfunction will no longer register a store if another instance is registered with the same name.
- Updated dependencies to require React 18 (45235)
- The
registry.subscribefunction 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-objwithis-plain-object(#43511).
- Use
useDebugValueinuseSelectto better display data in React DevTools (#42225).
- Enabled thunks by default for all stores and removed the
__experimentalUseThunksflag. - Store the resolution errors in store metadata and expose them using
hasResolutionFailedthegetResolutionErrormeta-selectors (#38669). - Expose the resolution status (undefined, resolving, finished, error) via the
getResolutionStatemeta-selector (#38669).
- Removed unused
memizedependency (#38388).
- Corrected expect type of action creators and selectors in Redux store configuration type
- Move
reduxto 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
batchregistry 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
startResolutionsandfinishResolutionsactions as batched variants ofstartResolutionandfinishResolutionsactions.
- Updated
reduxdependency from requiring^4.0.0to^4.1.0(see changes at https://github.com/reduxjs/redux/releases/tag/v4.1.0).
- Added new
resolveSelectregistry method to initiate and wait for selector resolution
- Added new
registerfunction for registering a standard@wordpress/datastore definition (#26655). - Added new
createReduxStorefactory function that creates a data store definition for the provided Redux store options to use withregisterfunction (#26655). - Extended
selectanddispatchfunctions to accept a data store definition as their first param in addition to a string-based store name value #26655). - Extended
useDispatchhook to accept a data store definition as their first param in addition to a string-based store name value #26655).
registerGenericStorehas been deprecated. Useregisterinstead.registerStorehas been deprecated. Useregisterinstead.
- Expose
useSelecthook for usage in functional components. (#15737) - Expose
useDispatchhook for usage in functional components. (#15896)
withSelectinternally uses the newuseSelecthook. (#15737. Note: This could impact performance of code usingwithSelectin edge-cases. To avoid impact, memoize passed inmapSelectToPropscallbacks or implementuseSelectdirectly with dependencies.withDispatchinternally uses a newuseDispatchWithMaphook (an internal only api) (#15896)
- Restore functionality of action-generators returning a Promise. Clarify intent and behaviour for
dispatchbehaviour. Dispatch actions now always return a promise (#14830
- Expose
hasResolverproperty on returned selectors indicating whether the selector has a corresponding resolver.
- The
registerStorefunction now accepts an optionalinitialStateoption value. - Introduce new
invalidateResolutionForStoredispatch action for signalling to invalidate the resolution cache for an entire given store. - Introduce new
invalidateResolutionForStoreSelectordispatch 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
persistas 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'smapDispatchToPropsfunction takes theregistryobject as the 3rd param (#11851).withSelect'smapSelectToPropsfunction takes theregistryobject as the 3rd param (#11851).
registry.registerReducerhas been removed. Useregistry.registerStoreinstead.registry.registerSelectorshas been removed. Useregistry.registerStoreinstead.registry.registerActionshas been removed. Useregistry.registerStoreinstead.registry.registerResolvershas been removed. Useregistry.registerStoreinstead.
- Resolve an issue where
withSelect'smapSelectToPropswould not be rerun if the wrapped component had incurred a store change during its mount lifecycle.
registry.registerGenericStorehas been added to support integration with existing data systems.
registry.registerReducerhas been deprecated. Useregistry.registerStoreinstead.registry.registerSelectorshas been deprecated. Useregistry.registerStoreinstead.registry.registerActionshas been deprecated. Useregistry.registerStoreinstead.registry.registerResolvershas been deprecated. Useregistry.registerStoreinstead.
- Replace Redux implementation of
combineReducerswith 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
reduxdependency to the latest version.
- Writing resolvers as async generators has been deprecated. Use the controls plugin instead.
- Fix the promise middleware in Firefox.
- The
withRehdyrationfunction is removed. Use the persistence plugin instead. - The
loadAndPersistfunction is removed. Use the persistence plugin instead. restrictPersistence,setPersistenceStorageandsetupPersistencefunctions 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.