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

nuxt2: update hable to hookable #24419

Closed
3 of 4 tasks
AndreyYolkin opened this issue Nov 22, 2023 · 3 comments
Closed
3 of 4 tasks

nuxt2: update hable to hookable #24419

AndreyYolkin opened this issue Nov 22, 2023 · 3 comments
Labels

Comments

@AndreyYolkin
Copy link
Contributor

AndreyYolkin commented Nov 22, 2023

Describe the feature

This issue covers 3 packages: nuxt, nuxi and @nuxt/bridge

While digging inside outdated internals I've found out, that Nuxt Bridge relies on hookable package for types, but Nuxt 2 uses hable, which is the same package, but with old name and outdated versions. hable package doesn't even support removing hooks, which breaks hooks system in bridge with nitro.

For example, I write this code in a module:

nuxt.callHook('restart')

then I get
image

nuxi expects from hookable to return self-removing function, which only exists from v4 (hable is v3). @nuxt/bridge uses v5 as types reference, which is not entirely true.

With updating hookable in nuxt 2 to v4 (not 5, because it will break the usage with ie11, see https://github.com/unjs/hookable#migration) and also downgrading types in @nuxt/bridge to the same version we can solve this issue/proposal

Additional information

  • Would you be willing to help implement this feature?
  • Could this feature be implemented as a module?

Final checks

@pi0
Copy link
Member

pi0 commented Nov 23, 2023

Can you please try pnpm why hable or yarn why hable and show output which packages depend on it?

@pi0
Copy link
Member

pi0 commented Nov 23, 2023

Feel free to make a PR to 2.x branch to try for migration 👍🏼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants