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

Component layers

There's a threshold within any sufficiently large JavaScript application, where the number of communicating components presents a scaling problem. The main bottleneck is the complexity we create, and our inability to understand it. To fight against this complexity, we can introduce layers. These are abstract categorical notions that help us visually understand what's happening at runtime.

Event flow direction

One of the first things designing with layers will reveal about our code, is the complexity of our inter-component communication in terms of event flow direction. For example, let's say our application has three layers. The top layer is concerned with routing, and other entry points into the UI. The middle layer has data and business logic spread throughout. The bottom layer is where our views are found. It's not about how many components are in these layers; while that's a factor, it's a minor one. What's important from this perspective is the types of arrows that cross...