News for hackers. Stuff that matters.
Re:React Won by Default – and It's Killing Front End Innovation by gloosx on Tuesday September 16, 2025 @04:31AM (#45259598)
Surely they are not normal JavaScript functions, but at least the syntax itself is not turned into a DSL like we see it in Svelte or Vue. That is the main difference.
Re:React Won by Default – and It's Killing Front End Innovation by WickyNilliams on Tuesday September 16, 2025 @04:37AM (#45259654)
Yeah I get it. I don't think the "Just JavaScript" label can be applied to react anymore. It held in a class-based world. But it's not true post hooks.

I always hated templating languages

> Greenspun's {{rules.length | ordinal}} rule:

> Any sufficiently complicated templating language contains an ad-hoc, informally-specified, bug-ridden, slow implementation of half of the host language

But after working with Vue for a 18 months and expecting to hate it, I actually very much enjoyed it. The biggest downside is strictly one component per file.

Edit: in case I've come across as some kind of react hater, I was an early adopter and still use it professionally to this day

Re:React Won by Default – and It's Killing Front End Innovation by sensanaty on Tuesday September 16, 2025 @04:56AM (#45259776)
> Any sufficiently complicated templating language contains an ad-hoc, informally-specified, bug-ridden, slow implementation of half of the host language

Agreed, and Vue does it right exactly because they don't let you do complex things in the template. You can use ternaries in a pinch, but `computed`s exist so there isn't even a reason to do stuff like that. There's like... 10? directives that you can use and they are extremely obvious as to what they're doing, and the handlebar syntax itself is extremely limited and doesn't let you do any crazy stuff with it.

Re:React Won by Default – and It's Killing Front End Innovation by WickyNilliams on Tuesday September 16, 2025 @05:02AM (#45259817)
Yeah I was surprised, how little I felt hampered by its templating language. With things like handlebars and Jinja you often hit a wall like "how the hell do I express this in this language?", but never experienced it with vue.

Aside: I wish other frameworks would steal Vue's event modifiers. Doing things like `@click.prevent` or `@keyup.prevent.down` is so nice

Re:React Won by Default – and It's Killing Front End Innovation by wredcoll on Tuesday September 16, 2025 @02:21PM (#45265870)
I miss Vue's class based syntax. It felt so nice to have all the various magical bits having an actual home.
Re:React Won by Default – and It's Killing Front End Innovation by hasanhaja on Tuesday September 16, 2025 @05:09AM (#45259870)
Syntactical preferences are subjective though and are prone to familiarity bias. I started my webdev career with React so I'm really familiar with JSX and like it, but that alone isn't enough to make engineering decisions.

I think semantics could be a more objective way to assess the DX of frameworks because you can have/add a syntactic layer on top that suits your preferences [1]. Semantics would be things like rules of hooks, footguns of `useEffect`, component level reactivity rather than fine-grained reactivity, etc. The high level outcome of this would be being able to answer the following question:

"How likely is it that this framework will put me in the pit of success with minimal overhead?"

[1] https://vuejs.org/guide/extras/render-function.html#jsx-tsx

Re:React Won by Default – and It's Killing Front End Innovation by thedelanyo on Tuesday September 16, 2025 @06:05AM (#45260249)
I can create a .svelte file and I can just write only just hmtl - prolly a block of texts within a p tag.

With jsx, I don't think it's possible - I need to return it.

So even if Svelte is a DSL, to me it feels closer to web standard and jsx

Re:React Won by Default – and It's Killing Front End Innovation by baxuz on Tuesday September 16, 2025 @05:52AM (#45260142)
Which is arguably worse, because syntax comes with expectations. The way React (and JSX by extension) works is effectively a bunch of overloaded macros, that depends on the pragma used.

And god help you if you want to mix component level code inside React-land and "vanilla". They had to add 3 new hooks over the last 5 years to try and alleviate those issues, all while gaslighting the community and tool authors that the were "holding it wrong".

SolidJS is far better when it comes to how well it follows expectations, and how well it integrates.