JavaScript: Guides and Practical Know-how | Page 10 | mironsoft Blog
JavaScript
-
Sep 24, 2025
The Cookie Store API replaces the error prone parsing of document.cookie with an asynchronous, promise based interface featuring structured cookie objects, change events and real service worker access. Anyone managing session cookies, consent banners or auth tokens will find a much more robust foundation in the Cookie Store API than manual string parsing.
-
Sep 19, 2025
Turbo replaces full page changes with fast partial updates, yet client-side UI state can easily get lost on every Turbo Frame render. Alpine.js and Turbo/Hotwire together deliver exactly what each approach lacks on its own: server-side navigation without a reload, plus reliably re-initialized, local reactivity in every component.
-
Sep 16, 2025
=== only compares objects by reference identity, and JSON.stringify fails on key order, maps, sets and dates. A hand written deep equality function compares values recursively by structure instead of reference and covers exactly the data types the simple approaches regularly fail on.
-
Sep 16, 2025
Prop drilling and global variables are signs of tight coupling. Custom Events offer a native DOM solution: components send events, others listen, without a direct reference to each other, without a framework, and with full TypeScript support.
-
Sep 11, 2025
Date.now() delivers milliseconds with a precision that is not sufficient for serious performance measurement, and falls into the trap of system clock synchronization. The JavaScript Performance API provides sub-millisecond timestamps, structured marks and measures, a non-blocking observer mechanism, and direct access to Web Vitals without an external library.
-
Sep 11, 2025
Next.js middleware runs before a route is even rendered, deciding on redirects, rewrites, and headers before Server Components or Client Components become active. Once you understand matcher rules, auth checks, and the limits of the edge runtime, you can build routing logic that stays fast and still behaves robustly.
-
Sep 6, 2025
Anyone who wanted to resolve a promise from the outside, from an event handler, a callback API, or some other asynchronous context, had to smuggle resolve and reject out of the constructor scope. Promise.withResolvers() solves this in a single line: { promise, resolve, reject } as a structured object, clear and without boilerplate.
-
Sep 6, 2025
IndexedDB is the most powerful offline storage solution in the browser: structured data, gigabyte-scale capacity, transactions, indexes and asynchronous queries without ever blocking the UI thread. Once you master the fundamentals, you can build offline-first apps that work fully even without a network connection.
-
Sep 5, 2025
Svelte compiles components away instead of interpreting them at runtime, and this exact principle carries over to styling once Tailwind CSS is wired up correctly through Vite. This article covers the setup in SvelteKit, how scoped styles and utility classes work together, reactive statements for class logic and the server-side rendering pitfalls that occur particularly often with SvelteKit.
-
Sep 4, 2025
Cross Site Request Forgery is considered a solved problem by many teams the moment an application moves to a single page architecture with fetch instead of classic forms. In reality the risk merely shifts as long as session cookies are involved in authenticated API calls, and it stays real, requiring a deliberate combination of double submit cookie, the SameSite attribute and custom headers.