{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular-cli/issues/5885","repository_url":"https://api.github.com/repos/angular/angular-cli","labels_url":"https://api.github.com/repos/angular/angular-cli/issues/5885/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular-cli/issues/5885/comments","events_url":"https://api.github.com/repos/angular/angular-cli/issues/5885/events","html_url":"https://github.com/angular/angular-cli/issues/5885","id":220357258,"node_id":"MDU6SXNzdWUyMjAzNTcyNTg=","number":5885,"title":"How to work with web workers (use a web worker IN cli project)","user":{"login":"jbgarr","id":3316981,"node_id":"MDQ6VXNlcjMzMTY5ODE=","avatar_url":"https://avatars3.githubusercontent.com/u/3316981?v=4","gravatar_id":"","url":"https://api.github.com/users/jbgarr","html_url":"https://github.com/jbgarr","followers_url":"https://api.github.com/users/jbgarr/followers","following_url":"https://api.github.com/users/jbgarr/following{/other_user}","gists_url":"https://api.github.com/users/jbgarr/gists{/gist_id}","starred_url":"https://api.github.com/users/jbgarr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbgarr/subscriptions","organizations_url":"https://api.github.com/users/jbgarr/orgs","repos_url":"https://api.github.com/users/jbgarr/repos","events_url":"https://api.github.com/users/jbgarr/events{/privacy}","received_events_url":"https://api.github.com/users/jbgarr/received_events","type":"User","site_admin":false},"labels":[{"id":957896443,"node_id":"MDU6TGFiZWw5NTc4OTY0NDM=","url":"https://api.github.com/repos/angular/angular-cli/labels/comp:%20devkit/build-angular","name":"comp: devkit/build-angular","color":"c5def5","default":false},{"id":385594948,"node_id":"MDU6TGFiZWwzODU1OTQ5NDg=","url":"https://api.github.com/repos/angular/angular-cli/labels/type:%20RFC%20/%20discussion%20/%20question","name":"type: RFC / discussion / question","color":"EEEEEE","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":68,"created_at":"2017-04-07T23:43:24Z","updated_at":"2018-11-15T15:15:31Z","closed_at":null,"author_association":"NONE","body":"### Bug Report or Feature Request (mark with an `x`)\r\n```\r\n- [ ] bug report -> please search issues before submitting\r\n- [X] feature request\r\n```\r\n\r\n### Versions.\r\n@angular/cli: 1.0.0\r\nnode: 6.9.1\r\nos: darwin x64 (macOS Sierra 10.12.3)\r\n\r\nIs there a way to import and use a web worker in a component using angular-cli? I'm trying to incorporate a web worker that I wrote into my project, but I'm not having any luck. The web worker worked fine in my project before attempting to convert it to use the CLI (previous version was based on System.js). I'm trying to import my web worker code like this:\r\n\r\n```\r\nimport * as MyWorker from 'assets/workers/dropdown.worker.js';\r\n```\r\n\r\nand then I'm trying to create my actual worker instance like this:\r\n\r\n```\r\nlet blob = new Blob(['(this.onmessage=', MyWorker.toString(), ')'], { type: \"text/javascript\" });\r\nlet dropdownWorker = new Worker((<any>window).URL.createObjectURL(blob));\r\n```\r\n\r\nThe above does not work though, and if I log MyWorker right after I try to import it I see it's just an empty object instead of a function (which is what it is in my other app). Any help on this would be much appreciated!\r\n\r\n### UPDATE\r\nI just want to clarify what I'm trying to do: I want to use an existing web worker IN my Angular app, not run my whole app IN a web worker. I know there is separate issue already that relates to the trying to run an entire app in a web worker. These are similar, but very different issues.\r\n"},"comment":{"url":"https://api.github.com/repos/angular/angular-cli/issues/comments/439075008","html_url":"https://github.com/angular/angular-cli/issues/5885#issuecomment-439075008","issue_url":"https://api.github.com/repos/angular/angular-cli/issues/5885","id":439075008,"node_id":"MDEyOklzc3VlQ29tbWVudDQzOTA3NTAwOA==","user":{"login":"mhosman","id":5334175,"node_id":"MDQ6VXNlcjUzMzQxNzU=","avatar_url":"https://avatars1.githubusercontent.com/u/5334175?v=4","gravatar_id":"","url":"https://api.github.com/users/mhosman","html_url":"https://github.com/mhosman","followers_url":"https://api.github.com/users/mhosman/followers","following_url":"https://api.github.com/users/mhosman/following{/other_user}","gists_url":"https://api.github.com/users/mhosman/gists{/gist_id}","starred_url":"https://api.github.com/users/mhosman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhosman/subscriptions","organizations_url":"https://api.github.com/users/mhosman/orgs","repos_url":"https://api.github.com/users/mhosman/repos","events_url":"https://api.github.com/users/mhosman/events{/privacy}","received_events_url":"https://api.github.com/users/mhosman/received_events","type":"User","site_admin":false},"created_at":"2018-11-15T15:15:31Z","updated_at":"2018-11-15T15:15:31Z","author_association":"NONE","body":"Thanks @dirkluijk, my problem is that when I'm loading modules, loaders and the UI itself is stucked for a couple of seconds. I need a way to run the logic in the background in order to get the animations only working in the main thread."}}
{"actor":{"display_login":"mhosman"}}