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

Change folder structures #9

Merged
merged 3 commits into from
Jan 7, 2018
Merged

Change folder structures #9

merged 3 commits into from
Jan 7, 2018

Conversation

CVarisco
Copy link
Contributor

@CVarisco CVarisco commented Jan 5, 2018

This is the folder structure proposal, proposed at #8.

  • I choose this kind of structure because is more "scoped".
  • I also changed a little bit the naming of files.
  • I don't change the business logic.
  • I add the es2015 preset in the devDependecies
  • I used prettier to lint a little bit the code.

Take this PR like a proposal.
You did a good work and this is not better of you, it is just different 🙂

@alex-saunders
Copy link
Owner

alex-saunders commented Jan 5, 2018

Cheers for the pr :)

I'm open to the idea of keeping actions and reducers inside the container folder but do you think we could keep the <container-name>-reducer.js naming style (and same for actions)? At the moment we could end up with a lot of files all called actions.js + reducer.js which could get a little confusing if multiple are open.

I'm open to disagreement though

@alex-saunders
Copy link
Owner

@CVarisco any thoughts?

@CVarisco
Copy link
Contributor Author

CVarisco commented Jan 6, 2018

Hi @alex-saunders !

It is in that way because every folder should be scoped.
The name of the file that contains the name of the parent folder is unnecessary.
The naming should help developers at the view of the structure.
Let’s read the structure like a sentence when you go down.

What do you think ?

Ps: Also, it is very strange if you have two reducers/actions of different containers open.

@traverse
Copy link

traverse commented Jan 6, 2018

You could also have a look at the react-redux-complete-example which is based on the re-ducks structure.

@alex-saunders Multiple reducers.js files is normally no problem since if you look for [folder-name] you'll get the right reducers and everything else related to the state at least when using the re-ducks structure. So cmd or ctrl + p scripts would give you everything related to scripts e.g. scripts/actions.js, scripts/reducers.js.

@alex-saunders
Copy link
Owner

Sounds like it makes sense to me, thanks @CVarisco and @traverse for the explanations.

I'll get this merged now 👍

@alex-saunders alex-saunders merged commit 0416e12 into alex-saunders:master Jan 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants