Listeners
Which event targets invoke which code symbols?
Lesson 07 · Advanced frontend rendering
Estimated time: about 13 minutes
Hydration reconstructs browser runtime state by replaying component code. Resumability serializes enough execution metadata on the server to defer that work until a specific interaction needs code.
After HTML crosses from server to browser, an interactive runtime needs listener locations, application state, and a reactive/component graph. Architectures differ in when and how they recover them.
Which event targets invoke which code symbols?
Which values must survive the server-to-browser transition?
Which rendered regions depend on which state and should update?
These are architectural models, not universal benchmarks. Select each to explain where the startup cost goes.
A resumable system emits references that let a small loader locate an event handler chunk, restores supported state values, and retains dependency metadata so the browser need not eagerly execute the rendered tree merely to rediscover it.
<button on:click="./chunk.js#increment[0]">0</button>
// Conceptual meaning:
// on this event → fetch this chunk → invoke this symbol
// with serialized state captured by the server handoff
Event or render code can wait until it is needed, creating many fine-grained lazy boundaries.
The browser avoids a whole-tree startup replay, but the first use of a cold symbol may wait for a network fetch.
Captured state and references must fit the framework’s serializable model; arbitrary live objects cannot cross unchanged.
| Claim | Senior correction |
|---|---|
| “No hydration means no client JavaScript.” | A loader and interaction code still execute; the architecture changes eagerness and granularity. |
| “Instant interaction is guaranteed.” | A cold interaction may require a chunk request. Network conditions, prefetch policy, and handler size still matter. |
| “Serialization is free.” | Metadata increases HTML, server work, and constraints on captured values; inspect bytes and CPU on both sides. |
| “It is partial hydration with automation.” | Islands replay chosen roots. Resumability aims to preserve the runtime graph so startup replay is unnecessary. |
| “Architecture dominates every workload.” | Framework maturity, team fluency, cacheability, interaction density, and real-user evidence can outweigh startup theory. |
Scenario: The server has rendered a counter and retained its value. The browser can handle a click without eagerly rerunning the counter component. Which mechanism best describes the handoff?
Choose first. Then name what is serialized, what remains lazy, and what the first cold interaction may cost.
It executes rendered client component code to reconnect listeners and reconstruct framework/component state against existing DOM.
Listener locations and code references, serializable application state, and enough component/reactivity graph metadata to continue later.
Metadata or server serialization cost, serialization constraints, many-chunk delivery, cold-interaction latency, debugging complexity, or ecosystem maturity.
Compare representative-device startup CPU, transferred/evaluated code, HTML metadata, first and repeat interaction latency, server cost, cache behavior, and team delivery risk.
“Hydration and resumability solve the same browser handoff differently. Hydration re-executes client components to rebuild listeners and runtime state; resumability serializes those relationships and loads a handler when an interaction demands it.”
“That can reduce eager startup CPU and code, especially for large interactive pages, but it moves complexity into serialization, compilation, metadata, and asynchronous chunk delivery.”
“I would not choose from slogans. I’d benchmark startup and first-interaction latency on target devices, include server and HTML costs, and account for ecosystem and team constraints.”
Compare the models in the client execution field guide. Ask your teaching agent to challenge a framework claim with a measurement plan.
Short recall now helps decide what returns in your review queue.
Quick recall
Say your answer first, then reveal the explanation.
After HTML crosses from server to browser, an interactive runtime needs listener locations, application state, and a reactive/component graph. Architectures differ in when and how they recover them.
Quick recall
Say your answer first, then reveal the explanation.
These are architectural models, not universal benchmarks. Select each to explain where the startup cost goes.
Quick recall
Say your answer first, then reveal the explanation.
A resumable system emits references that let a small loader locate an event handler chunk, restores supported state values, and retains dependency metadata so the browser need not eagerly execute the rendered tree merely to rediscover it.