unjs / crossws

🔌 Cross-platform WebSocket Servers for Node.js, Deno, Bun and Cloudflare Workers.
https://crossws.unjs.io
Other
394 stars 17 forks source link

feat: cloudflare durable objects support #54

Closed pi0 closed 3 months ago

pi0 commented 3 months ago

Resolves #49

This PR adds a new composable adapter for cloudflare with DurableObjects, Pub/Sub, and Hibernation support.

Composable method (vs class extension) allows automating setup and composing with other usecases in higher layers (H3, Nitro).

Note: This PR is only step 1, and needs to be better tested after release and also integrated in Nitro in order to be usable.

cloudflare-workers-and-pages[bot] commented 3 months ago

Deploying crossws with  Cloudflare Pages  Cloudflare Pages

Latest commit: 62ec9b6
Status: ✅  Deploy successful!
Preview URL: https://b57fec30.crossws.pages.dev
Branch Preview URL: https://feat-cloudflare-durable.crossws.pages.dev

View logs

vinayakkulkarni commented 2 months ago

hey @pi0, is there a demo using this with Nitro or Nuxt? i am building a Nuxt 3 app and find it extremely difficult to go deep into Nuxt -> Nitro -> h3 / crossws to find a solution for Durable objects w/ Nuxt 3.

//cc: @manniL

pi0 commented 2 months ago

@vinayakkulkarni this feature is not yet supported in nitro and needs a new preset.

vinayakkulkarni commented 2 months ago

@vinayakkulkarni this feature is not yet supported in nitro and needs a new preset.

Is there a way I can help?

pi0 commented 2 months ago

@vinayakkulkarni i understand and appreciate that you are willing to help but sometimes patience is best course of action 🙏🏼 (please read https://github.com/pi0/tired-maintainer)