Skip to content
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

Bundle size jump #22

Open
ifiokjr opened this issue Jan 9, 2020 · 3 comments
Open

Bundle size jump #22

ifiokjr opened this issue Jan 9, 2020 · 3 comments

Comments

@ifiokjr
Copy link
Contributor

ifiokjr commented Jan 9, 2020

Since the update (#20) to the new version the bundle size has increased from 7.5 kB -> 11.1 kB. There may be nothing that can be done, but I was wondering how to address it since the default prop-types library comes in at 532 B.

I'm thinking it may be to do with the way their index file is structured to use shims when in production.

image

@gcanti
Copy link
Owner

gcanti commented Jan 9, 2020

This is weird, in their view io-ts went from 7.9kB to 4.7kB by switching to [email protected], where the jump in prop-types-ts comes from?

@ifiokjr
Copy link
Contributor Author

ifiokjr commented Jan 9, 2020

I think I see why.

Because io-ts switched to using fp-ts as a peer dependency it's bundle size dropped and because I added fp-ts as a direct dependency while upgrading the package file size has increased.

@gcanti
Copy link
Owner

gcanti commented Jan 9, 2020

Here's the numbers from https://bundlephobia.com

library minified
[email protected] 123.8
[email protected] 18.8
[email protected] 55.1

But then in the Composition section (from https://bundlephobia.com/[email protected]), says

io-ts: ~35.05 (io-ts code + fp-ts/lib/Either?)
fp-ts: ~17.14 (fp-ts/lib/Either module?)
self: ~2.92

Does it count the fp-ts/lib/Either module twice?

io-ts: ~35.05 = io-ts code: ~18.8 + fp-ts/lib/Either: ~17.14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants