After doing a bit more research, the best way to support vue2 without creating a separate package is to use vue-demi.
vue-demi utilizes @vue/composition-api to achieve the shim, which means we need to change the @userback/vue plugin to use the composition api instead of globalProperties.
This will still allow for a very similar api for the end user with $userback but will also allow for new functions, similar to the react hooks.
[ ] Update vue plugin to support demi
[ ] Add useUserback() composable.
[ ] Ensure vue2/vue3/nuxt2/nuxt3 all work as intended.
After doing a bit more research, the best way to support vue2 without creating a separate package is to use
vue-demi
.vue-demi
utilizes@vue/composition-api
to achieve the shim, which means we need to change the@userback/vue
plugin to use the composition api instead ofglobalProperties
.This will still allow for a very similar api for the end user with
$userback
but will also allow for new functions, similar to the react hooks.useUserback()
composable.