Skip to content
This repository has been archived by the owner on Feb 14, 2023. It is now read-only.

Releases: CharlesStover/reactn

2.0.3

01 Jun 08:09
Compare
Choose a tag to compare

Bug Fixes 🐛

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).

2.0.2

23 May 21:11
Compare
Choose a tag to compare

"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 🐛

Miscellaneous

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

2.0.1

15 May 04:19
Compare
Choose a tag to compare

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.

2.0.0

10 May 02:23
Compare
Choose a tag to compare

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! 🎉

1.0.0 🎉

18 Feb 03:07
Compare
Choose a tag to compare

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

0.2.1

11 Feb 17:59
Compare
Choose a tag to compare

Miscellaneous

  • Optimized bundle size by excluding some unneeded files.

0.2.0

04 Feb 03:56
Compare
Choose a tag to compare

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.

0.1.8

12 Dec 17:48
Compare
Choose a tag to compare

Bug Fix

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

0.1.7

10 Dec 18:53
Compare
Choose a tag to compare

Bug Fix

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

0.1.2

27 Nov 16:00
4cde6d1
Compare
Choose a tag to compare

Feature

  • TypeScript support! #10 🎉

Bug Fix

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