Slate: Add information on weight of code + explore reducing

Created on 22 Apr 2017  路  4Comments  路  Source: ianstormtaylor/slate

Just did a webpack analyze on slate and saw it's 440Kb without immutablejs (another 120Kb).

I know this is unminified, but was definitely a surprise to see such a large size for slate outside of immutable.

Would be good incentive to minimize it by adding it to README.md somewhere visible!

question

Most helpful comment

Hey @natew good point. I haven't done any true work on getting the size down yet, so there's probably low-hanging fruit everywhere. I'd be open to any pull requests that help! I'd also be open to a specific test-case (or system similar to ./benchmark) that would make it easy to keep track of the true bundle size over time.

For now since Slate is in beta and things change fairly often, I'd rather not have to maintain it in the readme since it's going to get stale fast.

Also, I think comparing "unminified" results are going to be very skewed unless you remove comments first, because Slate is much more commented than the average library鈥攚hich I find helpful when trying to keep track of all the inconsistencies it deals with, and is generally a reason that other libraries are hard to contribute to in the first place鈥攕o that's going to throw off super simple file size checks.

All 4 comments

Hey @natew good point. I haven't done any true work on getting the size down yet, so there's probably low-hanging fruit everywhere. I'd be open to any pull requests that help! I'd also be open to a specific test-case (or system similar to ./benchmark) that would make it easy to keep track of the true bundle size over time.

For now since Slate is in beta and things change fairly often, I'd rather not have to maintain it in the readme since it's going to get stale fast.

Also, I think comparing "unminified" results are going to be very skewed unless you remove comments first, because Slate is much more commented than the average library鈥攚hich I find helpful when trying to keep track of all the inconsistencies it deals with, and is generally a reason that other libraries are hard to contribute to in the first place鈥攕o that's going to throw off super simple file size checks.

Would including a simple badge like this be worthwhile?

gzip size

![gzip size](http://img.badgesize.io/https://unpkg.com/[email protected]/dist/slate.min.js?compression=gzip&label=gzip%20size)

Woah @conorcussel, that's cool! I'm down if you PR it next to the other green badges!

Was this page helpful?
0 / 5 - 0 ratings