-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A general and practically simple request for feedback #2
Comments
Haven't tried it yet, but just wanted to say that I really enjoyed the readme :) |
Hah. Why thank you. I rather enjoyed writing it. 😁 |
I suppose I should retract my premature statement that the first pre-release would be in just a few days. That was 15 days ago, so I think it's disqualified at this point. Here's an update on what's going on: The official React bindings are done! I have a few api additions for them, but they're done, tested, usable, documented, the works. Check them out!. An item on my todo list was to clean up the reactor hierarchy creation model. It was previously erasing the hierarchy and re-creating it from scratch every time Long story short, I also discovered a memory-leaking bug with the naive The repo examples also got some love. The zero configuration guide has been beefed satisfactorily.
Current Roadmap:
I've also been experimenting with some effect-based models for processors. They're looking pretty cool! But I don't think that'll be a v0.1.0 thing. Anyway, just a few tiny fixes and a doc page before v0.1.0. That'll be just a few days, right? 🤞 |
Incredible. I had the exact same idea and wrote a library (it's called finite-store) where you can use finite state machines instead of Reducers and have data coupled with the state machines. So instead of value just incrementing from 1 to 2, it checks if you are actually if the transition is valid and if it should run the transition(or action). |
Examples that I would like to see
Potential Flaws
The other flaws are mostly centred around learning experience. The idea and implementation are fantastic, but when you are a web developer who has just started with zedux, I feel that it should have a more promiment set of defaults which the user can just start using right away. Even a convention will do I would say (something which zeit does with nextjs). Learning experience directly impacts package usage in my opinion and I think that's a good area for the package to improve upon. |
Good, good! I totally agree. In fact, the latest version of React Zedux has a StoreApi class that is an attempt to standardize store creation for consumption with React's new context api. Since store consumption is very dependent on the environment in which Zedux is used, I think it makes sense to have those sorts of conventions live in environment-specific plugins. Like React Zedux. As far as folder/file structure conventions go, the docs definitely need a more prominent suggestion of how to organize Zedux code. But I'm still figuring this out. I've been using Zedux for a couple months now and have switched how I organize it several times. I think I'm just waiting till my own preferences calm down. But definitely open to suggestions. I agree with all those examples. I'll start working on the router example for sure. Next.js has been on my to-do list. I'll definitely look into it, but you can totally create the actual example for the Zedux repo. Like, I would be stoked if you did that. It would, of course, not use parceljs like the other examples, so the main examples readme would need some re-wording. next-redux-wrapper would work for a single, global, Redux-style Zedux store. Well, it would if it didn't have a strict peer dependency on Redux and React Redux. But other than having to create a whole new plugin just to make it import Zedux instead of Redux, the other hurdle would be handling composed stores. Especially since stores should have the ability to be attached to the root store in a separate, code-split bundle. That's where I need to do some digging. But I'd think it wouldn't be too hard. In React Zedux, stores are treated almost like normal components. In fact, that brings up the next point: Middleware has been specifically avoided in Zedux. There's a note about it in the overview doc page. But that should probably have some mention up-front in the readme itself. Something containing:
This is a core philosophy of Zedux. The Zedux architecture is patterned more after React than Redux. React components, of course, don't need middleware because composition covers all the bases. And much more elegantly than Redux. This is what Zedux aspires to. Think of a Zedux store more like a component. And did you delete the finite-store repo? I found the bundled module on unpkg, but I'm not too keen on digesting compiled code before dinner. ;) |
Ah Stores as components? So that should also mean that you should be able to create higher order stores or wrap some behavior on to stores. For people to be able to use sentry or raven to log actions on analytics servers. Perhaps that would also be a good example to have. Actually finite-store has been a private repo until now. Let me share that with you. :) |
haven't used it, but i was very impressed with the quality of absolutely everything about this project. well done :^) |
@meatwallace Thank you! Always good to know your hard work is appreciated. :)
Yep! Here's a proof of concept: const withLogger = wrappedStore => {
const loggerStore = createStore()
loggerStore.inspect((storeBase, action) => ({
next(newState, oldState) {
console.log('received next state:', action, newState, oldState)
},
error(err, state) {
console.log('action threw an error:', action, err, state)
}
}))
// The magic:
return loggerStore.use(wrappedStore)
}
const rootStore = withLogger(createStore()) This won't quite work (currently) as-is. Allowing inspectors to return observer objects is on my to-do list. But you can see the power of composable stores: export default compose(
withLogger,
withSentry,
withImmer,
withDevTools
)(rootStore) (Wow! I haven't actually put that in writing before. Isn't that sick?) I will definitely work on a real example showcasing this. And thanks for the access! Ah, I see the complexity. I put together this jsfiddle to compare
|
Ahh. I think the part where Zedux doesn't care for the transition name does kill a lot of complexity. |
Have been looking for a better redux for some time and apparently found it in Zedux 💯 |
@cjk I am warned. 😄 I'll be honest, the zedux-wrapper for Next.js has fallen pretty far down my todo list. I'm currently working on two projects called By the way, I recently refactored one of my client's Next.js projects to use React Static. If you're creating a static site, I can't recommend React Static enough. Zedux works out of the box with it. Among (lots of) other things. 🙂 But it depends on your use case, of course. Anyways. Thanks for your interest in Zedux! If I know we have something of a community going, I'll start being better about managing issues, tweeting tips, and maybe even blogging. 😮 Enjoy! |
Hey, all!
As Zedux ramps up for its first pre-release (v0.1.0!), I just wanted to make a general request for feedback. Feel free to comment on this issue.
Some idea sparkers:
Of course, anything else feedback-ish is welcome.
This is the beginning of Zedux. Let's make it awesome! ⚡
The text was updated successfully, but these errors were encountered: