Book Image

JavaScript at Scale

By : Adam Boduch
Book Image

JavaScript at Scale

By: Adam Boduch

Overview of this book

Table of Contents (17 chapters)
JavaScript at Scale
About the Author
About the Reviewers


This chapter introduced the concept of portability in frontend JavaScript applications. Portability in this context means not being tightly coupled with the backend. The main advantage of being portable means that we can treat our UI as its own application, it doesn't require any specific backend technologies to be in place.

To help our frontend achieve independence, we can mock the backend API it depends on. Mocking also lets us focus strictly on UI development—eliminating the possibility of backend issues from hindering our development.

Mocks can help us test our code as well. There're a number of unit testing libraries, each with their own approach, that we can utilize. If we're using the same mock data to run our tests, then we can rule out inconsistencies with what we see in the browser. Our tests need to be automated, alongside several other tasks that take place as part of our development process.

The toolchain we implement fits in nicely with a continuous integration server...