-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
distribution of types package is 30 kb? #274
Comments
I know its superbad, but since there is no traction overhere at all i just plucked the typings myself so i have typed options.
|
Sorry about that @maapteh . Though, if you only need TypeScript type definitions you can try the import type syntax. import type { ... } from '@contentful/rich-text-types`; |
That looks off @MarkosKon , sorry about that. Ajv shouldn't be included. I will need to investigate it and see what we can do. But that's probably not going to happen before next year. |
Thanks for replying. I needed the BLOCKS enum and Document/Text/Inline typing. I now moved them to a new own file so instead of 30Kb i now have 2Kb. AJV is set as your main dependency here: In my personal opinion validation things are helpers and should not be in a types package. |
I'm aware that we depend on |
@maapteh @MarkosKon FYI we no longer depend on |
@z0al thanks! can confirm your change has reduced our bundle by In our case was injecting the |
You export from one file https://github.com/contentful/rich-text/blob/master/packages/rich-text-types/src/index.ts So for bundlers maybe the option sideEffects will help. |
I noticed the rich-text-react-renderer uses the types package which gets bundles and adds 30kb (10kb zipped). I was wondering if its really needed?
The text was updated successfully, but these errors were encountered: