Frontend Bundling
Frontend bundling is a process by which your frontend source code, typically spread across multiple files, gets squished and transformed into few files, often just one file. This post will cover some basics around bundling.
Frontend bundling is a process by which your frontend source code, typically spread across multiple files, gets squished and transformed into few files, often just one file. This post will cover some basics around bundling.
There are currently two main module formats in the JavaScript ecosystem: ECMAScript Modules (ESM) and CommonJS (CJS). CJS was first, but ESM is now the JavaScript standard and is the future. The main difference between the two is how they import files.
What is "semantic versioning" (often called "semver")? (Specifically, semver v2.0.0.) It's detailed in full on its website (https://semver.org) but here's a quick summary and some notes on how it is used in npm.
I recently adopted ESLint into my workflow and enabled fix-on-save in VS Code. I've noticed since then that sometimes massive chunks of code get deleted on save by the fixes. My current suspicion is that this is entirely to blame on the rule @typescript-eslint/no-unused-expressions
. I've noticed other auto-fix issues as well, however, and will track down the culprit rules as they occur.
It is possible to leave fix-on-save enabled yet disable only the bad rules! Below is the JSON config that you will need to insert in your VS Code settings to do that. As I discover more problematic rules in the future, I'll append them below.
"eslint.codeActionsOnSave.rules": [
"!@typescript-eslint/no-unused-expressions",
"*"
],
Here are some quick conventions for good commit messages and pull request titles.
Npm is a package manager for JavaScript projects. What this means is that it enables easy installation of packages (published to the public registry, https://www.npmjs.com, or private registries) while also installing nested dependencies between packages. I received a bunch of questions about npm, and here are the answers! Note that I haven't looked at implementation details or any specs on how npm works, these answers are merely based on my observations after nearly a decade of using npm.
The tools we use as developers make us more effective (or at least hopefully faster) developers. So why not spend some time to make one of the most common dev tools much more useful? Here's a way to give any terminal app a personalized and awesome experience (fwiw I use the default app included with macOS). Features covered will be the following:
A simple script:
grep -rl '<search-string>' <search/dir> | xargs code -r
Between two different directories:
cd <first-path> && grep -rl '<search-string>' <search/dir> | (cd <second-path>; xargs code -r)
ffmpeg -i video.mp4 -c:v libvpx -crf 30 -b:v 0 -c:a libvorbis video.webm