I am not sure if issue is the appropriate place for this, or it should be a RFC. I figured we start here and see where it goes.
There is a problem with this library in a sense that using it in your code is very inefficient in terms of bundle size you get.
To show what I mean, I create a completely independent project. It has one entry point and the only thing it does is imports anything from react-invenio-forms. Note that the code is not even being used, just imported.
As you can see, you get 7.2 mb for importing anything from the package. As this is meant to be a reusable library that can be used in many places, this is really not ideal.
Issues:
The package.json contains browser key set to cjs, and so you are always importing from cjs distribution even when using es syntax (import from).
The more critical issue is that the package is bundled into one flat index.js file that just imports all the dependencies including tinymce which is humongous. Probably the package build should be changed in such way, to create more files and that you import only what you specifically need from the package (i.e. import {FieldLabel} from "react-invenio-forms/forms/FieldLabel").
More or less there is the same issue with react-searchkit, though in that one, the consequences are not so big, as it does not have such large depndencies as react-invenio-forms.
Please let me know what you think about all this or if you have some plans to work on this?
I am not sure if issue is the appropriate place for this, or it should be a RFC. I figured we start here and see where it goes.
There is a problem with this library in a sense that using it in your code is very inefficient in terms of bundle size you get.
To show what I mean, I create a completely independent project. It has one entry point and the only thing it does is imports anything from react-invenio-forms. Note that the code is not even being used, just imported.
As you can see, you get 7.2 mb for importing anything from the package. As this is meant to be a reusable library that can be used in many places, this is really not ideal.
Issues:
More or less there is the same issue with react-searchkit, though in that one, the consequences are not so big, as it does not have such large depndencies as react-invenio-forms.
Please let me know what you think about all this or if you have some plans to work on this?
Thank you,
Dusan