News for hackers. Stuff that matters.
Re:Rich Harris joins Vercel to work on Svelte full time by JimDabell on Thursday November 11, 2021 @08:39PM (#29195424)
> - Special syntax for reactivity is not javascript

> - I find the javascript-native flexibility of JSX far more expressive than any custom templating

These are odd points to combine – JSX is special syntax not JavaScript as well.

Re:Rich Harris joins Vercel to work on Svelte full time by veidelis on Thursday November 11, 2021 @09:17PM (#29195649)
Sure, but it maps 100% to an expected JS syntax and improves readability (subjective). From <div attr1="str">{children}</div> To React.createElement("div", { attr1: "str" }, children) Custom templating is not like that.
Re:Rich Harris joins Vercel to work on Svelte full time by keb_ on Thursday November 11, 2021 @09:43PM (#29195791)
Subjective indeed. If the goal is to leverage the full expressiveness of JavaScript, you could just alias React.createElement to something like `h`. Or use something like https://github.com/caderek/react-plain
Re:Rich Harris joins Vercel to work on Svelte full time by jeswin on Thursday November 11, 2021 @09:51PM (#29195843)
Yeah, but that's harder in practice. You often copy html snippets into your code, for example from tailwind or bootstrap samples. This is easier in JSX syntax; you'd just need to copy and fix up some attribute names.
Re:Rich Harris joins Vercel to work on Svelte full time by keb_ on Thursday November 11, 2021 @11:55PM (#29196419)
> You often copy html snippets into your code, for example from tailwind or bootstrap samples. This is easier in JSX syntax; you'd just need to copy and fix up some attribute names.

I literally never do this, but I suppose there are people who use React/JSX as a glorified templating library. Even then I probably wouldn't do this and rather use a proper templating library where HTML is valid.

Re:Rich Harris joins Vercel to work on Svelte full time by Kiro on Friday November 12, 2021 @02:23AM (#29197074)
It's very common if you're working with Tailwind (since the markup is self-contained). No need to be condescending.
Re:Rich Harris joins Vercel to work on Svelte full time by keb_ on Friday November 12, 2021 @09:48AM (#29199748)
Sorry, I did not mean to be condescending. I do use Tailwind, but even then I don't really copy-paste HTML examples.
Re:Rich Harris joins Vercel to work on Svelte full time by zdragnar on Thursday November 11, 2021 @11:06PM (#29196216)
JSX is more akin to a macro than a DSL, which is why I strongly prefer it. Debugging errors in templating languages is invariably more frustrating and time consuming.

More on point, being constrained within the special language is miles away from the constraint of JSX, which is essentially limited to only allowing expressions, because the macro expands to expressions. Everything else is fair game, and that makes it far more expressive.