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

Fix and improve pages Hono guide #7410

Merged
merged 1 commit into from
Feb 10, 2023

Conversation

dario-piotrowicz
Copy link
Member

Improve the Hono guide by fixing present wrong statements, clarifying others, providing the option to use typescript as well as javascript and also renaming Honojs to Hono (since afaict that's the correct name)

@dario-piotrowicz
Copy link
Member Author

@yusukebe please give this PR a review if you want 🙂

@yusukebe
Copy link
Contributor

Thanks for looking out for Hono! I am glad.

I am just now thinking about the use of Hono on Pages. There is much more that is not covered in this document. In addition to transpiling to _workers.js as described here, it can be used as an API for SPAs in /functions. Also, we can use JSX middleware with Hono.

But, it is difficult to create new content that includes them right now. We will create another PR when the time comes. Looks good for this PR. Thanks!

@dario-piotrowicz
Copy link
Member Author

dario-piotrowicz commented Jan 26, 2023

Thanks for the approval @yusukebe 😃

regarding other stuff yeah I understand but if you look at the pages framework guides https://developers.cloudflare.com/pages/framework-guides/ you can see that they are all very minimalistic and just tell you basically how to get started with the various frameworks, so I don't think we should anyways include too much content here, if we can find a way to shortly give the general idea of what Hono can do (for example by adding things in the initial app boilerplate) I think that would be totally fine, but maybe not much more than that (I think)

If you want to have a more descriptive document showcasing various cool things that Hono can do maybe there is some other place in which we could provide that? (and potentially linking to that place in the guide?) (I think that even a blog post in the Cloudflare blog would be pretty cool, I'd definitely like try to help out with that 🙂)

@yusukebe
Copy link
Contributor

Thanks for the advice. It's sure better not to write a lot of stuff.

If you want to have a more descriptive document showcasing various cool things that Hono can do maybe there is some other place in which we could provide that?

Yes, we are planning to renew the website of Hono ( https://honojs.dev ) when releasing the next major version. It's appropriate there.

I think that even a blog post in the Cloudflare blog would be pretty cool, I'd definitely like try to help out with that

Wow, that's super cool! No, ultra cool!

@dario-piotrowicz
Copy link
Member Author

@deadlypants1973 Thanks so very much for the awesome reviewing 🙂 (and sorry about the silly mistakes 😅)

I've accepted all your suggestions 🙂👍

@dario-piotrowicz dario-piotrowicz requested review from deadlypants1973 and removed request for WalshyDev January 26, 2023 19:07
@yudai-nkt
Copy link

yudai-nkt commented Jan 27, 2023

Hi, I'd like to add my thoughts on @yusukebe's proposal here. Regarding the JSX middlware, it sounds to me a non-fundamental topic that doesn't need to be covered in Cloudflare's domain. On the other hand, what is referred to "as an API for SPAs in /functions" could be covered IMHO.

Adapters, which were proposed in honojs/hono#802 and implemented in honojs/hono#807, make it way easier to integrate Hono into Pages like this:

import { Hono } from "hono";
import { handle } from "hono/cloudflare-pages";

const app = new Hono();

// implement requests handling here

export const onRequest = handle(app);

With this feature, you don't need to set up build scripts yourself. All you have to do is just run a single wrangler pages dev.

Since this feature is not in stable releases now (only in v3 RC), we need to consider when to ship a document describing adapters but it would definitely be a nice-to-have!

Improve the Hono guide by fixing present wrong statements,
clarifying others, providing the option to use typescript as
well as javascript and also renaming Honojs to Hono (since
afaict that's the correct name)
@deadlypants1973 deadlypants1973 merged commit dd2bbf7 into cloudflare:production Feb 10, 2023
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.

None yet

4 participants