Open quisido opened 5 years ago
What is the status on 3.0? More specifically, the feature where React
is removed from the library, so that it is no longer re-exported.
React
will remain in 2.x
because removing it would be a breaking change. ReactN functions the same way whether or not you import React
from it or from the react
package. In my personal projects, I still import React from 'react';
when using ReactN. I hope you don't feel as if you are forced into importing it from reactn
!
3.x
is on pause, as my contributions to Amazon CloudWatch take higher priority at the moment.
I still think about 3.x
on almost a daily basis! :) It's simply a matter of finding time to do a near-complete rewrite of an established product. That's a lot of time: something I simply don't have right now.
@CharlesStover Reactn is a fantastic tool and my team and I have been using it for a while. The roadmap to 3.0 is exciting, but there is just one thing I wanted to mention:
Remove support for
@reactn
decorator. Typing the decorator is difficult to maintain, and the feature is not often (if ever?) used.
We do use this feature a lot. The only problem we've had with it is the constant deprecation notice it generates, as componentWillUpdate
is still implemented by the decorator, as mentioned in #134.
This Issue serves as documentation for anticipated breaking changes in 3.0 and allows community feedback to drive the development process.
Breaking Changes 💔
reactn
. Have users just import React and ReactN Component/hooks from separate packages. This will help with the namespace conflicts withComponent
in TypeScript.@reactn
decorator. Typing the decorator is difficult to maintain, and the feature is not often (if ever?) used.addPropertyReducer
andusePropertyDispatch
instead of sharing a namespace withaddReducer
anduseDispatch
.New Features ✨
src/index.ts
.addPropertyReducer
is given its own helper function, the property can be tightly coupled at the global level.addPropertyReducer(property, reducer)
would be synonymous withaddReducer((global, dispatch, ...args) => ({ [property]: reducer(global[property], ...args) }))
. This may make some reducers easier to write.useSelector('id')
as a simplified way to grabglobal.x.y.z.mutate(f)
./docs
app to reflect 3.0 as development occurs.Undecided 📃
type Reducers = typeof reducers
inreactn/global.d.ts
.function reducer(global, ...args)
andfunction reducer(global, dispatch, ...args)
should both be acceptable ways to write a reducer.addReducer
andaddSaga
.Error
, etc.useGlobal('x', 'y', 'z')
. On state change, check all global subscriptions for shallow keys, then check all matches for shallow key changes. Implementation direction could use fleshing out.