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

huge filesize overhead - twice the size of react+redux implementation? #26

Open
tconroy opened this issue Jan 9, 2018 · 6 comments
Open

Comments

@tconroy
Copy link

tconroy commented Jan 9, 2018

hi!

we're considering using preact + preact-redux as an alternative to react + react-redux. This is pretty much solely due to bundle size savings migrating to preact.

However preact-redux seems to take up a crazy amount of space. On a fresh preact-cli app with only 1 additional dependency outside of redux and preact-redux, preact-redux is 35% of the total bundle size at 41.8KB on a production build. Way larger than preact, preact-router, polyfills, etc.

screen shot 2018-01-09 at 4 36 10 pm

Meanwhile in a react app production build I am seeing redux @ 5.76KB + react-redux @ 11.79KB === 17.55KB total, versus preact-redux's 41.9KB. Something doesn't seem right here!

Both are using latest versions of respective libraries (Redux + react/preact-redux).

any ideas how we can bring this bundle size down? It's unclear to me why this would be over twice the filesize.

@tconroy tconroy changed the title huge filesize overhead huge filesize overhead - twice the size of react+redux implementation? Jan 9, 2018
@developit
Copy link
Owner

Looks like it's because we're inlining PropTypes and possibly another dependency (which seems like an error!)

@tconroy
Copy link
Author

tconroy commented Jan 30, 2018

awesome, glad to hear it's just a bug! Curious if you had any headway with this issue @developit? I'm sure you're quite busy so I'd be happy to help if you can point me in the right direction. :)

@developit
Copy link
Owner

I spent a good long time looking into this yesterday, and it's a result of changes in react-redux, which we upstream (and compile to modify). I haven't had much success yet, only getting it down to 3.7kb.

@tconroy
Copy link
Author

tconroy commented Jan 30, 2018

thank you for the update & the investigation! 3.7kb is definitely a notable improvement. Just out of curiosity what were the changes made upstream to lead to this? are they inlining proptypes like you suspected?

Cheers!

@glf256
Copy link

glf256 commented Nov 24, 2018

I am also interested in learning what changes were made to get the final size down to 3.7kb.

@developit
Copy link
Owner

Hiya, sorry for dropping the ball on this. I'll try to dig up the branch I was working on.

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

3 participants