Skip to content

Commit a686179

Browse files
committed
perf(solid,signals): drop two checks the served-snapshot path never needs
markSnapshotScope's served branch only sees hydrated signal-likes, never the internal boundary signals that carry CONFIG_NO_SNAPSHOT; a settled answer already took its creation snapshot, so the landing hook needs no `!initP.s`. -16 B minified on the hydrating and page scenarios; keeps the store app within the size gate's allowance now that #4313 is on next. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018LY7F9czoRqdMEvk2QwPr1
1 parent bb497a7 commit a686179

2 files changed

Lines changed: 2 additions & 6 deletions

File tree

‎packages/signals/src/core/core.ts‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -273,11 +273,7 @@ export function setSnapshotCapture(active: boolean): void {
273273
*/
274274
export function markSnapshotScope(owner: Owner, served?: unknown): void {
275275
if (arguments.length < 2) owner._snapshotScope = true;
276-
else if (
277-
snapshotCaptureActive &&
278-
!((owner as Computed<any>)._config & CONFIG_NO_SNAPSHOT) &&
279-
(owner as Computed<any>)._x?._snapshotValue === undefined
280-
)
276+
else if (snapshotCaptureActive && (owner as Computed<any>)._x?._snapshotValue === undefined)
281277
takeSnapshot(owner as Computed<any>, served);
282278
}
283279

‎packages/solid/src/client/hydration.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ export function readSerializedOrCompute(
746746
// over first (above) drops the landing, not the snapshot — the boundary
747747
// claims what its markup shows, then replays the client's value at its
748748
// release.
749-
if (value && initP?.then && !initP.s) initP.then((v: any) => markSnapshotScope(o, v), noop);
749+
if (value && initP?.then) initP.then((v: any) => markSnapshotScope(o, v), noop);
750750
}
751751
return readHydratedValue(
752752
initP,

0 commit comments

Comments
 (0)