4 ms·
not sure why you're being downvoted. SPA's have their place but I agree with you that they are being heavily overused. I've seen plenty of applications that co
by cultofmetatron 6y ago
not sure why you're being downvoted. SPA's have their place but I agree with you that they are being heavily overused.
I've seen plenty of applications that could have easily been a collection of server driven pages broken into an api and spa. I think it comes down to a few things where SPAs are great.
1. Programmers padding their resume. react looks more marketable that any server side templating technology
2. fomo, what if later we want to add something that needs it
3. seperate api/frontend teams, spas make seperating responsibility easier. two seperate codebases.
of course it has its downsides
1. you're maintaining a communication bridege between two different applications. This entails a context switch if you're a developer hopping back and forth.
2. more failure modes to handle. Only so many things can go wrong loading a page. If an SPA breaks, it can render the entire page unusable. You also need to have error. handling code for inputs on both your frontend and backend.
3. large file sizes to download. This one has been beaten to death but it still holds true.
Ive personally found a nice middleground with phoenix liveview. Its slightly more work than a tradtional page driven app while giving me teh ability to create all the features I was being asked for that before would have warrented an SPA. I hear livewire and stimulus reflex are great too.