Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs update & guide to where code lives #1738

Merged
merged 1 commit into from
Jul 13, 2021
Merged

Docs update & guide to where code lives #1738

merged 1 commit into from
Jul 13, 2021

Conversation

jameskerr
Copy link
Member

@jameskerr jameskerr commented Jul 12, 2021

Fixed some outdated docs, but mostly wanted to create some guiding principles on where code goes in our codebase going forward.

This is the text I've added to the "Codebase Walkthrough" wiki page:

Directory Structure

├── app (renderer code)
│   ├── core (generic shared code)
│   ├── features (larger app features)
│   ├── initializers (code run on startup)
│   ├── plugins (plugin code)
│   ├── routes (entry points for each url)
│   ├── state (ui state)
│   ├── window-a.tsx (window entry points)
│   └── window-b.tsx
├── electron (main process code)
└── ppl (licensed code)

Import Rule: Only import modules from "core", "state", or your own descendants.

Exceptions:

  • Components in "routes" can import modules from "features".

Bibliography

https://dev.to/bytebodger/how-i-organize-react-projects-1f36

https://addyosmani.com/largescalejavascript/

https://www.pluralsight.com/guides/how-to-organize-your-react-+-redux-codebase

https://ryanlanciaux.com/blog/2017/08/20/a-feature-based-approach-to-react-development/

https://www.robinwieruch.de/react-folder-structure

Copy link
Contributor

@mason-fish mason-fish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good stuff, I'm on board! Thanks for compiling the inspirations too, it's very helpful to have several perspectives on this.

@jameskerr
Copy link
Member Author

Great!

@jameskerr jameskerr merged commit 05643d3 into main Jul 13, 2021
@jameskerr jameskerr deleted the folder-structure branch July 13, 2021 21:36
philrz added a commit that referenced this pull request Jul 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants