-
-
Notifications
You must be signed in to change notification settings - Fork 482
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
Renew "Pages Framework guide" on Cloudflare Docs #838
Comments
@dario-piotrowicz told me that the documentation to be put on Cloudflare Docs should be minimal. I think it's right. cloudflare/cloudflare-docs#7410 (comment) However, I think it's not a best, so either way, let's make it new. |
The instructions for getting started with Hono on Cloudflare Pages are currently significantly different if you compare: The most fundamental difference is that Cloudflare instructs you to configure and run Esbuild directly, while hono.dev uses Vite. Among other things this prevents Client components from working when following the Cloudflare instructions, since only the main worker will ever be transpiled. On the other hand, following the instructions from hono.dev doesn't give you any obvious way to develop locally with live reload while also using Cloudflare bindings (such as KV, R2, D1 etc). I might have missed something important, but it seems like the documentation should at a minimum be aligned. Ideally the instructions should also find a good tradeoff between the different configuration options. |
Hi @kpalmvik Yes. We should take an action.
I think this is wrong. We can develop the Pages application using Hono and Bindings with live reloading. Have you ever tried it? https://hono.dev/getting-started/cloudflare-pages#bindings |
You are most likely correct, but for some reason I didn’t get it to work the first time. Will try again and get back soon. |
I can confirm that by following all the steps in Hono: Cloudflare Pages, including the Binding section, I seem to have a working local development environment! ✅ 🎉 Some feedback on the current instructions:
|
Hi @yusukebe, I faced a few issues with updating the documentation for Cloudflare. The command to create a Hono application is: $ npm create cloudflare@latest my-hono-app -- --framework=hono However, this will create an application with the
It appears we are unable to create multiple options on I understand that this creates a bigger abstraction on top of the |
Hi @NicoPlyley Yes. I know about that issue, and I have some ideas.
Currently, https://github.com/honojs/create-hono?tab=readme-ov-file#--template So you can specify the template for In Cloudflare internal, we are disuccusing about it but this not will resolved immediately. For Hono, it's a little special because Hono can create a Web API for Workers or create web pages for Pages. So, my selfish suggestion is to introduce both Workers and Pages patterns. It's an exceptional case, but it will be best. For example, the first section is for Workers and uses the C3 command. The second section is for Pages using |
@yusukebe, I want to explain what I was mentioning because I think it would fix the issue. However, we would be working around c3 rather than c3 working with Hono. And it would require two small modifications to c3. If we had an option for a template (or another argument) like I do understand if this is too much complexity. Or just does not make sense for a single use case. For now I will finish the docs for using |
I see! C3 can't be changed immediately, so as you are doing, please use |
Thanks to @rishavs, we have the documentation for Cloudflare Pages on the Cloudflare official site. That is one of "Pages Framework guides".
https://developers.cloudflare.com/pages/framework-guides/deploy-a-honojs-site/
And, in this PR cloudflare/cloudflare-docs#7410, @dario-piotrowicz improved it. That's great for us.
But, what Hono can do with Pages is not limited to what this document describes. We can make it as API for SPA in
/functions
or we can use JSX middleware for SSR. So, we have to renew the document.Let's consider writing new documentation after v3 is released.
The text was updated successfully, but these errors were encountered: