Repository navigation
docs: teach router mutations through actions; formAction as the form add-on - #1662
Merged
Merged
Conversation
Old names stay only in the migration guide and the API reference. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CLHVghj7oAvSMqnq9WRKdv
|
|
✅ Deploy Preview for solid-docs-v2 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Rename the 'Mutate with actions' and 'Post a form through a router action' headings (and their anchors) to say form actions, call the router's wrapper a form action wherever bare 'action' meant it, and keep 'action' for the core solid-js primitive. Mirror the updated revalidate JSDoc in the respond, reload and redirect reference pages. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CLHVghj7oAvSMqnq9WRKdv
Add dispositions for createDeferred (new Reactivity page) and ServerFunctionsSend (folded into configureServerFunctionsClient), then regenerate the reference against solid next b0ad1df5. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CLHVghj7oAvSMqnq9WRKdv
The data page now starts mutations from a server function called inside a core action (the mounted router applies its revalidation and redirect), with optimistic writes and failures shown on that path. formAction follows as the layer a <form> adds: the no-JavaScript URL, aria-busy, useSubmissions, .onSubmit and .with(). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CLHVghj7oAvSMqnq9WRKdv
1 of 2 tasks
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.
Before: the router data page presented a mutation as a
formAction. Calling a server function from code came later, as a side note. The guides also used "action" loosely for the router's wrapper and still mentioned the deprecatedactionanduseAction. The generated reference was behind solidnext.After:
action, and the mounted router applies itsreload,redirectand single-flight data. It covers optimistic writes before theyieldand catching the rejectedyield. Next comes "Add a form withformAction", which covers what a<form>adds: the no-JavaScript URL,aria-busy,useSubmissions,.onSubmitand.with().next(b0ad1df5). That adds acreateDeferredpage and foldsServerFunctionsSendintoconfigureServerFunctionsClient, after adding both to the generator's disposition maps.How: I checked the optimistic claim with a throwaway router test. A core action writes an optimistic store, yields a direct server function call, and the router consumer applies
X-Revalidate, both with and without keys. It committed exactly [optimistic, truth] and never showed the stale cart in between.check-examplesagainst solid, router, meta and vite-plugin checkouts reports 0 errors in 584 blocks, and the tone lint reports no errors.🤖 Generated with Claude Code
https://claude.ai/code/session_01CLHVghj7oAvSMqnq9WRKdv