You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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").
The library contains search related components such as
. This creates unhealthy dependency between search and form. The search related components should be in invenio_search_ui to keep this clean (in current implementation you get tinymce in your search endpoint).
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
The text was updated successfully, but these errors were encountered:
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:
react-invenio-forms/src/lib/elements/GridResponsiveSidebarColumn.js
Line 5 in 8ccf8e5
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
The text was updated successfully, but these errors were encountered: