From my notes

Scaling up

Questions and flashcards from your notes on the Vue docs' Scaling Up chapter — why single-file components need compiling, how Vite's dev server works, code splitting, Vite 8 and Rolldown, Vue Router links, views, guards and reused instances, NuxtLink prefetching, global state on a server, test types, SSG versus SSR, and hydration mismatches from fetching and invalid HTML — with a fact check of the notes.

Written from your scaling up note. The matching study page is Scaling up — SFC, tooling, routing, state, testing, SSR.

Know

  • Tooling: the SFC compile step, native-ESM development, route-level chunks, and where Rolldown stands in 2026.
  • Routing: what RouterLink and RouterView do, what a guard can return, why reading route.params once goes stale, a router with a lazy route, and NuxtLink's prefetch default.
  • State: why module-level state is dangerous on a server and what Nuxt uses instead.
  • Testing and rendering modes: unit, component and end-to-end tests, SSG pages that still hydrate, and two hydration mismatch causes.

Fact check of your notes

Gotcha· Rolldown already shipped

The note describes Vite as esbuild in development and Rollup in production, with Rolldown as the future. Since Vite 8 (March 2026) Rolldown handles both, and Nuxt 4.5 builds with it. Rolldown is the bundler inside Vite, not a "superpowered Vite".

Gotcha· NuxtLink prefetches on visibility by default

"Also prefetches the chunks on hover" describes the opt-in prefetchOn: 'interaction'. By default NuxtLink prefetches when the link scrolls into view.

Gotcha· Guards run per navigation

Navigation guards run before each navigation (beforeEach, beforeEnter, onBeforeRouteLeave), not before each component.

Gotcha· SSG pages are interactive

"No dynamic functionality" is not right: SSG pages hydrate and then behave like any client-side app. Only the pre-rendered HTML and data are fixed at build time.

Gotcha· Fetch with useFetch, not useState

For the $fetch-in-setup mismatch, the fix is useFetch or useAsyncData, which fetch once on the server and pass the result through the payload. useState is for shared state.

Gotcha· Global state on a server leaks between users

"A controlled memory leak" undersells it: on a server, module-level state is shared by every request, so one user's data can appear in another user's page.

Gotcha· Small slips

Routes are defined in a script module such as router.ts, not router.vue. The example's const currentUserId = route.params.id goes stale when the same component is reused for another id.

Exercise

Exercise
  • Build /users/:id with plain Vue Router, log route.params.id read once and through a computed, then navigate from user 1 to user 2.
  • Run nuxt analyze on a project and find the chunk for one lazy route.
  • Write one unit test, one component test and one Playwright test for the same feature, and note what each one could miss.

Be able to say

Be able to say· Why is Vite fast in development, and what changed with Vite 8?

"In development Vite does not bundle the app: it serves source files as native ES modules and transforms each one only when the browser requests it, with dependencies pre-bundled once, so start-up and hot updates stay fast as the app grows. For production it bundles everything into chunks, splitting at dynamic imports such as lazy routes. Until Vite 7 that meant esbuild for some dev work and Rollup for builds; Vite 8 runs Rolldown, a Rust bundler, for both, which removes dev and production differences and speeds up builds."

Be able to say· How does client-side routing work in Vue?

"Vue Router keeps the current route in a reactive reference. RouterLink renders a real <a> but intercepts clicks and updates the URL with the History API instead of loading a new page, and RouterView renders the component matched for that URL. Guards run before each navigation and can cancel or redirect. Lazy routes use dynamic imports so each page is its own chunk. One trap: the same component instance is reused when only params change, so values must be derived reactively from the route. Nuxt builds the routes from pages/ and its NuxtLink prefetches linked pages when they come into view."

Your notes

Open in Notes

Nothing yet. Notes filed here show up on this page and the section overview.