ChainSafe / simpleserialize.com

https://simpleserialize.com
MIT License
7 stars 6 forks source link

upgrade packages and use threadsjs #43

Closed 3xtr4t3rr3str14l closed 3 years ago

3xtr4t3rr3str14l commented 3 years ago

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 commented 3 years ago

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.

dapplion commented 3 years ago

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

3xtr4t3rr3str14l commented 3 years ago

@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.

lgtm-com[bot] commented 3 years ago

This pull request introduces 1 alert when merging e5416614504435905499fa9f1dbe11d459cdc232 into 1fc8fb376e2d400c5aa4f342361d4a01d8c51498 - view on LGTM.com

new alerts:

lgtm-com[bot] commented 3 years ago

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

new alerts:

3xtr4t3rr3str14l commented 3 years ago

@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[bot] commented 3 years ago

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

new alerts:

lgtm-com[bot] commented 3 years ago

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

new alerts: