Skip to content
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

Merged

Conversation

christoshrousis
Copy link
Contributor

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.


```tsx routes/_app.tsx
import { AppContext } from "$fresh/server.ts";
Copy link
Contributor Author

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.

Copy link
Collaborator

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.

Copy link
Collaborator

@marvinhagemeister marvinhagemeister left a 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 👍

@marvinhagemeister marvinhagemeister enabled auto-merge (squash) December 2, 2023 11:11
Comment on lines -21 to 31
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";
Copy link
Contributor Author

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)

@marvinhagemeister marvinhagemeister merged commit f3578f8 into denoland:main Dec 2, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants