hoppula / refire

Declarative Firebase bindings for Redux and React
46 stars 9 forks source link

Great work! #1

Closed ninjasort closed 8 years ago

ninjasort commented 8 years ago

This is really great. Just a few comments on the structure.

Thoughts on removing the components folder altogether and using something like this: http://marmelab.com/blog/2015/12/17/react-directory-structure.html? We know they are components at this point and for scaling up it makes sense to keep everything together by domain.

You could also split out the data bindings and group them into each of the domain-specific folders. For example you could put profile specific bindings in /src/Profile/ProfileBindings.js. This way you have a nice group of the following:

/src
  /Profile
    /Profile.js
    /Profile-spec.js
    /ProfileContainer.js
    /ProfileActions.js
    /ProfileReducer.js
    /ProfileReducer-spec.js
    /ProfileBindings.js
hoppula commented 8 years ago

Thanks!

I assume you mean the directory structure in refire-forum repository?

I agree that it would be best to move everything under /src/components to /src level. I've already placed most of related components under /src/components/*, e.g. all Thread related components at /src/components/Thread, but I agree that it'd make things simpler if all components and their related actions and reducers resided in their domain specific folders.

I've kept bindings in one file so far because it's easy to go through them quickly (they're like react-router routes) and avoid duplicating bindings. Your idea is good though, at some point they must be splitted to separate files.

I've also been thinking about the possibility to move bindings and routes to the folder with their related components, it would allow creating reusable mini-apps that could be utilized in any app. It would require some changes in refire, but it should be fairly quick to implement.

ninjasort commented 8 years ago

Yes, that's a good idea. I think for the sake of verbosity, it would be awesome to split the bindings and routes up next to their respective components. Also, have you tried https://github.com/jsstyles/react-jss for styling?