Book Image

Flux Architecture

By : Adam Boduch
Book Image

Flux Architecture

By: Adam Boduch

Overview of this book

Whilst React has become Facebook’s poster-child for clean, complex, and modern web development, it has quietly been underpinned by its simplicity. It’s just a view. The real beauty in React is actually the architectural pattern that handles data in and out of React applications: Flux. With Flux, you’re able to build data-rich applications that engage your users, and scale to meet every demand. It is a key part of the Facebook technology stack that serves billions of users every day. This book will start by introducing the Flux pattern and help you get an understanding of what it is and how it works. After this, we’ll build real-world React applications that highlight the power and simplicity of Flux in action. Finally, we look at the landscape of Flux and explore the Alt and Redux libraries that make React and Flux developments easier. Filled with fully-worked examples and code-first explanations, by the end of the book, you'll not only have a rock solid understanding of the architecture, but will be ready to implement Flux architecture in anger.
Table of Contents (21 chapters)
Flux Architecture
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Component life cycle difficulties


One aspect of scaling a frontend architecture is cleaning up unused resources. This frees memory for new resources that get created as the user interacts with the application. JavaScript is garbage-collected, meaning that once an object doesn't have any references to it, it's eligible for collection the next time the collector runs. This gets us partway there; in that, there's no need to manually allocate/de-allocate memory. However, we have a whole other category of scaling issues, and they're all related to the lifecycle of components.

In this section, we'll talk about the scenarios where we want to reclaim unused resources and how this generally happens in frontend architectures. Then, we'll look at the challenges that component dependencies present, in the context of lifecycle management. Finally, we'll look at memory leak scenarios. Even with the best tools in place, there's always the possibility that our code has done something to circumvent memory...