Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ref/SOLID_NEXT
Original file line number Diff line number Diff line change
@@ -1 +1 @@
c467fcd7f9f0ded3e6158409c9c148ece79e1aa1
30e7805eb1bbd9e2601d0252558e91d2547e96f4
2 changes: 1 addition & 1 deletion ref/compile/rt-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export function createApp(opts: { api?: Record<string, (...a: any[]) => unknown>
question(name: string, compute: (prev: unknown) => unknown, o: { loadingValue?: unknown } | undefined, mode: { optimistic: boolean; structured: boolean; derived?: boolean; record?: boolean; plain?: boolean }, key?: string): [Acc, Writer] {
const fn = named(name, compute);
const derive = (draft: any) => { const r = fn(draft); if (r instanceof Flight || r instanceof Promise) return (async () => landDraft(draft, r instanceof Flight ? await r.first : await r, key))(); return landDraft(draft, r, key); };
if (mode.optimistic && mode.structured && mode.plain && !mode.derived) { const [truth] = (createStore as any)(derive, key && !mode.record ? [] : {}, key ? { key } : undefined); (createOptimisticStore as any)(() => (key && !mode.record ? [] : {}), key && !mode.record ? [] : {}, key ? { key } : undefined); return ro(() => truth); } // the client's layer, created for its owner slot only: the server shows the truth (it has no guesses). A server layer over the pending truth would hydrate as an answer of its own, and the client's layer would stop following the truth (solidjs/solid#5146)
if (mode.optimistic && mode.structured && mode.plain && !mode.derived) { const seed = () => (key && !mode.record ? [] : {}); const [truth] = (createStore as any)(derive, seed(), key ? { key } : undefined); const [view] = (createOptimisticStore as any)(() => truth, seed(), key ? { key } : undefined); return ro(() => view); } // AC-3 over a plain-written question: the client's layer over the truth, so the owner trees (and hydration keys) match
if (mode.optimistic && mode.structured) { const [store] = (createOptimisticStore as any)(derive, key && !mode.record ? [] : {}, key ? { key } : undefined); return ro(() => store); }
if (mode.optimistic && mode.derived) { const [get] = createOptimistic(fn as any, o as any); return ro(get as Acc); } // AC-3 over an equation: the client's createOptimistic(fn), so the owner trees (and hydration keys) match
if (mode.optimistic) { const [truth] = createSignal(fn as any, o as any); const [get] = createOptimistic(() => (truth as Acc)()); return ro(get as Acc); }
Expand Down
2 changes: 1 addition & 1 deletion ref/oracle/repros/proj-hydrate/run.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// node repros/proj-hydrate/run.mjs (from ref/oracle)
// createOptimisticStore(() => truth) over an async createStore. The server renders "A,B". In the browser, the truth is
// solidjs/solid#5146
// solidjs/solid#5146 (FIXED in solid main fcaa05104, #5150)
// written (rename "Y"). Rendered on an empty page: "Y,B". Hydrated from the server's page: does the view follow?
import { harness, wait } from "../_hydrate.mjs";
const rows = [{ id: 1, t: "A" }, { id: 2, t: "B" }];
Expand Down
Loading