with sveltekit i cannot (yet) directly

with sveltekit i cannot (yet) directly code a durable object in the same project as the frontend/backend worker. to use durable objects in this case tho what would you recommend? should i make a worker that acts as kind of a "internal api" or is there a way to make just the DO, and link it even if they are in two separate projects?
14 Replies
Unknown User
Unknown User2w ago
Message Not Public
Sign In & Join Server To View
veeque
veequeOP2w ago
when building with the cloudflare adapter it makes a worker for you. it only has the fetch handler and you cannot modify it. i opened an issue about this https://github.com/sveltejs/kit/issues/13692 they are waiting for this https://github.com/sveltejs/kit/pull/13477
GitHub
Allow custom worker script when deploying to Cloudflare · Issue #1...
Describe the problem When deploying to Cloudflare there's no way to customize the worker. This means no Durable Objects, no RPC methods, no CRON jobs, just the fetch() handler. Describe the pro...
GitHub
feat: middleware for several adapters by dummdidumm · Pull Request...
This is a different take on adding middleware-like functionality to SvelteKit. In contrast to #13430 which tried to find the lowest common denominator, this PR instead makes this the responsibility...
Unknown User
Unknown User2w ago
Message Not Public
Sign In & Join Server To View
veeque
veequeOP2w ago
hm... by editing the build artifacts?
Unknown User
Unknown User2w ago
Message Not Public
Sign In & Join Server To View
veeque
veequeOP2w ago
that thread looks very promising. will test now my only fear is that maybe in dev it won't work, gimme a sec
Unknown User
Unknown User2w ago
Message Not Public
Sign In & Join Server To View
veeque
veequeOP2w ago
you mean using that method right? because it works normally
Unknown User
Unknown User2w ago
Message Not Public
Sign In & Join Server To View
veeque
veequeOP2w ago
using the approach in the thread :/
No description
veeque
veequeOP2w ago
so realistically i should just make a separate worker, right?
Unknown User
Unknown User2w ago
Message Not Public
Sign In & Join Server To View
veeque
veequeOP2w ago
i can use durable objects without rpc?!
Unknown User
Unknown User2w ago
Message Not Public
Sign In & Join Server To View

Did you find this page helpful?