Skip to content

Conversation

@fanny
Copy link
Contributor

@fanny fanny commented Oct 19, 2021

In order to improve our example comprehension, I've decided to group components related into modules. I know this is subject of judgment, but at least I saw this organization pattern many times, so I believe it's well adopted. Now the modules are organized as follows:

I'm totally open to closing this if y'll think it's not useful or change to another interesting organizational structure, so feel free to suggest things.

├── public
├── schema
└── src
    ├── __generated__
    ├── components
    ├── hooks
    ├── pages
    │   ├── IssueDetail
    │   │   └── __generated__
    │   └── Issues
    │       └── __generated__
    └── routing
  • components: Contains foundational components used by other pages (e.g ErrorBoundary, SuspenseImage)
  • hooks: Contains all hooks available on this project
  • pages: Contains the modules for our routes and their own components

I've also created a new component called IssueDetailComment because we were copying-paste its content on IssueDetailComments and IssueDetailRoot

Copy link
Contributor

@voideanvalue voideanvalue left a comment

Choose a reason for hiding this comment

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

Thanks for the pull request @fanny. I like the updated structure.

The files in src/__generated__/ are build artifacts created by relay-compiler and cannot be moved. I can merge this after those changes are reverted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants