I have an Enterprise Angular App that is built with Angular-CLI (thus is using webpack) and utilises NGRX-Redux-store. It has an own UI-Library, a simple main module and (among others) a module featuring two components that are heavy on rendering: a data-table (Ag-Grid) and an infinitly-scrollable gallery/cards-view. The calculations in the redux-store are mostly basic copying, concatenating and appending of arrays and JS-objects. Now my question is:
Which parts of the app should I make concurrent? My own thoughts on that are:
- Some arrays in my store can contain thousands of elements, so if I can put the copying/concatenating-logic in an own thread, it would stop blocking my pipes and rendering. But it seems to be not such a popular method. I could only find this article on it: https://github.com/chikeichan/redux-worker It is about ReactJS and not Angular/NGRX
- A more popular approach seems to be separating ALL of the rendering logic from the rest of the application. How to do it for webpack is described here: https://stackoverflow.com/questions/43276044/angular-cli-generated-app-with-web-workers and for SystemJS/Non-Angular-CLI in the “Angular Cookbook”-book.
- My own idea was to separate only those two components that I mentioned. The only blog-article I could find on putting individual components into WebWorkers is this one here: http://blog.brakmic.com/introduction-to-angular-2-part-5-webworkers/ I don’t know if this approach makes sense, because from my understanding of how rendering in a browser works, you have to render the whole viewport when change-detection is triggered and the rendering of things on one thread with the ones on another, would have a communication-overhead. Am I right or wrong about this?
- In general it would make sense to put effects (the asynchronous request handler) into a webworker. but all my effects-actions are HTTP-calls, so it doesnt make sense until I put some heavy FE calculation action in the app (and if did that I would rather utilize the backend)
Any feedback/comment/answer is appreciated!