<?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: Jay Lee</title>
    <description>The latest articles on DEV Community by Jay Lee (@jayl_e_e).</description>
    <link>https://dev.to/jayl_e_e</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3174523%2F92ec7613-5b94-4e90-ba92-c4233cc386e0.png</url>
      <title>DEV Community: Jay Lee</title>
      <link>https://dev.to/jayl_e_e</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jayl_e_e"/>
    <language>en</language>
    <item>
      <title>Did you know? # is the magic word to reduce your bundle size.</title>
      <dc:creator>Jay Lee</dc:creator>
      <pubDate>Sun, 18 May 2025 17:27:00 +0000</pubDate>
      <link>https://dev.to/jayl_e_e/did-you-know-is-the-magic-word-to-reduce-your-bundle-size-4pj2</link>
      <guid>https://dev.to/jayl_e_e/did-you-know-is-the-magic-word-to-reduce-your-bundle-size-4pj2</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2az9y6a5is6akl8cfbug.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2az9y6a5is6akl8cfbug.png" alt="Image description" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In modern JavaScript, prefixing a class field with &lt;strong&gt;#&lt;/strong&gt; makes it &lt;strong&gt;private&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;    &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;User&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="nx"&gt;token&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;secret&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;This isn’t just about access control. Bundlers like &lt;strong&gt;esbuild&lt;/strong&gt; can safely rename &lt;code&gt;#token&lt;/code&gt; to something shorter — like &lt;code&gt;#a&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;That means smaller bundles!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Compare this to public fields:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;User&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;token&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;secret&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;Here, token must stay as-is — &lt;em&gt;even in production&lt;/em&gt; — because external code might rely on it.&lt;/p&gt;

&lt;p&gt;Private fields, on the other hand, are guaranteed to be internal-only.&lt;br&gt;
That gives bundlers the green light to compress them aggressively.&lt;/p&gt;

&lt;p&gt;In large apps with many classes, switching to &lt;strong&gt;#&lt;/strong&gt; private fields can save a surprising amount of space — especially when field names are long.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bonus:&lt;/strong&gt; It’s not just about size.&lt;br&gt;
Private fields make your APIs cleaner and your code more robust.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;TL;DR:&lt;/em&gt;&lt;br&gt;
Use &lt;code&gt;#&lt;/code&gt; private fields.&lt;br&gt;
&lt;strong&gt;Smaller bundles, safer code.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Gotcha:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Supported in modern environments only.&lt;/li&gt;
&lt;li&gt;Can’t be accessed or tested from outside (even in unit tests) — by design!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Still, if you’re targeting evergreen browsers or bundling for modern platforms:&lt;/p&gt;

&lt;h2&gt;
  
  
  # is your friend.
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://medium.com/@jay_28506/if-you-use-node-redis-in-2025-you-deserve-the-bundle-size-1fb8c5adcbfc" rel="noopener noreferrer"&gt;If You Use &lt;code&gt;node-redis&lt;/code&gt; in 2025, You Deserve the Bundle Size&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>typescript</category>
      <category>opensource</category>
      <category>programming</category>
    </item>
    <item>
      <title>Solidis – Strongly Typed, Most Tiny Redis Client</title>
      <dc:creator>Jay Lee</dc:creator>
      <pubDate>Sun, 18 May 2025 05:27:49 +0000</pubDate>
      <link>https://dev.to/jayl_e_e/solidis-strongly-typed-most-tiny-redis-client-c0o</link>
      <guid>https://dev.to/jayl_e_e/solidis-strongly-typed-most-tiny-redis-client-c0o</guid>
      <description>&lt;p&gt;&lt;strong&gt;Hey everyone! 👋&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I'm new to this community, so I would really appreciate a warm welcome. If I'm posting something inappropriate or out of line as a newcomer, please kindly let me know — I’ll make sure to correct it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Over the past two years I threw myself back into full-time engineering with a simple goal: write code that &lt;em&gt;gives back&lt;/em&gt; to the community. After a lot of late-night FOMO (“AI will do it all for us, right?”) and some painful production incidents, I finally turned my weekend project into an open-source library.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is &lt;strong&gt;&lt;a href="https://github.com/vcms-io/solidis" rel="noopener noreferrer"&gt;Solidis&lt;/a&gt;&lt;/strong&gt;?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Super-light (&amp;lt; 30 KB) RESP2/RESP3 client&lt;/strong&gt; with zero runtime deps and first-class ESM/CJS support.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmgkqb1fzwvyca5o0s5df.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmgkqb1fzwvyca5o0s5df.png" alt="Bundle Size Comparison" width="800" height="496"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Fully &lt;strong&gt;tree-shakable&lt;/strong&gt; – import only the commands you need.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Written with SOLID principles &amp;amp; full TypeScript typings for every command.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Designed for &lt;strong&gt;cold-start sensitive&lt;/strong&gt; serverless platforms (small bundle + tiny memory footprint).&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Why I built it
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;node-redis &amp;amp; ioredis pain&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ESM is still an after-thought.
&lt;/li&gt;
&lt;li&gt;Hidden deadlocks on RST, vague error surfaces.
&lt;/li&gt;
&lt;li&gt;Everything gets bundled, even commands you’ll never call.
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;I refuse to add a dependency I don’t fully understand – I literally read candidates 10× before &lt;code&gt;npm i&lt;/code&gt;.  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Serverless bills love to remind me that every KB and millisecond matters.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs13wzjhx6yyzgdk19hro.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs13wzjhx6yyzgdk19hro.png" alt="Benchmark with IoRedis" width="800" height="1248"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Key features
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Protocols: RESP2 and RESP3 (auto-negotiation)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Bundle size: &lt;code&gt;&amp;lt;30 KB&lt;/code&gt; (core) / &lt;code&gt;&amp;lt;105 KB&lt;/code&gt; (full)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Dependencies: &lt;strong&gt;0&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Extensibility: Drop-in command plugins, custom transactions&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Reliability: Auto-reconnect, per-command timeouts, type-checked replies&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Roadmap / Help wanted
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Benchmarks&lt;/em&gt; against &lt;code&gt;node-redis&lt;/code&gt; &amp;amp; &lt;code&gt;ioredis&lt;/code&gt; (PRs welcome!)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;More first-class &lt;strong&gt;Valkey&lt;/strong&gt; love&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Fuzz-testing&lt;/em&gt; the parser&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Docs site&lt;/em&gt; – the README came first; I’d love help polishing full docs&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This might be my last big OSS push for a while, so &lt;strong&gt;stars, issues, and PRs mean the world&lt;/strong&gt;.  &lt;/p&gt;

&lt;p&gt;If Solidis saves you some cold-start time or just scratches a TypeScript itch, let me know!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Repo:&lt;/strong&gt; &lt;a href="https://github.com/vcms-io/solidis" rel="noopener noreferrer"&gt;https://github.com/vcms-io/solidis&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;License:&lt;/strong&gt; MIT&lt;/p&gt;

&lt;p&gt;Thanks for reading, and happy hacking! 🚀  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;(Feel free to AMA in the comments – I’m around.)&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>typescript</category>
      <category>javascript</category>
      <category>redis</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
