Thanks for your precious involvement, I read and take great interest in your work
Thanks for your precious involvement, I read and take great interest in your work
There is Brayden's elegant Alarm class but it's not documented, and by default requires your DO extend the Actor base class unless you duplicate what that base class does manually.You actually don't need the Actor base class. I am a fan of toolkits personally, so we tried

using CloudFlare and Durable objects under the hoodThe notion of "write once deploy anywhere" is appealing but it's extremely challenging from many dimensions (performance, DX, etc.). Think of it as a tradeoff between portability and avoiding leaky abstractions. This would be super-leaky and it would always lag DO features.

wrangler.jsonc (unless there is a magic way to not do this step) — and viola they have this particular durable object working.import { DurableObject } from "cloudflare:workers"; assumes cloudflare:workers can be resolved, but of course that is only importable with a build tool like vite. Should I bundle cloudflare:workers as an internal dependency? What would the CF team recommend?class_name property of wrangler's config work? Can it resolve a class that is in a dependency?cloudflare:workers comes from worker-configuration.d.ts file that gets generated from config using npx wrangler types. Durable object is just a typescript class that you import to your project and add to your wrangler config.node:-prefixed packagesclass_name property in the config, how does that resolve to the actual class? Seems a bit magical — would love to understand that part more.main file. So for example, if your package exports a DO named SuperDO, it would look something like this:wrangler.jsonc from some base — sort of like a tsconfig.json?actorsctx.storageexport class MyDurableObject extends DurableObject<Env> {
storage: Storage;
alarms: Alarms<this>;
constructor(ctx: DurableObjectState, env: Env) {
super(ctx, env)
this.storage = new Storage(ctx.storage);
this.alarms = new Alarms(ctx, this);
}
...
}cloudflare:testrunDurableObjectAlarm