Skip to content
This repository has been archived by the owner on Mar 6, 2019. It is now read-only.

Support for Redux #10

Open
giedrius-timinskis opened this issue Sep 22, 2016 · 8 comments
Open

Support for Redux #10

giedrius-timinskis opened this issue Sep 22, 2016 · 8 comments

Comments

@giedrius-timinskis
Copy link

Hello,

This is more of a question/request than an issue. Has anyone done Redux implementation with the universal kit? I'm currently trying to implement one and keep running server-side implementation issues.

@delambo
Copy link
Member

delambo commented Sep 22, 2016

Would you mind sharing your fork? We could probably help you from there, and hopefully that will inspire a redux starter-kyt.

@giedrius-timinskis
Copy link
Author

https://github.com/giedrius-timinskis/kyt-starter-universal/commit/f2f04d88ff023e1b38c954f0172b7a7e00050b8f
This is the version that seems to work. The implementation sets up the initial state server-side and then passes that state into the client side.

@delambo
Copy link
Member

delambo commented Sep 23, 2016

Nice!

I haven't done a lot of Redux work but I really like the idea of following the Ducks file pattern.

I'd love to hear your - or anyone's - thoughts on that.

@mrmckeb
Copy link

mrmckeb commented Sep 26, 2016

We've used Ducks before and it's not hard to wrap your head around. I'd love to see this as an option in the server-side and non-server-side starter kits.

@sabha
Copy link

sabha commented Oct 1, 2016

There are two parts to solve , we faced more issues with Server side rendering + Redux

  1. Dynamic reducers
  2. Async Data fetching

Complexity is primarily with component/router life cycle hooks with Flux architecture.

Solved # 1 by Injecting reducer for each route - http://stackoverflow.com/questions/32968016/how-to-dynamically-load-reducers-for-code-splitting-in-a-redux-application

Still Solving # 2 by different approach - static fetch call per component , resolving nested reducer. Finally end up keeping the reducer normalized rather deeply nested.
https://www.npmjs.com/package/redux-async-connect

Over all it requires more architecture work to handle , HTTP errors , keeping client & server STATE in sync , exception handling globally , authentication , authorization , showing spinners :-) etc

Thanks a lot for putting all the config together and made Developers life easy.

@oscar-g
Copy link

oscar-g commented Nov 3, 2016

@giedrius-timinskis,
I created a quick & dirty redux example, using Ducks, as suggested by @mrmckeb. Let me know if you'd like a pr into your branch

https://github.com/oscar-g/kyt-starter-universal/tree/dev-redux-example

@giedrius-timinskis
Copy link
Author

@oscar-g Looks good! Let's get @mrmckeb to review as well.

@janhoogeveen
Copy link

See: nytimes/kyt#213 (comment)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants