Skip to content

๐Ÿ–ผ๏ธ Frameworks & Runtimes

Frameworks are temporary, but architectural patterns (Componentization, One-way Data Flow, Reactive Programming) are permanent. A Programmer understands the โ€œmagicโ€ under the hoodโ€”be it the Virtual DOM, fine-grained reactivity, or ahead-of-time compilationโ€”to debug performance issues that abstractions hide.


โš›๏ธ React (The Library that acts like a Framework)

Section titled โ€œโš›๏ธ React (The Library that acts like a Framework)โ€

React revolutionized the web with the Virtual DOM and a declarative, component-based approach.

  • Core Philosophy: โ€œUI as a function of State.โ€ $UI = f(state)$.
  • Reactivity Model: Virtual DOM Diffing. When state changes, React creates a new virtual tree, compares it to the old one, and calculates the minimum set of changes to apply to the real DOM.
  • Programmer Insight: React is unopinionated. This gives you freedom but requires you to make decisions on routing, state management, and styling, which can lead to โ€œArchitecture Fatigue.โ€

Vue strikes a balance between the structure of Angular and the flexibility of React.

  • Core Philosophy: Approachability and versatility. It uses a template-based system that is valid HTML.
  • Reactivity Model: Proxy-based observation (Vue 3). It tracks dependencies automatically. When a piece of data changes, only the components that โ€œsubstantiallyโ€ rely on that data are re-rendered.
  • Programmer Insight: Vueโ€™s โ€œSingle File Componentsโ€ (.vue) provide an excellent separation of concerns while keeping the logic, template, and styles tightly coupled for maintenance.

A comprehensive, opinionated framework maintained by Google.

  • Core Philosophy: โ€œBatteries included.โ€ It provides a standard way to do everything: Dependency Injection, Routing, Forms, and HTTP.
  • Reactivity Model: Historically Zone.js (dirty checking), but moving toward Signals for fine-grained reactivity.
  • Programmer Insight: Angularโ€™s strictness is its strength in large teams. It forces a consistent structure, making it easier for 50+ developers to work on the same codebase without it turning into โ€œspaghetti.โ€

Svelte shifts the work from the browser to a compile-time step.

  • Core Philosophy: No Virtual DOM. Svelte compiles your code into highly efficient, vanilla JavaScript that surgically updates the DOM.
  • Reactivity Model: Compiler-driven. It transforms assignments (like count += 1) into direct DOM updates during the build process.
  • Programmer Insight: Svelte produces the smallest bundles and the fastest โ€œinitial loadโ€ performance, making it ideal for low-power devices and performance-critical applications.

FeatureReactVueAngularSvelte
Learning CurveModerateLow/ModerateHighLow
State ManagementExternal (Redux, Zustand)Built-in (Pinia)Built-in (Services/RxJS)Built-in (Stores)
PerformanceHigh (VDOM)High (Optimized VDOM)High (AOT)Extreme (Compiled)
ScalabilityHigh (Eco-system)HighVery High (Strictness)High

  • Virtual DOM (React/Vue): Efficient, but has a โ€œmemory taxโ€ because the browser must keep a copy of the UI in RAM to perform the diff.
  • Signals/Fine-Grained (Svelte/Solid/Angular): Updates only the specific node that changed. This is the current trend in frontend engineering to reduce CPU overhead.

A Programmer doesnโ€™t just build a โ€œSingle Page Appโ€ (SPA). They choose the rendering strategy:

  • SSR (Server-Side Rendering): Better SEO and faster perceived performance.
  • SSG (Static Site Generation): Best for blogs/docs; zero backend cost at runtime.
  • Hydration: The process where the static HTML sent by the server โ€œwakes upโ€ and becomes an interactive JS app. (Warning: This is often the biggest performance bottleneck in modern web apps).

For massive organizations, splitting the frontend into independent, deployable โ€œmicro-apps.โ€

  • Programmerโ€™s Strategy: Use Module Federation to share components between different frameworks or teams without duplicate loading of libraries.

๐Ÿ’ก Note: Donโ€™t get stuck in โ€œFramework Zealotry.โ€ If you understand Web Components, Browser APIs, and CSS Fundamentals, you can switch between these frameworks in a week. The framework is just the syntax you use to manipulate the DOM.