Feat: Run angular in web worker mode
In current setup there is no possibility to bootstrap angular in web worker mode. Please add this killer functionality.
Currently also looking for a good way to accomplish it. Any1 got a workaround for now?
No support at the moment, but we are looking at it.
Any news here? Thanks!
I'm also curious if there have been any updates to this.
Also looking for this.
... need this feature!!!
For those who can't wait, I've found a good post on stackoverflow.
I've heard of Angular running in a webworker in the early days of angular. But when you try it out on a real demo : https://kaikcreator.github.io/angular-cli-web-worker/ ... It's something :tada: !
Now I'm just wondering whether I'm gonna wait for built in solution with the cli or ng eject :smile:
The stackoverflow approach seems reasonable. Would a PR with this be welcome here?
Gotta try to find out @bmayen ! Seriously I think that yes it'd be welcome and even tho it might not be perfect the first time after few iterations it might go to master ... :smiley:
Don't forget to reference this issue if you try something so we can follow what's going on :+1: !
@maxime1992 Thanks for posting that, I'm not sure why workers (--mobile) were cut from angular-cli.
This is something that we've been exploring. There's currently limited experimental support that you can try by doing:
npm install --save @angular/service-worker
ng set apps.0.serviceWorker=true
ng build --prod
Now --prod builds will generate and load a service worker.
/cc @alxhub
@filipesilva, your comment refers to a service worker, but the issue pertains to web workers. Typo or am I missing something here?
@filipesilva dude there is fundamental difference between webworker and serviceworker.
Sorry guys, this was a major durf on my part. Completely misread the issue.
Service workers would still be nice to have. They don't yet have full modern browser support though, so not as urgent IMO. Web workers on the other hand... :)
@bmayen Service workers are available, very nice tutorial here: https://docs.google.com/document/d/19S5ozevWighny788nI99worpcIMDnwWVmaJDGf_RoDY/edit#
@mwent-cray, this document is all about Service Workers, not Web Workers. They are different things with different objectives.
@willgm I know it is about WEB workers, I was pointing to @bmayen 's post.
The tutorial posted by Enrique here:https://medium.com/@enriqueoriol/angular-with-web-workers-step-by-step-dc11d5872135 using the ng eject approach works for a basic app, I tried to get it to work on my Angular 4 application but I had to get rid of 'hammerjs' to remove a window undefined error and now I am getting a PlatformLocation provider error...it seem that the routing module breaks it!
Has anyone had any luck getting webworkers with ng eject working ?
Unfortunately not, but haven't done too much additional research into it. Our webworker apps simply do not use Angular CLI now :( Not that we wouldn't love to migrate them over though! @filipesilva, is there any chance of bumping this priority up from "nice to have"? I'd argue that it's higher than that because it's major Angular functionality which isn't supported.