Answer the question
In order to leave comments, you need to log in
Versioning Vue components. How not to break something in a large codebase?
I read an article about versioning Vue components.
For example, there is a dropdown component, but it needs to be radically changed, while retaining the old implementation of this component, so as not to break something in a large code base and gradually replace it with a new version.
The bottom line was that the dropdown component itself (or some other) was a "wrapper" of the form:
<template functional>
<component :is="`dropdown_version_${props.version || 1}`" .../>
</template>
where the specified version of this component was imported and props, attributes and listeners were forwarded. <dropdown version="3" :items="..." @change="..."/>
Answer the question
In order to leave comments, you need to log in
Well, here the adapter pattern probably suggests itself. You make a proxy component out of your component, which, depending on the type of version, passes data to the child. I don’t know the links, and it’s probably not needed here, it’s just everything to buzumiya. The main thing is not to shoot yourself in the foot with such things.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question