I'm noticing two things related to our use of the Composition API plugin that may not be 100% correct now that we've started using it in some WVUI components.
- The package is listed as a devDependency in package.json
- Individual component files like Checkbox.vue have their own calls to Vue.use( VueCompositionAPI ).
I think the correct place to be installing plugins into the Vue prototype is on the consumer side (i.e. the relevant Vue instance in the feature or application that is using these components) – not in the component library itself. This is how we are handling other Vue plugins in MediaWiki currently (i18n plugin, for example).
Moving the Composition API plugin into peerDependencies would help to make this obvious to end-users of WVUI. Would we want to automatically install this plugin in the vue module supplied by ResourceLoader?
On a related note, we probably should not include any code from the Composition API plugin in the bundled library output; this means we'd want to "externalize" this dependency in Webpack (or Rollup if we eventually migrate to that). Rollup has a plugin to automatically externalize any peerDependencies, and Webpack may have something similar.