LLearnCode
Academy/web-systems/Framework mental models

beginner · 23 minute study

Ask where and when this code runs

The same JavaScript syntax can run during a build, on a request server or inside a browser. Confusing those locations creates broken builds and misplaced trust.

Loading progressEvidence grows with practice
Useful preparation · 1 prerequisite

Use this as a map, not a lock. If these ideas are familiar, continue.

First, build a mental model

A runtime supplies capabilities. A browser has a document and user input; a build process emits files; a trusted request runtime can make private decisions for each request.

  1. Label both location and time: build-time execution is different from per-request execution even if both happen outside the browser.
  2. Browser modules can use browser APIs when actually running in the browser. Client Components may also be prerendered, so reading window during module evaluation or initial render is not automatically safe.
  3. A Server Component can run at build time for a static route. Its name alone does not imply there is a server available after deployment.
  4. Anything serialized into HTML, component data or a JavaScript bundle is delivered to the user. A server-side origin does not make emitted data private.
Read the codejson · educational example
{
  "build": ["read public curriculum", "emit HTML and assets"],
  "requestServer": ["verify actor", "authorize protected write"],
  "browser": ["handle pointer input", "save local practice history"]
}
  1. Before hosting

    The build reads safe curriculum data and produces files that can be served repeatedly.

  2. At a protected request

    A live trusted runtime would verify identity and authority; an exported HTML file cannot perform that private decision.

  3. In the learner's tab

    JavaScript handles input and local progress. The learner controls that browser and its storage.

Production thinking

Take this beyond the example.

Draw execution boundaries before choosing libraries or hosting. LearnLab's public curriculum and browser-local learning fit static hosting; a private write API would need a separate justified trusted runtime.

Sources and further reading

Your evidence

unseen is a local learning signal, not a credential or proof of production competence.

Explain the mental model, then explicitly acknowledge it. Opening a page is not evidence.

Supported retries can complete this lesson. Independent evidence and delayed review determine the skill stage.

Next lesson · Read an App Router application as a route tree →