Qwik resumability serialization change for non-serializable class instances
0 reputation · 24 Mar 2025, 18:41 UTC
Qwik resumability serialization change for non-serializable class instances
Qwik's resumability model serializes application state directly into the HTML so that traditional client-side hydration is unnecessary. In Qwik 1.x, useStore and useSignal handle primitive and plain-object data reliably, but the boundary becomes less predictable when a class instance containing methods or private fields crosses from server rendering into client-side de-serialization.
Because Qwik uses the $$ suffix to lazy-load functions, the framework must reconstruct the prototype chain when de-serializing state that originated outside the standard JSON payload. A class instance that relies on non-enumerable properties or custom prototypes may not survive that transition intact, creating a compatibility boundary between server-rendered HTML and client-side execution.
What is the documented pattern for wrapping non-serializable classes so they remain functional across the resumability boundary? How does Qwik 1.x handle de-serialization of methods and private properties that are not represented in the initial serialized state?