News for hackers. Stuff that matters.
Re:If it goes somewhere, it’s a link. If it does something, ... by moring on Wednesday October 12, 2022 @03:18AM (#33173873)
Prior to SPAs we had multi-page applications telling the user "don't use the back button or tabs, they break the website". Was that really better?
Re:If it goes somewhere, it’s a link. If it does something, ... by yakshaving_jgt on Wednesday October 12, 2022 @07:37AM (#33175482)
False dichotomy.

A poor implementation of a generally sensible approach is not justification to embrace a more complex and error-prone approach.

Re:If it goes somewhere, it’s a link. If it does something, ... by moring on Thursday October 13, 2022 @12:59AM (#33187424)
This argument can be used word-by-word in favor of SPAs and against earlier web applications, but it's a No True Scotsman either way.
Re:If it goes somewhere, it’s a link. If it does something, ... by yakshaving_jgt on Thursday October 13, 2022 @01:25AM (#33187566)
But then you’re making the argument that a SPA is less complex than a more orthodox equivalent, and I don’t think that’s the case.
Re:If it goes somewhere, it’s a link. If it does something, ... by moring on Thursday October 13, 2022 @04:49AM (#33188718)
It was definitely the case for most applications I have worked with because they had to perform client-side logic on the server side. Most SPAs I've seen at least have clearly separated responsibilities between the two, AND they don't act as if there wasn't a network in between.
Re:If it goes somewhere, it’s a link. If it does something, ... by yakshaving_jgt on Thursday October 13, 2022 @06:20AM (#33189260)
> AND they don't act as if there wasn't a network in between

…But there is a network in between. I'm not sure why pretending there isn't can somehow make a system less complex.

Furthermore, how do you write automated tests for your modals and slide-out panels? Your test suite needs to essentially run a browser. This is absolutely more complex than having an application on the server compute the document that the client expects.

Re:If it goes somewhere, it’s a link. If it does something, ... by moring on Thursday October 13, 2022 @08:42AM (#33190211)
> But there is a network in between

That's exactly my argument...? Seems to be a misunderstanding.

> I'm not sure why pretending there isn't can somehow make a system less complex.

Yes, that is exactly why pre-SPA web programming was more complex.

> Furthermore, how do you write automated tests for your modals and slide-out panels? Your test suite needs to essentially run a browser. This is absolutely more complex than having an application on the server compute the document that the client expects.

How do you test that the HTML/JS generated by the server actually show a modal? At least with libraries like React you can test everything up to the actual CSS engine. And no, you don't need a browser for that.

Re:If it goes somewhere, it’s a link. If it does something, ... by yakshaving_jgt on Friday October 14, 2022 @06:40AM (#33201767)
I don't think either of us are going to convince the other. I've built large, complex systems with both approaches, and I'm assuming you have too.

> How do you test that the HTML/JS generated by the server actually show a modal?

You can test for the existence of markup on page load. You can't test that some JavaScript for displaying a modal has run without running a JavaScript runtime, i.e., a [headless] browser.

In most cases, just loading a page which displays the appropriate information for the user is cheaper to test and implement, and usually is a better experience for the user also. It depends of course — this would not be true of an application like Google Maps. Most web applications aren't Google Maps though.

Re:If it goes somewhere, it’s a link. If it does something, ... by notyourwork on Wednesday October 12, 2022 @01:25PM (#33180157)
Not all websites got it wrong. They are both a problem but one does not excuse the other in regards to ignoring the way the web spec works.
Re:If it goes somewhere, it’s a link. If it does something, ... by moring on Thursday October 13, 2022 @12:58AM (#33187415)
Not all SPAs do it wrong either, that's my point. Caring about the user is orthogonal to the technology used.
Re:If it goes somewhere, it’s a link. If it does something, ... by notyourwork on Sunday October 16, 2022 @11:28PM (#33229555)
Most SPAs get it wrong because it’s complex to make work well in a single page framework. It’s nearly impossible to get wrong with a traditional webpage.