Some may argue that a low-end mobile device may have a poor performance with SPA because of the increased amount of JavaScript code. While that might have been true in the past, it may not be the reality at present and won't be in the future. Nowadays, even low-end devices have a powerful CPU that can perfectly execute most operations seamlessly. The real issue with mobile devices is not the computational power, but the network performance to download a larger size of code.
In this book, we will stick with SPA, and the main reason is that it fits well with the serverless approach. SPA is a modern approach to offload to clients some of the computing costs needed to run a website.
Lambda is cheap, but not free. On the other hand, client-side executions are limitless. Using the premise that more logic at the client won't significantly hurt the performance, I prefer avoiding making Lambda requests to handle the application state. Lambda should be used only to retrieve or save data and not to control UI logic.
However, as with most things in our field, each case should be treated separately. You may benefit from a multipage application and there is nothing wrong with it. With multipage, you just need to configure the Lambda function to return HTML content instead of JSON data, as we saw in an example in Chapter 3, Using the Serverless Framework.