Back to articles
Component-Based MVC

Component-Based MVC

via Dev.to Webdevcengiz ilhan

Modern component architecture for server-side MVC applications In the modern frontend world, large bundle files are gradually being replaced by component-based architectures. Thanks to modern frontend frameworks like React and Vue , the following approach has become common: UI is built from components each component owns its own code only the necessary code is loaded However, many server-side MVC applications still follow the older approach: site.css bundle.js Over time these files grow larger and create several problems: unused CSS unnecessary JavaScript hard-to-debug global code risky refactoring In this article, I will describe a simple approach to solve this problem in MVC applications: Component-Based MVC The Idea In Component-Based MVC, a page is composed of a layout and UI components. Page = Layout + Components Each component contains its own HTML, CSS, and JavaScript . And the most important rule: If a component is not rendered, its assets are not loaded. This prevents unnecess

Continue reading on Dev.to Webdev

Opens in a new tab

Read Full Article
2 views

Related Articles