JavaScript: Guides and Practical Know-how | Page 14 | mironsoft Blog
JavaScript
-
Jun 15, 2025
Anyone running TypeScript in Node.js projects quickly runs into conflicting advice about tsc, ts-node, ESM, and CommonJS. This article covers the practical options for running TypeScript in Node, clears up the module interop pitfalls between ESM and CommonJS, and gives you a minimal, working tsconfig for CLI and build-script projects, including the native type-stripping support in recent Node versions.
-
Jun 15, 2025
An async generator delivers values one at a time, on demand, instead of holding a complete result list in memory. For paginated APIs, large exports and live data streams, async function* together with for await...of replaces error prone loop constructs with readable, composable code.
-
Jun 12, 2025
JavaScript is fast enough for most web tasks, but for image compression, audio DSP, cryptography, AI inference or physics simulations it hits its limits. WebAssembly closes this gap: compiled machine code from Rust, C or Go runs in the browser at close to native speed and cooperates closely with the JavaScript ecosystem.
-
Jun 10, 2025
A testimonial slider shows customer quotes in a compact, rotating form and is therefore a central social proof element on product and landing pages. With Alpine.js you can build a testimonial slider with autoplay, touch swipe, keyboard control and bullet indicators in a handful of lines of code, entirely without Swiper, Slick or any other external slider library.
-
Jun 9, 2025
Anyone who does not cancel fetch requests risks race conditions, memory leaks and inconsistent UI states. AbortController is the native browser API that solves this problem once and for all, for fetch, event listeners and any async operation.
-
Jun 3, 2025
A countdown timer for sale promotions lives on millisecond accurate remaining time, clean expiry behavior and stable performance over hours. With Alpine.js such a countdown timer comes together in a handful of x-data lines, with no external timer library, yet with full control over time zones, multiple instances and accessibility.
-
May 28, 2025
Rendering hundreds or thousands of entries in an Alpine.js x-for loop works fine, but without targeted optimizations filter inputs get sluggish, scrolling stutters and the browser tab freezes up. With the right patterns, Alpine.js stays fast and reactive even with large datasets.
-
May 26, 2025
For years, set operations in JavaScript had to be laboriously assembled with filter() and has(). The new JavaScript Set Methods solve this problem with a clean, readable API, directly on the Set object, without external libraries and without workarounds.
-
May 23, 2025
Migrating Encore to AssetMapper does not mean rewriting the frontend, it means moving entrypoints, npm packages and Sass files piece by piece onto Symfony's built in importmap mechanism, until Node.js is no longer strictly required for the production build.
-
May 16, 2025
Scroll, resize, and input events fire hundreds of times per second and can bring the main thread to a crawl if every call triggers an expensive function unchecked. Debouncing and throttling tame this flood deliberately, with clear timer mechanics, rAF-based patterns for visual updates, and ready-made Alpine.js modifiers for Hyva themes.