upvote

  FWIW, Custom Attributes in .Net are kind of a pain in geneal, powerful but painful
Why? What's kind of painful in general about them? They are just pieces of static data. You can abuse them, e.g. have some obscure logic somewhere, but you can abuse many things just the same (ahem, Reflection, excuse me), so this factor doesn't make a distinction.

  Probably why JS still doesnt really have them in practice.
Did you mean JS doesn't have TS decorators? Those are an entirely different beast.
reply
haha, "use server", use...(use...(...))
reply
deleted
reply
The language doesn't, but I'd say the language integration isn't the tricky part of this kind of cross-cutting-concern code. In JS you could imagine a function that decorates classes in some way, or React HOCs, etc. (We don't do HOCs anymore because we have a new kind of kludge, but we used to.)

The tricky part is as someone mentioned elsewhere in the thread: the attribute doesn't account for interactions well. You might want it to alter its behavior in different situations but the whole point is that it's cross-cutting and treats everything the same. (And I would say, even though I just called React hooks a kludge, that they are less cumbersome in this respect than HOCs were.)

reply