All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog.
Nothing!
- (actions): Added
makePayloadMetaActionCreator. - (actions): Added invariant to action creator factories which checks that the type is a non-empty string.
- (actions): Added invariant to
makePayloadActionCreatorandmakeEmptyActionCreatorfor checking the correct number of arguments. - (injectors-react): Added
isNamespacedprop for all injector hooks and decorators. Use this option to indicate that an injectable must always be injected under a namespace. - (injectors-react): It is now possible to reliably inject functions, arrays, and complex objects.
- (middleware): Added
composeMiddleware. - (namespaces): Added
preventNamespace, which always overwrites the original namespace with a "global" namespace. - (namespaces): Added
getStateByActionandgetStateByNamespacewhich always use the default feature. - (namespaces-react): New package! Existing logic from various packages has been moved here (
useNamespace,NamespaceProviderandnamespacedConnect). - (namespaces-react):
withNamespaceProvidercan now be used to create complex multi-instance components more easily. - (namespaces-react): Added
useNamespacedDispatchanduseNamespacedSelectorhooks. - (reducers):
makeReducernow supports arrays of strings and predicates. - (reducers): It is now possible to inject deep reducer structures, allowing for view-based state management.
- (actions):
makeConstantActionCreatorhas been renamed tomakeEmptyActionCreator(original export still present). - (actions): Changed signatures of
makePayloadActionCreatorandmakeEmptyActionCreator. - (actions):
makeSimpleActionCreatorhas been renamed tomakePayloadActionCreator(original export still present). - (actions):
makeActionCreatorhas been renamed toconfigureActionCreator. - (actions):
makeReducerhas been moved to the@redux-tools/reducerspackage. - (injectors-react):
Providerhas been renamed toNamespaceProvider. - (injectors-react): It is no longer necessary to pass
isGlobal: truewhen not using the namespacing mechanism. - (namespaces): Renamed
getStateByActionandgetStateByNamespacetogetStateByFeatureAndActionandgetStateByFeatureAndNamespace. - (namespaces-react):
useNamespaceno longer falls back toDEFAULT_FEATUREif no namespace could be resolved. - (react): The unpkg bundle now includes all dependencies except for React, Redux, and React Redux.
- (reducers):
makeReducernow uses the default reducer for error actions if the error reducer is missing. - (reducers):
getStateByActionandgetStateByNamespacehave been moved to the@redux-tools/namespacespackage.
- (injectors-react): Static namespace and feature in decorators is no longer passed down to inner components.
- (namespaces-react): Static namespace and feature in
namespacedConnectis no longer passed down to inner components.
- The unpkg bundle is no longer created for non-preset packages.
Oops.
ramdaandramda-extensiondependency versions are now less strict.- All transitive peer dependencies are now listed in the appropriate packages.
- (reducers): Reducer state is no longer cleaned up if an equal entry is still injected.
- redux-tools.js.org ❤️
- (react): New package!
@redux-tools/reactreexports everything necessary to get started with Redux Tools in a React application. - (reducers): Enhancer now supports initial reducers.
- Appropriate dependencies added to
useEffectin injection hooks. - (middleware): Injected middleware are now properly called in the order of injection.
- (reducers): Existing state keys are now preserved to allow preloading of global state.
- (reducers): Clean up reducer state after ejection.
- (namespaces): Added
attachNamespace, which always overwrites the original namespace. - (middleware): Middleware now automatically sets the namespace of each dispatched action.
- (middleware):
getNamespacedStateandnamespaceare now available in the first argument in all injected middleware.
- (namespaces): Renamed
attachNamespacetodefaultNamespace.
- (middleware): Injected middleware are now properly called in the order of injection.
- (middleware): Middleware no longer automatically sets the namespace of each action via
next().
- (namespaces): Unnecessary utility functions (
attachFeatureandgetFeatureByAction).
- Hook-based API. You can now use
useMiddleware,useEpicsanduseReducerswith a caveat: don't dispatch any actions until the injectables are injected (based on hook return value). Hooks are also used under the hood for better structure and performance. - Loads of new useful warnings when injecting and ejecting.
- You can now define namespaces and features statically (or using props) in
withMiddleware,withEpicsandwithReducers. - You can now inject functions in addition to objects. Note that a function (reducer, middleware or epic) will only be initialized once per namespace/feature.
- Support for Redux Thunk! Just use our clone instead of the official implementation to enable automatic namespace passthrough via thunks.
- (reducers): Support for features! This allows using Redux Tools with a feature-based state structure, similar to when using e.g. Redux Form.
- (reducers-react): Warn when using withReducers with global: false and no namespace.
- The injection API was changed from
(injectables, namespace, version)to(injectables, { namespace, feature }). - All the
enhancerexports were changed tomakeEnhancerbecause of ambiguity in the injectable middleware enhancer. - Loads of internal refactoring under the hood to reduce duplicate code and improve tests maintainability.
globalandpersistoptions in decorators were renamed toisGlobalandisPersistent.- (middleware): Injectable middleware enhancer now has an
injectedMiddlewareproperty, which you must use to signify the execution point of the middleware.
- (middleware): Correctly skip duplicate middleware.
- (reducers): The reducer passed to
createStore()as the first argument is now composed with the injected reducers. - Support for injectable middleware! See the
middlewareandmiddleware-reactpackages.
- (injectors-react): Performance optimizations in
<InjectorContext.Consumer />.
- Documentation, including the README.md and FAQ.md files.
- (actions):
makeActionTypesas an export ofprefixedValueMirrorfrom the utils package.
- (utils):
getDisplayNamefunction now handles strings. - (injectors-react): Now compatible with react-redux v6.
- This changelog!
- (epics):
streamCreatorsproperty has been renamed tostreamCreatorand now accepts a function instead of an array. - (injectors-react):
<Provider />is now a separate component which acceptsstore,withNamespaceandnamespaceprops directly. It also allows for seamless nesting (no need to always provide all properties).
- The injection mechanism now supports React async rendering.
- (reducers): Reducers now filter actions by namespace properly.