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

@vueuse/core integration #289

Closed
pi0 opened this issue Sep 24, 2021 · 3 comments · May be fixed by vuejs/vue-class-component#571
Closed

@vueuse/core integration #289

pi0 opened this issue Sep 24, 2021 · 3 comments · May be fixed by vuejs/vue-class-component#571
Assignees

Comments

@pi0
Copy link
Member

pi0 commented Sep 24, 2021

vueuse is an awesome project with many many useful compostables that can help for DX and rewriting them in nuxt core is reinventing the wheel.

@antfu Has an initial idea to make @vueuse/core/nuxt module registering auto imports and making integration with one line! This module can also cover later compatibility and necessary config adjustments of nuxt.

Regarding making a built-in feature, the only concern I have is about versioning. When vueuse adds a breaking change, we have to essentially bump nuxt version too. By having a nuxt module from vueuse, we can make a smooth addition experience (#569) while not falling into versioning issues.

@pi0 pi0 changed the title Built-in @vueuse/core @vueuse/core integration Sep 24, 2021
@antfu
Copy link
Member

antfu commented Sep 25, 2021

I guess maybe it's better to have the module on the VueUse side. Since we have hundreds of functions and most functions are quite stable, we still expected to see breaking changes because of a few functions in a short amount of time. To archive the experience of "built-in", maybe we could have it inside the starter template so users could have it out-of-box but also have the flexibility to manage the version of VueUse on its own.

The other idea might be we include a very loose version range in dependencies, something like "@vueuse/core": ">=6.0". So that way we could have the latest version available to the newcomers and also not force existing users to upgrade to the least VueUse if any. In this way, we would expect users to always have lock in their project and they can always specify the version of VueUse by explicitly list it as their project dependencies (ideally this might work, just an idea but I haven't see anyone doing that).

@pi0
Copy link
Member Author

pi0 commented Sep 25, 2021

Having it in the template or simple command to add seems best option :) It is mostly an extra step when one starts without a template and directly a 2-3 file nuxt 3 project they need one more step which I'm pretty sure we can figure out a way. One idea would be prompting to install as soon as an auto import detected.

I'm not fond of loose version since we will end up depending on implicit node-modules structure and behavior of package managers how they hoist to the top-level. Recreating lock file can also happen for various reasons and they might just face an unwanted upgrade that needs manual addition step.

@antfu
Copy link
Member

antfu commented Oct 26, 2021

Closing as we are having the Nuxt module for VueUse now 💚. We could track the auto library discovery and install prompt in another issue.

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

Successfully merging a pull request may close this issue.

2 participants