Skip to content

Commit 727ce1b

Browse files
examples: vite-plugin-solid next.22 (drops the _$SC head splice); NoteEditor reads initial props under untrack
The plugin bump removes the head-open bootstrap splice that shifted every head hydration claim by one (references self-bootstrap since runtime next.38); chat already pinned next.22, the rest still spliced. NoteEditor seeds its editor state from live slot args once by contract, so it declares that with untrack instead of tripping strict-read warnings. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent dc7b5c2 commit 727ce1b

9 files changed

Lines changed: 39 additions & 48 deletions

File tree

examples/hackernews-spa/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@
1919
},
2020
"devDependencies": {
2121
"vite": "^8.0.0",
22-
"vite-plugin-solid": "3.0.0-next.21"
22+
"vite-plugin-solid": "3.0.0-next.22"
2323
}
2424
}

examples/hackernews/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@
1919
},
2020
"devDependencies": {
2121
"vite": "^8.0.0",
22-
"vite-plugin-solid": "3.0.0-next.21"
22+
"vite-plugin-solid": "3.0.0-next.22"
2323
}
2424
}

examples/migrating-element/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@
1818
"solid-js": "workspace:*",
1919
"typescript": "^6.0.2",
2020
"vite": "^7.0.0",
21-
"vite-plugin-solid": "3.0.0-next.21"
21+
"vite-plugin-solid": "3.0.0-next.22"
2222
}
2323
}

examples/notes/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@
2222
},
2323
"devDependencies": {
2424
"vite": "^8.0.0",
25-
"vite-plugin-solid": "3.0.0-next.21"
25+
"vite-plugin-solid": "3.0.0-next.22"
2626
}
2727
}

examples/notes/src/components/NoteEditor.tsx

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// fresh sidebar list and (for save) the fresh note view — submit to settled
1212
// UI in a single round trip. The live preview reuses the same NotePreview the
1313
// note's server component renders — the shared-module half of the demo.
14-
import { createSignal } from "solid-js";
14+
import { createSignal, untrack } from "solid-js";
1515
import { deleteNote, saveNote } from "~/lib/api";
1616
import NotePreview from "./NotePreview";
1717

@@ -20,9 +20,17 @@ export default function NoteEditor(props: {
2020
initialTitle: string;
2121
initialBody: string;
2222
}) {
23-
const [title, setTitle] = createSignal(props.initialTitle);
24-
const [body, setBody] = createSignal(props.initialBody);
25-
const noteId = props.noteId;
23+
// Slot args are live — a server morph can push fresh values through these
24+
// props. This editor seeds its own state from them ONCE by contract (the
25+
// `initial*` names), so read them under `untrack` to declare that intent.
26+
const initial = untrack(() => ({
27+
noteId: props.noteId,
28+
title: props.initialTitle,
29+
body: props.initialBody
30+
}));
31+
const [title, setTitle] = createSignal(initial.title);
32+
const [body, setBody] = createSignal(initial.body);
33+
const noteId = initial.noteId;
2634

2735
return (
2836
<div class="note-editor">

examples/rendering/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@
2626
"solid-js": "workspace:*",
2727
"typescript": "^6.0.2",
2828
"vite": "^7.0.0",
29-
"vite-plugin-solid": "3.0.0-next.21"
29+
"vite-plugin-solid": "3.0.0-next.22"
3030
}
3131
}

examples/sierpinski/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@
1818
"solid-js": "workspace:*",
1919
"typescript": "^6.0.2",
2020
"vite": "^7.0.0",
21-
"vite-plugin-solid": "3.0.0-next.21"
21+
"vite-plugin-solid": "3.0.0-next.22"
2222
}
2323
}

examples/todos/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@
1818
"solid-js": "workspace:*",
1919
"typescript": "^6.0.2",
2020
"vite": "^7.0.0",
21-
"vite-plugin-solid": "3.0.0-next.21"
21+
"vite-plugin-solid": "3.0.0-next.22"
2222
}
2323
}

pnpm-lock.yaml

Lines changed: 20 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)