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:
@@ -42,7 +42,7 @@ Now, let's render some HTML using the route component. Another example:
|
||||
|
||||
/** @jsx h */
|
||||
import { h } from "preact";
|
||||
import { PageProps } from "$fresh/runtime.ts";
|
||||
import { PageProps } from "$fresh/server.ts";
|
||||
|
||||
export default function Page(props: PageProps) {
|
||||
return <div>You are on the page '{props.url.href}'.</div>;
|
||||
@@ -65,8 +65,7 @@ response after rendering the page component.
|
||||
|
||||
/** @jsx h */
|
||||
import { h } from "preact";
|
||||
import { PageProps } from "$fresh/runtime.ts";
|
||||
import { HandlerContext, Handlers } from "$fresh/server.ts";
|
||||
import { HandlerContext, Handlers, PageProps } from "$fresh/server.ts";
|
||||
|
||||
export const handler: Handlers = {
|
||||
async GET(ctx: HandlerContext) {
|
||||
|
||||
@@ -29,7 +29,7 @@ as arguments in it's `props` object though.
|
||||
|
||||
/** @jsx h */
|
||||
import { h } from "preact";
|
||||
import { PageProps } from "$fresh/runtime.ts";
|
||||
import { PageProps } from "$fresh/server.ts";
|
||||
|
||||
export default function GreetPage(props: PageProps) {
|
||||
const { name } = props.params;
|
||||
|
||||
@@ -25,8 +25,7 @@ renders it in a page component.
|
||||
|
||||
/** @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 User {
|
||||
login: string;
|
||||
|
||||
@@ -34,8 +34,7 @@ server side:
|
||||
|
||||
/** @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";
|
||||
|
||||
const NAMES = ["Alice", "Bob", "Charlie", "Dave", "Eve", "Frank"];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user