Repository navigation
Router next.41: formAction, useAction deprecated, single flight on any server function - #1661
Merged
Merged
Conversation
…single flight Update the Solid 2.0 docs for @solidjs/router 2.0.0-next.41 (solidjs/solid-router#688): - Router `action`/`Action` are now `formAction`/`FormAction`; the old names are documented as deprecated aliases. Core solid-js `action` is unchanged. - `useAction` is deprecated with no replacement: call the server function (or a core `action` around it) directly. - A mounted router applies any server function's revalidation, redirect, reload and flight data, including direct calls from event handlers. - Every POST server function call is a mutation that revalidates on-screen queries by default; `respond(value, { revalidate: "" })` opts out, and `query()`/`GET()` reads are exempt. 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. |
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 2.0 docs teach the router's
actionanduseAction. They also say a server function called directly from an event handler doesn't revalidate, and that the router's single flight is installed by the first action.After (matching @solidjs/router 2.0.0-next.41, solidjs/solid-router#688):
actionis documented asformAction(ActionbecomesFormAction). The old names are covered as deprecated aliases in the reference and the migration guide.useActionis deprecated. Pages now call the server function directly, and the durable-generation chat example drops it.query()andGET()are exempt, andrespond(value, { revalidate: "" })opts a non-mutation out.actionusages are unchanged.This touches 17 pages: router data and its reference/types/index, server functions (mutations and responses, progressive enhancement, durable generation, index), forms, protected routes, the from-solid-router migration, integrate a router, server rendering, the overview, data-fetching patterns and the glossary.
Validation:
node scripts/check-examples.mjs --solid <solid next> --router <router next> --vite-plugin <plugin> --meta <npm @solidjs/meta> --refchecks 1346 blocks and passes for every changed page. Its 5 errors are all in unchanged@solidjs/metapages and come from the older npm meta package being missingHead/Scriptexports.prettier --checkpasses on the changed files.scripts/lint-tone.mjsreports 0 errors.Generated by Claude Code