Flux inside Web Workers

Problem 1 : Unable to Scale JavaScript Codebase

Problem 2 : UI Revamps

Problem 3: DOM is EVIL

Solution

Linux philosophy

DOMi vs DOMless

  1. It do DOM Manipulation
  2. It process our Data, take data from server, send to server, do other business logic.

Mixing Both Layers” is the major bottleneck in “Scaling JavaScript Codebase”.

Develop BL Layer First (DOMless First)

  1. BL Team — highly skilled senior member can work on DOMLess code. Focus more on code quality and architecture. Writing test case for BL Layer is super easy
  2. UI Team — focus more on User interaction.

How to Code BL Layer without UI ?

Problem — How to restrict DOM manipulation from BL Layer ?

Solution — Web Workers

Flux inside Web workers

FLUX inside Web Workers

Demo

Conclusion

  1. Always have clear separation between UI Layer and Business Logic Layer
  2. BL Layer (DOMless) do not need access to DOM so keep it inside Web Worker.
  3. UI Layer should not communicate to Server.
  4. We can have 2 repository for client side code.

--

--

--

12+yrs exp. JavaScript Expert. Full Stack Expert. React, Nodejs Mongo AWS, Terraform Pulumi. IITian, Open Source. Currently Software Architect @ Prophecy.io

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Narendra Sisodiya

Narendra Sisodiya

12+yrs exp. JavaScript Expert. Full Stack Expert. React, Nodejs Mongo AWS, Terraform Pulumi. IITian, Open Source. Currently Software Architect @ Prophecy.io

More from Medium

Phase 5 of Flatiron School — Project

“This.” keyword with arrow functions and with normal functions in JavaScript

Axios Throttle

3 reasons you should be using ES6 Proxy for higher-order functions