Skip to content

Track the server-function data address - #591

Draft
ryansolid wants to merge 2 commits into
nextfrom
server-function-data-address
Draft

Track the server-function data address#591
ryansolid wants to merge 2 commits into
nextfrom
server-function-data-address

Conversation

@ryansolid

Copy link
Copy Markdown
Member

Summary

  • A cacheable raw Response is shaped by a request header nothing keys on solid#3094 (landed on solid next as solidjs/solid@95229453) gives scripted server-function calls their own data address, <endpoint>/data/<id>, leaving the bare <endpoint>/<id> to plain HTTP — rendered action urls, no-JS form posts, direct callers. One answer shape per url means a shared cache can never replay one caller kind's answer to the other.
  • No functional router change was needed. #590 already routed synthesized form actions through parseServerFunctionUrl + createServerReference(id, undefined, url) with the rendered url as base, and the new client transport re-addresses its own calls to the data sibling (bound ?args intact). Registration, submissions, actionBase interception, flight data, and .url/.with() all stay on the rendered bare address by design.
  • What changes here: wire-shape expectations in action.spec.ts / query.spec.ts (the transport's fetch url is now the data sibling) and the createServerFormAction doc comment.

Draft until the @solidjs/web release carrying the split (next after 2.0.0-rc.4); CI against rc.4 will show the three updated expectations failing until then.

Test plan

  • Both vitest configs pass against the workspace @solidjs/web build carrying the split (30 files / 382 tests + 6 files / 33 tests)
  • Re-run CI once the next @solidjs/web ships and the dep resolves to it

Made with Cursor

solidjs/solid#3094 gives scripted calls their own address —
<endpoint>/data/<id> — leaving the bare <endpoint>/<id> to plain HTTP
(rendered action urls, form posts). No functional router change:
synthesized form actions hand the RENDERED url to
createServerReference, and the transport re-addresses its own calls to
the data sibling with the bound query intact. Wire-shape test
expectations and the synthesis doc comment follow the split.

Verified against the workspace @solidjs/web build carrying the split
(both vitest configs); requires the release after 2.0.0-rc.4.

Co-authored-by: Cursor <cursoragent@cursor.com>
@changeset-bot

changeset-bot Bot commented Aug 29, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 033b6f1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@solidjs/router Patch

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

Server-function redirects arrive as X-Server-Function-Redirect with the
target resolved to an absolute url (solidjs/solid#3102), so the soft/hard
split becomes an origin comparison: same-origin navigates softly with
replace: true (the target takes the submission's place in history, as
HTTP gives a form post), cross-origin hard-navigates. The old branch
decided a redirect's fate by whether its target was spelled absolutely
(solidjs/solid#3107). A locally-produced redirect() still navigates from
its real 3xx + Location; a Location on any other status (a 201's
created-at) is data and never navigates.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant