<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Saad Ahmad</title>
    <description>The latest articles on DEV Community by Saad Ahmad (@saadahmad).</description>
    <link>https://dev.to/saadahmad</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2812503%2Fec30f77c-bb77-41e6-9c05-4666fb7bbcff.jpg</url>
      <title>DEV Community: Saad Ahmad</title>
      <link>https://dev.to/saadahmad</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/saadahmad"/>
    <language>en</language>
    <item>
      <title>My 4KB React package was installing 116 dependencies. Here's what I found when I audited it.</title>
      <dc:creator>Saad Ahmad</dc:creator>
      <pubDate>Mon, 24 Aug 2026 12:34:59 +0000</pubDate>
      <link>https://dev.to/saadahmad/my-4kb-react-package-was-installing-116-dependencies-heres-what-i-found-when-i-audited-it-47ig</link>
      <guid>https://dev.to/saadahmad/my-4kb-react-package-was-installing-116-dependencies-heres-what-i-found-when-i-audited-it-47ig</guid>
      <description>&lt;p&gt;I published a small React component to npm. Four kilobytes. One job: stack cards as you scroll.&lt;/p&gt;

&lt;p&gt;Then I sat down and actually audited it — the way you'd audit someone else's package before adding it to production.&lt;/p&gt;

&lt;p&gt;It was installing &lt;strong&gt;116 packages&lt;/strong&gt; onto every machine that ran &lt;code&gt;npm install&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Here's everything that was wrong, why each one mattered, and how to check your own packages tonight. 🔍&lt;/p&gt;




&lt;h2&gt;
  
  
  🚨 Bug 1: I was shipping a bundler to my users
&lt;/h2&gt;

&lt;p&gt;This was in my &lt;code&gt;package.json&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"dependencies"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"rollup"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"^4.40.1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"rollup-plugin-postcss"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"^4.0.2"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"@types/react"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"^19.1.2"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Those are &lt;strong&gt;build tools&lt;/strong&gt;. They belong in &lt;code&gt;devDependencies&lt;/code&gt;. Sitting in &lt;code&gt;dependencies&lt;/code&gt;, npm faithfully installed all three — plus their transitive deps — into every consuming project.&lt;/p&gt;

&lt;p&gt;I measured it. Installing that dependency set pulls &lt;strong&gt;116 packages&lt;/strong&gt;. My actual library is one file.&lt;/p&gt;

&lt;p&gt;The fix is a two-second edit. The lesson is that nobody ever looks:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm view your-package dependencies
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run that on your own packages right now. If a build tool comes back, that's a bundler on someone else's laptop. 😬&lt;/p&gt;




&lt;h2&gt;
  
  
  💥 Bug 2: React's JSX runtime was baked into my bundle
&lt;/h2&gt;

&lt;p&gt;My &lt;code&gt;rollup.config.js&lt;/code&gt; had this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;external&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react-dom&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Looks right. It isn't.&lt;/p&gt;

&lt;p&gt;My &lt;code&gt;tsconfig.json&lt;/code&gt; used &lt;code&gt;"jsx": "react-jsx"&lt;/code&gt;, so every component compiled to an import from &lt;strong&gt;&lt;code&gt;react/jsx-runtime&lt;/code&gt;&lt;/strong&gt; — a different specifier than &lt;code&gt;react&lt;/code&gt;. It wasn't in &lt;code&gt;external&lt;/code&gt;, so Rollup happily inlined it.&lt;/p&gt;

&lt;p&gt;Worse: it inlined the &lt;em&gt;development&lt;/em&gt; build, which contains this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;NODE_ENV&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;process&lt;/code&gt; doesn't exist in a browser. Anyone importing my package through plain ESM or certain Vite configs got a hard crash: &lt;code&gt;process is not defined&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;I had &lt;code&gt;rollup-plugin-peer-deps-external&lt;/code&gt; installed to prevent exactly this. But I'd never declared any &lt;code&gt;peerDependencies&lt;/code&gt; — so it read an empty list and did nothing. A safety net bolted to the ceiling. 🪤&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// what it should have been&lt;/span&gt;
&lt;span class="nx"&gt;external&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react-dom&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react/jsx-runtime&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react/jsx-dev-runtime&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  ⚛️ Bug 3: No &lt;code&gt;"use client"&lt;/code&gt;, so Next.js rejected it
&lt;/h2&gt;

&lt;p&gt;My components use hooks. Under the Next.js App Router, that makes them client components — and they must say so.&lt;/p&gt;

&lt;p&gt;Mine didn't. Anyone on modern Next.js hit an error immediately.&lt;/p&gt;

&lt;p&gt;The fix is one line at the top of the built bundle. But here's the part that nearly bit me twice: &lt;strong&gt;esbuild strips module-level directives when it bundles&lt;/strong&gt;, and &lt;code&gt;tsup&lt;/code&gt;'s &lt;code&gt;banner&lt;/code&gt; option doesn't survive minification.&lt;/p&gt;

&lt;p&gt;I only caught it because I checked the built file instead of trusting the config:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;head&lt;/span&gt; &lt;span class="nt"&gt;-c&lt;/span&gt; 20 dist/index.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now a post-build script adds the directive, and a test asserts it's there. Which brings me to the thing I'd most want you to take away. 👇&lt;/p&gt;




&lt;h2&gt;
  
  
  🧪 The real lesson: test the artifact, not the source
&lt;/h2&gt;

&lt;p&gt;Every bug above lived in &lt;code&gt;dist/&lt;/code&gt;, not &lt;code&gt;src/&lt;/code&gt;. My source code was fine. Unit tests passing means nothing if the thing you &lt;em&gt;ship&lt;/em&gt; is broken.&lt;/p&gt;

&lt;p&gt;So I wrote tests that read the built output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;never references process.env&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;esm&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;not&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toContain&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;process.env&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="nf"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;leaves the JSX runtime external&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;esm&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toMatch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/from&lt;/span&gt;&lt;span class="se"&gt;\s&lt;/span&gt;&lt;span class="sr"&gt;*&lt;/span&gt;&lt;span class="se"&gt;[&lt;/span&gt;&lt;span class="sr"&gt;"'&lt;/span&gt;&lt;span class="se"&gt;]&lt;/span&gt;&lt;span class="sr"&gt;react&lt;/span&gt;&lt;span class="se"&gt;\/&lt;/span&gt;&lt;span class="sr"&gt;jsx-runtime&lt;/span&gt;&lt;span class="se"&gt;[&lt;/span&gt;&lt;span class="sr"&gt;"'&lt;/span&gt;&lt;span class="se"&gt;]&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="nf"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;opens with the use client directive&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;esm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;startsWith&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;"use client";&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)).&lt;/span&gt;&lt;span class="nf"&gt;toBe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every one of those exists because the previous release shipped that exact mistake. They're regression tests for bugs I'd already inflicted on people.&lt;/p&gt;

&lt;p&gt;Two tools do most of this for you, and both take under a minute:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx publint          &lt;span class="c"&gt;# catches malformed exports, wrong entry points&lt;/span&gt;
npx @arethetypeswrong/cli &lt;span class="nt"&gt;--pack&lt;/span&gt; &lt;span class="nb"&gt;.&lt;/span&gt;   &lt;span class="c"&gt;# catches broken TypeScript resolution&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you maintain a package and have never run these, go run them. 🎯&lt;/p&gt;




&lt;h2&gt;
  
  
  🔎 Bug 4: Zero keywords, zero downloads
&lt;/h2&gt;

&lt;p&gt;My npm page said &lt;strong&gt;Keywords: none&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;npm search is largely keyword-driven. No keywords means you are effectively unlisted. My weekly downloads were zero, and I'd assumed the idea was unpopular. It was just invisible.&lt;/p&gt;

&lt;p&gt;My description also read &lt;code&gt;"Reuseable Stack on scroll librabry"&lt;/code&gt; — two typos in the single line that shows up in search results. 🙈&lt;/p&gt;




&lt;h2&gt;
  
  
  🐛 Bug 5: The one my tests couldn't catch
&lt;/h2&gt;

&lt;p&gt;After shipping v2, I rebuilt my demo site on it — and the build failed with a TypeScript error.&lt;/p&gt;

&lt;p&gt;My hook returned &lt;code&gt;RefObject&amp;lt;T | null&amp;gt;&lt;/code&gt;. React 19's types accept that. React 18's &lt;strong&gt;don't&lt;/strong&gt;, because React 18 treats &lt;code&gt;RefObject&lt;/code&gt; as covariant.&lt;/p&gt;

&lt;p&gt;My package claimed &lt;code&gt;"react": "&amp;gt;=18"&lt;/code&gt;. For every TypeScript user on React 18, it didn't compile.&lt;/p&gt;

&lt;p&gt;My CI &lt;em&gt;had&lt;/em&gt; a React 18 job. It ran the test suite. But &lt;strong&gt;tests don't typecheck against React 18&lt;/strong&gt; — Vitest ran against whatever types were installed. The job was theater.&lt;/p&gt;

&lt;p&gt;The fix was a compile-only fixture:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="c1"&gt;// test/types/consumer.tsx — never runs, just has to compile&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;PassesHookRefToCard&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ref&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;useStackProgress&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;HTMLElement&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;onProgress&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toFixed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;StackCard&lt;/span&gt; &lt;span class="na"&gt;ref&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;ref&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;first&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;StackCard&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Plus CI that installs the matching &lt;code&gt;@types/react&lt;/code&gt; for each React major and runs &lt;code&gt;tsc&lt;/code&gt;. I verified it works by reverting the fix — the error came right back.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If you support a version range, prove it. Don't just declare it.&lt;/strong&gt; ✅&lt;/p&gt;




&lt;h2&gt;
  
  
  ✅ The 10-minute audit for your own packages
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm view your-package dependencies   &lt;span class="c"&gt;# build tools in here? move them&lt;/span&gt;
npm view your-package keywords       &lt;span class="c"&gt;# empty? nobody can find you&lt;/span&gt;
npm publish &lt;span class="nt"&gt;--dry-run&lt;/span&gt;                &lt;span class="c"&gt;# see exactly what ships&lt;/span&gt;
npx publint                          &lt;span class="c"&gt;# manifest correctness&lt;/span&gt;
npx @arethetypeswrong/cli &lt;span class="nt"&gt;--pack&lt;/span&gt; &lt;span class="nb"&gt;.&lt;/span&gt;   &lt;span class="c"&gt;# TypeScript resolution&lt;/span&gt;
&lt;span class="nb"&gt;head&lt;/span&gt; &lt;span class="nt"&gt;-c&lt;/span&gt; 20 dist/index.js             &lt;span class="c"&gt;# is "use client" actually there?&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it. Six commands. They'd have caught all five of my bugs.&lt;/p&gt;




&lt;h2&gt;
  
  
  📦 Where the package landed
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.npmjs.com/package/stack-on-scroll" rel="noopener noreferrer"&gt;&lt;strong&gt;stack-on-scroll&lt;/strong&gt;&lt;/a&gt; is now:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Zero dependencies.&lt;/strong&gt; 4 packages install total, versus 116 before&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Zero config&lt;/strong&gt; — no stylesheet to import, styles are inline&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Zero JavaScript on the default path&lt;/strong&gt; — the stacking is pure &lt;code&gt;position: sticky&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Opt-in scale, fade, and tilt, all sharing one animation frame&lt;/li&gt;
&lt;li&gt;Full TypeScript types, verified against React 18 &lt;em&gt;and&lt;/em&gt; 19&lt;/li&gt;
&lt;li&gt;58 tests, including ones that read the built artifact
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;stack-on-scroll
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;StackContainer&lt;/span&gt; &lt;span class="na"&gt;offset&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;32&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;scaleStep&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="mf"&gt;0.07&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;fadeStep&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="mf"&gt;0.35&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;chapters&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;c&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;StackCard&lt;/span&gt; &lt;span class="na"&gt;key&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;StackCard&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;))&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;StackContainer&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No &lt;code&gt;index&lt;/code&gt; prop — the container counts its own children.&lt;/p&gt;

&lt;p&gt;🔗 &lt;strong&gt;&lt;a href="https://stack-on-scroll.vercel.app/" rel="noopener noreferrer"&gt;Live demo with sliders for every prop&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;
🐙 &lt;strong&gt;&lt;a href="https://github.com/saadahmad888/stack-on-scroll" rel="noopener noreferrer"&gt;Source on GitHub&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  👋 About me
&lt;/h2&gt;

&lt;p&gt;I'm &lt;strong&gt;Saad Ahmad&lt;/strong&gt;, a freelance frontend developer. I build React and Next.js interfaces, and — as you can probably tell — I enjoy the unglamorous part: the packaging, the build config, the reason your bundle is 400KB when it should be 40.&lt;/p&gt;

&lt;p&gt;If your team is shipping a component library, fighting a slow build, or has an npm package nobody can find, that's the kind of work I like. &lt;strong&gt;I'm currently open to freelance projects.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;📮 &lt;a href="https://isaadahmad.com" rel="noopener noreferrer"&gt;isaadahmad.com&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Found a bug in your own package after reading this? I'd genuinely love to hear about it in the comments — misery loves company.&lt;/em&gt; 😄&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>react</category>
      <category>npm</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Building a Lightweight Dark/Light Mode System in React with use-theme-mode</title>
      <dc:creator>Saad Ahmad</dc:creator>
      <pubDate>Tue, 14 Apr 2026 13:44:50 +0000</pubDate>
      <link>https://dev.to/saadahmad/building-a-lightweight-darklight-mode-system-in-react-with-use-theme-mode-42o0</link>
      <guid>https://dev.to/saadahmad/building-a-lightweight-darklight-mode-system-in-react-with-use-theme-mode-42o0</guid>
      <description>&lt;p&gt;Dark mode has become a standard expectation in modern web applications. But implementing it &lt;strong&gt;correctly&lt;/strong&gt;—with persistence, system preference detection, and clean separation of logic and styles—is often more complicated than it should be.&lt;/p&gt;

&lt;p&gt;That’s exactly why I built &lt;strong&gt;&lt;code&gt;use-theme-mode&lt;/code&gt;&lt;/strong&gt;, a lightweight React hook that handles theme state for you—without enforcing any styling system.&lt;/p&gt;




&lt;h2&gt;
  
  
  ✨ Why Another Theme Hook?
&lt;/h2&gt;

&lt;p&gt;Most theme solutions today fall into one of two categories:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Too opinionated&lt;/strong&gt; (UI framework–specific)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Too heavy&lt;/strong&gt; for simple use cases&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I wanted something that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✅ Works with &lt;strong&gt;any CSS solution&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;✅ Persists user preference&lt;/li&gt;
&lt;li&gt;✅ Respects system theme&lt;/li&gt;
&lt;li&gt;✅ Is &lt;strong&gt;SSR‑safe&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;✅ Has &lt;strong&gt;zero runtime dependencies&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That became &lt;strong&gt;&lt;code&gt;use-theme-mode&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  📦 Installation
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;use-theme-mode
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  🚀 Basic Usage
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useTheme&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;use-theme-mode&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;App&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;theme&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;toggleTheme&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useTheme&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt; &lt;span class="na"&gt;onClick&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;toggleTheme&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      Current theme: &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;theme&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That’s it. Behind the scenes, the hook:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;Detects&lt;/strong&gt; system preference&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Saves&lt;/strong&gt; the theme to &lt;code&gt;localStorage&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Updates&lt;/strong&gt; the &lt;code&gt;&amp;lt;html data-theme="..."&amp;gt;&lt;/code&gt; attribute&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Syncs&lt;/strong&gt; changes across tabs&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  🎨 Styling Is 100% in Your Control
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;use-theme-mode&lt;/code&gt; does not inject styles. Instead, it gives you a single source of truth via &lt;code&gt;data-theme&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  CSS Implementation
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nd"&gt;:root&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nt"&gt;data-theme&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;"light"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="py"&gt;--bg-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#ffffff&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;--text-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#000000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nd"&gt;:root&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nt"&gt;data-theme&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;"dark"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="py"&gt;--bg-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#121212&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;--text-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#ffffff&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;body&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--bg-color&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--text-color&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nl"&gt;transition&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;background&lt;/span&gt; &lt;span class="m"&gt;0.3s&lt;/span&gt; &lt;span class="n"&gt;ease&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;color&lt;/span&gt; &lt;span class="m"&gt;0.3s&lt;/span&gt; &lt;span class="n"&gt;ease&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This approach works beautifully with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tailwind&lt;/li&gt;
&lt;li&gt;CSS variables&lt;/li&gt;
&lt;li&gt;Styled-components&lt;/li&gt;
&lt;li&gt;MUI / Chakra&lt;/li&gt;
&lt;li&gt;Vanilla CSS&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🔄 Works Great with Tailwind Too
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;JavaScript Configuration:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// tailwind.config.js&lt;/span&gt;
&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;darkMode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;attribute&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;data-theme&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;JSX Usage:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"bg-white text-black dark:bg-black dark:text-white"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  Hello world
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  🌍 Live Demo
&lt;/h2&gt;

&lt;p&gt;I’ve deployed a live demo showcasing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Real theme switching&lt;/li&gt;
&lt;li&gt;Persistent state&lt;/li&gt;
&lt;li&gt;Code examples synced with UI&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;👉 &lt;a href="https://use-theme-mode-demo.vercel.app/" rel="noopener noreferrer"&gt;View Live Demo&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  🧩 API Reference
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;theme&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;toggleTheme&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setLight&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setDark&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useTheme&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;theme&lt;/code&gt;&lt;/strong&gt; → &lt;code&gt;"light" | "dark"&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;toggleTheme()&lt;/code&gt;&lt;/strong&gt; → switch modes&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;setLight()&lt;/code&gt;&lt;/strong&gt; → force light mode&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;setDark()&lt;/code&gt;&lt;/strong&gt; → force dark mode&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🛡️ SSR Safe &amp;amp; Production Ready
&lt;/h2&gt;

&lt;p&gt;The hook:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Avoids direct &lt;code&gt;window&lt;/code&gt; access during render.&lt;/li&gt;
&lt;li&gt;Works in &lt;strong&gt;Next.js&lt;/strong&gt; and other SSR frameworks.&lt;/li&gt;
&lt;li&gt;Synchronizes changes across tabs automatically.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🔮 What’s Coming Next?
&lt;/h2&gt;

&lt;p&gt;Plans for future versions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✅ TypeScript-first API&lt;/li&gt;
&lt;li&gt;✅ Optional context provider&lt;/li&gt;
&lt;li&gt;✅ ESM build support&lt;/li&gt;
&lt;li&gt;✅ Custom storage keys&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🔗 Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;npm:&lt;/strong&gt; &lt;a href="https://www.npmjs.com/package/use-theme-mode" rel="noopener noreferrer"&gt;use-theme-mode&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/saadahmad888/use-theme-mode" rel="noopener noreferrer"&gt;saadahmad888/use-theme-mode&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Live Demo:&lt;/strong&gt; &lt;a href="https://use-theme-mode-demo.vercel.app/" rel="noopener noreferrer"&gt;Vercel Demo&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you find this useful, I’d love feedback or contributions!&lt;/p&gt;

