Refactor Sessions Summary #845
Replies: 4 comments 3 replies
-
A summary of what we covered in steps: Session 1
Session 2
Session 3
Session 4 (Just did on my own)
|
Beta Was this translation helpful? Give feedback.
-
Initial Refactor Issues: This covers the majority of current guild component that we will split up into their own wrappers and components. The title refers to the current folder of the component inside the old-components/Guilds/ folder currently on v1.1-beta |
Beta Was this translation helpful? Give feedback.
-
We have a few things to clarify and define some rules regarding refactors. JS is of course very opinionated, none are wrong, we just need to define rules. The first is how we want to nest smaller components in a component folder. This is one approach we merged for ActionModal:
Next, how should we split up styles? |
Beta Was this translation helpful? Give feedback.
-
Main conclusion we came to for now at least is to go with the structure in ActionsModal as described by Milton. Instead of describing it in detail here I think it makes most sense to just refer to the source code. It's a very understandable intuitive structure. We will have root component files, styles, fixtures and stories. Then a components folder with a root index file and individual files for each sub-component each with its own styles and index file. |
Beta Was this translation helpful? Give feedback.
-
Our refactors sessions were a great success and we got a lot of work done going over these
This is the PR we can use as a reference for expected changes.
#822
It looks like a lot but most changes are moving files and yarn lock, make sure you take a read through and understand the structure and definition of done
And if there is anything you think we should improve then let us know
Definition of done
For unit testing since we are aiming for no business logic inside the components we should be fine to do simple snapshot tests like in this PR. If you need to mock data fetching then probably you need to split things up more. For the wrappers we are also aiming not to need to test these as the bulk of logic should be in hooks which are also tested (I believe we have some examples of this coming soon)
This doesn't need to be the end of these mobbing sessions, we can keep them up, just let us know in the chat when there is anything you are not sure or want feedback on refactoring.
We don't yet have storybook, we will add an example at some point soon
Beta Was this translation helpful? Give feedback.
All reactions