knaxuslearn · build · ship

Roadmaps / Frontend / Phase 2

Phase 2 of 4 · Study weeks 5-8

Types, components, state and accessibility

This phase makes the second checkpoint possible: a typed, accessible app whose state has one owner.

Topics every week

  1. Week 58 h
    • TypeScript strict mode
    • Unions and narrowing
    • Generics
    • Types at the boundary (parsing API data)

    Hand inThe app typed under strict mode with parsed API responses

  2. Week 68 h
    • React components and rendering
    • State and effects
    • Keys and reconciliation
    • When effects are the wrong tool

    Hand inThe product list and product page, with a note on each effect you removed

  3. Week 78 h
    • State ownership
    • Server state against client state
    • Caching and invalidation
    • The cart as a state machine

    Hand inThe cart with a test per transition and the seeded stale-total bug

  4. Week 88 h
    • Semantic HTML and ARIA
    • Keyboard and focus
    • Screen reader testing
    • Accessible dialogs, menus and forms

    Hand inCheckpoint 2, with the keyboard-only run and the automated scan

Practice projects

  • Practice 1, strict mode (Week 5): turn on strict in an existing project. Done when: it compiles, and you list three places the checker exposed a real bug or a wrong assumption.
  • Practice 2, remove an effect (Week 6): replace three useEffect calls with derived values or event handlers. Done when: each change is explained and a test shows the behaviour is the same.
  • Practice 3, the cart machine (Week 7): model the cart with explicit states and events. Done when: a test covers every transition and the stale-total bug fails the test before the fix.
  • Optional, a screen reader run: buy a product using only a screen reader. Done when: you write down every point where the announcement was wrong or missing.

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.

RepoWhat to readWeek
microsoft/TypeScriptThe handbook source and the checker's narrowing rules5
facebook/reactThe reconciler and how hooks are stored6
TanStack/queryCaching and invalidation design7
pmndrs/zustandExternal-store design and subscriptions7
radix-ui/primitivesAccessibility and composition patterns8

Milestone checkpoint

Build Checkpoint 2. Type the app under strict mode first. Model the cart, then write the transition tests and watch the seeded bug fail one. Build the search box, menu and dialog and test them with the keyboard and a screen reader. Hand in the strict compile, the test report, the scan result, ADR-3 (state ownership) and ADR-4 (the accessibility rules for custom components).

Check yourself

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

  1. What does strict mode catch that loose mode does not?
    Unchecked null and undefined, implicit any and loose function types, so a whole class of runtime errors becomes a compile error.
  2. Why is an effect often the wrong tool?
    Effects run after render and copy state around, which causes extra renders and stale values. A derived value or an event handler is simpler.
  3. What is the difference between server state and client state?
    Server state is data owned elsewhere that can go stale and needs caching and refetching. Client state is local, such as an open menu.
  4. When is ARIA the wrong choice?
    When a native element does the job. A real button gives focus, keys and a role with no ARIA.
  5. What must a modal dialog do for a keyboard user?
    Move focus into the dialog, keep it inside while open, close on Escape and return focus to the element that opened it.