Flux Architecture

Learn to build powerful and scalable applications with Flux, the architecture that serves billions of Facebook users every day

Flux Architecture

This ebook is included in a Mapt subscription
Adam Boduch

Learn to build powerful and scalable applications with Flux, the architecture that serves billions of Facebook users every day
$35.99
$44.99
RRP $35.99
RRP $44.99
eBook
Print + eBook
Subscribe and access every Packt eBook & Video.
 
  • 4,000+ eBooks & Videos
  • 40+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 
Preview in Mapt

Book Details

ISBN 139781786465818
Paperback316 pages

Book Description

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

Chapter 1: What is Flux?
Flux is a set of patterns
Flux isn't another framework
Flux solves conceptual problems
Flux components
Installing the Flux package
Summary
Chapter 2: Principles of Flux
Challenges with MV*
Unidirectional data
Explicit over implicit
Layers over hierarchies
Application data and UI state
Summary
Chapter 3: Building a Skeleton Architecture
General organization
Information design
Putting stores into action
Stores and feature domains
Bare bone views
End-to-end scenarios
Summary
Chapter 4: Creating Actions
Action names and constants
Feature action creators
Mocking data
Stateful action creators
Parameterized action creators
Summary
Chapter 5: Asynchronous Actions
Keeping Flux synchronous
Making API calls
Combining API calls
Returning promises
Summary
Chapter 6: Changing Flux Store State
Adapting to changing information
Reducing duplicate store data
Handling store dependencies
View update order
Dealing with store complexity
Summary
Chapter 7: Viewing Information
Passing views data
Keeping views stateless
View responsibilities
Using ReactJS with Flux
Summary
Chapter 8: Information Lifecycle
Component life cycle difficulties
Flux structures are static
Scaling information
Inactive stores
Summary
Chapter 9: Immutable Stores
Renouncing hidden updates
Enforcing unidirectional data flow
The cost of immutable data
Using Immutable.js
Summary
Chapter 10: Implementing a Dispatcher
Abstract dispatcher interface
Challenges with the dispatcher
Building a dispatcher module
Improving store registration
Summary
Chapter 11: Alternative View Components
ReactJS is a good fit for Flux
The downsides of ReactJS
Using jQuery and Handlebars
Using VanillaJS
Summary
Chapter 12: Leveraging Flux Libraries
Implementing core Flux components
Implementation pain points
Using Alt
Using Redux
Summary
Chapter 13: Testing and Performance
Hello Jest
Testing action creators
Testing stores
Performance goals
Profiling tools
Benchmarking tools
Summary
Chapter 14: Flux and the Software Development Lifecycle
Flux is open to interpretation
Development methodologies
Borrowing ideas from Flux
Packaging Flux components
Summary

What You Will Learn

  • Understand the Flux pattern and how it will impact your React applications
  • Build real-world applications that rely on Flux
  • Handle asynchronous actions in your application
  • Implement immutable stores with Immutable.js
  • Replace React.js with alternate View components such as jQuery and Handlebars
  • Test and benchmark your Flux architecture using Jest—Facebook’s enhancement of the Jasmine library

Authors

Table of Contents

Chapter 1: What is Flux?
Flux is a set of patterns
Flux isn't another framework
Flux solves conceptual problems
Flux components
Installing the Flux package
Summary
Chapter 2: Principles of Flux
Challenges with MV*
Unidirectional data
Explicit over implicit
Layers over hierarchies
Application data and UI state
Summary
Chapter 3: Building a Skeleton Architecture
General organization
Information design
Putting stores into action
Stores and feature domains
Bare bone views
End-to-end scenarios
Summary
Chapter 4: Creating Actions
Action names and constants
Feature action creators
Mocking data
Stateful action creators
Parameterized action creators
Summary
Chapter 5: Asynchronous Actions
Keeping Flux synchronous
Making API calls
Combining API calls
Returning promises
Summary
Chapter 6: Changing Flux Store State
Adapting to changing information
Reducing duplicate store data
Handling store dependencies
View update order
Dealing with store complexity
Summary
Chapter 7: Viewing Information
Passing views data
Keeping views stateless
View responsibilities
Using ReactJS with Flux
Summary
Chapter 8: Information Lifecycle
Component life cycle difficulties
Flux structures are static
Scaling information
Inactive stores
Summary
Chapter 9: Immutable Stores
Renouncing hidden updates
Enforcing unidirectional data flow
The cost of immutable data
Using Immutable.js
Summary
Chapter 10: Implementing a Dispatcher
Abstract dispatcher interface
Challenges with the dispatcher
Building a dispatcher module
Improving store registration
Summary
Chapter 11: Alternative View Components
ReactJS is a good fit for Flux
The downsides of ReactJS
Using jQuery and Handlebars
Using VanillaJS
Summary
Chapter 12: Leveraging Flux Libraries
Implementing core Flux components
Implementation pain points
Using Alt
Using Redux
Summary
Chapter 13: Testing and Performance
Hello Jest
Testing action creators
Testing stores
Performance goals
Profiling tools
Benchmarking tools
Summary
Chapter 14: Flux and the Software Development Lifecycle
Flux is open to interpretation
Development methodologies
Borrowing ideas from Flux
Packaging Flux components
Summary

Book Details

ISBN 139781786465818
Paperback316 pages
Read More

Read More Reviews