# Kenil Sudani (Super Kenil) — Full Site Context > Full-stack developer from Gujarat, India. Building free browser tools, open-source developer utilities, and AI automation systems. - Primary Domain: https://sknl.dev - Secondary Owned Domain: https://superkenil.com (canonical entity is https://sknl.dev) - Role: Full-Stack Software Engineer - Location: Gujarat, India - Availability: Open to full-time software engineering roles and freelance engagements - Core Skills: TypeScript, JavaScript, React, Next.js, Astro, Angular, Vue, Node.js, Tailwind CSS, WebAssembly, Rust, AI Automation - Resume: https://sknl.dev/Kenil-Sudani-Resume.pdf - Email: hello@sknl.dev - GitHub: https://github.com/Super-Kenil - LinkedIn: https://linkedin.com/in/super-kenil - X (Twitter): https://x.com/super_kenil - Bluesky: https://bsky.app/profile/sknl.dev - npm: https://www.npmjs.com/~super-kenil --- ## About Kenil Sudani I grew up in a small town in southern Gujarat, India. I've loved computers since my dad got me an AMD Athlon II PC when I was 10 - back then it was all about gaming day and night. Fast forward to 2014, I got my first taste of the internet and spent countless hours tinkering with Microsoft Office tools, doing random experiments here and there. In 2020, when I finally got my first laptop for my bachelor's degree, things started getting serious. I dove headfirst into machine learning, Python, Java, C++ - basically anything that crossed my path. In mid-2022, while pursuing my Master's, I joined [Genxel](https://genxeltechnology.com/) as an intern. That's where I planted the seeds of my development career, learning from everyone around me and YouTube tutorials. Built an NFT Marketplace from scratch there, which was wild for a beginner. Later, I moved to [Coderthemes](https://coderthemes.com/) where I really leveled up. Learned TypeScript, Angular, Vue, design patterns, SOLID principles, and a bunch of Linux stuff. The most valuable lesson? "Devs can often resolve issues independently, by Googling and with a little bit of luck." Also picked up tons of life lessons from my boss during weekend hangouts. These days, I have 4+ years of experience under my belt. I'm building automation tools - some AI-powered, some not. I write code in VSCode with AI features used selectively because I believe in maintaining deep problem-solving skills and keeping my fundamentals sharp. That said, I do use AI chat platforms for debugging and strategic input when I'm genuinely stuck. It's about staying sharp while still leveraging the tools available. --- ## Work Experience ### Staff Engineer / Front End Developer — Coderthemes Design LLP (2023-2024) Tech stack: Typescript, React, NextJs, Angular, Vue, NuxtJs, Laravel, Django, Sveltekit, NodeJs, Tailwindcss, Bootstrap, Linux The place where I acquired extensive knowledge of Typescript, Angular, Vue, Design Patterns, SOLID principles, Linux, while honing my ability to write quality code. Additionally I also learned a crucial lesson: "Devs can often resolve issues independently, by Googling and with a little bit of luck". Also got tons of life lessons from my Boss every time we were hanging out on weekends. As a Part Time SE, I was responsible for ensuring that all employees are working at their peak efficiency. Over time, I identified and encountered numerous time-consuming/repetitive tasks which could be optimized or automated. For eg. I wrote a script to automate a task which used to take a whole day for 1 person, while being error prone, which is now reduced to mere seconds without any errors. These improvements were well-recognized, and I was personally appreciated by my Boss😁. ### Full Stack Developer — Genxel Technology (2022-2023) Tech stack: NextJs, Web3, Solidity, React Native, NodeJs, Sanity, MySQL The place where I sowed the seeds of my development career while learning all kind of cool stuff from Youtube and people around me. The place which gave an opportunity to someone who knew nothing about development and provided training wheels. As an Intern I built an NFT Marketplace from scratch based on client's requirements 🚬😎. I also got to see what a good mentor looks like (my Boss). --- ## Projects & Free Tools ### StyleX UI - Detail page: https://sknl.dev/project/stylexui - Live URL: https://stylexui.dev - Tech stack: StyleX, React, TypeScript, Base UI, TanStack Start - Summary: Production-ready StyleX components, blocks, and templates Craft high-performance, accessible web apps without runtime CSS overhead. An extensive collection of 55+ agent-ready StyleX components, pre-built UI blocks, and dashboard templates engineered with Meta's StyleX and Base UI. Zero-runtime CSS-in-JS meets accessible headless primitives for scalable, collision-free styling. ### OMG (One More Game) - Detail page: https://sknl.dev/project/games - Live URL: https://onemorega.me - Tech stack: React, Three.js, Vite, Turborepo - Summary: Tiny browser games built with a focus on multiplayer, playable in a click I've been making small browser games lately, with a focus on multiplayer, and they needed a home. This is it: a shelf where every game opens in a click, no installs, no accounts. Brawlers, breakout cabinets, chess, physics toys and a few WebGPU tech demos. Each game is its own little project, bundled into a static site and framed in a viewer with fullscreen. The shelf has search, a poster grid or compact list, and a device filter so phones only see what actually plays on a phone. The games aren't open source, but they're all free to play. ### paper pdf - Detail page: https://sknl.dev/project/paper-pdf - Live URL: https://pdf.sknl.dev/ - Tech stack: React, TypeScript, Vite, PDF.js, pdf-lib, jsPDF, Tesseract.js, Tailwind - Summary: Free browser-based PDF toolkit for merging, converting, compressing, and securing files paper pdf is a privacy-first PDF toolkit built for the browser. Every tool runs locally in the user's browser, so files never need to be uploaded to a server. It includes 32 tools for merging, splitting, compressing, converting, OCR, editing, watermarking, signing, and protecting PDFs—without signup or cloud storage. The project is built with React and TypeScript, with a focus on fast local processing, simple workflows, and a polished document-editing experience. ### MediaGo - Detail page: https://sknl.dev/project/mediago - Live URL: https://mediago.sknl.dev - Source code: https://github.com/Super-Kenil/mediago - Tech stack: React, Vite, FFmpeg, WebAssembly, Tailwind - Summary: Video and image converter with client-side AI background removal and mask editing A high-performance media converter and editor running client-side. Convert videos and images right in the browser using FFmpeg and WebAssembly, or process folders locally. Includes an auto background removal tool similar to remove.bg, along with a mask editor to manually erase or touch up parts of any image. Everything runs privately on your device. ### Builder.io Velocity - Detail page: https://sknl.dev/project/builder-io - Live URL: https://builder-io.sknl.dev - Source code: https://github.com/Super-Kenil/builder-io - Tech stack: Nextjs, React, Tailwind - Summary: Interactive clone of Builder.io AI launch event landing page A pixel-perfect clone of Builder.io's Velocity AI launch event landing page. Features fluid background gradients, rotating framework logos, real-time countdown clock animations, and slick modern micro-interactions. Recreated to study and replicate the intricate UI animations and styling techniques of high-converting modern developer marketing pages. ### Ray-Ban Meta Converter - Detail page: https://sknl.dev/project/metarayban - Live URL: https://metarayban.sknl.dev - Source code: https://github.com/Super-Kenil/metarayban - Tech stack: React, Tailwind, Bun, TypeScript - Summary: Injects Meta Ray-Ban metadata into images for Instagram Spin View A browser tool that injects Ray-Ban Meta Smart Glasses hardware profile metadata into any photo. It patches JPEG EXIF, XMP, Display P3 ICC, and AROT headers client-side using binary manipulation. When uploaded to Instagram Stories, Instagram detects the metadata and unlocks the interactive 3D Spin View tilt effect with the 'Made with Ray-Ban Meta' badge. 100% private and runs entirely in your browser. ### super-detype - Detail page: https://sknl.dev/project/super-detype - Live URL: https://super-detype.sknl.dev - Source code: https://github.com/Super-Kenil/super-detype - Tech stack: Typescript, fs, Babel, Esbuild - Summary: Strips out TS definitions and syntax from your WHOLE project Ever had to create JavaScript examples from a TypeScript project? You know the pain. Manually stripping types, removing interfaces, dealing with type assertions scattered everywhere. I got tired of doing this repeatedly, so I built a tool that does it for me. super-detype is a CLI tool that transpiles your entire TypeScript project to JavaScript. Not just individual files - your whole project, preserving the directory structure. It's powered by Babel and esbuild under the hood, so the output is clean and reliable. I mainly built this for creating JS examples from my TS codebases. Documentation sites, tutorials, quick demos - sometimes you just need vanilla JS versions. It handles React, Next.js, Remix, and Vite projects without breaking a sweat. Install it globally via npm and run it from anywhere. Two arguments: source directory and output directory. That's it. No config files, no complex setup. Just works. ### Base64 - Detail page: https://sknl.dev/project/base64 - Live URL: https://base64.sknl.dev - Source code: https://github.com/Super-Kenil/base64 - Tech stack: html - Summary: Encodes and decodes base64 strings, keeps history A dead simple base64 encoder and decoder. Drop an image, get a base64 string. Paste a base64 string, get an image. That's the whole thing. Built this because I kept needing to convert images for inline embedding in emails and documents. The twist? It keeps a history of your conversions, so you don't lose track of what you've encoded before. Pure HTML and JavaScript. No frameworks, no build step. Opens in any browser, works offline once loaded. Sometimes the simplest tools are the most useful ones. ### Birthday Wish - Detail page: https://sknl.dev/project/birthday-wish - Live URL: https://birthday-wish.sknl.dev - Source code: https://github.com/Super-Kenil/birthday-wish - Tech stack: React - Summary: Wish the happiest birthday to your loved ones with a sweet 3D cake A fun little project for wishing birthdays in style. Enter someone's name, and you get a shareable link with a 3D animated cake just for them. Built with React and some CSS magic for the 3D cake effect. The link gets auto-copied to clipboard so you can paste it directly into WhatsApp or wherever. Made this for a friend's birthday and decided to make it reusable. Turns out people love personalized birthday links more than generic WhatsApp stickers. ### Crack Me Up - Detail page: https://sknl.dev/project/crack-me-up - Live URL: https://lol.sknl.dev - Source code: https://github.com/Super-Kenil/crack-me-up - Tech stack: Nextjs - Summary: A collection of crackers to read while webpack is generating build You know those moments when webpack is frozen at 99% and you're just... waiting? I made this to fill that void. Hit a button, get a developer joke. Simple as that. Built with Next.js because I was learning it at the time and wanted something fun to practice with. The jokes are mostly programming-related puns and one-liners. Some are actually funny, some make you groan. Perfect for those 30-second build pauses that feel like eternity. ### Offline To-Do - Detail page: https://sknl.dev/project/offline-to-do - Live URL: https://local-todo.sknl.dev - Source code: https://github.com/Super-Kenil/offline-todo - Tech stack: SQLite, PWA, AI - Summary: A minimal To-Do and Reminders app that works offline using SQLite A todo app that works completely offline. No servers, no accounts, no sync issues. Your data lives in your browser using SQLite (via sql.js). Built this as a PWA, so you can install it on your phone or desktop and use it without internet. The data persists in IndexedDB, so it survives browser restarts. Added some AI features to help with task organization and reminders. It's basically my personal task manager that I decided to open source. Privacy-first, no data leaves your device. ### Portfolio v2 - Detail page: https://sknl.dev/project/portfolio-v2 - Live URL: https://v2.sknl.dev - Source code: https://github.com/Super-Kenil/v2.sknl.dev - Tech stack: Nextjs, React, Three.js, Tailwind, GSAP - Summary: Second iteration of my personal portfolio featuring 3D elements The second evolution of my developer portfolio. Rebuilt with Three.js (React Three Fiber) and GSAP to deliver an immersive 3D experience with interactive retro computers, custom shaders, and sound effects. Complete with interactive terminal, 3D workspace, custom cursor, and fluid transitions. ### Portfolio v1 - Detail page: https://sknl.dev/project/portfolio-v1 - Live URL: https://v1.sknl.dev - Source code: https://github.com/Super-Kenil/v1.sknl.dev - Tech stack: Nextjs, React, Tailwind - Summary: The first version of my developer portfolio The first iteration of my personal developer portfolio. Built with Next.js and custom typography to showcase projects, skills, and open source contributions. Designed with clean typography, responsive layout, and custom sections highlighting work and contributions. --- ## Technical Blog Posts ### I am Open Sourcing My Portfolio - URL: https://sknl.dev/blog/open-sourcing-my-portfolio - Published: 2026-05-13 | Updated: 2026-11-26 - Tags: open-source, portfolio, astro, webdev, performance, seo, typescript, minimalism - Summary: 100 Lighthouse score, dynamic OG images, and type-safe markdown. Here is why you should steal my code. **`sknl.dev` is an open-source developer portfolio template** built with Astro, Tailwind CSS v4, DaisyUI 5, Zod-validated Markdown collections, and automated Satori Open Graph PNG generation. Designed by [Kenil Sudani](/about) for speed and clean SEO, the entire codebase is MIT-licensed on [GitHub](https://github.com/Super-Kenil/sknl.dev). A couple of friends recently asked for the source code to this site—specifically the SEO setup, fast static output, minimalist layout, and page transitions. Keeping a personal portfolio closed-source felt unnecessary, so it is open for anyone to fork. ## Architecture Overview | Layer | Implementation | Purpose | |---|---|---| | **Static Site Framework** | Astro (`output: 'static'`) | Ships zero-JS HTML by default with view transitions | | **Styling & Themes** | Tailwind CSS v4 + DaisyUI 5 | Minimal CSS footprint with multi-theme support | | **Type-Safe Content** | `src/content.config.ts` + Zod | Validates blog, project, and experience frontmatter at build time | | **Dynamic OG Images** | `src/pages/blog/[id].png.ts` (`satori` + `@resvg/resvg-js`) | Generates 1200×630 PNG social preview cards for every post | | **Search & AI Discovery** | `sitemap.xml.ts`, `llms.txt.ts`, `llms-full.txt.ts`, JSON-LD | Exposes structured metadata for search engines and AI agents | ## 1. Fast Static Performance + Minimalist UI Getting high Lighthouse scores is easy if a site looks like an unstyled text file. Keeping pages snappy while supporting smooth transitions and theme switching takes deliberate restraint in client-side JavaScript. ## 2. Dynamic OG Images at Build Time Manually designing social cards in Figma for every article slows down publishing. `src/pages/blog/[id].png.ts` converts post titles and descriptions via `satori` into SVG and renders crisp PNGs with `@resvg/resvg-js` automatically during the build. ## 3. Type-Safe Content Collections `src/content.config.ts` validates every Markdown entry with `zod`, catching missing titles, invalid dates, or malformed URLs before deployment. ## Fork and Customize It Clone [Super-Kenil/sknl.dev](https://github.com/Super-Kenil/sknl.dev), swap in your own `src/consts.ts` and `src/content/` Markdown files, and deploy—or browse my [live tools and projects](/project) to see what else I build. #### Frequently Asked Questions **What tech stack powers sknl.dev?** sknl.dev is built with Astro static site generation, Tailwind CSS 4, DaisyUI 5, TypeScript, Zod-validated content collections, and Satori plus @resvg/resvg-js for build-time dynamic Open Graph PNG generation. **Where is the sknl.dev source code hosted?** The complete portfolio repository is open source under the MIT license on GitHub at https://github.com/Super-Kenil/sknl.dev. ### Lazy Load Without Killing Your UX - URL: https://sknl.dev/blog/lazy-load-without-killing-ux - Published: 2026-04-05 | Updated: 2026-11-26 - Tags: react, nextjs, webperf, frontend, ux-design, zustand, javascript, architecture - Summary: Clicking a button shouldn't feel like a chore. Discover how to eliminate 'ghost delays' in your React apps by decoupling dialog state from content loading for a buttery-smooth, high-performance interface. **To lazy load React dialogs without UX lag**, decouple the dialog shell from its lazily imported body: keep a lightweight store (`dialogName`) that opens the dialog frame instantly on click, and wrap the dynamic modal content inside a React `` boundary so the chunk downloads while the open animation plays. The problem with naive lazy-loaded dialogs is simple: code splitting delays feedback. You click a button, nothing happens for 200ms while JavaScript fetches the chunk, and then the modal pops in. Preloading every dialog defeats code splitting—so the solution is opening the shell first and streaming the content inside. ## The Pattern Keep a **stateless dialog layer** powered by a lightweight state store (Zustand, Redux, Jotai, or Context). Clicking a button updates only `dialogName`, opening the dialog frame immediately while React loads the specific inner component inside ``. ```typescript // src/stores/use-dialogs.ts import { create } from 'zustand' import { startTransition } from 'react' type DialogStoreType = { dialogName: string | null open: (name: string) => void close: () => void } export const useDialogs = create((set) => ({ dialogName: null, open: (name) => { startTransition(() => { set({ dialogName: name }) }) }, close: () => { startTransition(() => { set({ dialogName: null }) }) } })) ``` That's the entire store—just the active dialog identifier. Now wire the root container with `next/dynamic` (or `React.lazy`) inside `Suspense`: ```typescript // components/dialogs-root.tsx 'use client' import dynamic from 'next/dynamic' import { Suspense } from 'react' import { useDialogs } from '@/stores/use-dialogs' import { Dialog, DialogContent } from '@/ui/dialog' const FirstDialog = dynamic(() => import('./first-dialog')) const SecondDialog = dynamic(() => import('./second-dialog')) export function DialogsRoot() { const { dialogName, close } = useDialogs() return ( Loading...}> {dialogName === 'first' && } {dialogName === 'second' && } ) } ``` ## Triggering a Dialog From Any Component ```typescript const openDialog = useDialogs((store) => store.open) return ( ) ``` Click happens → store updates → dialog shell animates open immediately → inner chunk loads inside `Suspense`. ## Why This Pattern Works 1. **Instant UI feedback:** The dialog container opens on the click frame so users know their action registered. 2. **Animation masks network latency:** During a 200–300ms entrance animation, the dynamic chunk often finishes downloading before the transition completes. 3. **True on-demand splitting:** Unopened modals (settings, delete confirmations, invite flows) never ship in the initial page bundle. 4. **Graceful slow-network fallback:** If the network is slow, the `Suspense` fallback inside `` gives clear loading feedback. ## Minimal Fallback Pattern ```tsx
}> {/* dialogs here */}
``` ## Scaling to Pages With 10+ Dialogs On complex dashboards with many modals, forms, and confirmation dialogs, deferring individual dialog bodies avoids shipping tens of kilobytes of unused form/validation code upfront while keeping interactions responsive. Any dialog-specific form state stays isolated inside that dialog component itself. #### Frequently Asked Questions **How do you lazy load a React modal or dialog without delaying its open animation?** Store only the active dialog identifier in lightweight global state (such as Zustand or React Context) inside startTransition so the dialog shell opens immediately, while lazy-loading the inner dialog body inside a React Suspense boundary. **Why does lazy loading a whole dialog wrapper hurt UX?** If the trigger button directly wraps a dynamically imported dialog component, clicking the button blocks on the network chunk download before the modal opens, causing a noticeable 150-300ms unresponsive delay. ### Signals: The end of the "re-render everything" era - URL: https://sknl.dev/blog/signals-architecture - Published: 2026-03-28 - Tags: javascript, signals, reactivity, frontend - Summary: Every framework is moving to signals. Here is why you should care and how they actually work. If you have spent any time with React, you know the pain of `useState` and the constant battle against unnecessary re-renders. You change one tiny string and suddenly your entire component tree is recalculating. Signals are here to fix that. They are the biggest shift in how we handle state since hooks arrived. ## What is a Signal? Think of a Signal as a supercharged variable. It doesn't just hold a value; it knows exactly who is looking at it. In a traditional setup, when a value changes, the framework has to guess what needs to be updated. With Signals, the value *tells* the specific part of the UI to update. No diffing overhead here. ## The Two Main Parts Signals architecture is basically just two things: 1. **The Signal:** This is your data. It has a getter and a setter. When you read it, it remembers you. 2. **The Effect:** This is a function that runs whenever the data changes. It could be a DOM update or a console log. It is a clever version of the "Observer" pattern. When an Effect runs, it signs up as a subscriber to any Signal it touches. When the Signal updates, it just pings its subscribers and says "hey, I changed, run your function again." ## Why this is better than useState * **Fine-grained updates:** If you have a signal inside a `
`, only that `
` updates. Not the parent, not the children, just that one spot. * **No Dependency Arrays:** Say goodbye to `[prop1, prop2]` in your `useEffect`. Signals track dependencies automatically. If you use it, it is tracked. * **Use it anywhere:** You don't have to be inside a component to use a Signal. You can define your state in a separate file and share it across your whole app effortlessly. ## The Future is Signal based Angular, Vue, SolidJS, and Preact have already jumped on this. There is even a proposal to make Signals a built-in part of the JavaScript language (TC39). Most frameworks are moving away from "re-render everything" and toward "only update what changed." If you are a JS dev, you are going to be seeing a lot more of these in the next year. It is simpler code, faster apps, and a lot less debugging of memoization bugs. ### RAG is just a fetch call before your prompt - URL: https://sknl.dev/blog/rag-is-just-a-fetch-call - Published: 2026-03-22 | Updated: 2026-11-26 - Tags: ai, rag, llm, javascript - Summary: Retrieval Augmented Generation sounds complex, but for JS devs, it is just a fetch call before your prompt. ## What is RAG? **Retrieval Augmented Generation (RAG)** is an AI architecture pattern that fetches relevant information from your own database or documents and injects it into an LLM prompt before generating an answer. For JavaScript developers, it works like middleware: a data `fetch()` step that grounds the model in fresh, private facts without retraining. LLMs like GPT or Claude have knowledge cutoffs and cannot see your private database rows, internal docs, or events from ten minutes ago. RAG solves that by giving the model temporary working context on every request. ## RAG vs. Fine-Tuning vs. Plain Prompting | Approach | Up-to-Date Knowledge | Accesses Private Data | Setup Cost | Best For | |---|---|---|---|---| | **Plain Prompting** | Cutoff-limited | Manual paste only | Lowest | General reasoning & coding | | **RAG** | Real-time (on every query) | Yes (scoped per query) | Low–Medium | Docs search, support bots, private knowledge bases | | **Fine-Tuning** | Static after training | Baked into weights (harder to update) | Highest | Output tone, formatting, specialized style | ## How RAG Works (The JS Perspective) Imagine building a support assistant for your product. Instead of sending the user's question straight to the model, you run three steps: 1. **The Search:** Take the user's question and query your database (for example, Pinecone, pgvector, or full-text search) for matching docs. 2. **The Context:** Extract the most relevant text snippets from those docs. 3. **The Prompt:** Send a single combined prompt containing those snippets plus the user's question to the LLM endpoint. It is literally a context-retrieval call before your LLM request. ## The Three Main Steps of a RAG Pipeline ### 1. Retrieval Convert queries and documents into vector embeddings (arrays of numbers capturing semantic meaning) or combine vector search with keyword search so you match intent, not only exact words. ### 2. Augmentation Format the top matching chunks into a structured prompt template alongside the user's question. At this stage, you are combining retrieved text strings with clear instructions. ### 3. Generation Send the augmented prompt to the model. Because the relevant facts are explicitly present in the context window, the model is far less likely to fabricate an answer. ## Why RAG Is Practical for Product Teams * **No retraining required:** Updating knowledge means updating database rows, not running expensive model training jobs. * **Always current:** New or edited documents become searchable immediately after indexing. * **Controlled data access:** Keep proprietary records on your own servers and pass only the relevant chunks needed for the current user's request. #### Frequently Asked Questions **What is RAG (Retrieval Augmented Generation) in simple terms?** RAG is a pattern that searches your own docs or database for relevant context first and injects those retrieved passages into the LLM prompt before generating an answer, keeping responses accurate and up to date without retraining the model. **When should you use RAG instead of fine-tuning an LLM?** Use RAG when the model needs up-to-date facts, private company documents, or verifiable citations. Fine-tuning adjusts style or domain behavior, while RAG supplies fresh factual context at query time. **What are the three steps of a RAG pipeline?** A standard RAG pipeline runs Retrieval (searching embeddings or text indexes for relevant chunks), Augmentation (inserting retrieved chunks into the prompt template), and Generation (calling the LLM with that grounded context). ### OpenAPI vs. The Ecosystem: Why oRPC is Chasing the tRPC Crown - URL: https://sknl.dev/blog/openapi-vs-trpc-orpc-battle - Published: 2026-03-15 | Updated: 2026-11-26 - Tags: typescript, trpc, orpc, openapi, web-development, api-design, react-query, backend - Summary: Type safety shouldn't mean sacrificing standards. tRPC gave us the DX, but oRPC is bringing the spec. A no-nonsense breakdown of the four ways we fetch data today and why the 'o' in oRPC is a game changer. **Quick answer:** Use **raw `fetch`** when you want full manual HTTP control, **Server Functions** for simple framework-coupled SSR, **tRPC** for internal TypeScript monorepos, and **oRPC** when you want end-to-end TypeScript safety **plus** native OpenAPI spec generation for external or multi-language clients. Fetching data used to be simple, but modern TypeScript apps now pick between four main approaches. Here is the practical breakdown without the corporate fluff. ## Comparison: Raw API vs. Server Functions vs. tRPC vs. oRPC | Approach | End-to-End Type Safety | OpenAPI Support | URL & Method Control | Framework Lock-In | Best For | |---|---|---|---|---|---| | **Raw API (`fetch` / TanStack Query)** | Manual | Optional (manual) | Full | None | Custom REST/GraphQL APIs | | **Server Functions** | Automatic | None | None | High (Next.js / TanStack) | Simple full-stack framework apps | | **tRPC** | Automatic | Third-party plugins only | RPC conventions | Low (TS ecosystems) | Internal TypeScript monorepos | | **oRPC** | Automatic (with Zod) | Native (`openapi.json`) | Full | Low | Type-safe APIs needing OpenAPI specs | ## 1. Raw API Requests This is the classic approach: use `fetch` or TanStack Query and maintain your request/response TypeScript types on the client. **Pros:** * Complete control over your URLs * Full choice over HTTP methods and response payloads **Cons:** * No automatic type safety between frontend and backend * Backend changes can silently break the frontend until runtime * Requires wiring up auth and schema validation manually (for example with Zod) ## 2. Server Functions Framework-coupled helpers such as `createServerFunction` let you write server logic right alongside frontend code. **Pros:** * Automatic end-to-end type safety * Straightforward SSR data fetching * Built-in input validation patterns **Cons:** * Little to no control over generated endpoint URLs * Tightly coupled to a specific framework (Next.js patterns do not port directly to TanStack) ## 3. tRPC tRPC pairs naturally with React Query to give TypeScript teams instant client-to-server type inference. **Pros:** * Strong type safety from router procedures to React hooks * Clean parameter validation and protected middleware procedures for auth * Easy type sharing across a monorepo (including React Native) **Cons:** * Does not follow external standards like OpenAPI out of the box, making it harder to expose the API to external teams or non-JS clients ## 4. oRPC oRPC targets the same developer experience as tRPC while prioritizing HTTP and OpenAPI standards. **Pros:** * Full control over REST-style URLs and HTTP methods * Built-in Zod integration for input and output validation * Native OpenAPI support out of the box With oRPC, you can generate an `openapi.json` document directly from your procedures and import it into Postman or generate typed clients for Go, Rust, or Python. That is a major advantage once external clients enter the picture. ## Final Verdict: Which Should You Choose? * **Raw APIs** if you need maximum custom HTTP control * **Server Functions** if you want simplicity inside one full-stack framework * **tRPC** for internal TypeScript monorepos where every consumer shares types * **oRPC** if you want tRPC-grade TypeScript DX while staying OpenAPI-compliant for external or multi-language clients Pick the one that matches who consumes your API and start shipping. #### Frequently Asked Questions **What is the main difference between tRPC and oRPC?** Both tRPC and oRPC provide end-to-end TypeScript type safety from backend to frontend, but oRPC also gives you native OpenAPI specification generation and explicit URL/HTTP method control for external or multi-language API consumers. **When should you choose oRPC over Server Functions or raw fetch?** Choose oRPC when you want TypeScript type safety and Zod validation while still needing standard REST/OpenAPI endpoints for Postman testing, third-party integrations, or non-TypeScript clients such as Go or Rust. **When is tRPC still the better choice?** tRPC remains a great fit for TypeScript monorepos (such as Next.js plus React Native) where every API consumer lives inside your own codebase and you do not need to publish an external OpenAPI specification. ### Stop Saying CI/CD If You Don't Mean It - URL: https://sknl.dev/blog/ci-cd-cd-breakdown - Published: 2026-03-07 | Updated: 2026-11-26 - Tags: devops, productivity, engineering - Summary: Continuous Integration vs. Delivery vs. Deployment. Let’s stop mixing them up. **Continuous Integration (CI)** merges small changes into the main branch frequently with automated checks, **Continuous Delivery (CDel)** keeps every tested build ready for one-click manual release, and **Continuous Deployment (CDep)** automatically ships every passing commit to production with no manual gate. Everyone says they have "CI/CD" because it's the industry buzzword, yet most teams only practice part of it. If you're still merging week-long branches and manually copying artifacts to a server, you don't have CI/CD—you have release friction. ## CI vs. Continuous Delivery vs. Continuous Deployment | Practice | Core Goal | Release Trigger | Key Requirement | |---|---|---|---| | **Continuous Integration (CI)** | Merge code to `main` multiple times daily | Developer PR / push | Small tasks + fast automated tests | | **Continuous Delivery (CDel)** | Always keep a deployable artifact ready | Manual human approval | Automated build + staging/test checks | | **Continuous Deployment (CDep)** | Ship every passing commit live | Fully automated | High test coverage + rollback safety | ## 1. Continuous Integration (CI) This is the base layer. It’s not just about running tests; it’s about **merging code**. - **Goal:** Merge your changes into the main branch multiple times a day. - **The Secret:** Small tasks. If your task takes three days, you aren't doing CI—you're doing "frequent-ish integration." - **The Result:** No more "merge hell" on Friday afternoons. ## 2. Continuous Delivery (CDel) This is about being **ready** to ship at any second. - **Goal:** Your code is always in a deliverable state. If the team says "ship it now," you can. - **The Process:** Automated tests and builds complete cleanly so the artifact is ready. - **The Catch:** Production deployment is still an intentional human decision. ## 3. Continuous Deployment (CDep) This is full release automation. - **Goal:** Every change that passes your automated pipeline goes live immediately. - **The Process:** No release manager and no manual approval gate. - **The Catch:** You need deep confidence in automated tests, monitoring, and fast rollbacks because weak tests put production directly at risk. ## Which One Should Your Team Choose? Most product teams want **Continuous Delivery**: full build/test automation paired with human timing over production releases. **Continuous Deployment** fits teams whose test suite and observability already catch regressions reliably. #### Frequently Asked Questions **What is the difference between Continuous Delivery and Continuous Deployment?** Continuous Delivery keeps every tested build ready to release with one manual approval step, whereas Continuous Deployment automatically pushes every commit that passes automated tests straight to production without human intervention. **What is the main goal of Continuous Integration?** Continuous Integration (CI) focuses on merging small code changes into the main branch frequently—often multiple times a day—and running automated builds and tests on every merge to avoid integration conflicts. ### RustedZip: Because Windows shouldn't take minutes to archive - URL: https://sknl.dev/blog/rustedzip-fast-windows-archiving - Published: 2026-03-01 | Updated: 2026-11-26 - Tags: rust, productivity, windows, rustedzip - Summary: Windows zipping is painfully slow. So I built a Rust tool to fix it. **RustedZip** is an open-source, multi-threaded Rust archiving tool built for Windows by [Kenil Sudani](/about). By combining `rayon` parallelism, buffered file I/O, and Windows Explorer right-click integration, it compresses multi-gigabyte folders of small files in seconds instead of the minutes built-in Windows Explorer often takes. If you've ever used a Mac or Linux, you know zipping a folder is basically instant. You hit compress, and it's done. Then I moved to Windows for a project and reality hit me: zipping a few gigs of data through the built-in Explorer tool took minutes and sometimes hung completely. ## Why Default Windows Zipping Feels Slow The built-in Windows Explorer compression flow runs conservatively on I/O and UI progress updates. When a folder contains thousands of small source files or assets, sequential file reads and shell overhead dominate the runtime. ## How RustedZip Is Engineered | Optimization Layer | Implementation | Purpose | |---|---|---| | **Parallelism** | `rayon` crate | Reads multiple files into memory concurrently across CPU cores | | **Buffered I/O** | `BufReader` & `BufWriter` | Reduces tiny syscall overhead during archive reads/writes | | **Release Binary Profile** | `opt-level = 3`, `lto = true`, `codegen-units = 1` | Maximizes throughput and keeps the compiled executable compact | | **Shell Integration** | PowerShell + `Microsoft.Win32.Registry` | Adds right-click `"Rusted ZIP: Compress"` directly in Explorer | ### 1. Parallelism with Rayon Instead of processing one file at a time, `rayon` reads multiple files concurrently across available CPU cores. ### 2. Buffered I/O Using `BufReader` and `BufWriter` batches disk operations instead of issuing tiny unbuffered reads and writes for every small chunk. ### 3. Release Optimization The `Cargo.toml` release profile enables Link Time Optimization (`lto = true`), single codegen unit, and `opt-level = 3`: ```toml [profile.release] opt-level = 3 lto = true codegen-units = 1 panic = "abort" ``` ## Windows Explorer Right-Click Integration A CLI tool only saves time if it fits your daily workflow. I wrote a PowerShell script (`Install-RustedZip.ps1`) using .NET `Microsoft.Win32.Registry` APIs to add RustedZip directly to the Windows Explorer right-click context menu. ## How to Set Up RustedZip on Windows 1. **Place the binary:** Copy your compiled `rustedzip.exe` to `C:\Tools\rustedzip\`. 2. **Install the context menu:** Run the PowerShell installer script as an Administrator: ```powershell # Run as Administrator .\Install-RustedZip.ps1 ``` Once installed, right-click any folder in Explorer to compress it without opening a terminal. ## Open Source Repository RustedZip is an experimental open-source tool. You can inspect the Rust code or grab releases on GitHub: [github.com/Super-Kenil/rustedzip](https://github.com/Super-Kenil/rustedzip), or explore other utilities on the [projects page](/project). ## My Practical Result On my own multi-gigabyte project folders on Windows, archiving dropped from 5–15 minutes in Explorer down to roughly 2–3 seconds—keeping my workflow moving without waiting on the OS. #### Frequently Asked Questions **What is RustedZip?** RustedZip is an open-source, multi-threaded Windows archiving CLI and right-click Explorer utility written in Rust by Kenil Sudani to compress folders with many files in seconds instead of minutes. **Why is RustedZip faster than built-in Windows Explorer zipping?** Unlike the sequential, UI-bound built-in Windows compression flow, RustedZip uses Rayon to read files across CPU cores in parallel, BufReader and BufWriter for buffered I/O, and release LTO compiler optimizations. **Where can I download RustedZip?** The source code and Windows installation script (Install-RustedZip.ps1) are open source on GitHub at https://github.com/Super-Kenil/rustedzip. ### I Built My Own Next.js (In 60 Lines of Bun) - URL: https://sknl.dev/blog/bun-react-rsc - Published: 2026-02-22 - Tags: bun, react, ssr, rsc - Summary: Next.js is a massive black box. I wanted to see if I could build a streaming SSR framework with just Bun and React. Next.js is great. It's also huge. Sometimes you don't need a 300MB node_modules folder just to stream some React components. I wanted to see how close I could get to a modern SSR experience using nothing but **Bun native APIs**. Here is how I built a streaming React framework in one file. ## The Engine: Bun.serve Forget Express or Hono. Bun has a built-in server that is absurdly fast and understands JSX out of the box. I used the new `routes` object in `Bun.serve` to handle everything. No more manual `if (url === "/api")` blocks. ```typescript const server = serve({ routes: { '/rsc': async (req) => { const Page = await import('./app/page.tsx') const stream = await renderToReadableStream(createElement(Page.default)) return new Response(stream, { headers: { "Content-Type": "text/html" } }) }, "/api/hello": { async GET() { return Response.json({ message: "Hello from Bun!" }) } } } }) ``` ## The Magic: renderToReadableStream The secret sauce is `renderToReadableStream` from `react-dom/server`. Instead of waiting for the whole page to render, it sends chunks to the browser as they're ready. Bun handles `ReadableStream` natively as a response body. This means you get **Streaming SSR** for free. ## Component-Level Data Fetching In `page.tsx`, I'm using `async/await` directly inside components. ```tsx const Page = async () => { const res = await fetch('https://api.example.com/posts') const data = await res.json() return ( <>

