-
-
Notifications
You must be signed in to change notification settings - Fork 69
Implement getResolve #99
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
Conversation
alexander-akait
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job, but we need tests for this
|
Could you provide some hints on testing? I looked at a similar PR #88 and there are no tests. At a glance, this library doesn't seem to contain any tests directly calling functions like |
|
@qnighy You can create test with |
|
Thanks! I'll take a shot. |
|
Added a test that actually runs webpack using the Node interface. I wanted to specify |
alexander-akait
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job, thanks!
Fixes #79 by implementing
getResolve.getResolveis a generalization ofresolvewhereresolver.resolve(context, request, callback)is equivalent toresolver.getResolve(null)(context, request, callback). Differences:options.getResolveitself returns a function. I guess this is meant to cacheoptions. Howeveroptionsis also cached in the later stage of the resolver, so I decided not to implement caching in the thread-loader side.callbackis omitted.Therefore message-wise we can extend the existing
resolvemessage to allowoptionspayload and handle them in the worker pool. In the worker pool, we delegateresolvemessage togetResolveifoptionsis specified for compatibility with resolvers withoutgetResolve(although I'm not sure there's any). Currying and promise generation are handled on the worker side.