Skip to content
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

[Bug Report] filterPlugins hook is not available in node API #219

Closed
1 task done
meteorlxy opened this issue May 29, 2019 · 0 comments · Fixed by #221
Closed
1 task done

[Bug Report] filterPlugins hook is not available in node API #219

meteorlxy opened this issue May 29, 2019 · 0 comments · Fixed by #221
Assignees
Labels
bug Something isn't working

Comments

@meteorlxy
Copy link
Contributor

  • I confirm that this is an issue rather than a question.

Bug report

Version

[email protected]

Steps to reproduce

api.hooks.beforePlugins.tapPromise(nodeApiId, () => {
const hookHandler = getHookHandler('beforePlugins')
if (hookHandler.name !== '__noopHandler__') {
log.verbose(() => `beforePlugins ${colors.dim(`(${nodeApiId})`)}`)
}
return Promise.resolve(hookHandler.call(api))
})
api.hooks.afterPlugins.tap(nodeApiId, () => {
for (const hookName of Object.keys(api.hooks)) {
if (hookName === 'beforePlugins') {
continue
}
const hook = api.hooks[hookName]
if (hook) {
const tapType = hook.call ? 'tap' : 'tapPromise'
hook[tapType](nodeApiId, (...args) => {
const hookHandler = getHookHandler(hookName)
const result = hookHandler.call(api, ...args)
if (hookHandler.name !== '__noopHandler__') {
log.verbose(() => `${hookName} ${colors.dim(`(${nodeApiId})`)}`)
}
if (tapType === 'tapPromise') {
return Promise.resolve(result)
}
return result
})
}
}
})

  1. In saber beforePlugins hook, call beforePlugins of node API
  2. In saber filterPlugins hook, do nothing
  3. In saber afterPlugins hook, call other hooks of node API

What is expected?

filterPlugins of node API is involved

What is actually happening?

filterPlugins of node API is ignored

Other relevant information

  • Result of running saber -v: [email protected]
  • Browser version (optional): x
  • Is Saber a global or local install? local
  • Which package manager did you use for the install? npm
  • Does this issue occur when all plugins are disabled? yes
@egoist egoist self-assigned this May 29, 2019
@egoist egoist added the bug Something isn't working label May 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants