You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was playing around with solid start and Cloudflare this week, and I found a need to have more that one durable object in the app at once. This was all easy to get running from a deployment point of view, exporting to classes from entry.server.ts works a charm, but was struggle to get them running locally.
I ended up extending the default solid-start-cloudflare-workers plugin to allow me to define the Durable object classes in the miniflare config as imports to the Vite config itself.
This works by then shimming the dev server for Miniflare by getting the class names and doing some remapping to make them globals. This method has some super big drawbacks, the most annoying one being that classes cannot use basepath imports anymore :(
I don't know enough about plugins in general, but I can see a way where the solid-start-cloudflare-workers adapter could read the raw miniflare config and prebundle the exported classes from the entry.server.ts file. I am happy to contribute if people are interested in this!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I was playing around with solid start and Cloudflare this week, and I found a need to have more that one durable object in the app at once. This was all easy to get running from a deployment point of view, exporting to classes from
entry.server.ts
works a charm, but was struggle to get them running locally.I ended up extending the default solid-start-cloudflare-workers plugin to allow me to define the Durable object classes in the miniflare config as imports to the Vite config itself.
This works by then shimming the dev server for Miniflare by getting the class names and doing some remapping to make them globals. This method has some super big drawbacks, the most annoying one being that classes cannot use basepath imports anymore :(
I don't know enough about plugins in general, but I can see a way where the
solid-start-cloudflare-workers
adapter could read the raw miniflare config and prebundle the exported classes from theentry.server.ts
file. I am happy to contribute if people are interested in this!Link to source code https://github.com/fezproof/prometheus
Beta Was this translation helpful? Give feedback.
All reactions