Skip to content

Commit 4cee622

Browse files
committed
fmt
1 parent d12bc05 commit 4cee622

File tree

12 files changed

+148
-160
lines changed

12 files changed

+148
-160
lines changed

.github/workflows/deploy.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,3 @@ jobs:
3737
project: "fullsoak-examples"
3838
entrypoint: "src/main.ts"
3939
root: ""
40-
41-

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33
FullSoak is a no-build TypeScript fullstack SSR-first framework. This repo hosts
44
several examples using FullSoak.
55

6-
WARNING: as the
7-
[FullSoak framework](https://jsr.io/@fullsoak/[email protected]) is still in
8-
an early development phase, breaking changes are expected. When in doubt, please
9-
feel free to open a PR / discussion. Thank you for your interest!
6+
WARNING: as the [FullSoak framework](https://jsr.io/@fullsoak/fullsoak) is still
7+
in an early development phase, breaking changes are expected. When in doubt,
8+
please feel free to open a PR / discussion. Thank you for your interest!
109

1110
## Available commands
1211

deno.jsonc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"imports": {
3-
"fullsoak": "jsr:@fullsoak/[email protected]-rc.2",
3+
"fullsoak": "jsr:@fullsoak/[email protected]",
44
"preact": "npm:[email protected]",
5+
"preact-iso": "npm:[email protected]",
56
"@std/testing": "jsr:@std/testing@^1.0.9"
67
},
78
"nodeModulesDir": "auto",

deno.lock

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

src/components/MyComponent/index.tsx

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,23 @@ export const MyComponent: FunctionComponent<MyProps> = ({ foo }) => {
1616
return () => alert(`unmounted component with initial props foo=${foo}`);
1717
}, []);
1818

19-
return <>
20-
<section className="main">
21-
<h1>MyComponent</h1>
22-
<ul>
23-
<li>props 'foo' is {foo}</li>
24-
<li>
25-
state count is {count}{" "}
26-
<button onClick={() => setCount((x) => x + 1)}>+</button>
27-
<button onClick={() => setCount((x) => x - 1)}>-</button>
28-
</li>
29-
<li>
30-
<a href="/app">Route Aware App Component</a>
31-
</li>
32-
</ul>
33-
</section>
34-
<MyOtherComponent baz={count} />
35-
</>;
19+
return (
20+
<>
21+
<section className="main">
22+
<h1>MyComponent</h1>
23+
<ul>
24+
<li>props 'foo' is {foo}</li>
25+
<li>
26+
state count is {count}{" "}
27+
<button onClick={() => setCount((x) => x + 1)}>+</button>
28+
<button onClick={() => setCount((x) => x - 1)}>-</button>
29+
</li>
30+
<li>
31+
<a href="/app">Route Aware App Component</a>
32+
</li>
33+
</ul>
34+
</section>
35+
<MyOtherComponent baz={count} />
36+
</>
37+
);
3638
};

src/components/MyOtherComponent/index.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,17 @@ import { useEffect } from "preact/hooks";
33

44
type Props = {
55
baz: number;
6-
}
6+
};
77

88
export const MyOtherComponent: FunctionComponent<Props> = ({ baz }: Props) => {
99
useEffect(() => {
1010
alert(`MyOtherComponent mounted with initial props baz=${baz}`);
1111
}, []);
1212

13-
return <section style={{ padding: "1rem" }}>
14-
<h2>MyOtherComponent</h2>
15-
<span>props 'baz' is {baz}</span>
16-
</section>;
13+
return (
14+
<section style={{ padding: "1rem" }}>
15+
<h2>MyOtherComponent</h2>
16+
<span>props 'baz' is {baz}</span>
17+
</section>
18+
);
1719
};
Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,39 @@
1-
import { lazy, LocationProvider, ErrorBoundary, Router, Route } from 'fullsoak/preact-iso';
1+
import {
2+
ErrorBoundary,
3+
lazy,
4+
LocationProvider,
5+
Route,
6+
Router,
7+
} from "preact-iso";
28

39
// Synchronous
4-
import { Home } from './routes/Home.tsx';
5-
import { Profiles } from './routes/Profiles.tsx';
10+
import { Home } from "./routes/Home.tsx";
11+
import { Profiles } from "./routes/Profiles.tsx";
612

713
// Asynchronous (throws a promise)
8-
const Profile = lazy(() => import('./routes/Profile.tsx').then(cmp => cmp.Profile));
9-
const NotFound = lazy(() => import('./routes/_404.tsx').then(cmp => cmp.NotFound));
14+
const Profile = lazy(() =>
15+
import("./routes/Profile.tsx").then((cmp) => cmp.Profile)
16+
);
17+
const NotFound = lazy(() =>
18+
import("./routes/_404.tsx").then((cmp) => cmp.NotFound)
19+
);
1020

11-
type AppProps = { url: string }
21+
type AppProps = { url: string };
1222

1323
export const MyRouteAwareComponent = ({ url }: AppProps) => (
14-
<LocationProvider url={url} scope="/app">
15-
<ErrorBoundary>
16-
<Router>
17-
<Home path="/app" />
18-
{/* Alternative dedicated route component for better TS support */}
19-
<Route path="/app/profiles" component={Profiles} />
20-
<Route path="/app/profiles/:id" component={() => <Profile blah="foo" />} />
21-
{/* `default` prop indicates a fallback route. Useful for 404 pages */}
22-
<NotFound default />
23-
</Router>
24-
</ErrorBoundary>
25-
</LocationProvider>
24+
<LocationProvider url={url} scope="/app">
25+
<ErrorBoundary>
26+
<Router>
27+
<Home path="/app" />
28+
{/* Alternative dedicated route component for better TS support */}
29+
<Route path="/app/profiles" component={Profiles} />
30+
<Route
31+
path="/app/profiles/:id"
32+
component={() => <Profile blah="foo" />}
33+
/>
34+
{/* `default` prop indicates a fallback route. Useful for 404 pages */}
35+
<NotFound default />
36+
</Router>
37+
</ErrorBoundary>
38+
</LocationProvider>
2639
);

0 commit comments

Comments
 (0)