Following on my review of A Guide to Serverless Microservices, I read the new Serverless Single Page Apps by Ben Rady. It’s available as an e-book or dead tree book right now. You can get it from Pragmatic Press or on Amazon.
Right at the start Ben covers a few reader profiles and suggests which sections to pay the most attention to, depending on your goal for reading the book. There are recommendations for people just starting with single-page apps, experienced with single-page apps but new to serverless applications, or readers that want to use their own framework in a serverless context.
What makes it stand out is that all the frontend code for the book is written test-first. For example, when building a hash-change router Ben goes over the tests and goals for the code before getting into the router. It also covers the reason behind test-first development, so the reader gets a bit of portable testing experience along with the more specific single-page app information.
The Less Good
The book only uses jQuery, no single-page frameworks like React or Angular here. That’s good for teaching, but I’d really like to see an appendix or something at the end pointing to resources for users that want to move ahead with building SPA’s. Otherwise they might continue and end up with a kuldge like this.
On the up side, not picking a framework makes the book easier to follow and avoids the “here’s 15 steps to get the framework set up that won’t be explained” problem that afflicts framework-driven books.
For the test-first approach and the great introduction to using third-party identity services like Cognito, Serverless Single Page Apps takes home λλλλ of 5 Greek letters. It’s a great fit for developers wanting to move from template-driven Rails/Django environments to apps with more of a client-side focus.
It covers all the intro-level AWS topics you’d expect: IAM, Cognito, Lambda, DynamoDB, S3, and EC2 (for comparisons to Lambda). Coverage of CloudFront would be we a welcome addition. CDN’s are crucial to site performance, so any substantial SPA would want to take advantage of one.
Disclosure: I received a free ebook copy of this book as a technical reviewer. Other than a free copy, I received no compensation for this review, and none of the links in this post are affiliate links.