Repository navigation
Conversation
…codecs
- The option points at a module whose default export is the codec for
server-function payloads (plugins, disabledFeatures, depthLimit,
serializeErrorStacks). A bare plugin array is shorthand for { plugins }.
- Compiled server-function modules and the generated handler pass it as
codec to configureServerFunctions{Client,Server}, so both ends of the
wire use the same codec.
- Output is unchanged when the option is not set.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 20d26f6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
serverFunctions.serialization, a module that sets the codec for server-function payloads on both the client and the server. It is the counterpart of SolidStart'sserialization.pluginsoption.Changes
JSONCodecOptionsobject from@solidjs/web/serialization:plugins,disabledFeatures,depthLimitandserializeErrorStacks.{ plugins }. A SolidStartserialization.pluginsmodule works unchanged."use server"module imports the file and passes it ascodectoconfigureServerFunctionsClientorconfigureServerFunctionsServer. This uses the same appended configure call the custom endpoint already uses.virtual:solid-server-function-handleralso imports it, so the dev middleware and the production handler have the codec before the first dispatch.configure. Both options now share one resolve helper.serializationsection underoptions.serverFunctions.Notes
codecsetting on each configure call. The docs say not to also passcodecelsewhere.renderToStreamtakes its ownpluginsoption. SolidStart behaves the same way.Feature(fordisabledFeatures) is imported fromseroval. Re-exporting it from@solidjs/web/serializationwould need a change in solidjs/solid.Testing
src/server-functions/serialization.test.ts. It creates a project with aMoneyclass and a seroval plugin, calls the function through the generated handler on@solidjs/webrc.16, and decodes a realMoneyon the client side. It covers the object export, the array export, no option, and a missing path. It fails without the change.vitest run: 40 of 40 pass.examples/start-ssrbrowser e2e suite was not run.🤖 Generated with Claude Code