<?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>Forem: tinkerbaj</title>
    <description>The latest articles on Forem by tinkerbaj (@tinkerbaj).</description>
    <link>https://forem.com/tinkerbaj</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%2F886216%2F1cf3cb33-b9f2-4176-b707-97c6b1a7fca3.png</url>
      <title>Forem: tinkerbaj</title>
      <link>https://forem.com/tinkerbaj</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/tinkerbaj"/>
    <language>en</language>
    <item>
      <title>Why I Chose Datastar Over Alpine.js/HTMX For My Project</title>
      <dc:creator>tinkerbaj</dc:creator>
      <pubDate>Thu, 20 Mar 2025 19:32:34 +0000</pubDate>
      <link>https://forem.com/tinkerbaj/why-i-chose-datastar-over-alpinejshtmx-for-my-project-1j8b</link>
      <guid>https://forem.com/tinkerbaj/why-i-chose-datastar-over-alpinejshtmx-for-my-project-1j8b</guid>
      <description>&lt;h1&gt;
  
  
  Why I Chose Datastar Over Alpine.js/HTMX For My Project
&lt;/h1&gt;

&lt;p&gt;In recent years, developers have been embracing a more old-school approach to building websites, focusing on hypermedia-driven applications. This shift has brought some fantastic tools into the spotlight, and two that stand out are &lt;strong&gt;HTMX&lt;/strong&gt; and &lt;strong&gt;&lt;a href="https://data-star.dev/" rel="noopener noreferrer"&gt;Datastar&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;HTMX makes server-side rendering more powerful by allowing you to send HTML fragments over the wire, reducing the need for complex JavaScript frameworks. Many developers pair HTMX with Alpine.js for client-side interactions, but after testing this stack myself, I found it wasn’t quite what I expected. While HTMX worked well, I encountered some strange glitches with Alpine.js that made me rethink my approach.&lt;/p&gt;

&lt;h2&gt;
  
  
  Discovering Datastar
&lt;/h2&gt;

&lt;p&gt;That’s when I came across &lt;strong&gt;&lt;a href="https://data-star.dev/" rel="noopener noreferrer"&gt;Datastar&lt;/a&gt;&lt;/strong&gt;. It combines the power of HTMX and Alpine.js in just &lt;strong&gt;14.4 KiB&lt;/strong&gt;, making it an incredibly lightweight yet powerful alternative.&lt;/p&gt;

&lt;p&gt;Unlike HTMX, which relies on AJAX for dynamic content updates, Datastar leverages &lt;strong&gt;Server-Sent Events (SSE)&lt;/strong&gt; to keep the client updated in real-time. This approach feels much more fluid and efficient. It also introduces &lt;strong&gt;signals for state management&lt;/strong&gt;, making it easier to track and react to data changes without the need for additional dependencies.&lt;/p&gt;

&lt;p&gt;Another thing I love about Datastar is its built-in helper methods, which remind me of jQuery’s simplicity. One of my favorites so far is &lt;code&gt;@toggleAll&lt;/code&gt;, which I recently used to build a combobox in my project.&lt;/p&gt;

&lt;h2&gt;
  
  
  Give It a Try!
&lt;/h2&gt;

&lt;p&gt;If you’re interested in lightweight and reactive alternatives for building modern web apps, I highly recommend checking out the &lt;strong&gt;&lt;a href="https://data-star.dev/examples/web_component" rel="noopener noreferrer"&gt;Datastar examples&lt;/a&gt;&lt;/strong&gt;. There’s a lot to explore, and you might be surprised by how much you can achieve with just a few lines of code.&lt;/p&gt;

&lt;p&gt;One of the coolest recent showcases shared in the Datastar Discord community is this &lt;strong&gt;&lt;a href="https://tanks.mark3labs.com/" rel="noopener noreferrer"&gt;real-time tanks game&lt;/a&gt;&lt;/strong&gt;—a great demonstration of what’s possible with SSE and a smart state management approach.&lt;/p&gt;

