vue-formulate
vue-formulate copied to clipboard
Allow Vue Formulate to not require global components
Feature: be able to use vue-formulate without calling Vue.use().
(Maybe there is a way, but I've tried my methods for temporailry hacking into Vue.component() to intercept the registration, and it didn't work possibly due to recursive components)
why?
The same reason we don't always use global variables; namespacing and name collisions.
If I want to make a package/component that depends on Vue Formulate, AFAIK I can't scope the formulate components to prevent global namespace pollution. So the user of my custom component/package imports "just my component" and thinks nothing of it. Then when they try to import a much-newer/much-older version of Vue Formulate, they're going to have a problem. Or if they create a chemistry app that balances the stoichiometric coefficients in their formulas and so they create a "formulate input" component and try register it globally only for my component to randomly break.
Similarly if two teams are working on a very large webapp, and they are using different versions of Vue Formulate, they will have a very bad time.
It is enough of a problem that this is something Vue 3 tries to fix (short article here).