3 ms·
I think it may be worth specifically excluding Images from some of these checks. Or adjusting for what can be compressed in the images themselves. Though it's
by tracker1 11y ago
I think it may be worth specifically excluding Images from some of these checks. Or adjusting for what can be compressed in the images themselves. Though it's enough to say that they can be a huge portion of a site.
That said, I was able to boilerplate Preact + Redux for creation of a control that will be used stand-alone and the payload is about 16k of JS (min+gz), and under 1k of CSS [1]. The methodology I used could very well be carried to more "full" applications. There's very little reason most modern web applications can't be way under 500kb payload (excluding images). In this case I wanted more modern tooling, workflow, but a fairly light datepicker modal... I feel most datepickers suck. Could it be lighter? yes[1], but I wanted a little bit of a different approach. In the end it works...
All of that said, the biggest points of code bloat are usually in bringing in an entire library instead of only the pieces needed, especially bad with UI controls... I really wish more people would use/extend bootstrap from source here. It's really easy to do... usually I copy the variables file, copy the bootstrap base file, create a mixins file, and then update all the references in the copied base. From there, I can comment out/in as needed, and be fairly light.
Of course, fonts are another source of bloat, I'd suggest people start leaning towards using svg resources embedded in JS strings, and only those icons needed... all modern browsers support svg well enough in this case. Other web fonts should be limited to 2-3 includes of 1-2 families... that's it. Any more and your design is flawed anyway.
With webpack + babel, it isn't so hard to keep your applications structured, and much more minimal.
[1] https://github.com/tracker1/md-datepicker https://github.com/tracker1/md-datepicker
[2] https://dbushell.github.io/Pikaday/ https://dbushell.github.io/Pikaday/