AdamBrodzinski / meteor-flux-leaderboard

Flux Example with React & Meteor
131 stars 19 forks source link

including redux-devtools for live-editing and time travel #6

Closed levid closed 9 years ago

levid commented 9 years ago

Hey Adam,

I was playing around with your Redux branch (really great BTW ! ) and I wanted to play around with the DevTools and see how they worked compared to Alt. I managed to get devTools working with your example and thought I might submit a PR in case you or anyone else is interested in checking it out.

Best,

Isaac

AdamBrodzinski commented 9 years ago

Awesome! I briefly tried and ran into issues with ReactReduxDevTools and browserify or something and gave up. This is much appreciated! I'll check it out Thurs when i'm stuck at the airport :laughing:

:beers:

How do you like Redux compared to Alt btw? I find it easier to reason about the Alt with my larger React-Native app.... Alt isn't bad but Redux is just that much better for me!

AdamBrodzinski commented 9 years ago

Is there any way you can ignore the client/lib/app.browserify.js.cached and map files? It adds almost 6k lines to the repo :laughing: I forgot to add a .gitignore rule for those.

levid commented 9 years ago

Sure, sorry about that, I just deleted them from the repo and pushed an update.

That is a great question. I am not entirely sure which approach I am more interested in using yet to be honest. I just recently started tinkering around with React in Meteor and checking out some of the other Flux implementations it has to offer. Until now, I have just been using the basic Flux architecture in a Meteor app which I have been building in my spare time using Blaze Components and a package-only approach. One of the primary features includes some complex undo/redo functionality that could really be done easily with something like Alt snapshots or Redux time travel.

Right now I am manually keeping track of the state and changes in a giant object using Reactive Dict, and swapping out the state if a user clicks the undo/redo button. I am currently evaluating React and experimenting with a few Flux variations to decide which approach I like better. I have an Alt implementation mostly working, but the piece I am missing is storing the state on both client and server-side, and using the snapshot feature and bootstrap to re-hydrate the app state.

AdamBrodzinski commented 9 years ago

I have an Alt implementation mostly working, but the piece I am missing is storing the state on both client and server-side,

Hmmm perhaps storing something in a user collection document would be useful.... they you could prime it when the user logs in.

... and using the snapshot feature and bootstrap to re-hydrate the app state.

I've used the onMigrate callback to do a snapshot in alt and then store it in the Session... then on reload use the bootstrapping methods. I haven't tried out the bootstrapping yet but snapshotting on a hot-reload worked. I'm using Redux now so I haven't dug into bootstrapping alt yet.

AdamBrodzinski commented 9 years ago

merged in and added you to the contributors list. thanks!

AdamBrodzinski commented 9 years ago

I think i'll eventually merge this into master and make alt a feature branch... i'm really liking Redux so far!