Skip to content

feat(liveQuery): server function producers are declared live() - #690

Open
ryansolid wants to merge 1 commit into
nextfrom
claude/project-thread-8ayzle
Open

ryansolid wants to merge 1 commit into
nextfrom
claude/project-thread-8ayzle

Conversation

@ryansolid

Copy link
Copy Markdown
Member

Requested by Ryan · project thread

Summary

liveQuery(fn, key) over a server function now wraps it in live() (which implies GET), so the channel multicasts a connection with the transport's live lifecycle: live address, Last-Event-ID resume, response-lifetime deaths, Retry-After. Before, it only applied GET, so liveQuery(fn) silently lacked all of that unless written liveQuery(live(fn)). An explicit live(fn) passes through untouched.

Hydration takeover's LIVE_RESUME_FROM stamp on the subscriber iterable is forwarded onto the channel's first live() iterable, so a takeover whose value is unchanged costs nothing on the wire.

Release order: depends on solidjs/solid "live() implies GET" shipping first (its seam edit keeps live from pulling the transport into plain-producer apps). Bump the @solidjs/web peer to that rc before releasing. On older @solidjs/web this still works (live POSTs at the live address).

Bytes (brotli, app bundles, measured against local solid with the seam edit): query + server fn without liveQuery +0; liveQuery over a bare server fn +1.33 KB (live() itself, which that app needs); liveQuery(live(GET(fn))) already +18 B; liveQuery over a plain non-server producer +1.85 KB of live() it never runs (no static way to drop it without charging every server-function app).

How did you test this change?

  • pnpm test: 713 client, 96 server, types green (against published @solidjs/web).
  • New tests: liveQuery over a server reference connects at /_server/live/<id>; explicit live() passes through; the hydrated value is forwarded to the first connection.
  • prettier --check clean on the changed files.

Generated by Claude Code

liveQuery wraps a server function producer in live() (which implies GET)
so the channel multicasts a connection with the transport's live
lifecycle, and forwards hydration's served value to the first
connection so an unchanged takeover costs nothing on the wire.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fmb4aQtDJWoA8CUktR9QoZ
@changeset-bot

changeset-bot Bot commented Oct 21, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1d13328

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

@ryansolid ryansolid self-assigned this Oct 21, 2026
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.

2 participants