Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deno.jsonc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"imports": {
"fullsoak": "jsr:@fullsoak/fullsoak@0.15.0",
"fullsoak": "jsr:@fullsoak/fullsoak@0.16.0-alpha.1",
"preact": "npm:[email protected]",
"preact-iso": "npm:[email protected]",
"@std/testing": "jsr:@std/testing@^1.0.9"
Expand Down
8 changes: 4 additions & 4 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 9 additions & 8 deletions src/components/MyRouteAwareComponent/routes/Media/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ import type { FunctionComponent } from "preact";
import type { RoutableProps } from "preact-iso";

type Props = RoutableProps & {
id?: string
}
id?: string;
};

export const Media: FunctionComponent<Props> = ({ id }) => {

return <section className="page-media">
{id && <h1>Showing media for id {id}</h1>}
{!id && <small>Please provide a source url to view its content</small>}
</section>;
}
return (
<section className="page-media">
{id && <h1>Showing media for id {id}</h1>}
{!id && <small>Please provide a source url to view its content</small>}
</section>
);
};
3 changes: 2 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
ssr,
useFullSoak,
} from "fullsoak";
import { byoHat } from "fullsoak/batteries";
import { MyComponent } from "./components/MyComponent/index.tsx";
import { MyRouteAwareComponent } from "./components/MyRouteAwareComponent/index.tsx";

Expand All @@ -25,7 +26,7 @@ class MyController {
return ssr(MyRouteAwareComponent, {
foo: "Lorem Ipsum",
path: ctx.request.url.pathname,
});
}, { headContent: byoHat({ title: "FullSoak App" }) });
}
}

Expand Down
4 changes: 2 additions & 2 deletions tests/__snapshots__/MyComponent.test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export const snapshot = {};

snapshot[`MyComponent 1`] = `
'<!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">{
'<!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">{
"imports": {
"preact": "https://esm.sh/[email protected]",
"preact/hooks": "https://esm.sh/[email protected]/hooks",
Expand All @@ -21,5 +21,5 @@ snapshot[`MyComponent 1`] = `
"fullsoak": "/fullsoak",
"@fullsoak/fullsoak": "/fullsoak"
}
}</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>'
}</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>'
`;
4 changes: 2 additions & 2 deletions tests/__snapshots__/MyRouteAwareComponent.test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export const snapshot = {};

snapshot[`MyRouteAwareComponent 1`] = `
'<!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">{
'<!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">{
"imports": {
"preact": "https://esm.sh/[email protected]",
"preact/hooks": "https://esm.sh/[email protected]/hooks",
Expand All @@ -21,5 +21,5 @@ snapshot[`MyRouteAwareComponent 1`] = `
"fullsoak": "/fullsoak",
"@fullsoak/fullsoak": "/fullsoak"
}
}</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>'
}</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>'
`;
Loading