Skip to content

Releases: Harvtronix/react-substate

v5.0.4

07 Feb 07:39
Compare
Choose a tag to compare

Mostly currency updates with some TypeScript niceties mixed in.

💣 BREAKING CHANGE!

  • The exports have changed from using main and module in the package.json file to instead use exports.
  • The typescript types are stricter as it relates to action draft and payload parameters. This may break some existing applications if they're passing freeform (or additional) data into these function when invoked via dispatch.

v4.2.3

02 Aug 04:13
Compare
Choose a tag to compare

React 18 support.

(spoiler alert: I didn't have to change anything!)

v4.2.1

20 Jan 02:58
Compare
Choose a tag to compare

This version makes React Substate fully compatible with TypeScript!

This means that substates will now come back from hooks as more specific types than just any. This slightly changes the internal structure of some objects that are used to identify substates, but it does not change the external interfaces at all. That means you profit without having to change any of your code!

v4.1.1

15 Apr 03:09
Compare
Choose a tag to compare

Bugfix release! 🐛

  • Devtools was causing problems with React Server Side Rendering.
  • The window object was directly exposed in the module, which caused SSR problems.
  • Now it is guarded behind an appropriate check.

v4.1.0

16 Mar 04:26
Compare
Choose a tag to compare

Redux DevTools Support!

The 4.1 release introduces opt-in integration with the Redux DevTools browser extension.

Changes

  • Redux DevTools integration can be switched on by calling setDevToolsEnabled(true)
    • Entries are logged in response to:
      • Substate creation
      • Action dispatch

v4.0

05 Feb 19:23
Compare
Choose a tag to compare

Quality of Life API Updates!

The 4.0 release includes breaking changes, but should improve the user experience when using the module. It should also be a tiny bit faster because of some clever memoization.

Changes

  • Reworked createAction to not take a substate key as input. The mapping between a substate and a dispatch function is now handled when invoking the useSubstate or useDispatch hooks.
  • useDispatch now creates/returns a memoized, curried function that is automatically linked to to the provided substate.
  • useSubstate now internally uses useDispatch to obtain the dispatch function. This means less overall code and more efficiency.
  • Added some better debug logging.
  • Unregistering patch effects is now done more reliably by maintaining the same array reference across invocations.
  • All module exports are now exposed to consumers through both the default export and named exports.
  • Removed terser from the rollup build. Consumers can minify their code and dependencies themselves, if desired. This makes development debugging a lot easier.
  • Updated node modules.

Peer Dependency Updates

The Immer peer dependency has moved to v8.0 from v7.0

v3.7.0

19 Dec 17:10
Compare
Choose a tag to compare

Maintenance Update

Updated node modules

The peer React dependencies have moved to 16.14+, though should still work fine with older version so long as they support hooks.

Fixed some documentation bugs

v3.6.0

19 Aug 16:07
Compare
Choose a tag to compare

Two New Features!

useDispatch

You can now get a reference to the dispatch function without registering for state changes. This is useful for components that want to fire changes while still being pure, or for components that useSubstate multiple times and only want to deal with one reference to dispatch.

Passing multiple substates to usePatchEffect

Previously when using usePatchEffect you could either create a patch effect for all substate changes or changes to a single substate. Now, you can add a patch effect for changes to multiple substates without needing to call usePatchEffect multiple times. This should help slim down the size of components using this functionality.

One New Compatibility Update

The peer dependency on Immer has been moved from version 6 to version 7. Version 6 will still work perfectly fine as far as React Substate is concerned, but users now have the option to move to version 7 without being hit with an npm peer dependency warning.

v3.4.0

09 Jul 16:01
Compare
Choose a tag to compare

logging enhancements

  • replacing console log statements with custom debug class
  • providing method to turn debug on and off via Substate.setDebugEnabled
  • updating node modules