Frameworks Survey — React, Vue, Svelte

কোনটি শিখবেন? কখন কোনটি বেছে নিবেন?

~35 min Intermediate 8 practice problems Live runner

1. Why a Framework?

  • Declarative UI: describe state, not steps
  • Component reuse and isolation
  • Predictable state management
  • Huge ecosystem (forms, routing, animations)
  • Strong job market
Framework শেখার আগে vanilla JS শক্তভাবে শিখুন। তাহলে যেকোনো framework কয়েক দিনে শেখা যাবে — এই কোর্স সেই foundation দিয়েছে।

2. Counter Example — All Three

React

import { useState } from "react";

export default function Counter() {
    const [n, setN] = useState(0);
    return (
        <button onClick={() => setN(n + 1)}>
            count: {n}
        </button>
    );
}

Vue 3 (Composition API)

<script setup>
import { ref } from "vue";
const n = ref(0);
</script>

<template>
    <button @click="n++">count: {{ n }}</button>
</template>

Svelte 5

<script>
    let n = $state(0);
</script>

<button onclick={() => n++}>count: {n}</button>

3. Mental Models

ReactVueSvelte
UI asfunction of statetemplate + reactive refscompiled DOM ops
Re-rendersWhole component on state changeFine-grained reactivityOnly the touched DOM nodes
Bundle~45 KB~35 KB~5 KB (no runtime)
Job market🥇 largest🥈 strong, especially Asia🥉 small but growing
Hiring in BDBy far the largestNiche but growingRare

4. The Reactivity Idea — Sandbox Demo

All three frameworks build on the same foundation: when state changes, the view updates automatically. Here's a 25-line proxy-based mini reactivity system that captures the essence.

reactivity.js
let currentSubscriber = null;

function reactive(target) {
    const subs = new Map();
    return new Proxy(target, {
        get(t, k) {
            if (currentSubscriber) {
                (subs.get(k) ?? subs.set(k, new Set()).get(k))
                    .add(currentSubscriber);
            }
            return t[k];
        },
        set(t, k, v) {
            t[k] = v;
            (subs.get(k) || []).forEach(fn => fn());
            return true;
        }
    });
}

function effect(fn) {
    currentSubscriber = fn;
    fn();
    currentSubscriber = null;
}

const state = reactive({ count: 0 });
effect(() => console.log("render: count =", state.count));
state.count = 1;
state.count = 2;
state.count = 3;

5. How to Pick

Pick React if…

  • You want maximum job openings (especially in Bangladesh)
  • You need React Native for mobile too
  • You have a big team — most engineers know it
  • You want the deepest ecosystem (Next.js, Remix, Tanstack)

Pick Vue if…

  • You like a more "complete" framework (router, store official)
  • Your team comes from HTML/CSS background
  • You're working with Laravel — Vue is the default pairing
Pick Svelte when… you want the smallest bundle (great for landing pages, slow networks), or you've built React/Vue apps and want to write half as much code. SvelteKit is a polished SSR framework.

6. The Recommendation for 2026 Bangladesh

Learn React first — the largest market and the deepest ecosystem. Once you understand it, peek at Vue and Svelte to see how the same problems are solved differently. After ten years in the field, knowing more than one framework is a superpower; on day one, going deep on React is the right move.

7. Glossary (শব্দকোষ)

