Skip to content

fix(solid): keep client stores pending during hydration - #3223

Merged
ryansolid merged 2 commits into
solidjs:nextfrom
GabbeV:fix/client-store-hydration-pending
Sep 2, 2026
Merged

fix(solid): keep client stores pending during hydration#3223
ryansolid merged 2 commits into
solidjs:nextfrom
GabbeV:fix/client-store-hydration-pending

Conversation

@GabbeV

@GabbeV GabbeV commented Sep 2, 2026

Copy link
Copy Markdown

Summary

Client-sourced stores currently expose their seed during hydration unless seedLoadingValue is enabled. This makes a value that was not declared as commit zero observable before the client derive has run.

Keep these stores unasked through hydration so that:

  • without seedLoadingValue, reads suspend until the first client result
  • with seedLoadingValue: true, the seed remains visible as commit zero

This is extracted from #3194 because the behavior applies independently to the existing seeded API and does not depend on the proposed seedless store API.

How did you test this change?

From packages/solid:

  • pnpm exec vitest run test/client-hydration.spec.ts (128 tests)
  • pnpm types
  • pnpm test-types

@changeset-bot

changeset-bot Bot commented Sep 2, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 6b3871a

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

This PR includes changesets to release 11 packages
Name Type
solid-js Patch
@solidjs/element Patch
@solidjs/h Patch
@solidjs/html Patch
test-integration Patch
@solidjs/universal Patch
@solidjs/web Patch
@solidjs/babel-plugin Patch
@solidjs/compiler Patch
@solidjs/diagnostics Patch
@solidjs/signals 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 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The runtime change looks directionally correct and remains independent from #3194, but the committed regression only covers a synchronous createProjection property read. Please add an asynchronous hydration regression through the public store path (createStore(fn) is sufficient) that demonstrates <Loading> remains pending through hydration/first flight and reveals only after the client result lands. This is the observable behavior the change is protecting.

No API concern. The measured client output is slightly smaller, so there is no size blocker.

@ryansolid

Copy link
Copy Markdown
Member

The underlying fix looks right and matches the existing memo/server-store semantics. I'm going to add the broader asynchronous createStore(fn) + <Loading> hydration regression directly, then we'll move this toward merge. No action needed from you on the earlier coverage request.

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

@ryansolid ryansolid left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the missing async createStore/Loading hydration regression. The focused hydration suite, declarations, type tests, treeshake diagnostics, and all size scenarios pass. Hydrated output is 13–43 gzip bytes smaller.

@ryansolid
ryansolid merged commit ecaa3fb into solidjs:next Sep 2, 2026
2 checks passed
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