Live data from Hacker News

Make any TypeScript function durable

useworkflow.dev

11–20 of 89 posts

Re: Make any TypeScript function durable

#11

i hate the new pattern of using these magic strings everywhere. “use workflow”, “use client”, etc etc. I don’t like having custom bundler logic for my code.

Custom bundler + telemetry already included. Smells way too much like Microsoft, too much like lock-in with a deal that gets worse and worse.

Re: Make any TypeScript function durable

#12
post #2

Of all the syntax options they could've gone with, they settled on what I would say is arguably the worst. If you want a one-liner, decorators are widely used across different languages and Typescript supports them as well.

or no-op functions like useWorkflow() (with some kind of stub that prevents dead code elimination).

Re: Make any TypeScript function durable

#13
So vercel is adamant on making nextjs apps behavior completely unpredictable and hidden behind tons of magic code?

At least in any other framework library I can just command click and see why things are not working, place breakpoints and even modify code.

Re: Make any TypeScript function durable

#14
post #2

Of all the syntax options they could've gone with, they settled on what I would say is arguably the worst. If you want a one-liner, decorators are widely used across different languages and Typescript supports them as well.

Decorators don't work for functions, unfortunately, so wouldn't work in this case. You'd need to add a bunch of class boilerplate to make it work.

JavaScript didn't have a lot of great options for this kind of statically-declared metaprogramming, which is why the "use X"; syntax has become so popular in various spaces. It's definitely not my favourite approach, but I don't think there's any clear "best" solution here.

Re: Make any TypeScript function durable

#15
post #14
post #2

Of all the syntax options they could've gone with, they settled on what I would say is arguably the worst. If you want a one-liner, decorators are widely used across different languages and Typescript supports them as well.

Decorators don't work for functions, unfortunately, so wouldn't work in this case. You'd need to add a bunch of class boilerplate to make it work. JavaScript didn't have a lot of great options for this kind of statically-declared metaprogramming, which is why the "use X"; syntax has become so popular in various spaces. It's definitely not my favourite approach, but I don't think there's any clear "best" solution here…

You can use generator fns to achieve the exact same thing without magic strings or bundles. And the bonus is that you can debug it.

Re: Make any TypeScript function durable

#17
post #9
post #5

Earlier quoted context omitted.

It's on the landing page, there is not even a standalone mode yet, so you can't use it with node.js you need to use with Next.js. All to say, it's just early alpha preview, I would wait the project to mature before considering using it anywhere.

My bad, this is open telemetry stuff to check the status of your servers, not for the vendor to slurp as much data from you as possible.

This is Open Telemetry functions you're referencing. Being able to trace, profile and debug your own code that's executing in a highly distributed environment is a pretty useful thing. This isn't (necessarily) user behavior telemetry.

At least understand what you're looking at before getting the ick.

Re: Make any TypeScript function durable

#18
post #9
post #5

Earlier quoted context omitted.

It's on the landing page, there is not even a standalone mode yet, so you can't use it with node.js you need to use with Next.js. All to say, it's just early alpha preview, I would wait the project to mature before considering using it anywhere.

My bad, this is open telemetry stuff to check the status of your servers, not for the vendor to slurp as much data from you as possible.

Good luck running a server without any sort of telemetry. How will you debug stuff without logs and traces? Seems to me that the priorities are with practical, real everyday engineering concerns.

Re: Make any TypeScript function durable

#19
This is actually pretty cool. We have a similar custom library at Xbox that's used extensively across all of our services.

I do wish that there was some kind of self-hostable World implementation at launch. If other PAAS providers jump onto this, I could see this sticking around.

Post reply on HN