🔥 Rust Port of Webpack? Rspack, the New Kid on the Block

Source: https://blog.stackademic.com/rust-port-of-webpack-rspack-the-new-kid-on-the-block-c3a3de569bfb

Frontend bundling is a task as old as time, and for ages webpack has been the standard. It's used almost everywhere, including in many well-known tools. But its main problem is slowness. Today there are worthy competitors — Vite, Parcel.js, Rollup.js, and others — yet the common pain point is migrating an existing application from webpack to an alternative. That task can take an overwhelming amount of time and feel more like a burden than a pleasure. But what if a fast bundler appeared that was compatible with webpack configuration? As it turns out, one has. Meet Rspack!

#js #builder

🔥 Prettier 3.0.0 release

Source: https://prettier.io/blog/2023/07/05/3.0.0.html

Prettier has released a major version 3.0.0! There are plenty of changes, all listed here:

➡️ https://prettier.io/blog/2023/07/05/3.0.0.html

My take: a very large release. The team made plenty of breaking changes, so upgrade carefully and treat it as a separate, full-fledged task.

The notable changes include:

#1 trailingComma: "all" is now the default. To restore the v2 default behavior, set trailingComma: "es5". As a general rule, I set trailingComma: "none" — I don’t see any advantage in a confusing trailing comma. Some argue it helps write code faster (supposedly you no longer have to keep thinking about whether you’ve put a comma at the end of an object, array, function, type, and so on, because it gets added automatically when autofixers are configured correctly). I can’t wrap my head around that: we’re not typists, we’re programmers, and our time goes mostly into thinking, not typing 🙂

#2 Support for Flow special comments has been removed. Too few people use Flow and its directives, and the code still has to be maintained — so the team tossed it rather than spend time on it. Move to TypeScript and you’ll be happy

#3 TypeScript support got a nice upgrade. Many pleasant changes and fixes landed for formatting types, keywords, and more. It used to happen that a pass through Prettier left types less readable than you’d like — the new version should fix that

#prettier

🔥 Increasing Application Performance with HTTP Cache Headers

Source: https://devcenter.heroku.com/articles/increasing-application-performance-with-http-cache-headers

If browser caching is a mess in your head, the article below will help you sort it out:

➡️ https://devcenter.heroku.com/articles/increasing-application-performance-with-http-cache-headers

My take:

The article above covers the main caching scenarios, which is enough for 99% of tasks. For the remaining 1%, you can look up the description of all Cache-Control header properties (here) or search for your specific case.

P.S. If your project uses NestJS, you can experiment with CacheInterceptor, as shown here

#cache