knaxuslearn · build · ship

Roadmaps / Frontend / Phase 1

Phase 1 of 4 · Study weeks 1-4

The browser, the runtime and measurement

This phase makes the first checkpoint possible: a page you can trace and a baseline of real numbers.

Topics every week

  1. Week 18 h
    • The event loop, tasks and microtasks
    • Promises and async
    • Closures and scope
    • Modules and the module graph

    Hand inA note that predicts the order of eight snippets, checked in the browser

  2. Week 28 h
    • The critical rendering path
    • Layout, paint and compositing
    • Core Web Vitals (LCP, INP, CLS)
    • Reading a DevTools trace

    Hand inThe first category page and a trace with the critical path labelled

  3. Week 38 h
    • The network: HTTP caching, compression and priorities
    • Images and fonts
    • Resource hints
    • Third-party scripts

    Hand inThe seeded layout-shift problem found and fixed with numbers

  4. Week 48 h
    • Node.js and the same event loop on the server
    • Streams
    • Lab and field measurement
    • Predicted against measured

    Hand inCheckpoint 1: the table, the trace and the before and after numbers

Practice projects

  • Practice 1, the event-loop quiz (Week 1): write eight snippets that mix setTimeout, promises and await. Done when: you predict the output order of each, run it and explain every difference.
  • Practice 2, the trace (Week 2): record a trace of a page load. Done when: you label the first byte, first paint and LCP element, and name the one longest task.
  • Practice 3, the image fix (Week 3): serve the hero image with explicit dimensions, a modern format and the right priority. Done when: LCP and CLS are measured before and after and the change is a number.
  • Optional, a field script: add the web-vitals library and log the three metrics. Done when: the numbers appear in the console for three real interactions.

GitHub repos to study

Existence and last commit were checked on 22 Nov 2026 by shallow clone. Every repository below had a commit in the last 12 months. Look at the README for archive notices before you rely on one.

RepoWhat to readWeek
GoogleChrome/web-vitalsHow each metric is measured in the field2
nodejs/nodeThe event loop docs and the streams implementation4
GoogleChrome/lighthouse-ciHow a lab run is repeated and asserted in CI4

Milestone checkpoint

Build Checkpoint 1. Write your predictions for LCP, INP and CLS before the first run. Build the category page with the seeded unsized image, record the trace, find the shift and fix it. Hand in the table with your own numbers, the traces, ADR-1 (the framework choice) and ADR-2 (image and script loading).

Check yourself

Answer each question in your head first, then open it to check.

  1. In what order do setTimeout, a promise callback and synchronous code run?
    Synchronous code first, then promise callbacks (microtasks), then the timer callback (a task).
  2. What are LCP, INP and CLS, and what is a good value for each?
    LCP is when the largest content element paints, good at 2.5 s or less. INP is how long the page takes to respond to interactions, good at 200 ms or less. CLS is how much the layout moves, good at 0.1 or less. Each is judged at the 75th percentile of real visits.
  3. Why measure on a throttled profile?
    Your laptop is much faster than a typical phone, so problems hide until the CPU and network are slowed down.
  4. What makes an image cause layout shift?
    The browser does not know its size until it loads, so the content below moves. Set the width and height or reserve the space.
  5. What is the difference between lab and field data?
    Lab data comes from a controlled run you repeat. Field data comes from real visitors on many devices, and it is what search engines use.