Open v1vendi opened 5 years ago
moving from const to let can also save some bytes, if you agree)
moving from const to let can also save some bytes, if you agree)
Did you measure the reductions after transpiling the code?
That's fun, for current rollup setup build size increases for all 3 of bundles (cjs, default and minified), as it builds to ES5. So the question now is should we optimize for older or for newer browsers. Decision is for you :)
Some more info - when I build the project as is, the minified file size is 6312b. When I add optimizations, file size grows to 6459b, but if I add a browserslist config with (for example) chrome > 49
I get 6181b.
Also this optimizations will be used by a large number of developers, who build hoist-non-react-statics
with their own bundles
So I'd still consider applying this micro-optimizations, even though they increase bundle size for old browsers and make some parts of code a bit more complex
Hello! I saw that you race for minified size, and I have tried several options to minify the bunde for modern browsers for about 15%:
let x = true
and set all settings fromcontextTypes: true
tocontextTypes: x
- saves ~20b of minified codegetStatics
method to arrow function - 16b of minified codeUnminified souce is also reduced by 400 bytes
Should I provide a PR for all of this or some points are useless?)