News for hackers. Stuff that matters.
Re:The balance has shifted away from SPAs by jabart on Saturday May 21, 2022 @12:56PM (#31459536)
If your non-spa app requires a page load per an operation, my opinion is someone built it wrong. You can do a lot with < 200 lines of JS to make a page interactive.

Legacy apps were rebuilt as SPAs and rebuilding them made them faster.

"Spinning wheel of doom" is used by users now to describe delays in both SPA and non-spa web applications. Same tricks to make a SPA feel responsive work for both styles.

Re:The balance has shifted away from SPAs by dymk on Saturday May 21, 2022 @01:02PM (#31459621)
In 200 lines of JS, you can add maybe an interactive file uploader, or a tooltip implementation, and some form validation. But good luck doing anything of "business-tool" complexity in 200 lines that constitutes an application.
Re:The balance has shifted away from SPAs by Spivak on Saturday May 21, 2022 @01:06PM (#31459660)
Yeah I’m so confused what people think “interactivity” even means, like do people think interaction ends at “make the hamburger menu open and close?”
Re:The balance has shifted away from SPAs by TedDoesntTalk on Saturday May 21, 2022 @01:16PM (#31459767)
Dynamically replacing a div, based on a DOM event, with results of a fetch call can be done in way less than 200 lines of JS.

But why you’d do that instead of using 10 MB of React code, I don’t know.

Re:The balance has shifted away from SPAs by dymk on Saturday May 21, 2022 @01:23PM (#31459850)
How do you get 10MB of React code when React is 0.031MB, and Preact is 0.003MB?
Re:The balance has shifted away from SPAs by lobocinza on Saturday May 21, 2022 @09:21PM (#31463982)
Someone that is using React is probably also using X, Y and Z library and 10MB is realistic.
Re:The balance has shifted away from SPAs by dymk on Sunday May 22, 2022 @02:49AM (#31465552)
And somebody not using React but rather re-implementing everything to achieve their equivalent complexity usecase brings in X, Y and Z a well...
Re:The balance has shifted away from SPAs by lobocinza on Sunday May 22, 2022 @10:26AM (#31468504)
Not really. IMO, people are using large dependencies for things that can be implemented with a few lines of JS or even no JS at all. Doing things for the sake of complexity. The whole point is that X, Y and Z aren't needed.
Re:The balance has shifted away from SPAs by TedDoesntTalk on Saturday May 21, 2022 @01:41PM (#31460042)
I’m exaggerating to make a point :)
Re:The balance has shifted away from SPAs by bzxcvbn on Saturday May 21, 2022 @02:09PM (#31460318)
Your point is literally the size of the framework. Getting it wrong by more than two orders of magnitude is not exaggeration, it's a false argument.
Re:The balance has shifted away from SPAs by mmcnl on Saturday May 21, 2022 @03:53PM (#31461191)
What is the point? Optimizing for lines of code is a wasteful target. I thought we all knew that by now? Great that you can demonstrate that you can do something without React where others are using React, but that's not the point at all.

If you do more than a few asynchronous calls you will quickly find yourself developing your own DOM abstraction. That's a waste of time because React and Vue already exist, and have existed for years, and are battle tested.

SPA frameworks also give you the ability to write your applications in a declarative way, which is _far_ easier and way less error prone, thus easier to test, than imperative DOM modifications.

Re:The balance has shifted away from SPAs by NoWizards on Saturday May 21, 2022 @02:25PM (#31460456)
Its more like the time to become interactive. Even if internet and smarphones are fast. Sometimes it's pretty annoying to click an unresponsive page... just because it's loading-starting a lot of js
Re:The balance has shifted away from SPAs by thex10 on Saturday May 21, 2022 @11:19PM (#31464598)
I’ve worked with devs whose first instinct is to whip out React for this use case. It really makes me question their skills.
Re:The balance has shifted away from SPAs by cjbgkagh on Saturday May 21, 2022 @01:00PM (#31459592)
I find the more interactions I add to a non-SPA the more SPA like it becomes.
Re:The balance has shifted away from SPAs by sanderjd on Saturday May 21, 2022 @10:03PM (#31464234)
Yep, but with ever-more wheel reinvention.