4 ms·
Answering the question in the title: no, probably you don't. Many developers today do not understand what a SPA is and when one should choose this architecture
by codedokode 10y ago
Answering the question in the title: no, probably you don't.
Many developers today do not understand what a SPA is and when one should choose this architecture. Writing a client side and a server side code is more complicated task that writing just a server side code so it should be justified.
Client side code is necessary when building interactive applications like spreadsheet or when an application has to work offline or store data locally. When a website feels more like a desktop application than a plain web page. There should be reasons to complicate architecture.
Most of a web sites are just a collection of pages, not applications. Using SPA there gives no advantages. For examples, developers of this website [1] used a megabyte of Javascript and API to display a list of 10 links. I do not see a single benefit from using SPA here over serving a 5Kb HTML file with those links. Everything just got worse.
And it looks like some JS frameworks authors do not understand it too. For example, I looked at Ember documentation and saw a tutorial [2] on building a rental site. Using Ember there gives no advantages over good old server-side generated pages (optionally using github-style AJAX page reloading). This over-engineered approach just makes a website load slower, comsume more CPU and memory resources, increases complexity, complicates deployment. If they are presenting Ember as a tool to build applications they should provide an example of application, not a plain old HTML 1.0 website.
[1] https://whosfiring.com/ https://whosfiring.com/
[2] https://guides.emberjs.com/v2.9.0/tutorial/ember-cli/ https://guides.emberjs.com/v2.9.0/tutorial/ember-cli/