-
Notifications
You must be signed in to change notification settings - Fork 639
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: Remove references to deprecated types #2125
docs: Remove references to deprecated types #2125
Conversation
|
||
```tsx routes/_app.tsx | ||
import { AppContext } from "$fresh/server.ts"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the generated code for a new 1.6 fresh project, we get
import { type AppContext } from "$fresh/server.ts";
It is unclear whether the Deno/fresh team prefer import { type
over import type
syntax, and whether the docs should reflect this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm neutral on that as both styles are merely a hint to the runtime that the import can be stripped.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thank you for making this PR! The changes look good to me 👍
import { MiddlewareHandlerContext } from "$fresh/server.ts"; | ||
import { FreshContext } from "$fresh/server.ts"; | ||
|
||
interface State { | ||
data: string; | ||
} | ||
|
||
export async function handler( | ||
req: Request, | ||
ctx: MiddlewareHandlerContext<State>, | ||
ctx: FreshContext<State>, | ||
) { | ||
ctx.state.data = "myData"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The release documentation mentions:
RouteContext (for async routes/layouts/app wrapper)
When I tried to confirm this, and use that typing in this code example, I got a typing error:
Property 'next' does not exist on type 'RouteContext<State>'.deno-ts(2339)
As per the 1.6 release, and commentary by @csvn here, this PR aims to replace the references to deprecated typing in the documentation.
Please see inline commentary for parts I'm unclear on.