-
-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
serialization? #75
Comments
yes, the |
Presumably the right fix is to use the dedicated Node API for complex object serialization: |
@arcanis I think that solution would work well for almost every case - serializing functions isn't a thing and I think it will just need to be noted in the docs + have a nice error message that it isn't supported. I do see functions used in loader configs relatively frequently. |
@yocontra I'm sorry to tag you directly. Could you clarify whether the current README is out of date? Specifically, the third rule in below. I want to make sure that each worker will read the
I also opened a question there, if you could help I will be very grateful: webpack/webpack#18196. |
Stumbled on it by noticing that my regex's were failing, but raises a larger issue:
There are plenty of non-JSON values used in loader options that currently break when using thread-loader (regex, dates, functions). It seems like an easy solution would be to use a more comprehensive serialization method, or allow users to plug their own in. This will allow thread-loader to work with even more loaders and seems like a quick win.
I think this is the line in question:
thread-loader/src/WorkerPool.js
Line 101 in b02d503
Quick glance shows a few libraries that handle this, I'm sure you could either do this internally or find a better one as well:
The text was updated successfully, but these errors were encountered: