This seems... bad, inelegant.
Make any TypeScript function durable
51–60 of 89 posts
Re: Make any TypeScript function durable
#52Earlier quoted context omitted.
But then it's not valid TypeScript anymore. So all the other tooling breaks: syntax highlighting, LSP, Linter, ...
Looking at the AST [0], this doesn't seem to be the case. Since Typescript already supports decorators in other contexts, it successfully parses everything and identifies the decorator to boot. Since you're working in a preprocessor context anyway, there's a number of options to make all of this work well together. [0] https://ts-ast-viewer.com/#code/GYVwdgxgLglg9mABMOcAUBKRBvAU...
Re: Make any TypeScript function durable
#53Re: Make any TypeScript function durable
#54Earlier quoted context omitted.
Looking at the AST [0], this doesn't seem to be the case. Since Typescript already supports decorators in other contexts, it successfully parses everything and identifies the decorator to boot. Since you're working in a preprocessor context anyway, there's a number of options to make all of this work well together. [0] https://ts-ast-viewer.com/#code/GYVwdgxgLglg9mABMOcAUBKRBvAU...
Instead of decorators, it could be just a higher-order function. Which could handle it easily and in any scenario that interchanges between TS/JS.
Re: Make any TypeScript function durable
#55Re: Make any TypeScript function durable
#56- where does the state and telemetry get stored?
- if something is sleeping for 7 days, and you release a new version in that time, what is invoked?
- how do you configure retries? Looks like it retries forever
And I echo the hatred of the magic strings. Terrible dx
Re: Make any TypeScript function durable
#57This seems pretty similar to Cloudflare Workflows ( https://developers.cloudflare.com/workflows/ ), but with code-rewriting to use syntax magic (functions annotated with "use workflow" and "use step") instead of Cloudflare's `step.do` and `step.sleep` function calls. (I think I lightly prefer Cloudflare's model for not relying on a code-rewriting step, partly because I think it's easier for programmers to see what's…
I strongly believe that being obvious about steps with `step.run` is important: it improves o11y, makes things explicit, and you can see transactional boundaries.
Re: Make any TypeScript function durable
#58I asked their main developer Dillon about the data/durability layer and also the compilation step. I wonder if adding a "DBOS World" will be feasible. That way, you get Postgres-backed durable workflows, queues, messaging, streams, etc all in one package, while the "use workflow" interface remains the same.
Here is the response from Dillon, and I hope it's useful for the discussion here:
> "The primary datastore is dynamodb and is designed to scale to support tens of thousands of v0 size tenants running hundreds of thousands of concurrent workflows and steps."
> "That being said, you don't need to use Vercel as a backend to use the workflow SDK - we have created a interface for anyone to implements called 'World' that you can use any tech stack for https://github.com/vercel/workflow/blob/main/packages/world/..."
> "you will require a compiler step as that's what picks up 'use workflow' and 'use step` and applies source transformations. The node.js run time limitations only apply to the outer wrapper function w/ `use workflow`"
Re: Make any TypeScript function durable
#59Earlier quoted context omitted.
Yea but it's a vercel product and they also pushed the 'use server' and 'use client' directives and probably want to build on them.
Absolutely bizarre decisions.