breaking: Move cloudflare bindings from platform to cloudflare:workers - #16754
breaking: Move cloudflare bindings from platform to cloudflare:workers#16754ottomated wants to merge 10 commits into
platform to cloudflare:workers#16754Conversation
|
Install the latest version of pnpm add https://pkg.svelte.dev/@sveltejs/kit/c/1f442d6cb9c9939a9a95d3df5c696b7c67585e26Open in |
🦋 Changeset detectedLatest commit: 1f442d6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
platform to cloudflare:workers
| export const env: { | ||
| YOUR_DURABLE_OBJECT_NAMESPACE: DurableObjectNamespace; | ||
| }; |
There was a problem hiding this comment.
We should definitely open a separate PR to showcase how to hook up the output of wrangler types to type the entire env object so that the user doesn't use @cloudflare/workers-types or have to spell out the bindings here
There was a problem hiding this comment.
I did mention that below, this section is just to get the docs types correct
There was a problem hiding this comment.
Yeah, what I meant was we should make that change independant of this PR. It's a good change to have and will make this one smaller
Breaking #16705 into smaller pieces; this is the first step of making the dev environment closer to the workerd runtime. Instead of accessing Cloudflare bindings on
platform.env, you would do the following:Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm testand lint the project withpnpm lintandpnpm checkChangesets
pnpm changesetand following the prompts. Changesets that add features should beminorand those that fix bugs should bepatch. Please prefix changeset messages withfeat:,fix:, orchore:.