Describe the solution
I have a SvelteKit based framework Worker. This is using the @sveltejs/adapter-cloudflare adapter which uses Wrangler's getPlatformProxy API under the hood to provide a great DX with vite dev for local development. I'm able to use bindings to D1, KV, etc. and have hot module reloading from Vite.
When I tried to add a Durable Object binding, which I was running in a separate wrangler dev, I ran into the error:
Error: Cannot access `MyDurableObject#sayHello` as Durable Object RPC is not yet supported between multiple `wrangler dev` sessions.
Reading in the Docs, I can only do Durable Objects RPC when a single wrangler dev uses multiple configurations:
https://developers.cloudflare.com/workers/wrangler/api/#supported-bindings (related to #5918)
This would require me to build both the SvekteKit and DO workers before spinning them up in a single wrangler dev session. Therefore I would miss out on hot module reloading with Vite, significantly slowing down the DX.
Feature Request
I would like to request adding support for multiple configuration files to the getPlatformProxy API, to provide a similar solution as the multiple config files with wrangler dev.
In the svelte.config.js file, I would be able to conditionally pass in multiple config files depending on environment (local development vs production), since the SvelteKit adapter accepts a platformProxy prop on the options, which is passed to getPlatformProxy.
Currently, the getPlatformProxy options allows to specify a single config file with configPath already. Maybe this could accept an array of strings as well?
If that allows the framework worker and DO worker to communicate via RPC, then I can keep having the nice hot module reload DX with Vite, whilst depending on a Durable Object for persisted storage during development.
Describe the solution
I have a SvelteKit based framework Worker. This is using the
@sveltejs/adapter-cloudflareadapter which uses Wrangler'sgetPlatformProxyAPI under the hood to provide a great DX withvite devfor local development. I'm able to use bindings to D1, KV, etc. and have hot module reloading from Vite.When I tried to add a Durable Object binding, which I was running in a separate
wrangler dev, I ran into the error:Reading in the Docs, I can only do Durable Objects RPC when a single
wrangler devuses multiple configurations:https://developers.cloudflare.com/workers/wrangler/api/#supported-bindings (related to #5918)
This would require me to build both the SvekteKit and DO workers before spinning them up in a single
wrangler devsession. Therefore I would miss out on hot module reloading with Vite, significantly slowing down the DX.Feature Request
I would like to request adding support for multiple configuration files to the
getPlatformProxyAPI, to provide a similar solution as the multiple config files withwrangler dev.In the
svelte.config.jsfile, I would be able to conditionally pass in multiple config files depending on environment (local development vs production), since the SvelteKit adapter accepts aplatformProxyprop on the options, which is passed togetPlatformProxy.Currently, the
getPlatformProxyoptions allows to specify a single config file withconfigPathalready. Maybe this could accept an array of strings as well?If that allows the framework worker and DO worker to communicate via RPC, then I can keep having the nice hot module reload DX with Vite, whilst depending on a Durable Object for persisted storage during development.