fix(solid): keep client stores pending during hydration - #3223
Conversation
🦋 Changeset detectedLatest commit: 6b3871a The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 packages
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
left a comment
There was a problem hiding this comment.
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.
|
The underlying fix looks right and matches the existing memo/server-store semantics. I'm going to add the broader asynchronous |
Co-authored-by: Cursor <cursoragent@cursor.com>
ryansolid
left a comment
There was a problem hiding this comment.
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.
Summary
Client-sourced stores currently expose their seed during hydration unless
seedLoadingValueis 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:
seedLoadingValue, reads suspend until the first client resultseedLoadingValue: true, the seed remains visible as commit zeroThis 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 typespnpm test-types