BREAKING: move a bunch of types into server/ (#263)

Moved some server only types like `RouteConfig` into server/. They were
previously in runtime/.
This commit is contained in:
Luca Casonato
2022-06-21 15:21:07 +02:00
committed by GitHub
parent 3458e35d8e
commit da340daeb2
22 changed files with 245 additions and 231 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
/** @jsx h */
import { h } from "preact";
import { UnknownPageProps } from "$fresh/runtime.ts";
import { UnknownPageProps } from "$fresh/server.ts";
export default function NotFoundPage({ url }: UnknownPageProps) {
return <p>404 not found: {url.pathname}</p>;
+1 -1
View File
@@ -1,6 +1,6 @@
/** @jsx h */
import { h } from "preact";
import { ErrorPageProps } from "$fresh/runtime.ts";
import { ErrorPageProps } from "$fresh/server.ts";
export default function Error500Page({ error }: ErrorPageProps) {
return <p>500 internal error: {(error as Error).message}</p>;
+2 -1
View File
@@ -1,7 +1,8 @@
/** @jsx h */
/** @jsxFrag Fragment */
import { Fragment, h } from "preact";
import { AppProps, Head } from "$fresh/runtime.ts";
import { Head } from "$fresh/runtime.ts";
import { AppProps } from "$fresh/server.ts";
export default function App(props: AppProps) {
return (
+1 -1
View File
@@ -1,6 +1,6 @@
/** @jsx h */
import { h } from "preact";
import { PageProps, RouteConfig } from "$fresh/runtime.ts";
import { PageProps, RouteConfig } from "$fresh/server.ts";
export default function Page(props: PageProps) {
return <div>Book {props.params.id}</div>;
+1 -2
View File
@@ -1,7 +1,6 @@
/** @jsx h */
import { h } from "preact";
import { PageProps } from "$fresh/runtime.ts";
import { Handlers } from "$fresh/server.ts";
import { Handlers, PageProps } from "$fresh/server.ts";
interface Data extends Record<string, unknown> {
info: string;
+1 -3
View File
@@ -1,7 +1,5 @@
/** @jsx h */
import { h } from "preact";
import { RouteConfig } from "$fresh/runtime.ts";
import { HandlerContext } from "../../../server.ts";
import { HandlerContext, RouteConfig } from "$fresh/server.ts";
export const handler = {
GET(_req: Request, { params }: HandlerContext) {
+1 -1
View File
@@ -1,6 +1,6 @@
/** @jsx h */
import { h } from "preact";
import { PageProps } from "$fresh/runtime.ts";
import { PageProps } from "$fresh/server.ts";
export default function Home(props: PageProps) {
return <div>{JSON.stringify(props)}</div>;
+1 -1
View File
@@ -1,6 +1,6 @@
/** @jsx h */
import { h } from "preact";
import { PageProps, RouteConfig } from "$fresh/runtime.ts";
import { PageProps, RouteConfig } from "$fresh/server.ts";
export default function WildcardPage({ params }: PageProps) {
if (typeof params.path === "string") {