cloudflare / workers-sdk

⛅️ Home to Wrangler, the CLI for Cloudflare Workers®
https://developers.cloudflare.com/workers/
Apache License 2.0
2.6k stars 678 forks source link

🚀 Add new `SvelteKit`+ DO (with local dev support) example #5164

Closed dario-piotrowicz closed 3 weeks ago

dario-piotrowicz commented 7 months ago

Describe the solution

[!NOTE] This is a follow up from this issue in our docs repo: https://github.com/cloudflare/cloudflare-docs/issues/13062#issuecomment-1963100362

In our Template & Examples directory let's add a new example for a project using SvelteKit with a DurableObject binding and showcase how that can work both locally and in production.

As mentioned in the docs issue I've already created the example here: https://github.com/dario-piotrowicz/sveltekit-durable-object-local-usage-example this could just be copied to our examples but ideally before doing so I think that we should:

Additionally there are a couple of questions that I'd love to hear people thoughts about:

admah commented 7 months ago

could/should we somehow generalize the example to use a generic full stack framework (instead of specifically target SvelteKit)?

It seems like frameworks are all different (and opinionated) enough to make that a hard task. Generalizing the template might make less sense to developers familiar with the way a framework does things, which would mean it's usage would probably be less. Just some initial thoughts.

are our examples discoverable enough? is anyone every going to find this? if not, could we make them more discoverable? (by for example adding a link (or multiple links) in our docs)?

I think we could add links within our own docs, as well as links within the framework's docs (ie. https://kit.svelte.dev/docs/adapter-cloudflare). I'm sure there are other places as well?

I've also wondered if we should move workers-sdk back to the cloudflare/templates repo for visibility?

penalosa commented 3 weeks ago

We no longer recommend users use these templates to get started with projects, as they're generally very out of date. For up to date project templates, you can refer to https://developers.cloudflare.com/workers/get-started/quickstarts/ & for tutorials you can refer to https://developers.cloudflare.com/workers/tutorials/