TermMeaningবাংলায়
ReactMeta's library — UI as a function of state, virtual DOM diffing.Meta-র library — UI = f(state); virtual DOM diff।
VueProgressive framework with reactive refs and SFCs.Reactive ref ও SFC-ভিত্তিক progressive framework।
SvelteCompiler that turns components into direct DOM ops.Compiler — কোডকে সরাসরি DOM ops-এ রূপ দেয়।
JSXJavaScript extension syntax for HTML-like markup in React.React-এ HTML-এর মতো লেখার JS extension।
Virtual DOMLightweight tree React diffs against to compute DOM patches.হালকা tree — React এটির সাথে diff করে।
ReactivityAuto-update of view when underlying data changes.Data বদলালে view আপনাআপনি update।
ComponentReusable, encapsulated UI unit with props/state.Reusable UI unit — props ও state থাকে।
HookReact API like useState / useEffect.React-এর useState/useEffect ইত্যাদি।
SFCSingle File Component — Vue/Svelte's .vue/.svelte file format.Vue/Svelte-এর Single File Component।
SSRServer-Side Rendering — render HTML on the server first.Server-এ আগে HTML render।
মনে রাখুন: তিনটি framework একই সমস্যা solve করে — UI-কে state-এর সাথে sync রাখা। React = বৃহত্তম bazar (Bangladesh-এ অগ্রাধিকার), Vue = সহজ ও complete, Svelte = ক্ষুদ্রতম bundle। Vanilla JS শক্ত হলে যেকোনো framework কয়েক দিনে শেখা যায়।

8. Practice Problems

  1. Without running, predict the React mental model in 3 sentences.
    ✨ Show Answer

    Answer: React renders a component as a function of its state and props. When state changes, React calls the function again, builds a new virtual DOM, diffs against the previous one, and patches only the differences into the real DOM. Hooks (useState/useEffect) attach state and side-effects to a function component.

  2. Why is Svelte's bundle smaller than React's?
    ✨ Show Answer

    Answer: Svelte does its work at compile time. It generates direct DOM-mutation code per component, so there's no virtual DOM, no reconciler, and almost no runtime to ship. React's runtime (the reconciler + scheduler) is a fixed cost in every bundle.

  3. Build a runnable mini-reactivity using a single Proxy.
    ✨ Show Answer

    See section 4 above — paste it into the runner.

  4. Why is "vanilla JS first, framework later" the right learning order?
    ✨ Show Answer

    Answer: Frameworks abstract over DOM, scope, and async work. If you only learned React, you can't tell which behaviour comes from React and which is JavaScript itself. With strong vanilla foundations, every framework becomes "ah, that's how they're solving X" — fast to learn, fast to debug.

  5. In one paragraph, why is React the safest first choice in Bangladesh?
    ✨ Show Answer

    Answer: The Bangladesh market follows global hiring patterns with a lag — and globally React has the largest job pool by a wide margin. Local outsourcing firms (which dominate hiring) standardise on React because clients ask for it. A junior dev who ships a single React project can land interviews in Dhaka, Chittagong and remote globally — Vue and Svelte don't yet open that many doors locally.

  6. Pick a framework for: (a) marketing site, (b) corporate SaaS dashboard, (c) Native mobile.
    ✨ Show Answer

    (a) Svelte/SvelteKit (smallest bundle, best Lighthouse). (b) React (richest component libraries, largest hiring pool). (c) React Native (only choice if your stack is JS).

  7. Sketch a React useEffect that runs once on mount.
    ✨ Show Answer
    useEffect(() => {
        fetch("/api/me").then(r => r.json()).then(setUser);
    }, []);
  8. In one paragraph, when should you avoid frameworks entirely?
    ✨ Show Answer

    Answer: Static landing pages, blog posts, simple forms, and tiny interactive widgets need only vanilla JS — adding React costs 45 KB and a build step for nothing. The Notes SPA you built in Module 30 was the proof: vanilla JS gets you a long way before frameworks pay off.

Summary — Module 39

React, Vue and Svelte solve the same problem: keep UI in sync with state. React owns the largest market; Vue is approachable and complete; Svelte ships the smallest bundle by compiling away the runtime. In Bangladesh, learn React first — then explore.

React, Vue, Svelte — তিনটি একই সমস্যা ভিন্নভাবে solve করে। বাংলাদেশের চাকরির বাজারে React-ই সবচেয়ে নিরাপদ first choice।

Next Module → Capstone: Build & Deploy a Full-Stack App!