Skip to content

upgrade packages and use threadsjs#43

Merged
wemeetagain merged 9 commits into
masterfrom
P0/#41
Jul 12, 2021
Merged

upgrade packages and use threadsjs#43
wemeetagain merged 9 commits into
masterfrom
P0/#41

Conversation

@3xtr4t3rr3str14l

@3xtr4t3rr3str14l 3xtr4t3rr3str14l commented Jul 6, 2021

Copy link
Copy Markdown
Contributor

Resolves #41 by upgrading to webpack 5 and using threadsjs for the web workers.

Since we were originally using the web-worker with an inline loader, but are no longer doing so under this PR, I also made a separate entry in the webpack config to transpile the worker *.ts file(s) into their own worker.ts

Moving from workerize-loaders to native web workers also opened the door to upgrade all the other packages in the repo, so I did that as well.

Also resolves #40

@3xtr4t3rr3str14l 3xtr4t3rr3str14l changed the title upgrade webpack and use native web workers upgrade all packages and use native web workers Jul 6, 2021
@3xtr4t3rr3str14l 3xtr4t3rr3str14l changed the title upgrade all packages and use native web workers upgrade webpack and use native web workers Jul 6, 2021
@3xtr4t3rr3str14l 3xtr4t3rr3str14l changed the title upgrade webpack and use native web workers upgrade all packages and use native web workers Jul 6, 2021
@3xtr4t3rr3str14l

Copy link
Copy Markdown
Contributor Author

I disabled ban-types since it was detected in the eslint upgrade. I will make an issue to go through these instances, uncomment ban-types, and apply the changes required by the linter.

@3xtr4t3rr3str14l 3xtr4t3rr3str14l changed the title upgrade all packages and use native web workers upgrade most packages and use native web workers Jul 6, 2021
@dapplion

dapplion commented Jul 7, 2021

Copy link
Copy Markdown
Contributor

@3xtr4t3rr3str14l Try this library, it's working great in Lodestar! https://www.npmjs.com/package/threads

@3xtr4t3rr3str14l

3xtr4t3rr3str14l commented Jul 7, 2021

Copy link
Copy Markdown
Contributor Author

@dapplion I tried using threads, and I have most of the code setup, but I'm running into webpack/script loading/etc woes. I've tried a bunch of things, and almost every time I try something I get these errors in the console:

GEThttp://localhost:8080/worker.tsx
[HTTP/1.1 404 Not Found 5ms]

Loading Worker from “http://localhost:8080/worker.tsx” was blocked because of a disallowed MIME type (“text/html”).

Any idea what might be going on? I thought I had all the types right in my webpack config, but now I'm not sure. This wasn't happening when I was using the native web workers, fwiw.

@3xtr4t3rr3str14l
3xtr4t3rr3str14l marked this pull request as draft July 7, 2021 22:07
@lgtm-com

lgtm-com Bot commented Jul 7, 2021

Copy link
Copy Markdown

This pull request introduces 1 alert when merging e541661 into 1fc8fb3 - view on LGTM.com

new alerts:

  • 1 for Unused variable, import, function or class

@lgtm-com

lgtm-com Bot commented Jul 7, 2021

Copy link
Copy Markdown

This pull request introduces 1 alert when merging 0e74c7d into 1fc8fb3 - view on LGTM.com

new alerts:

  • 1 for Unused variable, import, function or class

@3xtr4t3rr3str14l
3xtr4t3rr3str14l marked this pull request as ready for review July 8, 2021 23:29
@3xtr4t3rr3str14l

Copy link
Copy Markdown
Contributor Author

@dapplion I tried using threads, and I have most of the code setup, but I'm running into webpack/script loading/etc woes. I've tried a bunch of things, and almost every time I try something I get these errors in the console:

GEThttp://localhost:8080/worker.tsx
[HTTP/1.1 404 Not Found 5ms]

Loading Worker from “http://localhost:8080/worker.tsx” was blocked because of a disallowed MIME type (“text/html”).

Any idea what might be going on? I thought I had all the types right in my webpack config, but now I'm not sure. This wasn't happening when I was using the native web workers, fwiw.

fixed this. ready for review again

@lgtm-com

lgtm-com Bot commented Jul 8, 2021

Copy link
Copy Markdown

This pull request introduces 1 alert when merging 30980cf into 1fc8fb3 - view on LGTM.com

new alerts:

  • 1 for Unused variable, import, function or class

@lgtm-com

lgtm-com Bot commented Jul 8, 2021

Copy link
Copy Markdown

This pull request introduces 1 alert when merging 10889cd into 1fc8fb3 - view on LGTM.com

new alerts:

  • 1 for Unused variable, import, function or class

@3xtr4t3rr3str14l 3xtr4t3rr3str14l changed the title upgrade most packages and use native web workers upgrade most packages and use threadsjs Jul 8, 2021
@3xtr4t3rr3str14l 3xtr4t3rr3str14l changed the title upgrade most packages and use threadsjs upgrade packages and use threadsjs Jul 8, 2021
@wemeetagain wemeetagain assigned dapplion and unassigned dapplion Jul 9, 2021
@wemeetagain
wemeetagain requested a review from dapplion July 9, 2021 02:57
Comment thread src/components/Input.tsx Outdated
Comment thread src/components/worker/index.ts
Comment thread src/components/worker/index.ts Outdated
@wemeetagain
wemeetagain merged commit 7ffe4b0 into master Jul 12, 2021
@wemeetagain
wemeetagain deleted the P0/#41 branch July 12, 2021 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

workerize-loader and webpack 5 update deps where possible

3 participants