</description>
      <category>frontend</category>
      <category>javascript</category>
      <category>react</category>
      <category>showdev</category>
    </item>
    <item>
      <title>Digging Deep into the Core of Frontend Development</title>
      <dc:creator>Saad Ahmad</dc:creator>
      <pubDate>Sat, 08 Mar 2025 14:35:15 +0000</pubDate>
      <link>https://dev.to/saadahmad/digging-deep-into-the-core-of-frontend-development-oi3</link>
      <guid>https://dev.to/saadahmad/digging-deep-into-the-core-of-frontend-development-oi3</guid>
      <description>&lt;p&gt;Frontend development is more than just writing HTML, CSS, and JavaScript. It’s about creating seamless user experiences, ensuring performance, and writing maintainable code. If you truly want to master frontend development, you need to dig deep into its core concepts.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. &lt;strong&gt;HTML - The Backbone&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;HTML (HyperText Markup Language) structures the web. Understanding semantic HTML is crucial for accessibility and SEO. Don't just use &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; for everything; use &lt;code&gt;&amp;lt;article&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;section&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;header&amp;gt;&lt;/code&gt;, and &lt;code&gt;&amp;lt;footer&amp;gt;&lt;/code&gt; where appropriate.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. &lt;strong&gt;CSS - The Art of Styling&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;CSS (Cascading Style Sheets) is what makes the web beautiful. Mastering:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Flexbox &amp;amp; Grid for layout&lt;/li&gt;
&lt;li&gt;Variables for maintainability&lt;/li&gt;
&lt;li&gt;Transitions &amp;amp; animations for better UX&lt;/li&gt;
&lt;li&gt;Responsive design techniques&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;will help you create pixel-perfect designs.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. &lt;strong&gt;JavaScript - The Brain&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;JavaScript brings life to your UI. Core concepts to master:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ES6+ features (let, const, arrow functions, destructuring)&lt;/li&gt;
&lt;li&gt;DOM Manipulation&lt;/li&gt;
&lt;li&gt;Event Handling&lt;/li&gt;
&lt;li&gt;Fetch API &amp;amp; Async/Await&lt;/li&gt;
&lt;li&gt;Functional Programming principles&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  4. &lt;strong&gt;Frameworks &amp;amp; Libraries&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;While JavaScript is powerful, frameworks like React, Vue, or Angular make development faster and more scalable. For React.js enthusiasts, understanding Hooks, Context API, and performance optimizations is key.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. &lt;strong&gt;State Management&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;State management is the heart of modern web apps. Whether you use React’s Context API, Redux, Zustand, or Recoil, understanding state flow and performance optimization will set you apart.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. &lt;strong&gt;Performance Optimization&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;A fast website means a better user experience. Optimize:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Image loading (WebP, lazy loading)&lt;/li&gt;
&lt;li&gt;Code splitting &amp;amp; tree shaking&lt;/li&gt;
&lt;li&gt;Server-side rendering (SSR) &amp;amp; Static Site Generation (SSG)&lt;/li&gt;
&lt;li&gt;Caching strategies&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  7. &lt;strong&gt;Version Control (Git/GitHub)&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;A good frontend developer knows Git. You should be comfortable with branching, merging, rebasing, and handling pull requests. Speaking of GitHub, let’s connect! 😃&lt;/p&gt;

&lt;p&gt;📌 Follow me on GitHub: &lt;a href="https://github.com/saadahmad888" rel="noopener noreferrer"&gt;saadahmad888&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  8. &lt;strong&gt;Testing &amp;amp; Debugging&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Don’t just write code—test it! Get familiar with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Console debugging&lt;/li&gt;
&lt;li&gt;Unit testing (Jest, React Testing Library)&lt;/li&gt;
&lt;li&gt;End-to-end testing (Cypress, Playwright)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  9. &lt;strong&gt;Understanding APIs&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Frontend isn't just UI. Learning how to consume RESTful and GraphQL APIs will help you build dynamic applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  10. &lt;strong&gt;Soft Skills &amp;amp; Community Contribution&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Being a great frontend developer is not just about coding. It’s about collaboration, problem-solving, and sharing knowledge.&lt;/p&gt;

&lt;p&gt;🖥️ Want to see my work? Visit my portfolio: &lt;a href="https://isaadahmad.com" rel="noopener noreferrer"&gt;isaadahmad.com&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;🔥 If you're passionate about frontend and want to stay updated, let’s connect on GitHub and build something awesome together! 🚀&lt;/p&gt;

