Skip to content
This repository has been archived by the owner on Sep 11, 2018. It is now read-only.

Feature/Self Contained Apps (SCAs) #682

Closed

Conversation

alexhayes
Copy link
Contributor

This is something that I've been doing for a while now and it's not uncommon to the way a lot of frameworks are structured, for good reason. As outlined in the README;

The idea of a Self Contained App (SCA) is that you can keep everything specific to an section of your project within the one directory and not have pieces spread out all over the file system. This partitioning is similar to the concept of an app in Django (among others).

There are a number of advantages to using SCAs;

  • Less spread of naturally grouped items across the project file system.
  • Easier to code split the project.
  • Refactoring becomes much easier because everything is contained in the SCA.
  • Import using relative paths within the SCA rather than nested folders from the project root.
...
...
├── src                      # Project source code
|   ├── apps                 # Split your project up into Self Contained Apps
|   │   └── home             # Home app
|   |       ├── components   # Home app React Components (generally Dumb components)
|   |       ├── views        # Home app components that live at a route
|   |       ├── tests        # Home app unit tests
|   |       ├── reducers.js  # Home app Redux reducer
|   |       └── routes.js    # Home app ReactRouter Routes
...
...

Happy to squash down to a single commit if desired but my intention was to open this so that the feature could be discussed with possible changes.

@alexhayes
Copy link
Contributor Author

And obviously I'll fix up the tests :)

@justingreenberg
Copy link
Contributor

this is great—i'm working on something very similar. i will open a PR later tonight when i have a few minutes... @davezuko any initial reaction to this concept?

quick overview...

  • fractal hierarchy, kinda like SCA lite
    • route-driven project structure
    • components, actions and reducers are are bundled by route (webpack code splitting)
  • HMR is handled by webpack (remove react-transform from development builds)
  • remove redux devtools packages and components (store syncs with chrome extension)

update: conversation moved to #684 @alexhayes would love your thoughts

@justingreenberg justingreenberg mentioned this pull request Apr 1, 2016
17 tasks
@dvdzkwsk
Copy link
Owner

dvdzkwsk commented Apr 5, 2016

@alexhayes this is great, thanks for the contribution! To contain the discussion, I suggest we all contribute to #684.

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