Bits and bytes of code

Bytes is my collection of short-form posts, tips, and things I learn as I build software.

Showing results for #javascript

Clear

I build a custom ESLint plugin for my personal website to prevent using unescaped single or double quotes in JSX and instead use "smart quotes" which are handled properly and also display consistently with the rest of my website. The plugin is surprisingly simple, and hopefully helps relive your fears about writing your own simple plugins like this one!

If you ever have needed to use the requestAnimationFrame API in an async method where you wait for an animation frame before executing additional logic, the callback nature of it might get annoying. With a super small wrapper, you can make a function that returns a promise instead!

Earlier last year, I created a tool called Flashlight which is a Rust-powered JavaScript code search tool. I recently added support for searching for JSX tags and I'd like to highlight the features of Flashlight briefly.

I recently published a new library that is an extremely minimal dependency injection library: TiDI. It has an intentionally small feature set and is designed specifically for class-based dependency injection

I came across the document.designMode property recently, and at first I did not understand why you would ever need it, but today I actually used it and wanted to share my learnings with you!

Using localStorage is great for storing simple user preferences such as the expanded/collapsed state of a sidebar, or the light/dark theme preference for the site. An often overlooked but useful feature of localStorage is the ability to sync changes between open tabs.