&lt;p&gt;Have you tried Datastar yet? Let me know your thoughts in the comments!&lt;/p&gt;

</description>
      <category>datastar</category>
      <category>webdev</category>
      <category>htmx</category>
      <category>programming</category>
    </item>
    <item>
      <title>Job searching</title>
      <dc:creator>tinkerbaj</dc:creator>
      <pubDate>Sun, 09 Apr 2023 02:57:36 +0000</pubDate>
      <link>https://forem.com/tinkerbaj/job-searching-pb4</link>
      <guid>https://forem.com/tinkerbaj/job-searching-pb4</guid>
      <description>&lt;p&gt;When you are in desperate need of a job, what tactics do you use and where do you look for jobs?&lt;/p&gt;

&lt;p&gt;Currently, I am searching on LinkedIn, Upwork, and Remoteok, but I haven't received any responses, and I feel hopeless. Do you have any advice for me?&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Why I think TailwindCSS is overhyped</title>
      <dc:creator>tinkerbaj</dc:creator>
      <pubDate>Sat, 25 Mar 2023 02:25:38 +0000</pubDate>
      <link>https://forem.com/tinkerbaj/why-i-think-tailwindcss-is-overhyped-2if4</link>
      <guid>https://forem.com/tinkerbaj/why-i-think-tailwindcss-is-overhyped-2if4</guid>
      <description>&lt;p&gt;These days, I have been seeing a lot of posts promoting Tailwind and how amazing it is, etc. To be honest, I was thinking the same thing because I am not in love with design and TailwindCSS makes my life easier. But is it really true?&lt;/p&gt;

&lt;p&gt;I started working on a big ecommerce website alone, without anyone to consult, and I chose Tailwind. I loved how it looked with the Indigo color, so I started working on it. It started out okay, and everything was nice, like my button:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;button class="bg-indigo-600 hover:bg-indigo-700 py-2 px-4 rounded-lg text-white font-sm leading-wide"&amp;gt;Click me&amp;lt;/button&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;I continued to work and make the first and second components, and everything was good. But at some point, I got some partners to discuss the color scheme because our targets changed, and we decided to go with blue. Now all the indigo elements in multiple files (components) need to be converted to blue, but that's not all - elements with hover, active, ring, border, and all similar things need to be converted too. Instead of looking in the CSS and going to the .btn class, I needed to go to each component file and look for classes with indigo to switch them to blue.&lt;/p&gt;

&lt;p&gt;What I learned is this: &lt;strong&gt;Don't follow the masses without using your brain.&lt;/strong&gt; &lt;br&gt;
I switched to beautiful Sass and with super simple tricks, got much better results with even better control over my style.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$r: 8px;&lt;br&gt;
$pc: #ff23ed; //primary color&lt;br&gt;
$pch:  darken($pc, 5%); //primary color hover&lt;br&gt;
.btn {&lt;br&gt;
    color: white;&lt;br&gt;
    border-radius: calc($r * 1.5);&lt;br&gt;
    background-color: $pc;&lt;br&gt;
    &amp;amp;:hover {&lt;br&gt;
        background-color: $pch;&lt;br&gt;
    }&lt;br&gt;
}&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;With this kind of code, I can easily change the color (you don't need to declare variables in each component, you can have global ones). When you change $pc once, all your colors automatically adjust, even for the hover state. If you want to get a triad color scheme, it's easy:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$secolor: adjust-hue($pc, 120deg);&lt;br&gt;
$thcolor: adjust-hue($pc, -120deg);&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;It uses the color wheel with degrees. If your primary color is red, $secolor will be 0+120, which is equal to 120 and is green on the color wheel. $thcolor will be 0-120, which is 240 on the color wheel and is blue. &lt;/p&gt;

&lt;p&gt;I still think tailwind is nice for small projects but if you plan to use it on big one think twice is it really smart move.&lt;/p&gt;

&lt;p&gt;I think that's all for now. Thank you for reading, and if you have any questions, feel free to ask. &lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
