Daily Edition · Page 4

THE DAILY INDEX

Technology, AI, software, security, crypto and business

ARTICLES & TUTORIALS

TLDR Web Dev

JAVASCRIPT STRING SLICE() CONSIDERED HARMFUL

A bug was discovered in Attio's CSV importer when using JavaScript's `slice()` method to truncate strings. It was causing gRPC errors when it split Unicode characters (like flag emojis) in the middle of their UTF-16 code units, resulting in invalid data being sent to their database. The issue occurs because `slice()` operates on code units rather than complete Unicode code points, so truncating "🇬🇧" could result in incomplete character data like "🇬\uD83C".

BUILDING A LIGHTWEIGHT REACTIVE STATE MANAGER WITH JAVASCRIPT PROXIES

You can build a lightweight reactive state management system using JavaScript Proxies, which automatically trigger UI updates whenever state changes without requiring external libraries. This article goes through a practical example of a media submission form where a Proxy intercepts property assignments (like `mediaStateProxy.video = "url"`) and automatically runs multiple UI update functions, removing the need to manually call update functions throughout the codebase.

THE EVOLUTION OF CACHING LIBRARIES IN GO

On-heap caches store data in the heap memory managed by Go's garbage collector. Go caching libraries have progressed from early mutex-protected maps to advanced libraries like Ristretto (2019), which became dominant but had issues with breaking changes and suboptimal performance on certain workloads. Theine was released in 2023 and implemented more efficient algorithms from Java's Caffeine library, including adaptive W-TinyLFU for better hit rates.

TLDR IndexPage 4