DEV Community

Parsa Jiravand profile picture

Parsa Jiravand

Frontend developer building back-office tools with server-driven UI. Big on clean architecture, TypeScript, and writing about the craft. Currently shipping a dev post a day.

Location Istanbul - Turkey Joined Joined on  Personal website https://github.com/parsajiravand

Education

Master of IT

Pronouns

Parsa

Work

Senior frontend developer

Delete Your Auto-Resize Textarea JS. CSS Does It Now.

Delete Your Auto-Resize Textarea JS. CSS Does It Now.

5
Comments
5 min read

Want to connect with Parsa Jiravand?

Create an account to connect with Parsa Jiravand. You can also sign in below to proceed if you already have an account.

Already have an account? Sign in
Nobody tells you the question window is closing

Nobody tells you the question window is closing

10
Comments 2
6 min read
JavaScript Closures: The Complete Guide (with Cheat Sheet)

JavaScript Closures: The Complete Guide (with Cheat Sheet)

8
Comments
12 min read
CSS Animations Can't Pause. The Web Animations API Can.

CSS Animations Can't Pause. The Web Animations API Can.

9
Comments
5 min read
Vue Reactivity Explained: ref vs reactive (+ Cheat Sheet)

Vue Reactivity Explained: ref vs reactive (+ Cheat Sheet)

13
Comments
11 min read
JavaScript Proxy and Reflect: The Complete Guide

JavaScript Proxy and Reflect: The Complete Guide

13
Comments 2
13 min read
The CSS Selector Built to Lose Every Fight

The CSS Selector Built to Lose Every Fight

15
Comments 1
5 min read
One version bump, 40 files to edit. Import maps fix that.

One version bump, 40 files to edit. Import maps fix that.

15
Comments
5 min read
Your fetch in beforeunload is silently killed. navigator.sendBeacon guarantees delivery.

Your fetch in beforeunload is silently killed. navigator.sendBeacon guarantees delivery.

18
Comments 1
4 min read
The Modal Was Open. So Was Everything Behind It.

The Modal Was Open. So Was Everything Behind It.

15
Comments
5 min read
Stop Writing Regex to Match URLs — The Browser Already Can

Stop Writing Regex to Match URLs — The Browser Already Can

17
Comments
5 min read
Stop Writing Media Queries for Font Size

Stop Writing Media Queries for Font Size

15
Comments 1
4 min read
I Ripped Out a Carousel Library. CSS Replaced It.

I Ripped Out a Carousel Library. CSS Replaced It.

22
Comments 1
4 min read
Stop Writing Math.cos() in a Resize Listener

Stop Writing Math.cos() in a Resize Listener

21
Comments
4 min read
I Can Finally Delete My max-height: 9999px Animation Hack

I Can Finally Delete My max-height: 9999px Animation Hack

26
Comments
5 min read
Five tabs open, one refresh token — the race nobody noticed

Reveals why multi-tab apps trigger sudden logouts

Five tabs open, one refresh token — the race nobody noticed

24
Comments 4
5 min read
You copy and reverse the array to find the last match. `findLast()` searches from the end directly.

You copy and reverse the array to find the last match. `findLast()` searches from the end directly.

23
Comments
3 min read
Your `fetch()` in `beforeunload` is being silently dropped. Use `navigator.sendBeacon()`.

Your `fetch()` in `beforeunload` is being silently dropped. Use `navigator.sendBeacon()`.

26
Comments 2
4 min read
You're blocking touchmove events to contain scroll. `overscroll-behavior` does it natively.

You're blocking touchmove events to contain scroll. `overscroll-behavior` does it natively.

22
Comments
4 min read
You're polling setInterval to detect DOM changes. `MutationObserver` fires when they happen.

You're polling setInterval to detect DOM changes. `MutationObserver` fires when they happen.

22
Comments
4 min read
You're importing pako to gzip data. `CompressionStream` does it natively.

You're importing pako to gzip data. `CompressionStream` does it natively.

28
Comments 2
4 min read
Stop using the localStorage hack to sync browser tabs. BroadcastChannel does it natively.

Avoids localStorage cleanup bugs

Stop using the localStorage hack to sync browser tabs. BroadcastChannel does it natively.

56
Comments 14
4 min read
You built your modal with a `<div>` and a focus trap library. The native `<dialog>` does all of that.

You built your modal with a `<div>` and a focus trap library. The native `<dialog>` does all of that.

20
Comments
4 min read
Stop importing `uuid`. `crypto.randomUUID()` has been native since 2021.

Stop importing `uuid`. `crypto.randomUUID()` has been native since 2021.

20
Comments
3 min read
You're installing date-fns for 'X hours ago'. `Intl.RelativeTimeFormat` does it natively.

You're installing date-fns for 'X hours ago'. `Intl.RelativeTimeFormat` does it natively.

22
Comments
4 min read
You use `obj.hasOwnProperty(key)` to check property ownership. It can silently fail. `Object.hasOwn()` is the safe replacement.

You use `obj.hasOwnProperty(key)` to check property ownership. It can silently fail. `Object.hasOwn()` is the safe replacement.

17
Comments
4 min read
Container queries can check more than size — style queries let components read custom property values

Container queries can check more than size — style queries let components read custom property values

23
Comments
4 min read
You're collecting async iterable results with a for-await loop. `Array.fromAsync` does it in one call.

You're collecting async iterable results with a for-await loop. `Array.fromAsync` does it in one call.

23
Comments
4 min read
Your browser renders everything, even what you can't see — `content-visibility: auto` fixes that

