Using algorithms like gzip or brotli drastically reduces the size of your assets and can improve the load time of your app – in the case of this blog, by 25%. In this post I am going to explain how to add gzip and brotli compression to an existing webpack setup and serve the compressed files using express.
You are using highlight.js? You noticed that it takes up a huge portion of all your bundle? In this blog post I am going to write about how I brought down the size of this chunk from 750kb and almost 25% of my total bundle size to under 40kb and only about 1.7% by defining which languages should be available to the highlighter.
Have you ever found yourself writing a helper function to get properties nested in an object if the object or following properties exist? Something that does something along the lines of const nameError = errors && errors.address && errors.address.name? If so, you will *love* the TC39 proposal for optional chaining in JS. Here is a quick introduction into the operator.