Skip to content

Commit aa8b7d9

Browse files
committed
extend note about payload transfer differences between v1 and v2
1 parent e1dcb05 commit aa8b7d9

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/routes/solid-start/advanced/serialization.mdx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,24 @@ SolidStart enables Seroval plus a default set of web platform plugins. These plu
6767

6868
Seroval supports additional value types. The compatibility list is broader than what SolidStart enables by default, so treat it as a superset. See the [Seroval compatibility docs](https://github.com/lxsmnsyc/seroval/blob/main/docs/COMPATIBILITY.md).
6969

70+
## Server function payloads (v1 vs v2)
71+
72+
SolidStart applies extra handling for certain payload types so file uploads and binary data can flow without being serialized by Seroval.
73+
74+
In v1, only `FormData` is treated this way, and only when it is the single argument passed to a server function. This allows file uploads to work without Seroval serialization.
75+
76+
In v2, this behavior is expanded and applies to both server function arguments and return values. SolidStart bypasses Seroval for:
77+
78+
- `FormData`
79+
- `URLSearchParams`
80+
- `Uint8Array`
81+
- `ArrayBuffer`
82+
- `Blob`
83+
- `File`
84+
- `string`
85+
86+
Because these values are transferred directly, v2 can yield smaller payloads for these cases.
87+
7088
## Limits and exclusions
7189

7290
- `RegExp` is disabled by default.

0 commit comments

Comments
 (0)