Live data from Hacker News

Solid – A declarative JavaScript library for building user interfaces

github.com

31–40 of 178 posts

Re: Solid – A declarative JavaScript library for building user interfaces

#31

Earlier quoted context omitted.

Solid doesn't re-render Components over and over.. so integrating React is as simple as wrapping a `createEffect` calling `React.render` on a ref. The other way around is a bit harder, but been at this for a while here is a codesandbox with a HOC for that: https://codesandbox.io/s/solid-react-hoc-8m2yd If anything there is just so much to document.

Any comment on that storage-changed lib? I think that's a massively underrated abstraction for high level state / comms. I want it to be more popular. :)

It's interesting to wrap the persistence in there as well and it's lightweight so that's a plus. But someone also could use say Redux(or Storeon) and achieve a similar thing. The challenge of interopt is more with conflicting update/render cycle and props (especially children). For global storage any event emitter will do. Although one so browser native definitely has it's perks.

Re: Solid – A declarative JavaScript library for building user interfaces

#32
post #6

There is already a project named Solid led by Tim Berners-Lee: https://solid.mit.edu

This is interesting (I’m doing something similar in a specific domain) but there is a bunch of issues: very scarce documentation, funded by Quatari money, and more importantly built on bloated, low adoption set of Semantic Web specs. Heck, the tutorial even acknowledges[1] "If all the above looks terribly complicated: that’s because it is."

[1] https://solidproject.org/for-developers/apps/first-app/4-dat...

Re: Solid – A declarative JavaScript library for building user interfaces

#33
I personally have only had substantial experience with react (and its hooks), but the replacements for hooks in this library look very exciting to me, though I'm not sure I fully understand them on a first reading. One thing that react hooks require is the placing of hooks at the top level of a function, which precludes dynamically creating hooks in a loop, or lists of effects. While usually there is a way to achieve whatever you're trying to achieve anyway, it's still a bit of a restraint on what you can write with React. I haven't tried Solid yet, but if its hooks are nestable and composable as the Reactivity page says, then this could enable some patterns that were previously impossible with react hooks.

Re: Solid – A declarative JavaScript library for building user interfaces

#34
post #19

Earlier quoted context omitted.

Don't let him get you down, mate. These types of people who like tearing other projects down for the sake of it litter the internet. If you're having fun, keep going. That's all that matters.

> If you're having fun, keep going. That's all that matters. How is it different than what I said?

Surely you’d agree that “keep going” is rather different from “just don’t do it”?

Re: Solid – A declarative JavaScript library for building user interfaces

#37
post #34
post #19

Earlier quoted context omitted.

> If you're having fun, keep going. That's all that matters. How is it different than what I said?

Surely you’d agree that “keep going” is rather different from “just don’t do it”?

You missed a comment in between though.

Re: Solid – A declarative JavaScript library for building user interfaces

#38
post #35

People loved React because of VirtualDOM. Now JS libraries advertise themselves based having no VirtualDOM. Can someone explain this to me?

VirtualDOM is more of an implementation detail IMO. What I love about React is for its declarative API and we can compose components easily.

Re: Solid – A declarative JavaScript library for building user interfaces

#39
For the life of me, I can't understand why there is so much emphasis on the virtual-dom and dirty checking.

DOM manipulation is expensive, so a check is made to see if it really needs to be done.

If you're guaranteed to need an update, then this check is pointless. But this depends on what you're doing. Its really not something that's tied to the technical identity of any library. React, vue, etc, could probably also skip this step if they wanted.

Also, this will almost never be the bottle neck. It's really low down on a long list of other things that will have a bigger impact. Web dev is in a really bad state - you're supposed to have something like 1.5k nodes according to lighthouse because of all junk that browsers have to do now. That's a puny number of checks for the cpu to do.

Re: Solid – A declarative JavaScript library for building user interfaces

#40
post #35

People loved React because of VirtualDOM. Now JS libraries advertise themselves based having no VirtualDOM. Can someone explain this to me?

People loved React because it solved a problem. They just happened to solve it using virtual DOM.

but theses next generation frameworks are showing that there's a better way to solve the same problem.

Post reply on HN