← All demos

🍡 mochi

SERVER | DEV

Devalue Serialization

Interactive

Rich type serialization via devalue. The Server Type column is captured during SSR and shipped as strings; the Client Type column is resolved live after hydration. They should match — proving the types survived the round-trip.

TypeValueServer TypeClient TypeStatus
Date2025-01-15T12:00:00.000ZDateOK
RegExp/hello\s+world/giRegExpOK
MapMap(3) { a => 1, b => 2, c => 3 }MapOK
SetSet(3) { 10, 20, 30 }SetOK
BigInt9007199254740993nBigIntOK
URLhttps://mochi.dev/docs?version=5URLOK
URLSearchParamstheme=dark&lang=enURLSearchParamsOK
Uint8ArrayUint8Array [72, 101, 108, 108, 111]Uint8ArrayOK
undefinedundefinedundefinedOK
InfinityInfinityInfinityOK
NaNNaNNaNOK
-0-0-0OK
Repeated ref[{"x":1},{"x":1}]ArrayOK
Cyclic ref{ self: [Circular] }objectOK
Repeated refsame refidentity checkOK
Cyclic refself === objidentity checkOK

Server (SSR)