Web Technologies 2026 · BiUH · Lesson 6
What they are · why they exist · server and client · which ones · why we use Vue
Six questions, in order
| What is a framework? | and how it differs from a library |
| Why do we need one? | the real problem — and when we don't |
| Where does the code run? | your laptop, the server, the browser |
| Which ones exist? | a short history and today's field |
| How do they compare? | the same button, four times |
| Why Vue? | Evan You, and the ecosystem we will use |
The second deck today — Vue · Getting Started — is the hands-on part.
Lesson 4, the header and the footer
You have already
built part of a framework.
nav.html, six lines of fetch, and every
page got the same header. One piece, defined once, used everywhere.
That is a component — the first idea every framework is built on. We said then: "Frameworks are largely this idea, made faster and safer." Today we find out what the rest is.
The one distinction worth remembering
A toolbox. You decide the plan, and pick up a tool when you need it.
jQuery, a date library, a chart library.
Your code is in charge.
A floor plan. The rooms are decided — you fill them in.
Vue, React, Angular, Svelte.
The framework is in charge. It runs your code when it decides it is time.
The jargon for this is "inversion of control". The floor plan is the useful picture.
So what is a framework, really?
Somebody else's decisions about how an app is built — made before you start.
Every decision made for you is one you can no longer make differently.
Why they exist
Drawing the page is easy.
Keeping it right is the hard part.
The data changes. Every place on the screen that shows it has to change too — every time, without exception.
A like button, in plain JavaScript
let likes = 0; button.addEventListener('click', () => { likes++; button.textContent = '♥ ' + likes; // the button badge.textContent = likes; // the counter in the header document.title = likes + ' likes'; // the browser tab // a fourth place next month? forget it here, and the screen lies });
You tell the browser how to change, step by step. Fine for one button — a shop with a cart, a filter and a login has hundreds.
The same button, in Vue
<script setup> import { ref } from 'vue' const likes = ref(0) </script> <template> <button @click="likes++">♥ {{ likes }}</button> <span class="badge">{{ likes }}</span> </template>
ref(0) makes a value Vue watches. Change it, and every
{{ likes }} updates. A fourth place is one more {{ likes }}.
This is reactivity — the second idea every framework is built on.
Two ways of telling a computer what you want
"Left at the lights, second right, stop after the bank."
Plain DOM code: you give every step. One wrong turn and you arrive somewhere else.
You type the address into DiDi. The driver works out the route.
Vue: you say what the screen should show. Vue works out which parts of the page to change.
HTML and CSS were always declarative. Frameworks make JavaScript feel the same.
What you get
| Components | a page built from pieces you write once — your nav.html, done properly |
| Reactivity | change the data, the screen follows |
| Routing | many pages, one app — no full reload between them |
| Tooling | a dev server, instant reload, a build that makes files small |
| Conventions | everyone puts things in the same places — teammates and the AI can read your code |
What it costs — be honest about this
| A build step | your files no longer run as written — a tool translates them first |
| Many packages | a fresh Vue project downloads about 175 packages — code from many strangers — into node_modules |
| More JavaScript | every visitor's phone downloads and runs the framework too — about 90 KB before your own code |
| Change | versions move, examples on the internet go out of date — so does the AI |
| One more layer | when it breaks, you need HTML, CSS, JS and the framework to find out why |
The part most tutorials leave out
A four-page website
does not need a framework.
A framework earns its place when there is state: data that changes, is shown in many places, and is shared between pages.
Being able to say "I did not use one, and here is why" is a good answer in your project presentation.
Practise the decision
| The site | Framework? |
|---|---|
| A portfolio: four pages, text and photos | No — HTML and CSS are the right tool |
| A restaurant: menu, opening hours, map | No — unless the menu changes daily from a database |
| Your quote collection with search, likes, filters | Maybe — this is where it starts to pay |
| A shop with a cart that follows you across pages | Yes — shared state is the whole job |
| A dashboard, a chat, a game | Yes — the screen changes constantly |
| A WeChat Mini Program | Yes — and Vue can build one (more later) |
The question from "What the Web Is", one more time
Where does the work happen?
Frameworks are where this question stops being history and becomes a setting in a config file. So we answer it properly.
Not two places — three
Vite turns .vue files into plain .js and .css.
Happens once, before anyone visits.
Who sees it: only you
Answers each request. Reads the database, checks passwords, makes or sends HTML.
Node, PHP, Python, Java…
Who sees it: nobody outside
Runs your JavaScript. Clicks, state, changes to the page.
On a phone you have never seen.
Who sees it: everyone
"Client" is the browser. "Server" is the machine that answers. The build is the one people forget.
So what belongs where?
Rule of thumb: if it must be trusted, it happens on the server. If it must be fast, it happens in the browser.
The security rule that follows
Everything you send
to the browser is public.
The AI will happily put a secret key in client code if you ask it to "just make it work". This is where you say no.
Somebody has to turn data into HTML
SSG · built once
The HTML exists before anyone asks. The server just sends files.
Your four pages. Fast, cheap, nothing to break.
SSR · per request
The server builds the HTML for each visitor, from the database.
PHP in 2005. Nuxt and Next.js today.
CSR · SPA
The server sends an empty page and a JavaScript file. The browser builds everything.
A fresh Vue project, by default.
SSR + hydration
The server sends finished HTML. Then JavaScript wakes it up and takes over.
The course website works like this.
"SPA" means single-page application: one HTML page, and JavaScript swaps what is inside it.
The same page, delivered two ways
<body>
<header>…</header>
<main>
<h1>Quotes</h1>
<article class="quote">
<blockquote>…</blockquote>
</article>
<!-- all twenty -->
</main>
</body>
<body>
<div id="app"></div>
<script type="module"
src="/assets/index-4f2a.js">
</script>
</body>
<!-- that is all. JS builds -->
<!-- everything you see. -->
What an empty page costs
That is why server rendering came back — and why Nuxt exists.
Remember your Open Graph image from the project deck? A WeChat link preview reads the HTML. It does not wait for your JavaScript.
Try it now · two minutes
View sourceCtrl+U · Mac ⌥⌘U |
what the server sent — before any JavaScript ran |
Inspect → ElementsF12 · Mac ⌥⌘I |
the page as it is now — after JavaScript changed it |
Compare both on your own site, then on webtech.landrock.io. Where do they differ?
Your nav.html header is a small client-rendered part: in View source the <header> is empty. In Elements, it is full.
The site you open every week
<a v-for="l in materials.lessons" :href="l.href"> {{ l.title }} </a>
v-for.Server-rendered for speed and link previews, Vue in the browser for everything you click. That is the hybrid.
The pendulum, again
Every swing solved the last one's problem. None of them is "correct" — each is a trade.
One more piece you need today
2009, Ryan Dahl took the JavaScript engine out of Chrome and made it run on any computer.
The same language on both sides. Nuxt and Next.js servers are Node.
Vite, npm, the build — all Node. Even a site with no server needs Node on your laptop.
In the 2025 Stack Overflow survey, Node.js was the most used web technology of all — 48.7% of developers.
Twenty years in eight lines
The field today
The most used by far. Writes HTML inside JavaScript (JSX).
Huge job market. Many ways to do everything.
HTML templates you already know. Gentle to learn, complete ecosystem.
Very strong in China.
Everything built in, one right way. TypeScript required.
Banks, big companies, big teams.
A compiler: the framework mostly disappears at build time.
The one developers most enjoy.
A framework draws the page. A meta-framework also decides where.
| Framework | Meta-framework | What it adds |
|---|---|---|
| React | Next.js | a server · server rendering · pages from files and folders · API routes · one command to deploy |
| Vue | Nuxt | |
| Svelte | SvelteKit | |
| Angular | built in · Analog |
Start with the framework. Reach for the meta-framework when you need a server or link previews — not before.
Stack Overflow Developer Survey 2025 · "which did you use this year?"
A worldwide, mostly Western, English-speaking survey. In China, Vue’s share is far higher. jQuery is mostly old code nobody has rewritten.
The fairest comparison there is
import { useState } from 'react'; export default function Likes() { const [likes, setLikes] = useState(0); return ( <button onClick={() => setLikes(likes + 1)}> ♥ {likes} </button> ); }
<script setup> import { ref } from 'vue' const likes = ref(0) </script> <template> <button @click="likes++"> ♥ {{ likes }} </button> </template>
<script> let likes = $state(0); </script> <button onclick={() => likes++}> ♥ {likes} </button>
import { Component, signal } from '@angular/core'; @Component({ selector: 'app-likes', template: ` <button (click)="likes.update(n => n + 1)"> ♥ {{ likes() }} </button>`, }) export class Likes { likes = signal(0); }
Same idea in all four: a value, a button, a click that changes it. Only the spelling differs.
Side by side
| React | Vue | Angular | Svelte | |
|---|---|---|---|---|
| Backed by | Meta | independent team, sponsors | Vercel employs its creator | |
| You write | HTML inside JS (JSX) | HTML templates + JS | HTML templates + TypeScript classes | HTML + JS, compiled |
| Size of the idea | small core, choose the rest | core + official router, state, build | everything included | small, compiler does the work |
| Learning curve | medium | gentle | steep | gentle |
| Server sibling | Next.js | Nuxt | built in | SvelteKit |
| Mobile apps | React Native | uni-app, Capacitor | Ionic | Capacitor |
| Updates the page by | comparing a virtual copy | tracking what changed | signals + change detection | code the compiler wrote |
What the comparison actually shows
They are converging.
Components. A reactive value — ref, $state, signal, useState.
A compiler. A server sibling. All four now.
The differences left are taste, ecosystem, and who pays for it.
Learn one well. The second one takes a week — because the ideas are the same.
A question worth asking of any tool
| React | Meta — built for Facebook and Instagram, and steered by their needs |
| Angular | Google — used inside Google, on Google's schedule |
| Svelte | a community project; Vercel, a hosting company, pays its creator |
| Vue | no single company — an independent core team, paid by sponsors and companies that use it |
"On someone else's land", from the Web 2.0 slide, applies to your tools too. Nobody can switch Vue off by changing strategy.
The decision for this course
We use Vue.
First, the person behind it.
The person behind it
“I figured, what if I could just extract the part that I really liked about Angular and build something really lightweight.” — Evan You, on why he started
Why Vue, for this course and this room
<script> tag on one page — or a whole app. You choose how far.cn.vuejs.orgThe pieces, and the job each one does
Today: Vue, Vite, Vue Router, DevTools, the extension. Pinia and Nuxt when a project needs them.
Built here, used everywhere
| Element Plus | ready-made buttons, forms, tables — started at Ele.me |
| Vant | components for mobile pages — from Youzan |
| Ant Design Vue | Ant Group's design system, rebuilt for Vue by the community |
| Naive UI | a complete component library, Chinese-led |
| uni-app | one Vue codebase → WeChat Mini Program, Alipay, Douyin, Android, iOS and the web |
The WeChat Mini Programs from "What the Web Is" — many of them are written in Vue, through uni-app.
Take these with you