photo by Matías Santana
JQuery /Prototype |
---|
Cross-browsers API |
Animations |
2010-2020'
2000-2010'
<2000
Backbone |
---|
MVP |
Component-level State management |
Templating |
XHR |
ES5 |
Angular / React era |
---|
MVV, MV* |
Component pattern (Separation of Concerns) |
Application-level State management |
HTML5 |
ES6-7 (modules, async) |
Modern front-end is complex software
Easy to navigate 🧭
Easy to change 🔧
Easy to test 📏
Stable 🏗
Maintainable React app is about code that is:
Project:
[Domain]|[Context]|ComponentName|[Type]
Part surrounded by “[]” are optional.
[Domain]|[Context]|ComponentName|[Type]
Part surrounded by “[]” are optional.
File-based
Folders-based
Choose a testing strategy
Make your components testable
End-to-end tests: whole application
Integration tests: components interactions
Unit tests: component
Unit tests:
Business logic
Cypress
Enzyme
Jest
1. Staying up-to-date
1. Staying up-to-date
2. Properly reviewing your contributions
2. Properly reviewing your contributions
🧭 Naming is a good exercice to help divide your app in meaningful components
🔧 Hooks doesn't mean "fat components", decompose your components wisely
📏 Make your component testable and choose a test strategy to enhance refactoring
🏗 Keep your app stable by stay up-to-date and having code easy to review