Live data from Hacker News

Solid – A declarative JavaScript library for building user interfaces

github.com

151–160 of 178 posts

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

#151

This looks very interesting! With new projects and languages and frameworks a good angle to evaluate is, "what's the debug story like?"

Yep. I agree in practice Solid has some work to do here. The basics are think are reasonable in that we are dealing with your expressions in the template and real DOM nodes. So just drop a breakpoint in that sucker. Sort of return to how simple that was in jQuery/Backbone days.

It never is that simple mind you. I have an open issue around Dev Tools etc... We need to do better given the expectations of modern JS libraries.

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

#152

One minor thing I might consider is more examples with animation in UI --- it's a place where most apps want to go but have trouble doing elegantly/performantly.

I agree completely. I left an early github issue open with some examples. It just isn't my forte. I've worked with frontend guys who were mostly CSS ninja's and we never relied on framework mechanisms beyond applying some classes etc. I just lack the base knowledge to know what the expectation is here. I know Svelte has a very impressive system. I could look at doing something similar with Solid just not sure where t…

It's a dumb example, animated lists transition are kind of a good go to... https://svelte.dev/tutorial/animate as is https://dev.to/buhrmi/svelte-component-transitions-5ie

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

#153
post #51

Really cool, I should have a serious look at this non-virtual dom thing. All the examples make it look like this project is dependable. Sorry for the plug but I somehow explored similar path when creating the Blop language, maybe the author might be curious: https://github.com/batiste/blop-language Maybe I should get rid of the virtual DOM lib. I use?

It's not unexpected at all. I've had several template library writers reach out to me about the potential here. And there is some. The challenge is figuring out how to hide the reactivity in a way that your end users would be happy with but still benefit. I think it is an interesting challenge.

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

#154

Earlier quoted context omitted.

I agree completely. I left an early github issue open with some examples. It just isn't my forte. I've worked with frontend guys who were mostly CSS ninja's and we never relied on framework mechanisms beyond applying some classes etc. I just lack the base knowledge to know what the expectation is here. I know Svelte has a very impressive system. I could look at doing something similar with Solid just not sure where t…

It's a dumb example, animated lists transition are kind of a good go to... https://svelte.dev/tutorial/animate as is https://dev.to/buhrmi/svelte-component-transitions-5ie

Yeah I guess I mean more I don't understand what it takes mechanically to support those types of transitions. It makes sense to me but I also feel like there would be a lot of details in a generalizable solution. Super interesting though.

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

#155
post #136
post #74

Earlier quoted context omitted.

Well maybe we should compare apples to apples. With React you go down a rabbithole of workarounds around their initial concepts (like hooks) until you wonder why you chose it in the first place.

why do you consider Hooks a "workaround around [React's] initial concepts"?

I think Hooks are genius truthfully. But they are definitely shoehorning something into a place that didn't expect it. You are calling these render functions with the purpose of creating new transformations every cycle, and the injection mechanism has to include the initialization the first time. So you basically have these slotted things that allocate memory every time to just use what's cached most of the time.

Now don't get me wrong I've benchmarked Hooks like crazy and I don't think they are much consideration on performance at all. It's just the mental model of always update on the outside with bubbles of things that don't update creating these closures is a little unnatural. By comparison the mechanism they ape (fine grained reactivity) works exactly the opposite way. You just need to be aware the stuff outside doesn't update. Wrap what needs to be updated. Done. There are no out of date closures. No inconsistent mental model. It's as straightforward as registering event handlers.

Still I have to admit the solution is genius. They have managed to get 90% of the benefits with simply repositioning things. At one point this was one of my biggest arguments against React. People didn't appreciate it before hooks. But can you imagine knowing you could write applications this way years ago and trying to convince someone using React classes there was a better way? I just sort of gave up and did my own thing.

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

#156
> Whenever any dependency changes the State value will update immediately. Each setState statement will notify subscribers synchronously with all changes applied.

If two things change that both trigger a third thing to change, how does this efficiently prevent the third thing from updating twice needlessly? I'm imagining this becoming an exponential problem in real apps, where hundreds of components are re-updated needlessly at every UI interaction.

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

#157
post #131

Solid is another smart-compiler, virtual-dom-less frontend component building library. If you're wondering how this is different from Svelte, the author has a Medium post on it[0]. [0]: https://medium.com/@ryansolid/javascript-ui-compilers-compar...

One thing the article doesn't really dive too far into is that Svelte is template driven, while Solid is more about React's jsx-drive-components. As I've used both style methods for years, I think I'm growing fond of Svelte's template approach as the best general purpose solution. This is because usually my pages are 70% static and can be expressed as simple nearly vanilla web-idiomatic html pages. Being able to keep…

> This is because usually my pages are 70% static and can be expressed as simple nearly vanilla web-idiomatic html pages.

React can easily be used to render just the parts of the page that need it, with all the surrounding html done the old fashioned way.

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

#158

> Whenever any dependency changes the State value will update immediately. Each setState statement will notify subscribers synchronously with all changes applied. If two things change that both trigger a third thing to change, how does this efficiently prevent the third thing from updating twice needlessly? I'm imagining this becoming an exponential problem in real apps, where hundreds of components are re-updated ne…

The reactive graph is a push/pull system as it updates similar to MobX. This is a great article on the subject: https://hackernoon.com/becoming-fully-reactive-an-in-depth-e...

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

#159
post #71
post #61

HTML - A declarative markup language for building user interfaces. CSS - A declarative, domain-specific language for styling user interfaces.

Neither allow you to build interactive user interfaces besides what is provided by the browser. I understand the sentiment about reinventing the wheel, but this is more like inventing tyres I suppose (fortunately they are made of rubber, so I can stretch the analogy pretty far, haha). The wheel is there, but there is something to improve to cover more use cases.

click

That link tag above, is not only the poster boy of interactivity, it the the foundation of the web.

> Neither allow you to build interactive user interfaces besides what is provided by the browser.

Neither does JS, or any framework built on top of it. All types of interactivity in a browser are provided by for by the browser.

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

#160
post #61

HTML - A declarative markup language for building user interfaces. CSS - A declarative, domain-specific language for styling user interfaces.

Solid - A declarative JS library for building highly-interactive, logic-driven user interfaces. Better?

Short answer: worse.

Long answer: It is worse, and it all boils down to two phrases which I classify as "marketing speak". Marketing speaks aim is to impress and influence you, "technical speaks" aim is to inform and educate you. When shopping for a library or framework for your next feature or project, it helps to distinguish between the two. Usually any time you see a buzzword, you've stumbled upon some marketing speak. The buzz-wordy term "declarative" has been popularized by React, so I just thought I'd apply it to HTML and hopefully encourage someone to skill up on the web fundamentals (HTML, JS and CSS) before tackling JS frameworks to avoid disasters like this https://stackoverflow.com/questions/42464888/how-do-i-change....

> highly-interactive

What does this mean? Are you talking about video games? Because that is what comes to mind when I see the term "highly interactive".

> logic-driven

Aren't all programming languages logic driven? Or are there some feelings-driven apps?

Post reply on HN