vue-generators / vue-form-generator

:clipboard: A schema-based form generator component for Vue.js
MIT License
2.99k stars 532 forks source link

Removed Masked Input Component? #502

Open zoul0813 opened 5 years ago

zoul0813 commented 5 years ago

I’m proposing that we remove support for MaskedInput component, as the library is now defunct/abandoned and the author recommends Cleave as a replacement.

3.0.0 seems an appropriate time to remove it, as we’ll be introducing quite a few breaking changes in v3.

lionel-bijaoui commented 5 years ago

I'm fine with this. Any other candidate for the purge ? 😈

zoul0813 commented 5 years ago

Actually, just remembered ... didn't we discuss removing all of the "optional" components, and then adding them back in as separate plugins?

lionel-bijaoui commented 5 years ago

Yes, but I found out we add another discussion about this and the solution was to use the tree-shaking capabilities of Webpack #244 I still need to create a POC for the external fields.

So, I'm going to start with this tree-shaking solution. That will help decouple the engine from the fields and see the consequences. Then, I'm going to work on the POC.

zoul0813 commented 5 years ago

@lionel-bijaoui not sure how tree-shaking helps out with the optional components that have additional deps, etc.

If we package those up as officially supported separate packages, such as @vue-for-generator/vfg-field-cleave or whatever, then we can ensure that cleave.js is a dependency of that package and made available. As well as provide more detailed documentation and examples specific to Cleave within that project.

Tree-shaking, as far as I understand it, would just be a way of compiling the vfg-core and vfg-full dist files ... no? So we'd still have the vfg-full.js with all of the optional components, as opposed to just the optional components a developer wants to use ... making the bundle larger than it needs to be (for example, if you only use Cleave, why should RangeSlider, StaticMap, Image, DateTimePicker, etc be included?).

Am I missing something?

lionel-bijaoui commented 5 years ago

Tree-shaking might remove unused field at compilation. That's the idea that @cristijora proposed. But don't worry, I want to remove everything in the end. I just do baby step that's all :) (tree-shaking -> test external field -> remove them all)