Migration from legacy
WIP
The article is in the process of writing
To bring the release of the article closer, you can:
- ๐ข Share your feedback at article (comment/emoji-reaction)
- ๐ฌ Collect the relevant material on the topic from chat
- โ๏ธ Contribute in any other way
๐ฐ Stay tuned!
The article aggregates the experience of several companies and projects on moving to Feature-Sliced Design with different initial conditions
Why?
How much does the move need? "Death by a thousand cuts" and those debt. What is missing? How can the methodology help?
See the talk of Ilya Klimov about the need and procedure for refactoring
What's the plan?
1. Unification of the code base
- โโโ products/
- | โโโ components/
- | โโโ containers/
- | โโโ store/
- | โโโ styles/
- โโโ checkout/
- | โโโ components/
- | โโโ containers/
- | โโโ helpers/
- | โโโ styles/
+ โโโ src/
โโโ actions/
โโโ api/
+ โโโ components/
+ โโโ containers/
โโโ constants/
โโโ epics/
+ โโโ i18n/
โโโ modules/
+ โโโ helpers/
+ โโโ pages/
- โโโ routes/
- โโโ utils/
โโโ reducers/
- โโโ redux/
โโโ selectors/
+ โโโ store
+ โโโ styles/
โโโ App.jsx
โโโ index.jsx
2. Putting together the destructive decoupled
โโโ src/
- โโโ actions/
โโโ api/
- โโโ components/
- โโโ containers/
- โโโ constants/
- โโโ epics/
+ โโโ entities/{...}
+ | โโโ ui
+ | โโโ model/{actions, selectors, ...}
+ | โโโ lib
โโโ i18n/
| # We can temporarily put the remaining segments here
+ โโโ modules/{helpers, constants}
- โโโ helpers/
โโโ pages/
- โโโ reducers/
- โโโ selectors/
- โโโ store/
โโโ styles/
โโโ App.jsx
โโโ index.jsx
3. Allocate scopes of responsibility
โโโ src/
- โโโ api/
+ โโโ app/
+ | โโโ index.jsx
+ | โโโ style.css
โโโ pages/
+ โโโ features/
+ | โโโ add-to-cart/{ui, model, lib}
+ | โโโ choose-delivery/{ui, model, lib}
+ โโโ entities/{...}
+ | โโโ delivery/{ui, model, lib}
+ | โโโ cart/{ui, model, lib}
+ | โโโ product/{ui, model, lib}
+ โโโ shared/
+ | โโโ api/
+ | โโโ lib/ # helpers
+ | | โโโ i18n/
+ | โโโ config/ # constants
- โโโ i18n/
- โโโ modules/{helpers, constants}
โโโ index.jsx
4. Final ?
About the remaining problems and how much it is worth eliminating them
See also
- (Talk) Ilya Klimov-The Rat Race of endless refactoring: how not to let technical debt kill motivation and product
- (Talk) Ilya Azin - Architecture of Frontend projects
- There is also discussed approaches for architecture and costs of refactoring
Was this page helpful?
Your feedback helps us improve the docs