-
-
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
Implement getResolve #99
Conversation
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 |
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
.getResolve
is a generalization ofresolve
whereresolver.resolve(context, request, callback)
is equivalent toresolver.getResolve(null)(context, request, callback)
. Differences:options
.getResolve
itself returns a function. I guess this is meant to cacheoptions
. Howeveroptions
is also cached in the later stage of the resolver, so I decided not to implement caching in the thread-loader side.callback
is omitted.Therefore message-wise we can extend the existing
resolve
message to allowoptions
payload and handle them in the worker pool. In the worker pool, we delegateresolve
message togetResolve
ifoptions
is specified for compatibility with resolvers withoutgetResolve
(although I'm not sure there's any). Currying and promise generation are handled on the worker side.