feat: @cloudflare/vite-plugin integration, take 2 - #16705
Conversation
|
Install the latest version of pnpm add https://pkg.svelte.dev/@sveltejs/kit/c/f356c53f8ad0cde513cbd0c4757b823b95c3420dOpen in |
|
| type Span = import('@opentelemetry/api').Span; | ||
|
|
||
| // @ts-ignore see above | ||
| type ServerResponse = import('http').ServerResponse; |
There was a problem hiding this comment.
do we need this? I don't know if node types are guaranteed to be installed
|
|
||
| export { init_tracing, otel, record_span } from './telemetry.js'; | ||
|
|
||
| export { dedent } from '../../../core/sync/utils.js'; |
There was a problem hiding this comment.
Feel weird about this
| ], | ||
| post_plugins: [ | ||
| // ...or here to integrate with Vite | ||
| ] |
There was a problem hiding this comment.
Is it possible to solve this with order: 'pre' and order: 'post' on the plugin hook itself? If it isn't, I think we can add this public API in a separate PR before Kit 3 is out so that it's not a breaking change.
There was a problem hiding this comment.
@cloudflare/vite-plugin (like sveltekit) consists of a bunch of smaller plugins that are order sensitive, and it needs to go after sveltekit. I tried setting enforce: post on each of them and it broke things.
There was a problem hiding this comment.
Maybe we add vite.plugins.pre and vite.plugins.post in a new PR?
|
I think we should try to do this in stages of several PRs:
|
part of #16705 --- ### Please don't delete this checklist! Before submitting the PR, please make sure you do the following: - [ ] 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 - [ ] 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:`. --------- Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com> Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com> Co-authored-by: teemingc <chewteeming01@gmail.com>
closes #10496
closes #13692
closes #1712
closes #2963
closes #13300
closes #1519
Draft attempt to get
@cloudflare/vite-pluginto work without having to implementFetchableDevEnvironment. This means that sveltekit will still be running inside node instead of workerd, but enables custom worker entrypoints with full support for durable objects (including websockets in local dev), workflows, etc.TODO:
platformobject to import from our virtual'cloudflare:workers'modulecloudflare:workersvite previewvite builddurableObject.fetchcloudflare/workers-sdk#15086Please 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:.