Repository navigation
Conversation
🦋 Changeset detectedLatest commit: 3a27300 The changes in this PR will be included in the next version bump. This PR includes changesets to release 14 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Merging this PR will degrade performance by 27.21%2 warnings
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
With enableRichArguments(), a call whose arguments hold files or blobs used to fail before sending, unless the file was the only argument or the last one. Ports solidjs/solid-start#2359 to the core transport. - The rich-args encoder finds each file with a seroval plugin made for the call, wherever the codec meets it: arguments, arrays, objects, maps, sets and FormData entries. - A call with files sends multipart form data. The codec output goes in the `args` field and each file goes as it is in a `file<index>` part. - The new BodyFormat.SerializedFormData ("10") marks the request. - The server decodes `args` with a plugin made for that request, which turns each index back into its part. Other bodies decode without it. - A missing `args` field, a bad index or a missing part is refused with 400. bodySizeLimit bounds the whole body. - Default JSON mode is unchanged. Upload code ships only in the rich-args entry. - The version skew spec moves its unknown tag from "10" to "11". Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
3a27300 to
b745f10
Compare
Ports solidjs/solid-start#2359 (from #4177 by @lxsmnsyc), with uploads kept off the core client request path: they keep the Serialized tag and the handler spots them by their multipart content type. Co-authored-by: Alexis H. Munsayac <alexis.munsayac@gmail.com>
Generated by Claude Code |
With
enableRichArguments(), a server function can now take files and blobs anywhere in its arguments. This ports solidjs/solid-start#2359 to the core transport.Problem
A file only reached a server function as the only argument, or as the last argument of a bound call. Anywhere else, the call failed before it was sent:
The codec's default plugin list has no
BloborFileplugin.Changes
FormDataentries.argsfield, and each file goes as it is in its ownfile<index>part, without base64.BodyFormat.SerializedFormData("10") marks the request. The Start PR uses"8", which isJsonhere.argswith a plugin made for that request, which turns each index back into its part. Any other body decodes without that plugin, so an index in a plain codec body fails to decode.argsfield, a bad index, or a part that is not a file is refused with 400.bodySizeLimitbounds the whole body, which answers the "no total size limit" note on the Start PR.Blobarrives as aFilenamedblob, with its type kept.ResponseandRequestarguments are still refused before sending.enableRichArguments(), these calls still throw, and the message now names files.serializeArgsmay returnFormData. The core client only checks for it and picks the format.uploads.tsand ships only in the rich-args entry: +930 B minified there. The core client grows by 97 B minified."10"to"11".The Start PR is still open. If its design changes before it lands, this port should follow.
Testing
server-functions-uploads.spec.tsxwith 12 cases:FormData;Response;bodySizeLimit;@solidjs/webunit (1395), server (1746) and hydrate (520) suites pass withJSX_COMPILER=babel.test-types, the types build and Prettier pass.compiler.nodepredates recent compiler changes, so about 50 unrelated tests fail with it. The same tests fail without this change and pass with Babel.🤖 Generated with Claude Code