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:
Luca Casonato
2022-05-23 19:35:15 +02:00
committed by GitHub
parent fd1346ed6b
commit 80598d07fd
71 changed files with 188 additions and 141 deletions
+1 -1
View File
@@ -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;
+4 -4
View File
@@ -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) {