diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 3d8ce41b..e9e061d7 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -33,7 +33,7 @@ jobs:
run: deno lint
- name: Cache dependencies
- run: deno cache --no-check src/dev/deps.ts src/runtime/deps.ts src/server/deps.ts
+ run: deno cache --no-check --import-map=./www/import_map.json src/dev/deps.ts src/server/deps.ts www/main.ts
- name: Cache Chrome (Linux)
if: startsWith(matrix.os, 'ubuntu')
diff --git a/.vscode/import_map.json b/.vscode/import_map.json
index a4b4ed22..86b8a314 100644
--- a/.vscode/import_map.json
+++ b/.vscode/import_map.json
@@ -3,6 +3,10 @@
"imports": {
"$fresh/": "../",
"$twind": "https://esm.sh/twind@0.16.16",
- "$twind/": "https://esm.sh/twind@0.16.16/"
+ "$twind/": "https://esm.sh/twind@0.16.16/",
+
+ "preact": "https://esm.sh/preact@10.6.6",
+ "preact/": "https://esm.sh/preact@10.6.6/",
+ "preact-render-to-string": "https://esm.sh/preact-render-to-string@5.1.20?deps=preact@10.6.6"
}
}
diff --git a/docs/concepts/routes.md b/docs/concepts/routes.md
index 421d6ed8..26eb99cc 100644
--- a/docs/concepts/routes.md
+++ b/docs/concepts/routes.md
@@ -43,7 +43,8 @@ Now, let's render some HTML using the route component. Another example:
// routes/html.tsx
/** @jsx h */
-import { h, PageProps } from "$fresh/runtime.ts";
+import { h } from "preact";
+import { PageProps } from "$fresh/runtime.ts";
export default function Page(props: PageProps) {
return
You are on the page '{props.url.href}'.
;
@@ -65,7 +66,8 @@ response after rendering the page component.
// routes/html.tsx
/** @jsx h */
-import { h, PageProps } from "$fresh/runtime.ts";
+import { h } from "preact";
+import { PageProps } from "$fresh/runtime.ts";
import { HandlerContext, Handlers } from "$fresh/server.ts";
export const handler: Handlers = {
diff --git a/docs/getting-started/adding-interactivity.md b/docs/getting-started/adding-interactivity.md
index 4cba59d9..137fd63c 100644
--- a/docs/getting-started/adding-interactivity.md
+++ b/docs/getting-started/adding-interactivity.md
@@ -31,7 +31,8 @@ Here is an example of an island component that counts down to a specific time.
// islands/Countdown.tsx
/** @jsx h */
-import { h, useEffect, useState } from "$fresh/runtime.ts";
+import { h } from "preact";
+import { useEffect, useState } from "preact/hooks";
const timeFmt = new Intl.RelativeTimeFormat("en-US");
@@ -73,7 +74,7 @@ client with the correct props:
// routes/countdown.tsx
/** @jsx h */
-import { h } from "$fresh/runtime.ts";
+import { h } from "preact";
import Countdown from "../islands/Countdown.tsx";
export default function Page() {
diff --git a/docs/getting-started/create-a-route.md b/docs/getting-started/create-a-route.md
index 50a44872..d6d9f265 100644
--- a/docs/getting-started/create-a-route.md
+++ b/docs/getting-started/create-a-route.md
@@ -38,7 +38,7 @@ This is done with JSX.
// routes/about.tsx
/** @jsx h */
-import { h } from "$fresh/runtime.ts";
+import { h } from "preact";
export default function AboutPage() {
return (
diff --git a/docs/getting-started/custom-handlers.md b/docs/getting-started/custom-handlers.md
index 37329359..6dcb521b 100644
--- a/docs/getting-started/custom-handlers.md
+++ b/docs/getting-started/custom-handlers.md
@@ -31,7 +31,7 @@ then adds a custom header to the response before returning it:
// routes/about.tsx
/** @jsx h */
-import { h } from "$fresh/runtime.ts";
+import { h } from "preact";
import { Handlers } from "$fresh/server.ts";
export const handler: Handlers = {
diff --git a/docs/getting-started/dynamic-routes.md b/docs/getting-started/dynamic-routes.md
index 3c171805..e7f542fe 100644
--- a/docs/getting-started/dynamic-routes.md
+++ b/docs/getting-started/dynamic-routes.md
@@ -28,7 +28,8 @@ as arguments in it's `props` object though.
// routes/greet/[name].tsx
/** @jsx h */
-import { h, PageProps } from "$fresh/runtime.ts";
+import { h } from "preact";
+import { PageProps } from "$fresh/runtime.ts";
export default function GreetPage(props: PageProps) {
const { name } = props.params;
diff --git a/docs/getting-started/fetching-data.md b/docs/getting-started/fetching-data.md
index 71d0cc82..80ed6078 100644
--- a/docs/getting-started/fetching-data.md
+++ b/docs/getting-started/fetching-data.md
@@ -24,7 +24,8 @@ renders it in a page component.
// routes/github/[username].tsx
/** @jsx h */
-import { h, PageProps } from "$fresh/runtime.ts";
+import { h } from "preact";
+import { PageProps } from "$fresh/runtime.ts";
import { Handlers } from "$fresh/server.ts";
interface User {
diff --git a/docs/getting-started/form-submissions.md b/docs/getting-started/form-submissions.md
index a6d56565..43dcecfb 100644
--- a/docs/getting-started/form-submissions.md
+++ b/docs/getting-started/form-submissions.md
@@ -33,7 +33,8 @@ server side:
// routes/search.tsx
/** @jsx h */
-import { h, PageProps } from "$fresh/runtime.ts";
+import { h } from "preact";
+import { PageProps } from "$fresh/runtime.ts";
import { Handlers } from "$fresh/server.ts";
const NAMES = ["Alice", "Bob", "Charlie", "Dave", "Eve", "Frank"];
diff --git a/examples/counter/import_map.json b/examples/counter/import_map.json
index 7bdcd08d..47674ea3 100644
--- a/examples/counter/import_map.json
+++ b/examples/counter/import_map.json
@@ -1,5 +1,8 @@
{
"imports": {
- "$fresh/": "../../"
+ "$fresh/": "../../",
+ "preact": "https://esm.sh/preact@10.6.6",
+ "preact/": "https://esm.sh/preact@10.6.6/",
+ "preact-render-to-string": "https://esm.sh/preact-render-to-string@5.1.20?deps=preact@10.6.6"
}
}
diff --git a/examples/counter/islands/Counter.tsx b/examples/counter/islands/Counter.tsx
index ce4e644e..d0878396 100644
--- a/examples/counter/islands/Counter.tsx
+++ b/examples/counter/islands/Counter.tsx
@@ -1,5 +1,7 @@
/** @jsx h */
-import { h, IS_BROWSER, useState } from "$fresh/runtime.ts";
+import { h } from "preact";
+import { useState } from "preact/hooks";
+import { IS_BROWSER } from "$fresh/runtime.ts";
interface CounterProps {
start: number;
diff --git a/examples/counter/routes/index.tsx b/examples/counter/routes/index.tsx
index 52812f43..2e3b4b28 100644
--- a/examples/counter/routes/index.tsx
+++ b/examples/counter/routes/index.tsx
@@ -1,5 +1,5 @@
/** @jsx h */
-import { h } from "$fresh/runtime.ts";
+import { h } from "preact";
import Counter from "../islands/Counter.tsx";
export default function Home() {
diff --git a/init.ts b/init.ts
index b94cbfce..45494f54 100644
--- a/init.ts
+++ b/init.ts
@@ -48,6 +48,10 @@ const IMPORT_MAP_JSON = JSON.stringify(
{
"imports": {
"$fresh/": new URL("./", import.meta.url).href,
+ "preact": "https://esm.sh/preact@10.6.6",
+ "preact/": "https://esm.sh/preact@10.6.6/",
+ "preact-render-to-string":
+ "https://esm.sh/preact-render-to-string@5.1.20?deps=preact@10.6.6",
},
},
null,
@@ -56,7 +60,7 @@ const IMPORT_MAP_JSON = JSON.stringify(
await Deno.writeTextFile(join(directory, "import_map.json"), IMPORT_MAP_JSON);
const ROUTES_INDEX_TSX = `/** @jsx h */
-import { h } from "$fresh/runtime.ts";
+import { h } from "preact";
import Counter from "../islands/Counter.tsx";
export default function Home() {
@@ -78,7 +82,9 @@ await Deno.writeTextFile(
);
const ISLANDS_COUNTER_TSX = `/** @jsx h */
-import { h, IS_BROWSER, useState } from "$fresh/runtime.ts";
+import { h } from "preact";
+import { useState } from "preact/hooks";
+import { IS_BROWSER } from "$fresh/runtime.ts";
interface CounterProps {
start: number;
@@ -105,7 +111,8 @@ await Deno.writeTextFile(
);
const ROUTES_GREET_TSX = `/** @jsx h */
-import { h, PageProps } from "$fresh/runtime.ts";
+import { h } from "preact";
+import { PageProps } from "$fresh/runtime.ts";
export default function Greet(props: PageProps) {
return Hello {props.params.name}
;
diff --git a/runtime.ts b/runtime.ts
index 788d9325..eaeeea24 100644
--- a/runtime.ts
+++ b/runtime.ts
@@ -1,4 +1,3 @@
-export * from "./src/runtime/deps.ts";
export * from "./src/runtime/types.ts";
export * from "./src/runtime/utils.ts";
export * from "./src/runtime/head.ts";
diff --git a/src/runtime/csp.ts b/src/runtime/csp.ts
index 9955b054..15663310 100644
--- a/src/runtime/csp.ts
+++ b/src/runtime/csp.ts
@@ -1,4 +1,5 @@
-import { createContext, useContext } from "./deps.ts";
+import { createContext } from "preact";
+import { useContext } from "preact/hooks";
export const SELF = "'self'";
export const UNSAFE_INLINE = "'unsafe-inline'";
diff --git a/src/runtime/deps.ts b/src/runtime/deps.ts
deleted file mode 100644
index a7bad34e..00000000
--- a/src/runtime/deps.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-export * from "https://esm.sh/preact@10.6.6";
-export { jsx, jsxDEV, jsxs } from "https://esm.sh/preact@10.6.6/jsx-runtime";
-export {
- useCallback,
- useContext,
- useDebugValue,
- useEffect,
- useErrorBoundary,
- useImperativeHandle,
- useLayoutEffect,
- useMemo,
- useReducer,
- useRef,
- useState,
-} from "https://esm.sh/preact@10.6.6/hooks";
-export type {
- CreateHandle,
- EffectCallback,
- Inputs,
- PropRef,
- Reducer,
- Ref,
- StateUpdater,
-} from "https://esm.sh/preact@10.6.6/hooks";
diff --git a/src/runtime/head.ts b/src/runtime/head.ts
index e7a206a7..c10b72c6 100644
--- a/src/runtime/head.ts
+++ b/src/runtime/head.ts
@@ -1,4 +1,5 @@
-import { ComponentChildren, createContext, useContext } from "./deps.ts";
+import { ComponentChildren, createContext } from "preact";
+import { useContext } from "preact/hooks";
export interface HeadProps {
children: ComponentChildren;
diff --git a/src/runtime/main.ts b/src/runtime/main.ts
index ab1fb8b9..7639e272 100644
--- a/src/runtime/main.ts
+++ b/src/runtime/main.ts
@@ -1,4 +1,4 @@
-import { ComponentType, h, options, render } from "./deps.ts";
+import { ComponentType, h, options, render } from "preact";
import { assetHashingHook } from "./utils.ts";
function createRootFragment(
diff --git a/src/runtime/types.ts b/src/runtime/types.ts
index a2aec7cd..de5f0f40 100644
--- a/src/runtime/types.ts
+++ b/src/runtime/types.ts
@@ -1,4 +1,4 @@
-import { ComponentType } from "./deps.ts";
+import { ComponentType } from "preact";
// deno-lint-ignore no-explicit-any
export interface PageProps {
diff --git a/src/runtime/utils.ts b/src/runtime/utils.ts
index 6373e6e6..b6e5c93a 100644
--- a/src/runtime/utils.ts
+++ b/src/runtime/utils.ts
@@ -1,4 +1,4 @@
-import { VNode } from "./deps.ts";
+import { VNode } from "preact";
export const INTERNAL_PREFIX = "/_frsh";
export const ASSET_CACHE_BUST_KEY = "__frsh_c";
diff --git a/src/server/context.ts b/src/server/context.ts
index b8dfbfe9..2d4f7853 100644
--- a/src/server/context.ts
+++ b/src/server/context.ts
@@ -8,10 +8,10 @@ import {
toFileUrl,
walk,
} from "./deps.ts";
+import { h } from "preact";
import { Manifest } from "./mod.ts";
import { Bundler } from "./bundle.ts";
import { ALIVE_URL, BUILD_ID, JS_PREFIX, REFRESH_JS_URL } from "./constants.ts";
-
import DefaultErrorHandler from "./default_error_page.tsx";
import {
AppModule,
@@ -32,7 +32,6 @@ import {
} from "./types.ts";
import { render as internalRender } from "./render.tsx";
import { ContentSecurityPolicyDirectives, SELF } from "../runtime/csp.ts";
-import { h } from "../runtime/deps.ts";
import { ASSET_CACHE_BUST_KEY, INTERNAL_PREFIX } from "../runtime/utils.ts";
interface StaticFile {
diff --git a/src/server/default_error_page.tsx b/src/server/default_error_page.tsx
index 7ce32047..c919fb68 100644
--- a/src/server/default_error_page.tsx
+++ b/src/server/default_error_page.tsx
@@ -1,6 +1,6 @@
/** @jsx h */
-import { h } from "../runtime/deps.ts";
+import { h } from "preact";
import { DEBUG } from "./constants.ts";
import type { ErrorPageProps } from "../runtime/types.ts";
diff --git a/src/server/deps.ts b/src/server/deps.ts
index 0e6c0135..60fb37d5 100644
--- a/src/server/deps.ts
+++ b/src/server/deps.ts
@@ -1,6 +1,3 @@
-// -- preact --
-export { renderToString } from "https://esm.sh/preact-render-to-string@5.1.20?deps=preact@10.6.6";
-
// -- std --
export {
extname,
diff --git a/src/server/render.tsx b/src/server/render.tsx
index 196b24ab..33c08bc9 100644
--- a/src/server/render.tsx
+++ b/src/server/render.tsx
@@ -1,11 +1,6 @@
/** @jsx h */
-import { renderToString } from "./deps.ts";
-import {
- ComponentChildren,
- ComponentType,
- h,
- options,
-} from "../runtime/deps.ts";
+import { renderToString } from "preact-render-to-string";
+import { ComponentChildren, ComponentType, h, options } from "preact";
import {
AppModule,
ErrorPage,
diff --git a/src/server/types.ts b/src/server/types.ts
index fc3f7793..33123f16 100644
--- a/src/server/types.ts
+++ b/src/server/types.ts
@@ -1,4 +1,4 @@
-import { ComponentType } from "../runtime/deps.ts";
+import { ComponentType } from "preact";
import { ConnInfo, router, ServeInit } from "./deps.ts";
import {
AppProps,
diff --git a/tests/fixture/import_map.json b/tests/fixture/import_map.json
index 7bdcd08d..47674ea3 100644
--- a/tests/fixture/import_map.json
+++ b/tests/fixture/import_map.json
@@ -1,5 +1,8 @@
{
"imports": {
- "$fresh/": "../../"
+ "$fresh/": "../../",
+ "preact": "https://esm.sh/preact@10.6.6",
+ "preact/": "https://esm.sh/preact@10.6.6/",
+ "preact-render-to-string": "https://esm.sh/preact-render-to-string@5.1.20?deps=preact@10.6.6"
}
}
diff --git a/tests/fixture/islands/Counter.tsx b/tests/fixture/islands/Counter.tsx
index 19d0af1a..e877418e 100644
--- a/tests/fixture/islands/Counter.tsx
+++ b/tests/fixture/islands/Counter.tsx
@@ -1,5 +1,7 @@
/** @jsx h */
-import { h, IS_BROWSER, useState } from "$fresh/runtime.ts";
+import { h } from "preact";
+import { useState } from "preact/hooks";
+import { IS_BROWSER } from "$fresh/runtime.ts";
interface CounterProps {
start: number;
diff --git a/tests/fixture/islands/Test.tsx b/tests/fixture/islands/Test.tsx
index a3045518..a2c77765 100644
--- a/tests/fixture/islands/Test.tsx
+++ b/tests/fixture/islands/Test.tsx
@@ -1,6 +1,5 @@
/** @jsx h */
-
-import { h } from "$fresh/runtime.ts";
+import { h } from "preact";
export default function Test(props: { message: string }) {
return (
diff --git a/tests/fixture/routes/[name].tsx b/tests/fixture/routes/[name].tsx
index 9a0573cb..782d233a 100644
--- a/tests/fixture/routes/[name].tsx
+++ b/tests/fixture/routes/[name].tsx
@@ -1,6 +1,5 @@
/** @jsx h */
-
-import { h } from "$fresh/runtime.ts";
+import { h } from "preact";
interface Props {
params: Record;
diff --git a/tests/fixture/routes/_404.tsx b/tests/fixture/routes/_404.tsx
index 5be390c6..f811202a 100644
--- a/tests/fixture/routes/_404.tsx
+++ b/tests/fixture/routes/_404.tsx
@@ -1,6 +1,6 @@
/** @jsx h */
-
-import { h, UnknownPageProps } from "$fresh/runtime.ts";
+import { h } from "preact";
+import { UnknownPageProps } from "$fresh/runtime.ts";
export default function NotFoundPage({ url }: UnknownPageProps) {
return 404 not found: {url.pathname}
;
diff --git a/tests/fixture/routes/_500.tsx b/tests/fixture/routes/_500.tsx
index 0f4e4b61..5ec54a16 100644
--- a/tests/fixture/routes/_500.tsx
+++ b/tests/fixture/routes/_500.tsx
@@ -1,6 +1,6 @@
/** @jsx h */
-
-import { ErrorPageProps, h } from "$fresh/runtime.ts";
+import { h } from "preact";
+import { ErrorPageProps } from "$fresh/runtime.ts";
export default function Error500Page({ error }: ErrorPageProps) {
return 500 internal error: {(error as Error).message}
;
diff --git a/tests/fixture/routes/_app.tsx b/tests/fixture/routes/_app.tsx
index 72c78a99..72d80cdb 100644
--- a/tests/fixture/routes/_app.tsx
+++ b/tests/fixture/routes/_app.tsx
@@ -1,7 +1,7 @@
/** @jsx h */
/** @jsxFrag Fragment */
-
-import { AppProps, Fragment, h, Head } from "$fresh/runtime.ts";
+import { Fragment, h } from "preact";
+import { AppProps, Head } from "$fresh/runtime.ts";
export default function App(props: AppProps) {
return (
diff --git a/tests/fixture/routes/assetsCaching/index.tsx b/tests/fixture/routes/assetsCaching/index.tsx
index 06691095..27c546f1 100644
--- a/tests/fixture/routes/assetsCaching/index.tsx
+++ b/tests/fixture/routes/assetsCaching/index.tsx
@@ -1,6 +1,5 @@
/** @jsx h */
-
-import { asset, h } from "$fresh/runtime.ts";
+import { h } from "preact";
import Test from "../../islands/Test.tsx";
export default function Home() {
diff --git a/tests/fixture/routes/books/[id].tsx b/tests/fixture/routes/books/[id].tsx
index 21e59ce2..efc90bf3 100644
--- a/tests/fixture/routes/books/[id].tsx
+++ b/tests/fixture/routes/books/[id].tsx
@@ -1,6 +1,6 @@
/** @jsx h */
-
-import { h, PageProps, RouteConfig } from "$fresh/runtime.ts";
+import { h } from "preact";
+import { PageProps, RouteConfig } from "$fresh/runtime.ts";
export default function Page(props: PageProps) {
return Book {props.params.id}
;
diff --git a/tests/fixture/routes/index.tsx b/tests/fixture/routes/index.tsx
index 60710835..66e76903 100644
--- a/tests/fixture/routes/index.tsx
+++ b/tests/fixture/routes/index.tsx
@@ -1,6 +1,6 @@
/** @jsx h */
-
-import { h, IS_BROWSER } from "$fresh/runtime.ts";
+import { h } from "preact";
+import { IS_BROWSER } from "$fresh/runtime.ts";
import Test from "../islands/Test.tsx";
export default function Home() {
diff --git a/tests/fixture/routes/intercept.tsx b/tests/fixture/routes/intercept.tsx
index 8b862f35..06bcea5c 100644
--- a/tests/fixture/routes/intercept.tsx
+++ b/tests/fixture/routes/intercept.tsx
@@ -1,7 +1,6 @@
/** @jsx h */
-
-import { h } from "$fresh/runtime.ts";
-import { HandlerContext } from "../../../server.ts";
+import { h } from "preact";
+import { HandlerContext } from "$fresh/server.ts";
export default function Page() {
return This is HTML
;
diff --git a/tests/fixture/routes/intercept_args.tsx b/tests/fixture/routes/intercept_args.tsx
index 2eec8a72..6fa84b96 100644
--- a/tests/fixture/routes/intercept_args.tsx
+++ b/tests/fixture/routes/intercept_args.tsx
@@ -1,7 +1,7 @@
/** @jsx h */
-
-import { h, PageProps } from "$fresh/runtime.ts";
-import { HandlerContext, Handlers } from "../../../server.ts";
+import { h } from "preact";
+import { PageProps } from "$fresh/runtime.ts";
+import { Handlers } from "$fresh/server.ts";
interface Data extends Record {
info: string;
diff --git a/tests/fixture/routes/islands/index.tsx b/tests/fixture/routes/islands/index.tsx
index 6977fefa..9a818073 100644
--- a/tests/fixture/routes/islands/index.tsx
+++ b/tests/fixture/routes/islands/index.tsx
@@ -1,6 +1,5 @@
/** @jsx h */
-
-import { h } from "$fresh/runtime.ts";
+import { h } from "preact";
import Counter from "../../islands/Counter.tsx";
export default function Home() {
diff --git a/tests/fixture/routes/params.tsx b/tests/fixture/routes/params.tsx
index 30c6fc29..b66c71b8 100644
--- a/tests/fixture/routes/params.tsx
+++ b/tests/fixture/routes/params.tsx
@@ -1,6 +1,6 @@
/** @jsx h */
-
-import { h, RouteConfig } from "$fresh/runtime.ts";
+import { h } from "preact";
+import { RouteConfig } from "$fresh/runtime.ts";
import { HandlerContext } from "../../../server.ts";
export const handler = {
diff --git a/tests/fixture/routes/props/[id].tsx b/tests/fixture/routes/props/[id].tsx
index c18a557d..6f3beb1b 100644
--- a/tests/fixture/routes/props/[id].tsx
+++ b/tests/fixture/routes/props/[id].tsx
@@ -1,6 +1,6 @@
/** @jsx h */
-
-import { h, PageProps } from "$fresh/runtime.ts";
+import { h } from "preact";
+import { PageProps } from "$fresh/runtime.ts";
export default function Home(props: PageProps) {
return {JSON.stringify(props)}
;
diff --git a/tests/fixture/routes/static.tsx b/tests/fixture/routes/static.tsx
index 4c15e2a0..acb3af24 100644
--- a/tests/fixture/routes/static.tsx
+++ b/tests/fixture/routes/static.tsx
@@ -1,6 +1,6 @@
/** @jsx h */
-
-import { asset, h } from "$fresh/runtime.ts";
+import { h } from "preact";
+import { asset } from "$fresh/runtime.ts";
export default function StaticPage() {
return (
diff --git a/tests/fixture/routes/wildcard.tsx b/tests/fixture/routes/wildcard.tsx
index 256e4cbb..819403a4 100644
--- a/tests/fixture/routes/wildcard.tsx
+++ b/tests/fixture/routes/wildcard.tsx
@@ -1,6 +1,6 @@
/** @jsx h */
-
-import { h, PageProps, RouteConfig } from "$fresh/runtime.ts";
+import { h } from "preact";
+import { PageProps, RouteConfig } from "$fresh/runtime.ts";
export default function WildcardPage({ params }: PageProps) {
if (typeof params.path === "string") {
diff --git a/tests/fixture_error/import_map.json b/tests/fixture_error/import_map.json
index 7bdcd08d..47674ea3 100644
--- a/tests/fixture_error/import_map.json
+++ b/tests/fixture_error/import_map.json
@@ -1,5 +1,8 @@
{
"imports": {
- "$fresh/": "../../"
+ "$fresh/": "../../",
+ "preact": "https://esm.sh/preact@10.6.6",
+ "preact/": "https://esm.sh/preact@10.6.6/",
+ "preact-render-to-string": "https://esm.sh/preact-render-to-string@5.1.20?deps=preact@10.6.6"
}
}
diff --git a/tests/fixture_error/routes/index.tsx b/tests/fixture_error/routes/index.tsx
index 5979ffcc..fcaf0efc 100644
--- a/tests/fixture_error/routes/index.tsx
+++ b/tests/fixture_error/routes/index.tsx
@@ -1,6 +1,3 @@
-/** @jsx h */
-import { h } from "$fresh/runtime.ts";
-
export default function Home(): null {
throw new Error("boom!");
}
diff --git a/www/components/Button.tsx b/www/components/Button.tsx
index dc2a2ae1..e4af5309 100644
--- a/www/components/Button.tsx
+++ b/www/components/Button.tsx
@@ -1,6 +1,5 @@
/** @jsx h */
-
-import { h } from "$fresh/runtime.ts";
+import { h } from "preact";
import { tw } from "../utils/twind.ts";
export function RoundedButton(props: h.JSX.HTMLAttributes) {
diff --git a/www/components/DocsSidebar.tsx b/www/components/DocsSidebar.tsx
index 1bb876d2..6f1c042c 100644
--- a/www/components/DocsSidebar.tsx
+++ b/www/components/DocsSidebar.tsx
@@ -1,6 +1,5 @@
/** @jsx h */
-
-import { h } from "$fresh/runtime.ts";
+import { h } from "preact";
import { apply, tw } from "../utils/twind.ts";
import {
diff --git a/www/components/Footer.tsx b/www/components/Footer.tsx
index 1b4c2630..b968e41f 100644
--- a/www/components/Footer.tsx
+++ b/www/components/Footer.tsx
@@ -1,6 +1,5 @@
/** @jsx h */
-
-import { h } from "$fresh/runtime.ts";
+import { h } from "preact";
import { tw } from "../utils/twind.ts";
const LINKS = [
diff --git a/www/components/Icons.tsx b/www/components/Icons.tsx
index dd88c91b..7fb10822 100644
--- a/www/components/Icons.tsx
+++ b/www/components/Icons.tsx
@@ -1,6 +1,5 @@
/** @jsx h */
-
-import { h } from "$fresh/runtime.ts";
+import { h } from "preact";
import { tw } from "../utils/twind.ts";
export function IconMinus() {
diff --git a/www/components/NavigationBar.tsx b/www/components/NavigationBar.tsx
index fc65ee76..817a582b 100644
--- a/www/components/NavigationBar.tsx
+++ b/www/components/NavigationBar.tsx
@@ -1,6 +1,5 @@
/** @jsx h */
-
-import { h } from "$fresh/runtime.ts";
+import { h } from "preact";
import { tw } from "../utils/twind.ts";
export default function NavigationBar(props: { active: string }) {
diff --git a/www/components/WarningBanner.tsx b/www/components/WarningBanner.tsx
index 25db2667..8e4da3c1 100644
--- a/www/components/WarningBanner.tsx
+++ b/www/components/WarningBanner.tsx
@@ -1,6 +1,5 @@
/** @jsx h */
-
-import { h } from "$fresh/runtime.ts";
+import { h } from "preact";
import { tw } from "../utils/twind.ts";
export default function WarningBanner() {
diff --git a/www/import_map.json b/www/import_map.json
index 237a3514..7701760b 100644
--- a/www/import_map.json
+++ b/www/import_map.json
@@ -2,6 +2,9 @@
"imports": {
"$fresh/": "../",
"$twind": "https://esm.sh/twind@0.16.16",
- "$twind/": "https://esm.sh/twind@0.16.16/"
+ "$twind/": "https://esm.sh/twind@0.16.16/",
+ "preact": "https://esm.sh/preact@10.6.6",
+ "preact/": "https://esm.sh/preact@10.6.6/",
+ "preact-render-to-string": "https://esm.sh/preact-render-to-string@5.1.20?deps=preact@10.6.6"
}
}
diff --git a/www/islands/Counter.tsx b/www/islands/Counter.tsx
index 9b2db052..ab3688cc 100644
--- a/www/islands/Counter.tsx
+++ b/www/islands/Counter.tsx
@@ -1,5 +1,7 @@
/** @jsx h */
-import { h, IS_BROWSER, useState } from "$fresh/runtime.ts";
+import { h } from "preact";
+import { useState } from "preact/hooks";
+import { IS_BROWSER } from "$fresh/runtime.ts";
import { tw } from "../utils/twind.ts";
import { RoundedButton } from "../components/Button.tsx";
import { IconMinus, IconPlus } from "../components/Icons.tsx";
diff --git a/www/islands/LemonDrop.tsx b/www/islands/LemonDrop.tsx
index 52609fc1..e5731f15 100644
--- a/www/islands/LemonDrop.tsx
+++ b/www/islands/LemonDrop.tsx
@@ -1,6 +1,7 @@
/** @jsx h */
/** @jsxFrag Fragment */
-import { Fragment, h, useEffect, useRef, useState } from "$fresh/runtime.ts";
+import { Fragment, h } from "preact";
+import { useEffect, useRef, useState } from "preact/hooks";
import { tw } from "../utils/twind.ts";
import { Spring, WaveTank } from "../components/WaveTank.ts";
diff --git a/www/routes/docs/[...slug].tsx b/www/routes/docs/[...slug].tsx
index 19e7eb6f..68ec8b3c 100644
--- a/www/routes/docs/[...slug].tsx
+++ b/www/routes/docs/[...slug].tsx
@@ -1,7 +1,7 @@
/** @jsx h */
/** @jsxFrag Fragment */
-
-import { Fragment, h, Head, PageProps } from "$fresh/runtime.ts";
+import { Fragment, h } from "preact";
+import { Head, PageProps } from "$fresh/runtime.ts";
import { Handlers } from "$fresh/server.ts";
import { apply, tw } from "../../utils/twind.ts";
import { frontMatter, gfm } from "../../utils/markdown.ts";
diff --git a/www/routes/index.tsx b/www/routes/index.tsx
index 329c9aa3..dc42c14b 100644
--- a/www/routes/index.tsx
+++ b/www/routes/index.tsx
@@ -1,14 +1,7 @@
/** @jsx h */
/** @jsxFrag Fragment */
-
-import {
- asset,
- ComponentChildren,
- Fragment,
- h,
- Head,
- PageProps,
-} from "$fresh/runtime.ts";
+import { ComponentChildren, Fragment, h } from "preact";
+import { asset, Head, PageProps } from "$fresh/runtime.ts";
import { tw } from "../utils/twind.ts";
import Counter from "../islands/Counter.tsx";
import LemonDrop from "../islands/LemonDrop.tsx";