Reactn Versions Save

React, but with built-in global state management.

v2.0.3

4 years ago

Bug Fixes 🐛

  • Fixed class Components not unsubscribing from state changes on unmount and update. #76 #85 (Thanks @r1ckyrockz, @bugs181, @umbertoghio, @stahlmanDesign!)
    • Special thanks to @umbertoghio in depth logging and screenshots.
  • Attempt to prevent Webstorm's auto-imports from importing from the wrong file. #74

Miscellaneous

  • reactn/typings/* directory renamed to reactn/types/*.
  • package-lock.json added to the .gitignore and .npmignore files, allowing contributors to install with NPM instead of Yarn.
  • yarn upgrade performed on the repository root and docs directories (updating their respective yarn.lock files).

v2.0.2

4 years ago

"Breaking" Changes 💔

  • ReactN DevTools were moved to a separate package.
    • This only resulted in a minor version bump, because this change only breaks a tool in the development environment.
    • Builds, both development and production, remain unbroken.

New Features ✨

  • Callbacks now receive the state change in addition to the new state.
  • Callbacks now receive the reducer name and arguments that resulted in the state change (if applicable).

Bug Fixes 🐛

  • Builds no longer warn about a missing optional Redux dependency. #71 #79 (Thanks @ryanvanderpol, @chrise86!)

Miscellaneous

  • Added some placeholder methods for potential future implementations of middleware.
  • Some TypeScript definitions that were missing from the final build are now included.

v2.0.1

4 years ago

New Features

  • Adds a getDispatch helper function to return all dispatch functions (created from reducers) currently attached to the global state. #73

  • Allows useDispatch to be called without any parameters to return all dispatch functions currently attached to the global state.

v2.0.0

4 years ago

Since its inception, ReactN has always felt to me to be deeply tied to the community. It is likely the first time I started a project with intense community interviewing before ever writing the first line of code. Each step of the way, I tried to thoroughly document my and developers' thought processes and use cases in the most public ways possible -- GitHub Issues, Medium articles, Reddit threads, and even now a Discord channel on the Reactiflux server.

ReactN spent long enough evolving in v0 that 1.0.0 never even needed so much as a patch.

The first change since launch is a breaking change, so 2.0.0 launched today. I wanted to engage the community with this change.

Breaking Changes 👷‍♂️

  • Global state and reducers are now on different member variables and hooks.
// Class Component member variables
this.global.property; // -->
this.global.property; // (unchanged)

this.global.reducer('value'); // -->
this.dispatch.reducer('value');

// Function Component hooks
useGlobal('property'); // -->
useGlobal('property'); // (unchanged)

useGlobal('reducer'); // -->
useDispatch('reducer');

useGlobal(function(){ }); // -->
useDispatch(function(){ });
  • Global reducers now receive the dispatch object as a function parameter.
// Previous global reducer:
function reducer(state, arg1, arg2) { }

// Current global reducer:
function reducer(state, dispatch, arg1, arg2) { }

Feature Additions 🏢

  • Full TypeScript support. Intellisense has never been so powerful.

  • Redux DevTools are supported! View your ReactN state and dispatched actions right from developer tools. #41

  • Ability to type the default global state. (Example) #50

  • Reducers as sagas, which is why reducers now receive the dispatch object. You can now have a reducer that dispatches other reducers. #62

function addSubtract(state, dispatch, a, s) {
  await dispatch.add(a);
  await dispatch.subtract(s);
}

Bug Fixes 🐛

  • Slight re-render optimization. #5

Next Steps 💭

Since ReactN serves as both a React-integrated API and a global state, I was thinking it would be a non-breaking change (exact same API; semver 2.1) to change the global state manager to a Redux store. This could improve support for third party tooling (like middleware) while offsetting a lot of testing and maintenance. Just toying with the idea. I don't want the use of Redux to decrease user confidence that boilerplate is eliminated or learning curve is shallow. This would essentially make ReactN an alternative to react-redux instead of redux. I'll let the community discuss and focus more on a smooth 2.0 launch for the time being.

Thanks for all the support! 🎉

v1.0.0

5 years ago

Features

  • Added a Context-based Provider Component for managing multiple global states simultaneously. #17
  • Added helper functions to Provider Components for targeting a global state. #37
  • Added iterator logic to reducers to support [ state, dispatch ] destructuring. #42

v0.2.1

5 years ago

Miscellaneous

  • Optimized bundle size by excluding some unneeded files.

v0.2.0

5 years ago

Features

  • Added addCallback to execute a function after global state changes. #29

  • Added getGlobal helper function for accessing a snapshot of the current global state. #35

  • Added removeCallback to remove callbacks added via addCallback.

Miscellaneous

  • Added unit tests for most helper functions.

  • Ported the singleton global state to a default global state, in preparation for multiple global states via the Context API.

v0.1.8

5 years ago

Bug Fix

  • Removes a no-op re-render that occurs when both a parent and child subscribe to the same global property. #28

v0.1.7

5 years ago

Bug Fix

  • Fixed ReferenceError: window is not defined on server-side applications. #30

v0.1.2

5 years ago

Feature

  • TypeScript support! #10 🎉

Bug Fix

  • Fixed reducers being written to global state when spreading global state in a reducer. #22