iansinnott / react-static-boilerplate

A boilerplate for building static sites with Webpack 2, React and React Router
107 stars 16 forks source link

add redux support and implement small example #9

Closed scherler closed 8 years ago

scherler commented 8 years ago

The PR contains a complete working version with a redux store and static html export. The last was a bit tricky but in the end I found a way to workaround the invocation of the store/provider.

redux state is created using Immutable and further hooked up https://github.com/zalmoxisus/redux-devtools-extension for dev experience.

iansinnott commented 8 years ago

Thanks for the PR @scherler. It would be nice to be able to have Redux out of the box, I really like Redux as well, but not everyone is using Redux. Since this is a boilerplate I'd like to avoid adding any frameworks to it other than React itself.

But it would be great to be able to add redux very easily. Maybe a separate branch? Maybe a yeoman generator?

I'm definitely open to suggestions but I'd like to avoid adding Redux as a hard dependency to master.

scherler commented 8 years ago

Yeah, I understand what you mean, maybe in the spirit of https://github.com/iansinnott/react-static-boilerplate/issues/5 but I must admit I am not sure how to do that ATM. The main problem is that you have to wrap the App component with the redux store to inject it in the App as global meaning one would need to do the "wiring" outside of the app in the dependency but still it would need to be sufficient extensible for the user to add their logic. as said I have to think about it.

You can merge the PR into a branch if you want, I am not sure how I can open a PR against a new branch of your rep.

iansinnott commented 8 years ago

OK, I'll close this PR for now but it can server as a reference to anyone else who wants to integrate with Redux. I'll add a note to the readme. Thanks @scherler

bdougie commented 8 years ago

+1 For not merging this, but referencing to it instead.