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

Getting started #13

Open
mesterum opened this issue Sep 29, 2024 · 10 comments
Open

Getting started #13

mesterum opened this issue Sep 29, 2024 · 10 comments

Comments

@mesterum
Copy link

mesterum commented Sep 29, 2024

After I red your readme.md I was asking how to start? What's the difference between your project and https://github.com/sergiodxa/remix-hono ? I think yours uses Remix Vite Plugin instead of Classic Remix Compiler.
How to start? I see that you have an example folder. It's that enough to start with? How to download only the example folder from github? Shouldn't first start with npx create-remix@latest then add your example? I am a newbie with Remix.
Oh. Wait. npx create-remix@latest has a template option, but I don't see your example in the templates list.
I figure it out:

bunx create-remix@latest ./my-app  --template yusukebe/hono-remix-adapter/example

Please, let others know how easy is to start a new project with your adapter.

@wataruoguchi
Copy link

wataruoguchi commented Nov 10, 2024

Thanks for leaving your thoughts here.

I had a moment to serve static assets stored under the public dir, which the default Remix template stores logo images, as well as facivon.ico and _routes.json. Because those static assets are specified as it's served from the root dir, like http://localhost:5173/logo-dark.png, it'd be tricky to exclude them.

I mitigated it by making the assets directory under the public directory and moving those images into it. Then, I updated the path to those images accordingly (e.g., /logo-dark.png to /assets/logo-dark.png)

I hope this ^ will help someone.

Having said that, the following is the first practice I integrated this library into the template project.

https://github.com/wataruoguchi/poc-user-cf-hono-remix/pull/1/files

@yusukebe
Copy link
Owner

yusukebe commented Nov 11, 2024

Hi @wataruoguchi !

Just curious. Have you ever thought of using Cloudflare Workers instead of Cloudflare Pages? This is because we - the Cloudflare team- migrate to Workers for some framework applications, and I'm considering this hono-remix-adapter to support Cloudflare Workers.

@wataruoguchi
Copy link

@yusukebe, I am open to using Cloudflare Workers over Cloudflare Pages. As I am one of the Japanese developers, I get influenced a lot by Chimame-san's posts like this 静的ファイル配信を対応したCloudflare WorkersにRemixを移行してログ出力を容易にする方法 (JA) :)

@wataruoguchi
Copy link

@yusukebeI suppose the following PR is what I need to migrate from CF pages to CF workers in my project.

wataruoguchi/poc-user-cf-hono-remix#4

TBH, it's not a big deal how the static assets get served (via Pages vs Workers) to me.

@yusukebe
Copy link
Owner

@wataruoguchi Thanks!

I created the Cloudflare Workers handler yesterday and released the new version. You can use it by following the instruction. Can you try it?

@wataruoguchi
Copy link

@yusukebe It worked like a charm! It's amazing, no workaround is needed for static assets under the public directory!

Tested with dev, preview, and deploy.

Here's the diff: wataruoguchi/poc-user-cf-hono-remix#5

@wataruoguchi
Copy link

@yusukebe FYI, preview and deploy require the ASSETS binding like this, IIRC:

[assets]
directory = "./build/client"
binding = "ASSETS"

Probably, that's the only discrepancy while your document says:

assets = { directory = "./build/client" }

@yusukebe
Copy link
Owner

@wataruoguchi

I think ASSETS is not needed. The following project works well without ASSETS in wrangler.toml:

https://github.com/yusukebe/hono-remix-adapter-example

Can you take a look at it?

@wataruoguchi
Copy link

@yusukebe confirmed. It looks correct. It doesn't require ASSETS. Please disregard that!

@yusukebe
Copy link
Owner

@wataruoguchi Thanks for confirming it. Okay!

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

No branches or pull requests

3 participants