I have an app that can benefit from the use of web workers to separate UI interactions (scrolling etc) from processing that should be done in the background on the device. I am familiar with how to create and use web workers - however adding this retroactively to the app would require potentially lots of interfaces to be created to pass data/structures into and out of the web worker since it has it’s own scope and cannot access anything outside of it.
This is not a new challenge - others who’ve been down this road have written and presented about it before, as well as how they’ve have wrapped the entire App to run inside of a web worker using @angular/platform-webworker and @angular/platform-webworker-dynamic; but thus far they all reference Apps created directly with the Angular CLI! (not Ionic Apps)
(yes there are DOM access limitations but they are addressed via angular)
My questions is Is it possible to do this with an Ionic App built with the Ionic CLI?
I’ve tried the instructions from other forums for Angular CLI apps, and have been unsuccessful.
one such example that I tried is here:
Is there a guide/instructions on how to do this for Ionic or is it not possible at this time?
(I’ve searched and tested a TON, but still no luck)
Alternatively, is it a bad idea to run the entire App in a web worker vs sending messages to/from one or more modular web workers as needed? I’m willing to do the latter if it’s the right way to go.