Releases: CharlesStover/reactn
2.0.3
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 toreactn/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 anddocs
directories (updating their respectiveyarn.lock
files).
2.0.2
"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.
2.0.1
2.0.0
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
-
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 🎉
0.2.1
0.2.0
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 viaaddCallback
.
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.