sveltejs / sveltejs/kit

Cloudflare Worker Adapter - Durable Objects

Open
#1,712 40 comments 31 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

  • #15574 by @teemingc — closed without merging
  • #15627 by @teemingc — closed without merging
pkg:adapter-cloudflare
Dominant language
JavaScript
Stars
20.8k
Forks
2.3k
Avg merge
1d 16h
Merged PRs (30d)
156

Description

Is your feature request related to a problem? Please describe.
Cloudflare recently introduced the ability to maintain websocket connections with workers, in addition to a stateful storage solution called 'Durable Objects'. For workers, these objects are accessible through a env argument passed in during the fetch invocation. More information about durable objects and their utilization can be found here.
https://developers.cloudflare.com/workers/learning/using-durable-objects

Describe the solution you'd like
In my opinion, the cloudflare worker adapter should expose a way to mutate and interact with this env object passed in by cloudflare during a function invocation.

Describe alternatives you've considered
I have not found any alternate ways of using durable objects without modifying the adapter.

How important is this feature to you?
This feature is fairly important to me personally, since it would dramatically simplify my stack if my state coordination can be done in the same worker.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Cloudflare Worker adapter and the fetch invocation described in the issue, then read the linked Durable Objects documentation. Determine how the adapter can expose the invocation's env object, and consider the issue complete when callers can mutate and interact with Durable Objects through that exposed object.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
cloud
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.