News for hackers. Stuff that matters.
Re:You Shouldn't Start with an SPA by paxys on Friday February 02, 2024 @11:18AM (#39230396)
This article (and all others like it) always ignore the fact that mobile exists. Nowadays "front end" isn't just HTML pages being rended on some browser but also entire iOS and Android apps and maybe several others. Those APIs you think are an overhead are actually necessary regardless, and after that it's your server rendered HTML that instead becomes an additional burden to maintain. A SPA with dedicated front end engineers using the same APIs as the mobile ones is the most sensible approach for most apps.
Re:You Shouldn't Start with an SPA by simonhamp on Friday February 02, 2024 @01:08PM (#39232024)
I've done this. I spent six years building and maintaining an API platform to support apps and websites.

I'm fully aware of mobile and the need for those APIs. They just weren't sufficiently overlapping to be of any use to an SPA.

You need a whole slew of separate endpoints and behaviour, so it may as well not be an API - just make it a server-rendered monolith and move along.

Re:You Shouldn't Start with an SPA by paxys on Friday February 02, 2024 @01:21PM (#39232199)
Why would your mobile apps and browser client be so diverging that you need a completely separate set of APIs for both?
Re:You Shouldn't Start with an SPA by simonhamp on Friday February 02, 2024 @01:30PM (#39232330)
Because they were entirely different applications. It was an API platform for a suite of applications

There was almost zero crossover in functionality

Re:You Shouldn't Start with an SPA by paxys on Friday February 02, 2024 @01:40PM (#39232453)
Ok sure, but 99% of applications out there do not fit this description.
Re:You Shouldn't Start with an SPA by simonhamp on Friday February 02, 2024 @01:46PM (#39232531)
If you're building an SPA that's identical to a native app, I think someone in the exec team is making poor decisions

Either make a web app or a native app... don't do both

Re:You Shouldn't Start with an SPA by paxys on Friday February 02, 2024 @01:48PM (#39232564)
The only difference between a browser-based (or Electron) SPA and a native app is which runtime and rendering engine you are using. Why would API calls to the backend be different in either case?
Re:You Shouldn't Start with an SPA by simonhamp on Friday February 02, 2024 @01:54PM (#39232649)
Sure. But we're talking about needing the same API for two separate clients...

That infers building both and I'm questioning why you would build both if they're identical. Just build one and get your users to use it

Re:You Shouldn't Start with an SPA by paxys on Friday February 02, 2024 @01:57PM (#39232692)
Look around..no one is building native clients for every desktop OS anymore. Web, iOS and Android are the way to go for modern apps.
Re:You Shouldn't Start with an SPA by simonhamp on Friday February 02, 2024 @02:03PM (#39232767)
Yeh... and if you've got iOS and Android covered, then web is a different thing. Doesn't need to be an SPA, can still use those same APIs if that makes sense for your app