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