A module which represents part of a Reaat app could export an array of routes and a reducer.
export {default as routes} from './routes'
export {default as reducer} from './store/reducer'
The top level application can take these exports and collect them together into the root routes def and the root reducer.
source
├── app
│ ├── components
│ │ ├── SimpleDonut
│ │ │ ├── __tests__
│ │ │ │ └── SimpleDonut-test.js
│ │ │ └── index.js
│ │ └── View
│ │ └── index.js
│ ├── lib
│ │ ├── getEnv
│ │ │ └── index.js
│ │ └── resolveAsset
│ │ └── index.js
│ ├── modules
│ │ ├── beneficiaries
│ │ │ ├── store
│ │ │ │ ├── __tests__
│ │ │ │ │ └── factories.js
│ │ │ │ ├── helpers
│ │ │ │ │ └── index.js
│ │ │ │ └── reducer
│ │ │ │ └── index.js
│ │ │ └── index.js
│ │ ├── campaigns
│ │ │ ├── store
│ │ │ │ ├── __tests__
│ │ │ │ │ └── factories.js
│ │ │ │ ├── helpers
│ │ │ │ │ └── index.js
│ │ │ │ └── reducer
│ │ │ │ └── index.js
│ │ │ └── index.js
│ │ ├── donations
│ │ │ ├── store
│ │ │ │ ├── __tests__
│ │ │ │ │ └── factories.js
│ │ │ │ ├── helpers
│ │ │ │ │ └── index.js
│ │ │ │ └── reducer
│ │ │ │ └── index.js
│ │ │ └── index.js
│ │ ├── errors
│ │ │ └── index.js
│ │ ├── fundraiserCampaigns
│ │ │ ├── components
│ │ │ │ ├── FundraiserSummary
│ │ │ │ │ ├── __tests__
│ │ │ │ │ │ └── FundraiserSummary-test.js
│ │ │ │ │ └── index.js
│ │ │ │ ├── FundraisingProgress
│ │ │ │ │ ├── __tests__
│ │ │ │ │ │ └── FundraisingProgress-test.js
│ │ │ │ │ └── index.js
│ │ │ │ ├── Summary
│ │ │ │ │ └── index.js
│ │ │ │ └── __tests__
│ │ │ │ └── helpers.js
│ │ │ ├── routes
│ │ │ │ ├── Show
│ │ │ │ │ ├── __tests__
│ │ │ │ │ │ └── Show-test.js
│ │ │ │ │ └── index.js
│ │ │ │ ├── __tests__
│ │ │ │ │ └── helpers.js
│ │ │ │ └── index.js
│ │ │ ├── store
│ │ │ │ ├── __tests__
│ │ │ │ │ └── factories.js
│ │ │ │ ├── actions
│ │ │ │ │ ├── __tests__
│ │ │ │ │ │ └── fetchFundraiserCampaign-test.js
│ │ │ │ │ └── index.js
│ │ │ │ ├── helpers
│ │ │ │ │ └── index.js
│ │ │ │ ├── reducer
│ │ │ │ │ ├── list
│ │ │ │ │ │ └── index.js
│ │ │ │ │ ├── show
│ │ │ │ │ │ └── index.js
│ │ │ │ │ └── index.js
│ │ │ │ ├── constants.js
│ │ │ │ └── index.js
│ │ │ └── index.js
│ │ └── fundraisers
│ │ ├── store
│ │ │ ├── __tests__
│ │ │ │ └── factories.js
│ │ │ ├── helpers
│ │ │ │ └── index.js
│ │ │ ├── reducer
│ │ │ │ └── index.js
│ │ │ └── index.js
│ │ └── index.js
│ ├── routes
│ │ └── index.js
│ ├── store
│ │ ├── reducer
│ │ │ └── index.js
│ │ ├── constants.js
│ │ └── index.js
│ ├── index.js
│ └── stats.js
├── client
│ ├── index.js
│ └── stats.js
├── config
│ ├── clientEnvRequirements.js
│ └── index.js
└── server
├── components
│ └── Document.js
├── lib
│ └── renderDocument.js
├── index.js
└── stats.js
I don't think I have any feedback that hasn't already been raised, e.g. Making sure most purely UI components reside as high as possible in the tree in that generic
components
dir. On face value it appears fairly similar to the structure used bynexus
, I would definitely like to throw it in to some projects and get a feel for it going forward. 👍I guess the only other thing worth raising (which has been raised before) is how do we feel about using the ducks pattern for our Redux stores/actions/constants? Is there a particular reason you might have chosen to avoid that here @brad? I personally found it quite a nice pattern but honestly I'm not rolling with a lot of experience, just curious of your thoughts.