Your browser renders everything, even what you can't see — `content-visibility: auto` fixes that

42
Comments 1
4 min read
CORS Explained: The Complete Guide (with Cheat Sheet)

CORS Explained: The Complete Guide (with Cheat Sheet)

23
Comments 7
13 min read
Your UI is freezing because you never gave the browser a break

Your UI is freezing because you never gave the browser a break

21
Comments
4 min read
You're writing dark-mode colors twice. `light-dark()` fixes that.

You're writing dark-mode colors twice. `light-dark()` fixes that.

20
Comments
5 min read
You've been wrapping `new URL()` in try/catch. `URL.parse()` does it natively.

You've been wrapping `new URL()` in try/catch. `URL.parse()` does it natively.

21
Comments
5 min read
CSS has no native scoping. `@scope` changes that.

CSS has no native scoping. `@scope` changes that.

28
Comments 3
5 min read
Array methods are eager. Iterator helpers are lazy. Here's why that matters.

Array methods are eager. Iterator helpers are lazy. Here's why that matters.

22
Comments
4 min read
You reach for Sass to mix colors. `color-mix()` does it natively.

You reach for Sass to mix colors. `color-mix()` does it natively.

22
Comments
4 min read
You hand-edit headlines to avoid orphaned words. `text-wrap: balance` does it natively.

You hand-edit headlines to avoid orphaned words. `text-wrap: balance` does it natively.

17
Comments
4 min read
You copy and reverse the array to find the last match. `findLast()` searches from the end directly.

You copy and reverse the array to find the last match. `findLast()` searches from the end directly.

22
Comments 1
3 min read
You're watching `window` to detect element size changes. `ResizeObserver` watches the element itself.

You're watching `window` to detect element size changes. `ResizeObserver` watches the element itself.

22
Comments 1
4 min read
You use a setTimeout to trigger CSS entry animations. `@starting-style` makes it unnecessary.

You use a setTimeout to trigger CSS entry animations. `@starting-style` makes it unnecessary.

19
Comments 1
4 min read
You still write `finally { resource.close() }`. The `using` keyword does it automatically.

You still write `finally { resource.close() }`. The `using` keyword does it automatically.

14
Comments 3
4 min read
You've been doing Set math by hand. JavaScript finally shipped `.union()`, `.intersection()`, and friends.

You've been doing Set math by hand. JavaScript finally shipped `.union()`, `.intersection()`, and friends.

20
Comments 2
4 min read
You keep escaping the Promise constructor. `Promise.withResolvers` does it right.

You keep escaping the Promise constructor. `Promise.withResolvers` does it right.

18
Comments 1
4 min read
You're rethrowing errors and losing context. `Error.cause` fixes that.

Watch out for the positional argument footgun

You're rethrowing errors and losing context. `Error.cause` fixes that.

25
Comments 7
4 min read
TypeScript Generics: The Complete Guide (with Cheat Sheet)

TypeScript Generics: The Complete Guide (with Cheat Sheet)

18
Comments 5
12 min read
Your scroll listener fires on every pixel. `IntersectionObserver` fires when visibility actually changes.

Your scroll listener fires on every pixel. `IntersectionObserver` fires when visibility actually changes.

16
Comments
4 min read
You're using Floating UI to position your tooltip. The browser does it natively now.

You're using Floating UI to position your tooltip. The browser does it natively now.

12
Comments 1
5 min read
Your `margin-left` doesn't exist in Arabic. CSS logical properties fix that.

Your `margin-left` doesn't exist in Arabic. CSS logical properties fix that.

12
Comments
4 min read
Your CSS Grid cards look misaligned. `subgrid` is the fix you didn't know existed.

Your CSS Grid cards look misaligned. `subgrid` is the fix you didn't know existed.

10
Comments
4 min read
Your `.sort()` is mutating state. JavaScript finally gave you the fix.

Your `.sort()` is mutating state. JavaScript finally gave you the fix.

12
Comments
4 min read
You've been writing this `reduce` a hundred times. `Object.groupBy` does it in one.

You've been writing this `reduce` a hundred times. `Object.groupBy` does it in one.

16
Comments 4
4 min read
JavaScript Event Loop Explained: The Complete Guide

JavaScript Event Loop Explained: The Complete Guide

16
Comments 3
12 min read
You reach for `Promise.all` for every concurrent request. Here's when to use the other three.

You reach for `Promise.all` for every concurrent request. Here's when to use the other three.

11
Comments
4 min read
Your dropdown is a div. The browser has a native popover now.

Your dropdown is a div. The browser has a native popover now.

14
Comments 3
4 min read
Your TypeScript config objects are losing type information. `satisfies` fixes it.

Your TypeScript config objects are losing type information. `satisfies` fixes it.

15
Comments 4
4 min read
You've been deep-cloning objects with a JSON hack. `structuredClone` does it right.

You've been deep-cloning objects with a JSON hack. `structuredClone` does it right.

12
Comments
4 min read
You kept Sass for one reason. Native CSS nesting just ended it.

You kept Sass for one reason. Native CSS nesting just ended it.

14
Comments 4
4 min read
You can't transition a CSS variable. @property says otherwise.

Enabling interpolation via explicit types

You can't transition a CSS variable. @property says otherwise.

18
Comments 7
4 min read
Your scroll listener is doing CSS's job

Your scroll listener is doing CSS's job

13
Comments
5 min read
Your fetch() Is Still Running After the User Left

Your fetch() Is Still Running After the User Left

10
Comments
4 min read
loading...