Interactive frontend development
Urmas Talimaa
SaleMove Inc
Bug reports
Product manager received a complaint from a customer:
I tried to use feature X, but when I clicked on the button, nothing happens. I tried this several times, nothing happens at all. Also feature Y is not working at the same time. When I refresh then everything is back to normal.
Bug reports
Product manager approaches the developer responsible for the user interface and asks to investigate and fix the problem.
You, the developer, go digging into the user interface and backend logs. The logs are hard to parse (as is usual), no bugs can be identified from the logs.
Using feature X works both locally and in the production environment, bug is not reproducible.
Bug reports
A lot of time wasted trying to reproduce the issue, no idea what and how to fix.
Developers are unhappy
Product managers are unhappy
Customers are unhappy
Redux action history
The order of user interface transitions that surfaced a bug can be easily viewed and understood.
The bug might be in the user interface, but might also be in the backend or anywhere in between instead.
Redux action history
Rebel against wasting time trying to debug issue backend bugs through the user interface.
Order serializable, human readable user interface history today!
Redux action history
Hard to catch race conditions are the bane of developers.
Isolate and identify them with standardized, complete logs of the user interface!
Where to display all the views?
On a single Page?
Image courtesy of Derick Bailey.
Multi-Page Single Page Application
Another problem
What if I’m deep in a single page application and a friend wants to open the same page?
Disappointment when friend lands to the landing view.
These are solved problems
Traditional web pages have had this solved from the beginning:
The URL.
History API
History API
React Router
The React Router
Where’s the elephant in the room?
Where’s the elephant in the room?
Where’s the elephant in the room?
Connected React Router
Connected React Router
What not to do with URLs
What not to do with URLs
Example flow:
dispatch(proceedToStepFour());�dispatch(push('/stepFourInProcess'));
Optimization
General information and tips from https://facebook.github.io/react/docs/optimizing-performance.html
While optimization of React applications is not required for small or medium sized applications, thinking about ways to optimize generally (for arbitrary components) is useful.
Optimization
Optimization
Optimization
Hand-writing shouldComponentUpdate is error prone and hard to maintain.
There must be a better way!
We are using pure functions and functional programming, �good things are supposed to happen.
Optimization
Optimization
Optimization
Be careful
Simplest method cache
Immutable JS
Homework