News for hackers. Stuff that matters.
Re:A proposal to add signals to JavaScript by mardifoufs on Sunday March 31, 2024 @05:18PM (#39888151)
You don't need to be building Facebook or Google to have a TON of state in a webpage. Obviously if you are doing a basic dashboard, a blog or something similar, it isn't really needed. But for more complex stuff I think react provides a much better way to handle state changes than just using vanilla js. It's not like using react makes an app more complex, because if you wanted to do the same thing in vanillajs you'd end up with a much bigger mess.

I agree that some web pages don't need any of that, but those don't usually require a lot of development anyways.

Re:A proposal to add signals to JavaScript by xg15 on Sunday March 31, 2024 @08:04PM (#39889475)
Could you give a concrete example for the more complex stuff?
Re:A proposal to add signals to JavaScript by mardifoufs on Monday April 01, 2024 @12:30AM (#39890922)
Sure! Where I work we build very specialized, very low user count live remote non destructive testing software that can be run on a browser. Well, it used to be native, but clients complained a lot in part due to IT restrictions on updates. That means that we basically have to have a remote processing unit, sync the state with the front end at all time, and with the scanning equipment too. That means multiple different canvases and charts, different tabs etc that all contain state, need state to be updated sometimes in the background, and need to have consistent state changes. I don't do a lot of front end dev, but I did help in setting up our new inference module there as I'm in the AI/ML side and it would've been a nightmare to deal with even if I mostly did stuff in a webgl canvas. It was angular, which I don't really like, but is still much better than going vanilla.

I know it's pretty niche, but I'd say most non-trivial (blogs, CMS, forms) front ends handle a lot of state. If they don't, then they are relatively simple anyways. That's a generalization but still, you quickly hit the point where react/other framework becomes worth the complexity overhead versus the complexity of doing it in vanillajs

Re:A proposal to add signals to JavaScript by pcthrowaway on Monday April 01, 2024 @01:16AM (#39891117)
Maybe try making something like Grafana's dashboard by hand.