flipbyte / formik-json-schema

Easily create react forms using JSON / Javascript Object
MIT License
151 stars 40 forks source link

Bloated dist #40

Open compojoom opened 5 years ago

compojoom commented 5 years ago

Not sure if this is a bug, or a feature request. I just realized that our bundle size exploded with 200kb after adding formik-json package.

By the look of it - I initially thought it is lodash. I replaced all calls to lodash with calls to lodash-es, but this actually didn't help with the size. Then I looked further and it seems that the biggest problem is the quill and react-select renderers.

What is your goal with formik-json? I don't think that we'll ever use the quill component and right now I'm finding myself in a situation where I don't use any of the provided renderers.

Are there any plans to split the renderers from the package and have them in separate repositories and then everyone can register the renderers that are needed on per project basis?

easeq commented 5 years ago

The initial idea was to make an easy web form renderer with different types of fields manageable using a JS object. Your idea of splitting the package is a very good, but one which we cannot get into immediately due to lack of time. It might be a while before I am able to do the split myself.

easeq commented 5 years ago

I have been thinking about making this a monorepo and having separate packages for core and the form related elements.

I was thinking of splitting it as follows:

This would allow us to add react-native support with separate packages for native fields.

You keep the dependencies to a minimum by requiring only what you want.

Any thoughts?

compojoom commented 5 years ago

sounds awesome. This way the user could load in one project formik-json, field-dom, react-select and the container-dom stuff. and pass them as conf options to formik-json.

In another project one could juse use formik-json together with container-react-native and other react-native fields. It will both help with reducing the size of the package and making it more reusable.

tgrrr commented 4 years ago

Were you thinking Lerna?

easeq commented 4 years ago

Yes I was thinking Lerna