In working with this projects, I found that it requires all of Vue for the event bus and to register the component. That's obviously not very ideal since it often means having the main Vue in a project as well as Vue for vue-stripe. This makes the file larger and ultimately introduces bloat.
My recommendation would be to get rid of the Bus (https://github.com/matfish2/vue-stripe/issues/1#issuecomment-270204702) and to not implement the actual injections of the Vue component (Vue.component('stripe-checkout', StripeCheckout)). This is the method many other open source Vue components are being built.
Additionally, it would likely be rare that vue-stripe needs to be a global component so using Vue.use() seems like an over-step. Instead, using the component would look like this:
import VueStripe from 'vue-stripe';
new Vue({
component: [VueStripe],
...
});
If it needs to be global it can be done this way, but it doesn't have to be. More flexibility, smaller package size, no more need for Vue dependency.
In working with this projects, I found that it requires all of Vue for the event bus and to register the component. That's obviously not very ideal since it often means having the main Vue in a project as well as Vue for vue-stripe. This makes the file larger and ultimately introduces bloat.
My recommendation would be to get rid of the Bus (https://github.com/matfish2/vue-stripe/issues/1#issuecomment-270204702) and to not implement the actual injections of the Vue component (
Vue.component('stripe-checkout', StripeCheckout)
). This is the method many other open source Vue components are being built.Additionally, it would likely be rare that vue-stripe needs to be a global component so using
Vue.use()
seems like an over-step. Instead, using the component would look like this:If it needs to be global it can be done this way, but it doesn't have to be. More flexibility, smaller package size, no more need for Vue dependency.
I'll be happy to do this if you will merge a PR.
Thanks!