Live data from Hacker News

Solidjs: Simple and performant reactivity for building user interfaces

solidjs.com

101–110 of 190 posts

Re: Solidjs: Simple and performant reactivity for building user interfaces

#101
post #83
post #69

Earlier quoted context omitted.

Funny. To me JSX is a much superior language compared to HTML templating. And I would say it's provably so. You can do JSX-in-JS-in-JSX recursively in a way that is "natural" and "safe" and "maintainable". And with TypeScript you get great IDE support, ability to refactor and whatnot. No need to trust my word, just look at the huge amount of code in JSX that the world is maintaining at the moment. I would say the onl…

JSX is a huge conceptual mistake, IMO. Sure, it gives you expressiveness, flexibility, and templating for "free", but this comes at the expense of the separation of concerns principle, which is a bad tradeoff. HTML is concerned with the content and structure of the page. JS is concerned with behaviour and interactivity. Using JS, or any programming language for that matter, to control how HTML is rendered introduces…

Well, I guess personal preference is also a thing. But I would say that the "market" doesn't agree with your thoughts on the matter (and I don't also, but my opinion matters way less).

You can write MVVM as an unmaintainable mess also. From my experience as a freelancer, I have had much harder time fixing badly written Angular projects (all versions) than such written in React. It seems that people as a whole tend to produce much better React than any other UI code that I have encountered ever. (and I have done my share of Desktop/Mobile too). Flutter is great, but it's also practically React in a proper language.

Re: Solidjs: Simple and performant reactivity for building user interfaces

#102

svelte is far far superior to this. Instead of the verbose JSX or whatever that weird syntax is called, you literally write plain HTML in svelte and feels absolutely natural to do so

Yes, it feels super natural, which is actually a good way to describe Svelte's overall DX. Part of the reason it feels so natural in relation to HTML is that Svelte treats it as "The Mother Language". [0]

[0] https://github.com/sveltejs/svelte/discussions/10085

Re: Solidjs: Simple and performant reactivity for building user interfaces

#103
post #76

Genuine question: Why would you use Solid instead of Svelte? I'm coming from React and most alternatives seem quite similar to me. Only Svelte does things very differently with its compiler. Vue and Solid just seem to be a different flavour of React.

Ironically, mechanically Vue and Svelte historically were much closer to React. Vue has a similar VDOM and Svelte while compiled still had a rerun component model. It was only the past year about 6 years after Solid showed the way Svelte 5, and Vue Vapor got away from that and now compile down to what more or less Solid has been doing all along. Of course this is under the surface. But in many ways while Solid itself…

I love Svelte, but you are absolutely right about Solid's influence. Svelte's Signals implementation seems very performant compared to other Signals-based frameworks. [0]

[0] https://github.com/sveltejs/svelte/discussions/13277

Re: Solidjs: Simple and performant reactivity for building user interfaces

#104
post #76

Genuine question: Why would you use Solid instead of Svelte? I'm coming from React and most alternatives seem quite similar to me. Only Svelte does things very differently with its compiler. Vue and Solid just seem to be a different flavour of React.

so i managed to convince my company to try solid on a new project, pretty much on the basis of "this looks like react but solves many of our existing problems with react". since the JSX and project structure is basically the same, we could take our (pretty tiny at the time) demo project and do a 1:1 diff and show the differences inline. and it was pretty compelling! the code was simpler, and faster, and we still got to keep lots of the unique patterns/other stuff we were used to when creating react apps

Re: Solidjs: Simple and performant reactivity for building user interfaces

#105
post #61

Earlier quoted context omitted.

Both use signal-based reactivity, both are heavily optimised at compile-time to ensure only the parts of your app that need to well change at runtime. Vue uses single-file components, SolidJS uses JSX. That has a surprisingly large influence on how you develop with the frameworks, because it's a lot easier to create new components if those components are just regular Javascript functions, as opposed to being new file…

As someone that likes Vue and prefers templates that lost me at JSX. Which is of course entirely a matter of preference.

Yeah, I've heard a few people say that. Tbh, I think that (plus a few philosophical approaches) is probably the biggest difference between the two frameworks at this point. Both use signals, both use an optimising template compiler, but in one you write the templates as JSX and in the other you write the templates as SFCs.

Can I ask why you prefer SFCs to JSX?

Re: Solidjs: Simple and performant reactivity for building user interfaces

#106
My full time job is with React and my side projects are build with Solid.

I gave a presentation in the office about Solid a while ago and one of the guys said: "So this looks like React, it's easier to understand, it's faster, smaller, with more build in stuff... why are we not using it?"

Ryan, the creator of Solid, mentioned in one of his interviews that the fact Solid is gaining traction slowly is actually a sign that the web has matured. People are no longer as quick to jump to the next flashy thing - and I agree.

Re: Solidjs: Simple and performant reactivity for building user interfaces

#107
Can a SolidJS or an other non-React user chime in to explain what their experience is when using a more `modern|unorthodox` framework for a data-heavy SPA that uses lots of components?

For react you have got Mui(x). Especially the datagrid with the myriad of options is something which I cannot fathom to rebuild myself. I mean, look at this [0], which just is about the grouping options.

When I see other component libraries I think: nice, this is only 10% of what I need. So I am curious if and how people use non-React stuff to build `heavy` SPA applications. Maybe I can learn something.

For me the selling points for React are:

  - functional: components are pure functions 
    (with caveats 1. as much as possible; 2. from a dev experience)

  - large component libraries. High quality, battle tested, and well documented.

---

0. https://mui.com/x/react-data-grid/row-grouping/

Re: Solidjs: Simple and performant reactivity for building user interfaces

#108

So is Solid kind of like React but easier to use?

From my modest understanding it turns how you use hooks on its head. React will run the functional component to render each time state updates, and you need hooks to cache and sync things (eg useCallback, useMemo, useEffect). Solid is the opposite I think, it executes only once, and you use hooks to set up bindings which run updates on the component.

Re: Solidjs: Simple and performant reactivity for building user interfaces

#109

Portions of the react community are excited about how it's starting to feel more like PHP with the movement towards server actions in "client" code etc I personally don't like that direction so looking forward to exploring new frameworks. What I've generally liked about React/Next setups is that the code is generally explicit and less magic (I also have gripes with hooks feeling like magic). Things like Vue/Svelte wh…

> Things like Vue/Svelte where they mash together css and js in the same file if you want kind of turns me off.

I personally found Svelte much more intuitive than React.

Code first, then markup, then style.

React I have always just found a bit confusing and annoying.

Re: Solidjs: Simple and performant reactivity for building user interfaces

#110

Can a SolidJS or an other non-React user chime in to explain what their experience is when using a more `modern|unorthodox` framework for a data-heavy SPA that uses lots of components? For react you have got Mui(x). Especially the datagrid with the myriad of options is something which I cannot fathom to rebuild myself. I mean, look at this [0], which just is about the grouping options. When I see other component libr…

Most of the modern front end frameworks can handle those use cases.

Solid, Vue, Svelte all have capable SPA frameworks and component libraries

Post reply on HN