&lt;p&gt;Drop a comment below—what's your favorite frontend concept? 😊&lt;/p&gt;

</description>
      <category>frontend</category>
      <category>javascript</category>
      <category>react</category>
      <category>css</category>
    </item>
    <item>
      <title>🚀 How AI is Revolutionizing Frontend Development 🤖</title>
      <dc:creator>Saad Ahmad</dc:creator>
      <pubDate>Thu, 06 Mar 2025 10:55:19 +0000</pubDate>
      <link>https://dev.to/saadahmad/how-ai-is-revolutionizing-frontend-development-1apm</link>
      <guid>https://dev.to/saadahmad/how-ai-is-revolutionizing-frontend-development-1apm</guid>
      <description>&lt;p&gt;Artificial Intelligence (AI) is transforming every industry, and frontend development is no exception. With AI-powered tools and frameworks, developers can now create faster, more efficient, and highly personalized user experiences. Let’s dive into how AI is reshaping frontend development and what it means for developers. 🛠️&lt;/p&gt;

&lt;h2&gt;
  
  
  1️⃣ AI-Powered Code Generation ✨
&lt;/h2&gt;

&lt;p&gt;Tools like &lt;strong&gt;GitHub Copilot&lt;/strong&gt;, &lt;strong&gt;Tabnine&lt;/strong&gt;, and &lt;strong&gt;Codeium&lt;/strong&gt; are helping developers write code faster and with fewer errors. These AI-powered assistants suggest code snippets, complete functions, and even generate entire components based on context. This not only speeds up development but also reduces cognitive load. ⚡&lt;/p&gt;

&lt;h2&gt;
  
  
  2️⃣ Automated UI/UX Design 🎨
&lt;/h2&gt;

&lt;p&gt;AI is making UI/UX design more intuitive with tools like &lt;strong&gt;Figma AI&lt;/strong&gt; and &lt;strong&gt;Adobe Sensei&lt;/strong&gt;. These tools analyze user behavior and suggest design improvements, color palettes, and layouts, making it easier for developers to create visually appealing interfaces. 🖌️&lt;/p&gt;

&lt;h2&gt;
  
  
  3️⃣ AI for Accessibility and Responsiveness 📱
&lt;/h2&gt;

&lt;p&gt;AI-driven tools can analyze websites and ensure accessibility compliance with standards like &lt;strong&gt;WCAG&lt;/strong&gt;. They also help in making layouts responsive by predicting how elements should adjust for different screen sizes and devices. 🔍&lt;/p&gt;

&lt;h2&gt;
  
  
  4️⃣ AI-Based Testing and Debugging 🛠️
&lt;/h2&gt;

&lt;p&gt;AI-powered testing frameworks like &lt;strong&gt;Selenium AI&lt;/strong&gt;, &lt;strong&gt;TestCraft&lt;/strong&gt;, and &lt;strong&gt;Applitools&lt;/strong&gt; can automate UI testing, detect anomalies, and provide insights on how to fix them. This saves time in debugging and ensures a smooth user experience. ✅&lt;/p&gt;

&lt;h2&gt;
  
  
  5️⃣ Personalized User Experiences 🎯
&lt;/h2&gt;

&lt;p&gt;AI enables real-time personalization based on user behavior, preferences, and interactions. Recommendation engines, dynamic content rendering, and chatbot integrations are all powered by AI to enhance user engagement. 🤝&lt;/p&gt;

&lt;h2&gt;
  
  
  🔮 What’s Next?
&lt;/h2&gt;

&lt;p&gt;As AI continues to evolve, we can expect more intelligent automation in frontend development. From AI-generated animations to real-time code optimizations, the possibilities are endless. While AI won't replace frontend developers, it will certainly enhance their capabilities and streamline workflows. 💡&lt;/p&gt;

&lt;p&gt;What are your thoughts on AI in frontend development? Are you using any AI-powered tools in your projects? Let’s discuss in the comments! 🚀&lt;/p&gt;

