Frontend spectrum is changing rapidly. As new changes arrive, we have to be open to adopting new and better patterns and libraries. Learn about how the JavaScript scene has been evolving over the years.
4. JS Modules in Brief
● ES6 syntax + New Features
● Creating smaller functions is
easy
● Default exports / Named
exports
● Import creates immutable
bindings
5. JS Modules to Components
● One component should focus on one
section of the UI.
● Shouldn’t access another’s html
directly.
● Encapsulates its Output(html), Style
(css) and Functionality (javascript).
● Each component has some way to
interact with others.
6. JS Modules to Components
● Separation of concerns
● Major framework (React, Angular, Vue
or <insert your framework here>)
use this concepts
7.
8. Service Layers
● How to make our components communicate with the backend?
● Building boundaries with modules
● Each task needs to be encapsulated
● The component should not know more than what it requires
● Centralizes external access to data and functions
17. Middleware Pattern
● Middlewares are written to be
composable, meaning that multiple
middleware functions can be run one
after the other
● Example: A logging middleware
● Popular Example: redux-thunk (dispatch
side-effects)
19. All That Aside: How do we
structure all these
patterns?
Early
days
Today
20. Structuring The Modules
● Better separation of concern
● Feature based
● Components bundled together
● Easy to understand (but you need to know a lot more)
26. Conclusion
● The JavaScript ecosystem is ever changing
● Adopt new changes along the way (not
necessarily follow the hype)
● JavaScript is moving to a functional /
modular approach with better frameworks,
libraries and build tools
● The ecosystem is getting better
● Cope along, follow the community