Page MenuHomePhabricator

@wmde/wikibase-vuejs-components peer dependencies
Closed, ResolvedPublic

Description

@wmde/wikibase-vuejs-components declares 2 packages as peer dependencies, which we do not provide in bridge - causing warnings on install.
Its vue config indeed externalizes them, but we don't seem to experience a lack of functionality in bridge.
Is the peer dependency really needed there? Are the packages not rather dev dependencies and their goodness compiled into the components (dist)?

npm WARN @wmde/wikibase-vuejs-components@0.1.3 requires a peer of vue-property-decorator@^7.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @wmde/wikibase-vuejs-components@0.1.3 requires a peer of vue-class-component@^6.0.0 but none is installed. You must install peer dependencies yourself.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Are the packages not rather dev dependencies and their goodness compiled into the components (dist)?

Not as far as I can tell – dist/wikibase-vuejs-components.common.js doesn’t seem to contain their code, it loads them via require() (just like vue itself).

I think the reason we don’t experience a lack of functionality in Bridge is that we do provide them – just using different versions: our package.json has "vue-class-component": "^7.2.3" and "vue-property-decorator": "^8.4.0", each one major version above the wikibase-vuejs-components requirement. (I don’t know why the npm warning reports this as “none is installed” rather than “an incompatible version is installed” or something like that.) But since the require() call in the compiled dist file includes no version number, and the differences between the versions don’t seem to matter to us, it works out in practice.

Proposed solution: make the component library declare peer dependencies on ^7|^8 and ^6|^7 versions.

Change 574446 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[wikibase/vuejs-components@master] Relax peer dependency version

https://gerrit.wikimedia.org/r/574446

Change 574446 merged by jenkins-bot:
[wikibase/vuejs-components@master] Relax peer dependency version

https://gerrit.wikimedia.org/r/574446

Devs should verify that the warnings are gone after this change has been released (T244989) and we use the new version (T244992).

Hum.

npm WARN @vue/preload-webpack-plugin@1.1.1 requires a peer of html-webpack-plugin@>=2.26.0 but none is installed. You must install peer dependencies yourself.
npm WARN @wmde/wikibase-vuejs-components@0.1.5 requires a peer of vue-property-decorator@^7|^8 but none is installed. You must install peer dependencies yourself.
npm WARN @wmde/wikibase-vuejs-components@0.1.5 requires a peer of vue-class-component@^6|^7 but none is installed. You must install peer dependencies yourself.
npm WARN acorn-jsx@5.1.0 requires a peer of acorn@^6.0.0 || ^7.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN wdio-wikibase@2.3.1 requires a peer of wdio-mediawiki@^0.3.0 but none is installed. You must install peer dependencies yourself.

The warning is still there… did I get the syntax wrong or something?

Yup, logical or uses two vertical bars. Dammit. (It’s exactly the same in composer too, so really, I have no excuse for making this mistake.)

Change 574456 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[wikibase/vuejs-components@master] Fix peer dependency version syntax

https://gerrit.wikimedia.org/r/574456

npm WARN wdio-wikibase@2.3.1 requires a peer of wdio-mediawiki@^0.3.0 but none is installed. You must install peer dependencies yourself.

Uploaded I0c250cf713 for this one.

Change 574456 merged by jenkins-bot:
[wikibase/vuejs-components@master] Fix peer dependency version syntax

https://gerrit.wikimedia.org/r/574456

Change 574817 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/Wikibase@master] bridge: update to new component library version

https://gerrit.wikimedia.org/r/574817

Change 574817 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] bridge: update to new component library version

https://gerrit.wikimedia.org/r/574817

Peer dependency warnings from the component library are gone; the following remain:

npm WARN @vue/preload-webpack-plugin@1.1.1 requires a peer of html-webpack-plugin@>=2.26.0 but none is installed. You must install peer dependencies yourself.
npm WARN acorn-jsx@5.1.0 requires a peer of acorn@^6.0.0 || ^7.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN wdio-wikibase@3.0.1 requires a peer of wdio-mediawiki@^0.3.0 but none is installed. You must install peer dependencies yourself.
npm WARN wdio-wikibase@3.0.1 requires a peer of webdriverio@~5.0 but none is installed. You must install peer dependencies yourself.

(We have wdio-mediawiki but as version 1.0.0 rather than 0.3.0; I suspect wdio-wikibase is incorrect in requiring the older version. And we removed webdriverio in I32943e0152.)