2 ms·
What you're essentially asking about is building single-page style web apps versus a conventional backend-rendered web site. The question is essentially whether
by ufmace 9y ago
What you're essentially asking about is building single-page style web apps versus a conventional backend-rendered web site. The question is essentially whether it makes more sense for your site/app to be rendering independent pages one at a time on the server, or to run what is essentially a JavaScript application in the user's browser that communicates to the server via an API as needed.
As a few example reasons, a JavaScript webapp will be similar to a smartphone app, running in an independent environment and talking to the server via API, so if your product is primarily a smartphone app, this may be a good way to go, as you keep the same APIs and test them well.
If your app is mainly about basic CRUD, showing results from DB queries and adding rows, it's probably simpler to build a conventional site - it's fast and easy to do security and data processing on the server, and you don't need the extra steps of retrieving the data, then rending to JSON or something, then unpacking it on the client site and then rendering it into some sort of display.
Anything expected to behave in a highly interactive way is best done as a JS Webapp - reloading pages from the server will crawl if you're clicking around a lot.
None of these are hard and fast rules, and it takes a decent amount of experience with each and knowledge of your business plan to make a good decision.