Hello server components

Loading...
}> ) } ``` This looks like React Server Components (RSC), and because Bun can handle top-level await and dynamic imports, it just works. ## Experimental? Very. This isn't a production-ready framework. Yet. There are still big gaps: - **Client-Side Hydration:** Sending the JS to the client and "waking up" the HTML. - **Asset Bundling:** Still need to add a proper build step to handle CSS, images, and JS assets correctly. - **HMR:** Hot Module Replacement is tricky when you're manually managing the server lifecycle. ## The Point We've reached a point where the runtime (Bun) and the library (React) are so powerful that you can build the "magic" of a major framework in a few dozen lines of code. It's raw, it's buggy, and it's experimental. But it's also incredibly fast. I built it to understand how it exactly works under the hood. ### Your AI isn't bad, your context is - URL: https://sknl.dev/blog/system-engineering-ai - Published: 2026-02-15 - Tags: ai, productivity, antigravity - Summary: Stop fighting your AI. Start engineering it. Here is how I 2x my productivity. I used to spend half my day refactoring what AI wrote in my codebase. It would suggest patterns I hated, hallucinate libraries, or dive into my code before it even understood what I wanted. Then I stopped treating it like a magic wand and started treating it like an intern that needs a handbook. My productivity literally doubled. Here is how I fixed it. ## 1. Thinking Before Building (Plan Mode) The biggest mistake is letting an AI touch your code the second you hit enter. [Antigravity's Planning Mode](https://antigravity.google/docs/agent-modes-settings) changed everything. It forces the agent to explore the codebase and write a plan *before* it edits a single file. Its specially useful for long running jobs or complex tasks. It splits the job into smaller tasks and it separates the "thinking" from the "building.". No more "wait, why did you delete that file?" moments. ## 2. Framework DNA (Skills) You can't expect an LLM to know your specific project conventions out of the box. I started adding framework-specific knowledge via [Skills from skills.sh](https://skills.sh/). These are reusable knowledge packs for Next.js, React, or Astro. I especially like using `vercel-labs/agent-skills/web-design-guidelines` when working with UI, cause I don't want AI to generate common violet gradients everytime. With this, instead of generic "internet code," I get code that follows the exact performance optimizations and conventions of the framework I'm actually using. It's like giving the AI a custom brain for the tech stack. ## 3. The Unsung Rules (Workflows) Every project has "unsung rules." The things you just *know* not to do, but aren't in the product docs. I codified these into [Rules and Workflows](https://antigravity.google/docs/rules-workflows). Now, the AI knows exactly: - How I handle error states. - Where specific components go. - Which libraries are banned. - My specific project structure. ## The Strategy Beyond tools, I use five practices to stop AI slop and build bug-free apps: 1. **Guard Rails:** Scaffold with Shadcn. It gives the AI a foundation. No more guessing themes or UI patterns. 2. **Persistent Memory:** Use Antigravity Rules. Store project goals, tech stack, and API details. These act as long-term memory for your agent. 3. **Plan First:** This is the most important one. Use "Plan Mode" to think before building. Separate reasoning from execution. Alignment saves hours of debugging. 4. **Skill Packs:** Install framework Knowledge from [skills.sh](https://skills.sh/). Never code in a vacuum. 5. **Git Checkpoints:** Commit after every success. If the AI breaks it? Revert. Don't debug the AI just reset it. ## The Point Your AI is a reflection of the context you provide. Garbage in, garbage out. Give it rules, skills, and a solid plan, and it becomes a force multiplier. ### Ship It. Fix It Later. - URL: https://sknl.dev/blog/ship-it-fix-it-later - Published: 2026-02-08 - Tags: productivity, shipping - Summary: Why shipping fast beats shipping perfect, and why that unshipped feature is worthless. I spent three weeks perfecting a feature no one asked for. The code was beautiful. Types everywhere. Edge cases handled. Error messages that would make any developer weep with joy. Then I shipped it. No one used it. ## Perfection Is a Lie You Tell Yourself Here's the uncomfortable truth: that "perfect" version in your head doesn't exist. It's a moving target. Every time you get close, you'll find something else to fix. - "Just one more refactor" - "Let me handle this edge case" - "The animation could be smoother" - "What if the user does X?" Meanwhile, your users are waiting. Or worse, they've moved on. ## The Feature That Ships Wins An imperfect feature in production is infinitely more valuable than a perfect feature in your local branch. Why? Because: 1. **You can't get feedback on something no one has used.** All your assumptions about what users want are just that—assumptions. Ship it, watch what happens, then adjust. 2. **Real users break things in ways you never imagined.** That edge case you spent two days on? Never happens. That thing you thought was fine? Crashes for everyone. 3. **Done is a feature.** Shipping gives you momentum. It gives your users something to react to. It moves the project forward. ## The Unshipped Feature Is Worthless I need you to really internalize this: **code that hasn't shipped has zero value.** It doesn't matter how clean it is. It doesn't matter how many tests you wrote. If it's sitting in a branch, it's not helping anyone. It's not generating feedback. It's not solving problems. It's just bytes on a disk. ## Ship First, Polish Later Here's the workflow that actually works: 1. Build the simplest version that solves the problem 2. Ship it 3. Watch how people use it (or don't) 4. Fix what's actually broken 5. Repeat Notice step 4: fix what's *actually* broken. Not what you *think* might break. Not what *could theoretically* go wrong. What's actually broken, based on real usage. ## But What About Quality? I'm not saying ship garbage. I'm saying ship *good enough*. - Does it work? Ship it. - Is it secure? Ship it. - Will it crash the production database? Maybe don't ship that. The bar isn't perfection. The bar is "does this solve the user's problem well enough that they can give me feedback?" ## The 80/20 of Shipping 80% of the value comes from 20% of the effort. That last 20% of polish? It takes 80% of the time and delivers diminishing returns. Ship at 80%. Get feedback. Then decide if that remaining 20% even matters. Most of the time, it doesn't. ## Your Users Will Tell You What to Fix Stop guessing. Stop polishing in the dark. Ship it, put it in front of real humans, and let them tell you what's wrong. They'll surprise you. The thing you thought was critical? They don't care. The thing you almost skipped? They can't live without it. You can't learn this from your IDE. You learn it by shipping. ## The Takeaway Perfection is a delusion. Shipping is the goal. That feature sitting in your branch? It's not helping anyone. Push it. Deploy it. Get it in front of users. You can always fix it later. But you can't get feedback on something no one has ever seen. Ship it. ### How AI Made Me a Better Developer (By Using It Less) - URL: https://sknl.dev/blog/ai-made-me-better - Published: 2026-02-01 - Tags: ai, productivity - Summary: I turned off Copilot and became 10x more productive. Here is how. I know what you're thinking. "This guy turned off AI and claims to be more productive? Sure, grandpa." Hear me out. ## The Problem When I first got Copilot, I was hooked. It felt like having a senior dev pair-programming with me 24/7. Autocomplete everything. Accept, accept, accept. But then I noticed something weird. I was accepting code I didn't fully understand. Quick fixes that worked but I couldn't explain why. My debugging skills were getting rusty because I'd just ask the AI to fix things. I was becoming dependent. And dependency is the opposite of growth. ## The Switch I turned off Copilot in VSCode. Cold turkey. The first week was painful. My fingers kept expecting suggestions that never came. But something interesting happened - I started actually reading documentation again. Thinking through problems before typing. Writing code I actually understood. ## What I Use AI For Now I haven't abandoned AI completely. I use chat interfaces (Claude, ChatGPT, Gemini) when: 1. **I'm genuinely stuck** - After I've tried debugging myself for at least 30 minutes 2. **Learning new concepts** - AI is great at explaining things in different ways 3. **Rubber duck debugging** - Sometimes explaining the problem to AI helps me see the solution 4. **Code review** - Getting a second opinion on architecture decisions The key difference? It's intentional. I'm choosing when to get help, not having it shoved into every keystroke. ## The Results - I understand my codebase better - Debugging is faster because I know what my code does - I write more maintainable code - I learn new things instead of pattern-matching AI suggestions Turns out, struggling a bit is how you actually learn. Who knew? ## The Balance I'm not anti-AI. I'm anti-dependency. Use AI as a tool, not a crutch. Keep your brain sharp. The best developers I know use AI strategically, not constantly. Your future self will thank you when the AI is down and you still know how to code. ### Tailwind v4 Changed How I Write CSS - URL: https://sknl.dev/blog/tailwind-v4 - Published: 2026-01-25 - Tags: css, tailwind - Summary: The new CSS-first approach is actually cleaner than you think. Tailwind v4 dropped and it's a different beast. If you're still on v3, here's what you need to know. ## The Big Change: CSS-First Gone are the `tailwind.config.js` days. Now your config lives in CSS: ```css @import "tailwindcss"; @plugin "daisyui" { themes: garden --default; } ``` Yeah, that's it. Your entire Tailwind + DaisyUI setup in 4 lines of CSS. ## Why This Matters ### 1. Faster Builds No more JavaScript config parsing. The CSS-first approach means Tailwind can be processed as part of the normal CSS pipeline. In my projects, build times dropped noticeably. ### 2. No More PostCSS Config Remember maintaining `postcss.config.js`? That's gone too. Tailwind v4 runs as a Vite plugin: ```js import tailwindcss from '@tailwindcss/vite'; export default { vite: { plugins: [tailwindcss()] } } ``` ### 3. Theme Variables in CSS Custom themes are pure CSS now: ```css @theme { --color-primary: #3b82f6; --font-sans: 'Inter', sans-serif; } ``` No more converting between JS objects and CSS. Just write CSS. ## Migration Tips 1. **Start fresh** - For new projects, just use the new syntax 2. **Gradual migration** - For existing projects, you can migrate piece by piece 3. **Check your plugins** - Some v3 plugins might need updates ## My Favorite Part Less files to maintain. Seriously. My old setup had: - `tailwind.config.js` - `postcss.config.js` - `global.css` Now it's just `global.css`. One file. Done. Sometimes simpler is just better. ### Tailwind + DaisyUI: The Hidden Superpower - URL: https://sknl.dev/blog/tailwind-daisyui - Published: 2026-01-18 - Tags: css, tailwind, daisyui - Summary: Stop reinventing buttons. Start shipping features. Every time I mention DaisyUI, someone asks "but isn't Tailwind supposed to be utility-first?" Yes. And that's exactly why DaisyUI is genius. ## The Problem With Pure Tailwind Don't get me wrong, Tailwind is amazing. But have you seen a pure Tailwind button? ```html ``` Now look at the same thing with DaisyUI: ```html ``` Same result. 90% less code. ## Why This Isn't Cheating "But you're just hiding the complexity!" Exactly. That's called abstraction. It's what we do in programming. DaisyUI doesn't replace Tailwind - it builds on top of it. You still have all your utilities. You just don't have to use 15 of them for a basic button. ## The Real Superpower: Themes DaisyUI's theme system is ridiculously simple: ```css @plugin "daisyui" { themes: garden --default; } ``` Your entire app now has consistent: - Colors - Shadows - Border radiuses - Component styles Switch themes by changing one word. Switch to dark mode by adding a class. That's it. ## My Workflow Now 1. Use DaisyUI components for basics (buttons, cards, modals, etc.) 2. Customize with Tailwind utilities when needed 3. Build app-specific components combining both I spend way less time on CSS and way more time on features. That's the goal, right? ## The Catch There isn't really one. DaisyUI adds like 20KB to your bundle. If that's a dealbreaker, you probably have bigger optimization problems to solve first. Try it on your next project. You'll wonder why you were hand-crafting buttons for so long. ### I Stopped Using Lodash (Mostly) - URL: https://sknl.dev/blog/ditching-lodash - Published: 2026-01-10 - Tags: javascript - Summary: Native JavaScript has come a long way. Here is what I replaced. Lodash was my safety blanket for years. Need to deep clone? Lodash. Debounce? Lodash. Check if something is empty? You guessed it. Then I realized I was importing 70KB for functions JavaScript already has. ## What I Replaced ### Array Methods ```js // Before import { map, filter, find } from 'lodash'; const result = filter(users, u => u.active); // After - just use native const result = users.filter(u => u.active); ``` Native `map`, `filter`, `find`, `some`, `every`, `reduce` - they've been around forever. No import needed. ### Object Spread Instead of Merge ```js // Before import { merge } from 'lodash'; const config = merge({}, defaults, userConfig); // After const config = { ...defaults, ...userConfig }; ``` For shallow merges, spread works fine. For deep merges... okay, sometimes I still use Lodash. ### Optional Chaining Instead of Get ```js // Before import { get } from 'lodash'; const city = get(user, 'address.city', 'Unknown'); // After const city = user?.address?.city ?? 'Unknown'; ``` Optional chaining (`?.`) and nullish coalescing (`??`) are built into JavaScript now. Use them. ### Object.entries Instead of forEach/Object ```js // Before import { forEach } from 'lodash'; forEach(obj, (value, key) => console.log(key, value)); // After Object.entries(obj).forEach(([key, value]) => console.log(key, value)); ``` ## What I Still Use Lodash For - `debounce` and `throttle` - The native ones are messier - `cloneDeep` - When I actually need deep cloning - `groupBy` - Native `Object.groupBy` exists but browser support is still catching up ## The Point It's not about hating Lodash. It's about not importing a utility library for things your language already does. Check what you're actually using. You might be surprised how much you can drop. Your bundle size will thank you. ### From Callback Hell to Async/Await - URL: https://sknl.dev/blog/callbacks-to-async - Published: 2026-01-03 - Tags: javascript, async - Summary: The journey every JavaScript developer takes eventually. If you've been writing JavaScript long enough, you've lived through three eras of async code. Let me walk you through my journey. ## Era 1: Callback Hell My first real project had code like this: ```js getUser(userId, function(err, user) { if (err) handleError(err); getOrders(user.id, function(err, orders) { if (err) handleError(err); getOrderDetails(orders[0].id, function(err, details) { if (err) handleError(err); // Finally, do something with the data // But we're already 4 levels deep }); }); }); ``` The infamous pyramid of doom. Error handling everywhere. Logic buried under indentation. ## Era 2: Promises Then Promises came and it felt revolutionary: ```js getUser(userId) .then(user => getOrders(user.id)) .then(orders => getOrderDetails(orders[0].id)) .then(details => { // Do something with details }) .catch(handleError); ``` Flat! Chainable! One error handler! This felt like the future. But chaining got messy when you needed values from earlier in the chain: ```js getUser(userId) .then(user => { // I need 'user' later, but the next .then only gets 'orders' return getOrders(user.id).then(orders => ({ user, orders })); }) .then(({ user, orders }) => { // Now I have both, but this is getting ugly again }); ``` ## Era 3: Async/Await Then came the game changer: ```js async function loadUserData(userId) { try { const user = await getUser(userId); const orders = await getOrders(user.id); const details = await getOrderDetails(orders[0].id); // All values available, reads like sync code return { user, orders, details }; } catch (err) { handleError(err); } } ``` It's just... readable. Variables are available where you need them. Error handling is clean. It looks like the synchronous code we all learned first. ## Tips From Experience ### Don't Forget It's Still Promises `async/await` is syntactic sugar. Under the hood, it's promises. You can mix them: ```js const results = await Promise.all([ fetchUsers(), fetchProducts(), fetchOrders() ]); ``` ### Parallel vs Sequential ```js // Sequential - slower const a = await fetchA(); const b = await fetchB(); // Parallel - faster const [a, b] = await Promise.all([fetchA(), fetchB()]); ``` Only await sequentially when you need to. ### Error Handling Matters ```js // Option 1: try/catch blocks try { const data = await fetchData(); } catch (err) { // Handle it } // Option 2: .catch() on the promise const data = await fetchData().catch(err => defaultValue); ``` Pick what reads best for your use case. ## The Point Each era solved real problems. Callbacks were fine until they weren't. Promises fixed chaining. Async/await fixed readability. Write async code that future you can understand. Usually that means async/await.