nuxt-hub / core

Build full-stack applications with Nuxt on CloudFlare, with zero configuration.
https://hub.nuxt.com
Apache License 2.0
994 stars 56 forks source link

DurableObjects support #50

Open lucadalli opened 7 months ago

lucadalli commented 7 months ago

As a heavy Cloudflare user that is returning back to Nuxt after using other meta-frameworks, I am very excited about this project.

The greatest struggle I face when working with Cloudflare is that meta frameworks tend to provide no support/tooling/abstractions for DurableObjects and I have to set up an entirely new project with wrangler.

Would be an absolute game changer to be able to have my DurableObject definitions living inside my Nuxt project.

atinux commented 7 months ago

Hey @lucadalli

Yes this is planned! I want to use them for many reasons and the biggest one being sockets broadcasting.

As Pages does not support direct bindings we need to create another worker for accessing durable objects.

lucadalli commented 7 months ago

@Atinux Super exciting stuff!

I believe Pages does support bindings to production and preview deployments via the Cloudflare dashboard. In my Pages project dashboard I see the possibility to bind to DurableObjects defined in a separate workers project. So perhaps it would suffice to create another worker to define the DurableObjects, but binding to and accessing the DurableObjects can be done from Pages project.

atinux commented 7 months ago

If you have a small demo I would love to see how you achieved it, haven't got the time to look at it yet!

atinux commented 5 months ago

Adding https://github.com/kwhitley/itty-durable as I like how they define DO.

lucadalli commented 2 months ago

Cloudflare Workers now support static assets. This provides a clear way forward to support DurableObjects by deploying via Workers instead of Pages. Hurrah!

tahirmahmudzade commented 3 weeks ago

@atinux any improvement on this yet? nuxt hub is amazing, been working with it for a while but now i would like to introduce real time chat functionality on my website, would be amazing to see Durable Object support in action 🤌🏻