Why is some code implemented per (Vue) renderer set?

Hi,

I am experimenting with JSON Forms and the Vuetify renderer set, but as I need several custom, application-specific components, I am considering not using an existing renderer set at all. Creating custom control/layout renderers (now using the Vuetify renderer “environment”) appeared to be pretty easy.

But, looking at both Vuetify and the vanilla renderer set, I noticed that several pieces are implemented in both sets: things like a ControlWrapper, useVuetifyControl/useVanillaControl, etc. I’m not yet aware of what all these parts do (for my custom components I’m copying the basics from a Vuetify renderer), but I was wondering why these things are not included in the generic Vue code, instead of being implemented per renderer set.

If someone can point me to more documentation related to this, I’d appreciate that too.

Hi @jos,

The control wrapper pattern is one which we use in most renderer sets to avoid redundancy and making sure all basic controls look and act the same.

The control wrapper is implemented against the corresponding renderer technology, so it doesn’t make sense to share the implementations, i.e. check the implementation of the Vanilla wrapper and the Vuetitfy wrapper which is much simpler as most functionality is taken over by Vuetify.

Similarly the useVuetifyControl and useVanillaControl enhance the basic Vue bindings with additional attributes used in the implementation of the specific renderer set.

Some functionality is useful in both and could be shared, especially. the appliedOptions calculation, however this is really not much code anyway.

Thanks for the answer. In the meantime I’ve started writing an own renderer set, targeted at my specific application needs (and using ElementUI), that doesn’t include anything from the vanilla or vuetify renderer set packages anymore. I started to copy and adapt a few core files from vanilla and this works completely independent now. Comparing the vanilla and vuetify code indeed gives a good insight in what’s going on.