If you're using auxiliaryWorkers in @cloudflare/vite-plugin, we want to know why
#15267
Replies: 2 comments
|
TL;DR: Auxiliary workers helped us have an explicit dependency graph. For us this question is more ergonomics issue than anything else. I like auxiliary workers more, agents benefit from having to deal with less implicit/magical BS. Tradeoff... it's using a loot of memory in our machines. (PS: Removing them would suck make monorepo management/optimizations on Cloudflare super hard.) For context, We have a decently sized monorepo ATM. Part of it is our CF Worker infra. (~20 workers with staging, prod & dev variants, so ~60. total). Used to have one big API and now we've separated functionality in smaller services with one worker as our gateway API doing authentication checks/etc. Services don't have public network access and are either accessible publicly through the gateway or as bindings to other services. (pretty normal multi-services approach). Unless I'm mistaken on the dev registry, I assume it's mapping what services Am I manually running and routing things correctly for me. And if so, Well it is useful once an architecture start scaling we can really use an explicit service dependency tree. For us, our decision to split into multiple services was driven by the single worker that we had for API being really big and falling into startup time and bundle size blockers. (We could not deploy because startup time was over X ms, also for some time we could not ship maps, because we were over the amount of megabytes). Initially our split was very functionality based, 3 main workers:
The more we grew, the more that that stopped making sense and we started to move to a more product domain-based approach. Imagine a Benefits of this? (We made a bet in 2023 that while monorepo management still sucks... in an post-AI world they will be the bomb. And here we are) Back to my initial paragraph, GatewayAPI uses ~15 workers underneath (not all direct aux workers). So for our architecture, this is more a problem of explicit v/s implicit definition, and explicit dependency tree definition wins. On the infra side, An explicit dependency tree allows us to decide what tests to run in CI. Also it helps us decide what things to actually deploy as preview environment. Same example I can deploy a preview environment of API pointing to the preview environment of payment while all of the other bindings still point to staging. On the AI side, an agent now knows what affects what, can decide what tests and checks to run, checks are now quicker, which that help it course correct faster, do less context pollution and be better at autonomous work. In short, the dev registry great for small projects but In our experience, it has not been viable as we grow. My only wish would be that I can have some deferred loading for Continuing with the payment workers analogy: I ONLY need the |

Uh oh!
There was an error while loading. Please reload this page.
Hi all. We are working on version 2 of the Cloudflare Vite plugin. As part of this we are evaluating the existing feature set.
There are currently two ways to develop with multiple Workers when using the Vite plugin.
This is a feature that works automatically to enable multiple
vite devsessions to connect to each other.auxiliaryWorkersThis is a feature that enables running multiple Workers with a single
vite devcommand. These Workers are also built together when runningvite build.When v1 was introduced there were several features that were possible with
auxiliaryWorkersthat were not possible with the dev registry. These included calling a Durable Object or Workflow directly from another Worker. These feature gaps have now been closed and so should no longer be determining factors in which method you choose.If you are currently using
auxiliaryWorkers, we want to know why. We are particularly interested in what you are using it for and whether it would fit your use case to use the dev registry. Thanks!All reactions