How to update dependencies of one Polymer component without updating those of another?

流过昼夜 提交于 2020-01-14 04:18:09

问题


I'll try to describe our specific problem to avoid running into an XY Problem.

We have one Polymer app, that consists of several independent components (maintained by different teams). Each of these components has dependencies on other components, managed by Bower.

Sometimes, different components (say, A and B) have dependencies on the same components (e.g. C). Now when C releases a new version with a breaking change, both A and B have to upgrade to that new version at the same time.

This quickly becomes undesirable once the number of components grows (as it has for us). Thus, we're wondering if there's a way to update each component's dependencies individually.

We're using polymer-build and vulcanize, if that's relevant.


回答1:


Your individual elements can have different dependencies but your app can have only one version of a certain element.

The reason behind this is you can register a certain name/element only once using document.registerElement(which polymer uses internally) and i don't think there is any way to de-register an element.

In your app you can control the version of elements by adding resolution.



来源:https://stackoverflow.com/questions/42116106/how-to-update-dependencies-of-one-polymer-component-without-updating-those-of-an

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!