News for hackers. Stuff that matters.
Re:None of my projects want to be SPAs by freehunter on Monday February 11, 2019 @12:13PM (#19136051)
The other day I was arguing this exactly in a thread here about Ruby. People argue that Rails is outdated and is irrelevant for "modern web development", even though the web is not as modern as most people might think. Even what Facebook does, the only really hard part is the sheer scale they operate at. Facebook (the website) is not a single page app and other than the scale could be done in Rails with some AJAX sprinkled in or even Wordpress with some plugins.

People use SPA frameworks and make SPAs with them and those SPAs end up functioning exactly the same as any Rails/Django/Laravel site except the URL bar doesn't change. MVC is still the way the web is built, except for the people who got bored and wanted to make web development even harder than it already is.

YAGNI.

Re:None of my projects want to be SPAs by bunderbunder on Monday February 11, 2019 @01:44PM (#19137053)
I've started thinking of this phenomenon as "blog driven design". It's what happens when you fall into the assumption that what bloggers are writing about is what everyone is (or should be) doing.

The problem with that is, blogs are a poor barometer for that sort of thing. Nobody needs to write new blog posts about tried-and-true things that are already plenty well documented. The more solid and stable a technology is, the less incentive there is for anyone to bother writing how-to blogs about it.

Re:None of my projects want to be SPAs by master_oogway on Monday February 11, 2019 @01:28PM (#19136844)
In order to have dynamic UI you either have to use jQuery or SPA library like Vue or similar.

For me the major advantage of vuejs over jquery is the way data drives UI

Re:None of my projects want to be SPAs by irrational on Monday February 11, 2019 @01:53PM (#19137171)
But... people had dynamic UIs before jQuery and Vue. The main benefit of jQuery was back in the days when the browsers were so different from each other, but that's not the case anymore. I'd recommend learning some vanilla JS before thinking that you need jQuery/Vue/React to create dynamic UIs.
Re:None of my projects want to be SPAs by pault on Monday February 11, 2019 @02:24PM (#19137428)
The difference is imperative vs reactive UI. The impact of this is hard to overstate.
Re:None of my projects want to be SPAs by jaredsohn on Monday February 11, 2019 @01:39PM (#19136987)
Why do you need jQuery for this?
Re:None of my projects want to be SPAs by cpburns2009 on Monday February 11, 2019 @02:32PM (#19137488)
You don't strictly need jQuery for this. jQuery simply has a terser API than the standard DOM. That's why I still use it.
Re:None of my projects want to be SPAs by bryanrasmussen on Monday February 11, 2019 @12:16PM (#19136079)
sure, although modern browser apis mean the url bar can change in a reasonable way
Re:None of my projects want to be SPAs by mixmastamyk on Monday February 11, 2019 @01:17PM (#19136711)
What about tabs? SPA can make tabs troublesome. If I can't open a site in tabs it is broken to me.
Re:None of my projects want to be SPAs by tracker1 on Monday February 11, 2019 @04:22PM (#19138476)
I'm not sure when/why tabs should be an issue... it depends. To me it's a difference between localStorage and sessionStorage for the most part.
Re:None of my projects want to be SPAs by mixmastamyk on Tuesday February 12, 2019 @11:56AM (#19145181)
If links don't fully address an item then opening it in a tab won't work.
Re:None of my projects want to be SPAs by tracker1 on Tuesday February 12, 2019 @12:12PM (#19145334)
That isn't a limitation of SPA or browser based apps though. For that matter, even having an option to open an app multiple times is often a limitation of desktop apps. That doesn't make them somehow deficient as a platform.
Re:None of my projects want to be SPAs by mixmastamyk on Tuesday February 12, 2019 @01:25PM (#19146067)
It does. You don't open the "app" multiple times, you open lists or records in separate windows and/or tabs. That is a thing in desktop apps also. SPAs usually break it by tunneling everything through a single url, perhaps with anchors.
Re:None of my projects want to be SPAs by tracker1 on Thursday February 14, 2019 @03:22PM (#19165617)
But opening lists/records in another window/tab isn't a limitation of the browser environment, or SPA in particular. With proper router/caching in place it can be done within a browser app as well.
Re:None of my projects want to be SPAs by sangnoir on Monday February 11, 2019 @01:39PM (#19136991)
Browser-side routing/state management is a solved problem - SPAs can make tabs troublesome if the developer didn't put in the effort.
Re:None of my projects want to be SPAs by slavak on Tuesday February 12, 2019 @01:57AM (#19141586)
For God's sake, STOP trying to re-implement my browser's interface with Javascript! I don't want you to "put in the effort" to make my URL bar, back/forward buttons, and tabs work the way they naturally do in my browser; that's what my browser is FOR! Even when the developer does put in the effort, the results are usually _just_ different enough in various subtle ways from the browser's native behviour as to be annoying.

Just build a normal website and let my browser do what it was built to do. The APIs that allow SPAs are great and useful. The Pixlr online photo editor has a good reason to be a SPA, and that works great for it. Your forum/email interface/management API would work better as a normal website.

Re:None of my projects want to be SPAs by sangnoir on Tuesday February 12, 2019 @12:23PM (#19145443)
> Your forum/email interface/management API would work better as a normal website.

Good for you with your fast, always-on internet, I guess. Some consumers have to deal with expensive and unreliable 3G internet (that downgrades to 2G occasionally) - an offline-capable email (or management) SPA is indispensable for them. Sure, you could write 4 native offline apps for MacOS, Windows, iOS and Android but that is a bigger investment than targeting browser standards.

Re:None of my projects want to be SPAs by mixmastamyk on Tuesday February 12, 2019 @06:58PM (#19148981)
SPA is orthogonal to storage, nor are lightweight web techniques exclusive to it, and often in opposition. Native email clients already exist of course.
Re:None of my projects want to be SPAs by JetSpiegel on Monday February 11, 2019 @05:32PM (#19139092)
Using web API means tabs work even if the developer doesn't put in the effort.
Re:None of my projects want to be SPAs by Freak_NL on Monday February 11, 2019 @12:28PM (#19136198)
Having the address bar behave sensibly is one of guiding principles of the Ember JavaScript framework. A good modern SPA framework should be able to handle proper routing out of the box.