</description>
    </item>
    <item>
      <title>🚀 My Journey in Frontend Development &amp; Building with the Community</title>
      <dc:creator>Saad Ahmad</dc:creator>
      <pubDate>Thu, 13 Feb 2025 06:10:55 +0000</pubDate>
      <link>https://dev.to/saadahmad/my-journey-in-frontend-development-building-with-the-community-31h3</link>
      <guid>https://dev.to/saadahmad/my-journey-in-frontend-development-building-with-the-community-31h3</guid>
      <description>&lt;p&gt;Hey Dev.to! 👋 I'm excited to share my journey as a frontend developer and how I keep up with the ever-evolving world of web development. From building innovative tools to engaging with the dev community, here’s my story.&lt;/p&gt;

&lt;h2&gt;
  
  
  🛠 Who Am I?
&lt;/h2&gt;

&lt;p&gt;I'm a &lt;strong&gt;frontend developer&lt;/strong&gt; passionate about crafting high-performance user interfaces with &lt;strong&gt;React, Next.js, and modern web technologies&lt;/strong&gt;. I love solving problems, optimizing performance, and exploring new trends in frontend development. My journey has been fueled by curiosity, continuous learning, and a deep love for coding.&lt;/p&gt;

&lt;h3&gt;
  
  
  💡 Things I’m Working On:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Open-Source Projects&lt;/strong&gt; → I maintain &lt;strong&gt;npm packages&lt;/strong&gt; like &lt;a href="https://www.npmjs.com/package/stack-on-scroll" rel="noopener noreferrer"&gt;stack-on-scroll&lt;/a&gt;, helping developers create better UI experiences.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Frontend Innovation&lt;/strong&gt; → I’m building a &lt;strong&gt;Skeleton Screen Generator&lt;/strong&gt;, making it easier for developers to create seamless loading states.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Speech-to-Text &amp;amp; Text-to-Speech in Urdu&lt;/strong&gt; → I’m working on implementing this feature to enhance accessibility in apps.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🔥 Staying Updated with Frontend Trends
&lt;/h2&gt;

&lt;p&gt;Frontend development is always changing! Here’s how I stay ahead:&lt;/p&gt;

&lt;p&gt;✅ &lt;strong&gt;Exploring New Features&lt;/strong&gt; → React Server Components (RSC), Next.js advancements, and modern UI patterns.&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;Experimenting with Tech&lt;/strong&gt; → Trying new tools and frameworks to build better web apps.&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;Engaging in the Dev Community&lt;/strong&gt; → Writing blogs, sharing knowledge, and connecting with like-minded developers.  &lt;/p&gt;

&lt;h2&gt;
  
  
  🏗 How I Build &amp;amp; Share
&lt;/h2&gt;

&lt;p&gt;One of my goals is to &lt;strong&gt;share my knowledge&lt;/strong&gt; with others. Writing blogs, building open-source tools, and contributing to the dev community help me grow as a developer.&lt;/p&gt;

&lt;h3&gt;
  
  
  ✍️ Topics I Write About:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Modern Frontend Trends&lt;/strong&gt; → React, Next.js, and emerging frameworks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Performance Optimization&lt;/strong&gt; → Making apps faster and more efficient.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Developer Tools &amp;amp; Productivity&lt;/strong&gt; → Tips and tricks for better frontend development.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🚀 Let’s Connect &amp;amp; Grow Together!
&lt;/h2&gt;

&lt;p&gt;I’d love to hear from you! Whether it's discussing &lt;strong&gt;frontend trends, performance hacks, or open-source projects&lt;/strong&gt;, let’s build together. Drop a comment, share your thoughts, or connect with me on &lt;strong&gt;&lt;a href="https://isaadahmad.com" rel="noopener noreferrer"&gt;isaadahmad.com&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  What’s your favorite frontend trend right now? Let’s discuss!👇
&lt;/h3&gt;

</description>
      <category>react</category>
      <category>nextjs</category>
      <category>frontend</category>
      <category>servercomponents</category>
    </item>
  </channel>
</rss>
