Skip to content

Commit de8272b

Browse files
committed
fixture tweaks
1 parent 1c0efad commit de8272b

File tree

10 files changed

+37
-27
lines changed

10 files changed

+37
-27
lines changed

apps/fixtures/basic/src/app.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { MetaProvider, Title } from "@solidjs/meta";
12
import { Router } from "@solidjs/router";
23
import { FileRoutes } from "@solidjs/start/router";
34
import { Loading } from "solid-js";
@@ -7,11 +8,12 @@ export default function App() {
78
return (
89
<Router
910
root={(props) => (
10-
<>
11+
<MetaProvider>
12+
<Title>SolidStart - Basic</Title>
1113
<a href="/">Index</a>
1214
<a href="/about">About</a>
1315
<Loading>{props.children}</Loading>
14-
</>
16+
</MetaProvider>
1517
)}
1618
>
1719
<FileRoutes />

apps/fixtures/basic/src/routes/about.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
import { Title } from "@solidjs/meta";
2+
13
export default function About() {
24
return (
35
<main>
6+
<Title>About</Title>
47
<h1>About</h1>
58
</main>
69
);

apps/fixtures/basic/src/routes/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
import { Title } from "@solidjs/meta";
12
import Counter from "~/components/Counter";
23

34
export default function Home() {
45
return (
56
<main>
7+
<Title>Hello World</Title>
68
<h1>Hello world!</h1>
79
<Counter />
810
<p>

apps/fixtures/hackernews/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"@solidjs/router": "^0.15.0",
1111
"@solidjs/start": "workspace:*",
1212
"solid-js": "2.0.0-beta.0",
13-
"vite": "7.1.10"
13+
"vite": "7.1.10",
14+
"@solidjs/web": "2.0.0-beta.0"
1415
},
1516
"engines": {
1617
"node": ">=22"

apps/fixtures/hackernews/src/components/comment.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const Comment: Component<{ comment: CommentDefinition }> = props => {
1313
<div class="text" innerHTML={props.comment.content} />
1414
<Show when={props.comment.comments.length}>
1515
<Toggle>
16-
<For each={props.comment.comments}>{comment => <Comment comment={comment} />}</For>
16+
<For each={props.comment.comments}>{comment => <Comment comment={comment()} />}</For>
1717
</Toggle>
1818
</Show>
1919
</li>

apps/fixtures/hackernews/src/routes/[...stories].tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export default function Stories(props: RouteSectionProps) {
4747
<main class="news-list">
4848
<Show when={stories()}>
4949
<ul>
50-
<For each={stories()}>{story => <Story story={story} />}</For>
50+
<For each={stories()}>{story => <Story story={story()} />}</For>
5151
</ul>
5252
</Show>
5353
</main>

apps/fixtures/hackernews/src/routes/stories/[id].tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default function Story(props: RouteSectionProps) {
3131
{story()!.comments_count ? story()!.comments_count + " comments" : "No comments yet."}
3232
</p>
3333
<ul class="comment-children">
34-
<For each={story()!.comments}>{comment => <Comment comment={comment} />}</For>
34+
<For each={story()!.comments}>{comment => <Comment comment={comment()} />}</For>
3535
</ul>
3636
</div>
3737
</div>

apps/fixtures/notes/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"marked": "^12.0.1",
1414
"solid-js": "2.0.0-beta.0",
1515
"unstorage": "1.10.2",
16-
"vite": "7.1.10"
16+
"vite": "7.1.10",
17+
"@solidjs/web": "2.0.0-beta.0"
1718
},
1819
"engines": {
1920
"node": ">=22"

apps/fixtures/todomvc/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"@solidjs/start": "workspace:*",
1313
"solid-js": "2.0.0-beta.0",
1414
"unstorage": "1.10.2",
15-
"vite": "7.1.10"
15+
"vite": "7.1.10",
16+
"@solidjs/web": "2.0.0-beta.0"
1617
},
1718
"engines": {
1819
"node": ">=22"

apps/fixtures/todomvc/src/routes/index.tsx

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { Todo } from "~/types";
2020

2121
declare module "solid-js" {
2222
namespace JSX {
23-
interface ExplicitProperties {}
23+
interface ExplicitProperties { }
2424
}
2525
}
2626
const setFocus = () => (el: HTMLElement) => setTimeout(() => el.focus());
@@ -91,41 +91,41 @@ export default function TodoApp(props: RouteSectionProps) {
9191
<ul class="todo-list">
9292
<For each={filterList(todos())}>
9393
{todo => {
94-
const togglingTodo = useSubmission(toggleTodo, input => input[0] == todo.id);
95-
const editingTodo = useSubmission(editTodo, input => input[0] == todo.id);
96-
const title = () => (editingTodo.pending ? editingTodo.input[0] : todo.title);
94+
const togglingTodo = useSubmission(toggleTodo, input => input[0] == todo().id);
95+
const editingTodo = useSubmission(editTodo, input => input[0] == todo().id);
96+
const title = () => (editingTodo.pending ? editingTodo.input[0] : todo().title);
9797
const pending = () =>
9898
togglingAll.pending || togglingTodo.pending || editingTodo.pending;
9999
const completed = () =>
100100
togglingAll.pending
101101
? !togglingAll.input[0]
102102
: togglingTodo.pending
103-
? !todo.completed
104-
: todo.completed;
105-
const removing = () => removingTodo.some(data => data.input[0] === todo.id);
103+
? !todo().completed
104+
: todo().completed;
105+
const removing = () => removingTodo.some(data => data.input[0] === todo().id);
106106
return (
107107
<Show when={!removing()}>
108108
<li
109109
class={["todo", {
110-
editing: editingTodoId() === todo.id,
110+
editing: editingTodoId() === todo().id,
111111
completed: completed(),
112-
pending: pending(),
112+
pending: pending() ?? false,
113113
}]}
114114
>
115115
<form class="view" method="post">
116116
<button
117-
formAction={toggleTodo.with(todo.id)}
117+
formaction={toggleTodo.with(todo().id)}
118118
class="toggle"
119119
disabled={pending()}
120120
>
121-
{completed() ? <CompleteIcon /> : <IncompleteIcon />}
121+
<Show when={completed()} fallback={<IncompleteIcon />}><CompleteIcon /></Show>
122122
</button>
123-
<label onDblClick={[setEditing, { id: todo.id, pending }]}>{title()}</label>
124-
<button formAction={removeTodo.with(todo.id)} class="destroy" />
123+
<label onDblClick={[setEditing, { id: todo().id, pending }]}>{title()}</label>
124+
<button formaction={removeTodo.with(todo().id)} class="destroy" />
125125
</form>
126-
<Show when={editingTodoId() === todo.id}>
126+
<Show when={editingTodoId() === todo().id}>
127127
<form
128-
action={editTodo.with(todo.id)}
128+
action={editTodo.with(todo().id)}
129129
method="post"
130130
onSubmit={e => {
131131
e.preventDefault();
@@ -135,9 +135,9 @@ export default function TodoApp(props: RouteSectionProps) {
135135
<input
136136
name="title"
137137
class="edit"
138-
value={todo.title}
138+
value={todo().title}
139139
onBlur={e => {
140-
if (todo.title !== e.currentTarget.value) {
140+
if (todo().title !== e.currentTarget.value) {
141141
e.currentTarget.form!.requestSubmit();
142142
} else setTimeout(() => setEditing({}));
143143
}}
@@ -154,7 +154,7 @@ export default function TodoApp(props: RouteSectionProps) {
154154
{sub => (
155155
<li class="todo pending">
156156
<div class="view">
157-
<label>{String(sub.input[0].get("title"))}</label>
157+
<label>{String(sub().input[0].get("title"))}</label>
158158
<button disabled class="destroy" />
159159
</div>
160160
</li>
@@ -198,6 +198,6 @@ export default function TodoApp(props: RouteSectionProps) {
198198
</Show>
199199
</footer>
200200
</Show>
201-
</section>
201+
</section >
202202
);
203203
}

0 commit comments

Comments
 (0)