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:
@@ -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,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>;
|
||||
|
||||
@@ -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,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,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,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,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,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") {
|
||||
|
||||
Reference in New Issue
Block a user