Skip to content

Commit 3f7fc8e

Browse files
authored
Merge pull request #3 from fullsoak/exp/0.16.0-alpha.1
exp 0.16.0-alpha.1
2 parents cfb229b + 60db1d5 commit 3f7fc8e

File tree

6 files changed

+20
-18
lines changed

6 files changed

+20
-18
lines changed

deno.jsonc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"imports": {
3-
"fullsoak": "jsr:@fullsoak/fullsoak@0.15.0",
3+
"fullsoak": "jsr:@fullsoak/fullsoak@0.16.0-alpha.1",
44
"preact": "npm:[email protected]",
55
"preact-iso": "npm:[email protected]",
66
"@std/testing": "jsr:@std/testing@^1.0.9"

deno.lock

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

src/components/MyRouteAwareComponent/routes/Media/index.tsx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@ import type { FunctionComponent } from "preact";
22
import type { RoutableProps } from "preact-iso";
33

44
type Props = RoutableProps & {
5-
id?: string
6-
}
5+
id?: string;
6+
};
77

88
export const Media: FunctionComponent<Props> = ({ id }) => {
9-
10-
return <section className="page-media">
11-
{id && <h1>Showing media for id {id}</h1>}
12-
{!id && <small>Please provide a source url to view its content</small>}
13-
</section>;
14-
}
9+
return (
10+
<section className="page-media">
11+
{id && <h1>Showing media for id {id}</h1>}
12+
{!id && <small>Please provide a source url to view its content</small>}
13+
</section>
14+
);
15+
};

src/main.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
ssr,
77
useFullSoak,
88
} from "fullsoak";
9+
import { byoHat } from "fullsoak/batteries";
910
import { MyComponent } from "./components/MyComponent/index.tsx";
1011
import { MyRouteAwareComponent } from "./components/MyRouteAwareComponent/index.tsx";
1112

@@ -25,7 +26,7 @@ class MyController {
2526
return ssr(MyRouteAwareComponent, {
2627
foo: "Lorem Ipsum",
2728
path: ctx.request.url.pathname,
28-
});
29+
}, { headContent: byoHat({ title: "FullSoak App" }) });
2930
}
3031
}
3132

tests/__snapshots__/MyComponent.test.ts.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export const snapshot = {};
22

33
snapshot[`MyComponent 1`] = `
4-
'<!doctype html><html><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0"/><title></title><script type="importmap">{
4+
'<!doctype html><html><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0"/><link rel="preload" href="/components/MyComponent/mount" as="script" type="text/javascript"/><link rel="preload" href="/components/MyComponent/index.tsx" as="script" type="text/javascript"/><script type="importmap">{
55
"imports": {
66
"preact": "https://esm.sh/[email protected]",
77
"preact/hooks": "https://esm.sh/[email protected]/hooks",
@@ -21,5 +21,5 @@ snapshot[`MyComponent 1`] = `
2121
"fullsoak": "/fullsoak",
2222
"@fullsoak/fullsoak": "/fullsoak"
2323
}
24-
}</script><script type="text/javascript"></script><style></style></head><body><main id="fullsoak-htmlshell-main"><section class="main"><h1>MyComponent</h1><ul><li>props &#39;foo&#39; is bar</li><li>state count is 0 <button >+</button><button >-</button></li><li><a href="/app">Route Aware App Component</a></li></ul></section><section style="padding:1rem;"><h2>MyOtherComponent</h2><span>props &#39;baz&#39; is 0</span></section><footer><span>source code of this website:</span> <a href="https://github.com/fullsoak/deno-examples">https://github.com/fullsoak/deno-examples</a></footer></main><script type="text/javascript">window.preloadedProps = {"foo":"bar"}</script><script type="module" src="/components/MyComponent/mount"></script></body></html>'
24+
}</script><script type="text/javascript"></script><style></style></head><body><main id="fullsoak-htmlshell-main"><section class="main"><h1>MyComponent</h1><ul><li>props &#39;foo&#39; is bar</li><li>state count is 0 <button >+</button><button >-</button></li><li><a href="/app">Route Aware App Component</a></li></ul></section><section style="padding:1rem;"><h2>MyOtherComponent</h2><span>props &#39;baz&#39; is 0</span></section><footer><span>source code of this website:</span> <a href="https://github.com/fullsoak/deno-examples">https://github.com/fullsoak/deno-examples</a></footer></main><script type="text/javascript">window.preloadedProps = {"foo":"bar"}</script><script defer type="module" src="/components/MyComponent/mount"></script></body></html>'
2525
`;

tests/__snapshots__/MyRouteAwareComponent.test.ts.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export const snapshot = {};
22

33
snapshot[`MyRouteAwareComponent 1`] = `
4-
'<!doctype html><html><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0"/><title></title><script type="importmap">{
4+
'<!doctype html><html><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0"/><link rel="preload" href="/components/MyRouteAwareComponent/mount" as="script" type="text/javascript"/><link rel="preload" href="/components/MyRouteAwareComponent/index.tsx" as="script" type="text/javascript"/><script type="importmap">{
55
"imports": {
66
"preact": "https://esm.sh/[email protected]",
77
"preact/hooks": "https://esm.sh/[email protected]/hooks",
@@ -21,5 +21,5 @@ snapshot[`MyRouteAwareComponent 1`] = `
2121
"fullsoak": "/fullsoak",
2222
"@fullsoak/fullsoak": "/fullsoak"
2323
}
24-
}</script><script type="text/javascript"></script><style></style></head><body><main id="fullsoak-htmlshell-main"><main><h1>NotFound</h1><a href="/app">Back</a></main></main><script type="text/javascript">window.preloadedProps = {"url":"http://localhost/bar"}</script><script type="module" src="/components/MyRouteAwareComponent/mount"></script></body></html>'
24+
}</script><script type="text/javascript"></script><style></style></head><body><main id="fullsoak-htmlshell-main"><main><h1>NotFound</h1><a href="/app">Back</a></main></main><script type="text/javascript">window.preloadedProps = {"url":"http://localhost/bar"}</script><script defer type="module" src="/components/MyRouteAwareComponent/mount"></script></body></html>'
2525
`;

0 commit comments

Comments
 (0)