Live data from Hacker News

Solid.js feels like what I always wanted React to be

typeofnan.dev

31–40 of 444 posts

Re: Solid.js feels like what I always wanted React to be

#33
post #14

What was wrong with the class component? It was very understandable and predictable.

Class components are fine for the simplest examples, but the moment they start increasing in complexity, they become a bit of a mess. Sharing functionality across multiple components becomes tricky with class components (with the only real option being HoCs / render props). You necessarily have to spread logic across different lifecycle methods.

Hooks allow you to bundle code together by functionality, and consequently allow you to easily extract and share said functionality in a very composable way.

This is my go to for visualizing the difference: https://i.imgur.com/e9K8vfz.gif

Re: Solid.js feels like what I always wanted React to be

#35

Earlier quoted context omitted.

https://www.solidjs.com/docs/latest/api#control-flow For reactive control flow to be performant, we have to control how elements are created. For example, with lists, a simple map is inefficient as it always maps the entire array. This means helper functions.

This feels like we're trading complexity here for complexity there, and it seems impossible to judge which way is actually "better". I use loops in React all the time but only have used `setInterval` in a component a handful of times..

Most of our jobs is determining the right trade offs.

I don’t see the big deal here. Error boundaries, suspense, context, very popular routing libraries all have used components to encapsulate functionality. That’s to say first party and third party functionality in the React ecosystem have gone down this path.

Re: Solid.js feels like what I always wanted React to be

#36
post #10

I swear we're just going around in circles because people only have a surface level understanding of these front-end frameworks, and the challenges with building at scale. react isn't about 'hooks', 'jsx', 'top-down-state', or 'component-driven architecture'. All these frameworks are component-based, can have top down state only (or do bottom up in react), can use things like jsx/hooks because it's just syntactic sug…

> react is fundamentally about 'inputs changed, render this'.

The actual article acknowledges that when it's read: "React isn’t truly reactive."

And the author also claims to love React and to think it made things better.

You're arguing with phantoms.

Re: Solid.js feels like what I always wanted React to be

#37
post #20
post #10

I swear we're just going around in circles because people only have a surface level understanding of these front-end frameworks, and the challenges with building at scale. react isn't about 'hooks', 'jsx', 'top-down-state', or 'component-driven architecture'. All these frameworks are component-based, can have top down state only (or do bottom up in react), can use things like jsx/hooks because it's just syntactic sug…

The thing is that While react is against side effects, javascript is not. Which result in these impedance mismatch where what devs want is against react itself. Vue/svelte/solid do not fight against js, hence they do not end up in similar situation

React lets you build DOM with normal JavaScript loops and .map; solid requires its own For element. How do you define “does not fight against js”? Because the above feels likes solid fighting against js.

Re: Solid.js feels like what I always wanted React to be

#38
post #6

Earlier quoted context omitted.

React hooks are footguns

Vue hooks avoid the closure/scoping issue mentioned in the doc. Very similar conceptually, but I find Vue's implementation a bit nicer to use

Took me 30 minutes to get up and running in Vue. Week 4 of this job and I still can't unfuck myself with React.

Re: Solid.js feels like what I always wanted React to be

#39
I am fundamentally skeptical of anything that needs a runtime for anything other than security and profiling.

I am extra skeptical of any framework that needs 50mb memory baseline.

I am triple skeptical of anything that uses brand-new packages and components like legos.

*Iterations on React are welcome.*

Re: Solid.js feels like what I always wanted React to be

#40
post #39

I am fundamentally skeptical of anything that needs a runtime for anything other than security and profiling. I am extra skeptical of any framework that needs 50mb memory baseline. I am triple skeptical of anything that uses brand-new packages and components like legos. *Iterations on React are welcome.*

Well, you can be skeptical, and the enterprise front-end engineers are going to go right on using that stuff because it scales to large codebase.
Post reply on HN