breaking: Move cloudflare bindings from platform to cloudflare:workers - #16754
breaking: Move cloudflare bindings from platform to cloudflare:workers#16754ottomated wants to merge 19 commits into
platform to cloudflare:workers#16754Conversation
|
Install the latest version of pnpm add https://pkg.svelte.dev/@sveltejs/kit/c/0f6072c6b23b162fd2e8bf94290bea14a8104194Open in |
🦋 Changeset detectedLatest commit: 0f6072c 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
1f442d6 to
04fd512
Compare
b3c32be to
11e9241
Compare
f44c3dc to
9d6c489
Compare
| enterSpan() { | ||
| throw new Error('tracing is not available in dev mode'); | ||
| }, | ||
| startActiveSpan() { | ||
| throw new Error('tracing is not available in dev mode'); | ||
| } |
There was a problem hiding this comment.
should these just be no-ops in dev?
There was a problem hiding this comment.
I wonder if it would be confusing if these didn't work and the user didn't know. SvelteKit tracing does work during dev (but I'm not sure what these functions do).
There was a problem hiding this comment.
They are now no-ops, I don't think it'll be too confusing (and there's nothing we can do until they give us a non-mock implementation)
| prerendering = true; | ||
| } | ||
|
|
||
| const als = new AsyncLocalStorage(); |
There was a problem hiding this comment.
why do we need ALS here? isn't env always going to be the same?
There was a problem hiding this comment.
They export a withEnv function like below. We could stub that but it's easy enough to get working
There was a problem hiding this comment.
Mocking the env object for child functions that import it globally (https://developers.cloudflare.com/workers/runtime-apis/bindings/#overriding-env-values)
0374920 to
2ce7ca5
Compare
as suggested in #16754, modernizes the cloudflare adapter's docs to mention `wrangler types`. No changeset because docs-only --- ### Please don't delete this checklist! Before submitting the PR, please make sure you do the following: - [x] It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs - [x] This message body should clearly illustrate what problems it solves. - [ ] Ideally, include a test that fails without this PR but passes with it. ### Tests - [x] Run the tests with `pnpm test` and lint the project with `pnpm lint` and `pnpm check` ### Changesets - [x] If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running `pnpm changeset` and following the prompts. Changesets that add features should be `minor` and those that fix bugs should be `patch`. Please prefix changeset messages with `feat:`, `fix:`, or `chore:`.
3fb8a2f to
0494d35
Compare
5bb5fd7 to
0a289ea
Compare
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:.