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

Update the C3 behavior for Cloudflare Workers template #3193

Open
yusukebe opened this issue Jul 27, 2024 · 2 comments · Fixed by cloudflare/workers-sdk#6481
Open

Update the C3 behavior for Cloudflare Workers template #3193

yusukebe opened this issue Jul 27, 2024 · 2 comments · Fixed by cloudflare/workers-sdk#6481

Comments

@yusukebe
Copy link
Member

Currently, if we create a new Cloudflare Workers project with C3, C3 will add the following code to index.ts:

type Bindings = {
  [key in keyof CloudflareBindings]: CloudflareBindings[key]
}

This snippet does convert interface to type because new Hono() does not accept interface before.

But, since v4.5.0, we can pass an interface to it! We can remove that snippet and pass the CloudflareBindings directly.

@yusukebe yusukebe changed the title Update the C3 behavior for Workers template Update the C3 behavior for Cloudflare Workers template Jul 27, 2024
@roottool
Copy link

I tried this issue at cloudflare/workers-sdk#6481. I think this issue can be closed when the PR is merged.

@CarmenPopoviciu
Copy link

@yusukebe could I please get a stamp from you on @roottool 's PR 🙏 . Looks good on our side, but since you have more Hono context than I do, I'd feel better if we can get your review as well. It's a fairly straightforward PR so shouldn't be time consuming.

Thank you in advance for your help ❤️

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 a pull request may close this issue.

3 participants