feat: use import maps instead of deps files (#209)
This commit updates fresh to use import maps instead of deps files in generated projects.
This commit is contained in:
@@ -15,7 +15,7 @@ used to pass arbituary data to downstream (or upstream) handlers.
|
||||
|
||||
```ts
|
||||
// routes/_middleware.ts
|
||||
import { MiddlewareHandlerContext } from "../deps.server.ts";
|
||||
import { MiddlewareHandlerContext } from "$fresh/server.ts";
|
||||
|
||||
interface State {
|
||||
data: string;
|
||||
|
||||
@@ -22,7 +22,7 @@ Let's look at a basic route that returns a plain text string:
|
||||
```tsx
|
||||
// routes/plain.tsx
|
||||
|
||||
import { HandlerContext, Handlers } from "../deps.server.ts";
|
||||
import { HandlerContext, Handlers } from "$fresh/server.ts";
|
||||
|
||||
export const handler: Handlers = {
|
||||
GET(ctx: HandlerContext) {
|
||||
@@ -43,7 +43,7 @@ Now, let's render some HTML using the route component. Another example:
|
||||
// routes/html.tsx
|
||||
|
||||
/** @jsx h */
|
||||
import { h, PageProps } from "../deps.client.ts";
|
||||
import { h, PageProps } from "$fresh/runtime.ts";
|
||||
|
||||
export default function Page(props: PageProps) {
|
||||
return <div>You are on the page '{props.url.href}'.</div>;
|
||||
@@ -65,8 +65,8 @@ response after rendering the page component.
|
||||
// routes/html.tsx
|
||||
|
||||
/** @jsx h */
|
||||
import { h, PageProps } from "../deps.client.ts";
|
||||
import { HandlerContext, Handlers } from "../deps.server.ts";
|
||||
import { h, PageProps } from "$fresh/runtime.ts";
|
||||
import { HandlerContext, Handlers } from "$fresh/server.ts";
|
||||
|
||||
export const handler: Handlers = {
|
||||
GET(ctx: HandlerContext) {
|
||||
|
||||
Reference in New Issue
Block a user