<?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: Livecodebase</title>
    <description>The latest articles on DEV Community by Livecodebase (@livecodebase).</description>
    <link>https://dev.to/livecodebase</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%2F728923%2F7f78f102-65e3-4afc-bb84-7ffce20ca108.webp</url>
      <title>DEV Community: Livecodebase</title>
      <link>https://dev.to/livecodebase</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/livecodebase"/>
    <language>en</language>
    <item>
      <title>The Hidden Cost of ‘Reusable Components’ in Vue</title>
      <dc:creator>Livecodebase</dc:creator>
      <pubDate>Mon, 13 Apr 2026 14:32:13 +0000</pubDate>
      <link>https://dev.to/livecodebase/the-hidden-cost-of-reusable-components-in-vue-4mce</link>
      <guid>https://dev.to/livecodebase/the-hidden-cost-of-reusable-components-in-vue-4mce</guid>
      <description>&lt;p&gt;Reusable components sound like the perfect solution for building any application: write once and use everywhere, with a single source of truth that we can use to make global changes by modifying just one component.&lt;/p&gt;

&lt;p&gt;But when the project gets huge with lots of complexities, then managing that component will become a nightmare. That day, I learned that over-reusability can quietly destroy our codebase.&lt;/p&gt;

&lt;p&gt;As a developer, we are often told to follow:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Make components reusable&lt;/li&gt;
&lt;li&gt;Avoid duplication&lt;/li&gt;
&lt;li&gt;Keep things DRY ( Don't repeat yourself )&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But at the end, instead of a reusable component, we end up with a &lt;strong&gt;"Universal component"&lt;/strong&gt; that is becoming impossible to maintain.&lt;br&gt;
Let's dive deeper into this.&lt;/p&gt;

&lt;p&gt;Lets support we just started a project and we need a button with these basic features&lt;/p&gt;

&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;Have labels&lt;/li&gt;
&lt;li&gt;Each button has a different type of variation ( Filled, Outlined, text )&lt;/li&gt;
&lt;li&gt;Each button has a different type of color variants ( Primary, Secondary, Accent )&lt;/li&gt;
&lt;li&gt;Can have links&lt;/li&gt;
&lt;li&gt;Can be disabled&lt;/li&gt;
&lt;li&gt;Can be fullwidth&lt;/li&gt;
&lt;li&gt;May have a loading state&lt;/li&gt;
&lt;li&gt;Support adding an icon with icon position ( after/before text)
&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&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;BaseButton&lt;/span&gt; 
  &lt;span class="na"&gt;label&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"Submit"&lt;/span&gt;
  &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"submit"&lt;/span&gt;
  &lt;span class="na"&gt;variant&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"primary"&lt;/span&gt;
  &lt;span class="na"&gt;size&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"large"&lt;/span&gt;
  &lt;span class="na"&gt;icon&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"check"&lt;/span&gt;
  &lt;span class="na"&gt;iconPosition&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"right"&lt;/span&gt;
  &lt;span class="na"&gt;loading&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"true"&lt;/span&gt;
  &lt;span class="na"&gt;disabled&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"true"&lt;/span&gt;
  &lt;span class="na"&gt;fullWidth&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;It still looks manageable, as we already saw this type of button in UI library like material design. Till now i will be happy with what i achieved, it looks pretty good to me, we can do almost everything with our global button component.&lt;br&gt;
Now lets move to the part where things get started dirty.&lt;/p&gt;

&lt;p&gt;Now new requirements came up, and we started to modify our button component.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Requirement 1&lt;/strong&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  A new screen introduced in the app using a completely new button with a different color, size, and icon position on top.
&lt;/h4&gt;

&lt;p&gt;Now, instead of creating a new component, we decided to enhance our button component by introducing new props for custom color and custom classes. This will add a few more lines of code, which seems okay for now.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;BaseButton&lt;/span&gt; 
 &lt;span class="na"&gt;color=&lt;/span&gt;&lt;span class="s"&gt;"#115eae"&lt;/span&gt;
 &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"h-48 px-20"&lt;/span&gt;
 &lt;span class="na"&gt;iconPosition=&lt;/span&gt;&lt;span class="s"&gt;"top"&lt;/span&gt;
&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Requirement 2&lt;/strong&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  A new feature of the floating button has been introduced, and we still decided to use the same button component
&lt;/h4&gt;

&lt;p&gt;Now, for this, we need to add more conditions to remove the label and show the icon aligned centre. This will make the code messier and unmanageable. &lt;/p&gt;

&lt;p&gt;More requirements will come, and we continue to enhance our existing button, and in the end, we end up with a monster component.&lt;/p&gt;

&lt;h2&gt;
  
  
  The hidden costs
&lt;/h2&gt;

&lt;h4&gt;
  
  
  Props Explosion
&lt;/h4&gt;

&lt;p&gt;Too many props, which makes the component hard to read, easy to misuse by new devs and difficult to debug&lt;/p&gt;

&lt;h4&gt;
  
  
  Mixup of logic
&lt;/h4&gt;

&lt;p&gt;Now it's hard to differentiate which part will handle the UI/basic features and which part stores the advanced functionality &lt;/p&gt;

&lt;h4&gt;
  
  
  Risk on Bugs
&lt;/h4&gt;

&lt;p&gt;Now, when multiple things are connected to each other, then making the change in a small part may affect the overall implementation, which results in bugs in unrelated features&lt;/p&gt;

&lt;h4&gt;
  
  
  Slower Development
&lt;/h4&gt;

&lt;p&gt;One component contains so many lines of code, which we need to go through every time we need to update something in this component&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The Real problem in not reusable component but the mindset to handle everything with the same resualble component. Insetad of "Let’s make this reusable", we should avoid adding unrelated changes to resualbe component or making a different component by using existing features of the reusable component.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;We don't need to make our resusable component too smart to manage everything by itself, instead stick with its basic feature. And one more thing I want to add is don't create resualbe component until we need to repeat someting 2 or more times and its purpose is clear to us.&lt;/p&gt;

&lt;p&gt;The solution to the problem is splitting new features into multiple components instead of using the same component.&lt;/p&gt;

&lt;p&gt;Instead of using the same button component, we can create different components like &lt;code&gt;&amp;lt;FloatingButton&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;NotificationButton&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;A simple rule i follow is if a component needs more than 5-6 props, then its probabluty handing too many features all by itself. Reusable components are powerful and awesome if we use them in a proper manner because as the project grows, team changes, requirement changes and code evolves, and if we handle too much in the same component, then it's definitely gonna explode on us.;&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>frontend</category>
      <category>javascript</category>
      <category>vue</category>
    </item>
    <item>
      <title>Ubuntu Nginx wordpress Configration</title>
      <dc:creator>Livecodebase</dc:creator>
      <pubDate>Sat, 09 Mar 2024 08:22:35 +0000</pubDate>
      <link>https://dev.to/livecodebase/ubuntu-nginx-wordpress-configration-g8a</link>
      <guid>https://dev.to/livecodebase/ubuntu-nginx-wordpress-configration-g8a</guid>
      <description>&lt;p&gt;create folder in your directory with domain name&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir example.com
cd example.com 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Installing Additional PHP Extensions&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt update
sudo apt install php-curl php-gd php-intl php-mbstring php-soap php-xml php-xmlrpc php-zip
sudo systemctl restart php7.2-fpm
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Download wordpress and change into writable directory&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl -LO https://wordpress.org/latest.tar.gz
tar xzvf latest.tar.gz
cd wordpress
mv * ../
cd ..
rm -rf wordpress
cd ..
sudo chown -R www-data:www-data example.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Configure Nginx&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd /etc/nginx/sites-available
nano example.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;paste below sample configuration&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;server {
        server_name example.com;
        index index.html index.php;
        root /var/www/example.com;

        location / {
                try_files $uri $uri/ /index.php?$args;
        }

        location ~ \.php$ {
                include snippets/fastcgi-php.conf;
                fastcgi_pass unix:/var/run/php/php8.0-fpm.sock;
        }

        location ~ /\.ht {
                deny all;
        }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;then press &lt;code&gt;CTRL + X&lt;/code&gt; and press &lt;code&gt;Y&lt;/code&gt; and enter to save configuration&lt;/p&gt;

&lt;p&gt;Now time to add this file in nginx sites-enabled dir. It ln -s creates a link to sites-available directory in sites-enabled directory&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd ../sites-enabled
ln -s ../sites-available/example.com ./
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now finally run below command to test nginx configuration&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nginx -t
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;if not get any error then restart nginx&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;systemctl restart nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Time to setup mysql&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mysql
create database example;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create unique user to give access to db&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON crochetlove.* TO 'newuser'@'localhost';
FLUSH PRIVILEGES;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>How to setup git ssh</title>
      <dc:creator>Livecodebase</dc:creator>
      <pubDate>Wed, 06 Apr 2022 16:34:21 +0000</pubDate>
      <link>https://dev.to/livecodebase/how-to-setup-git-ssh-5118</link>
      <guid>https://dev.to/livecodebase/how-to-setup-git-ssh-5118</guid>
      <description>&lt;p&gt;Enter &lt;code&gt;ls -al ~/.ssh&lt;/code&gt; to see if existing SSH keys are present.&lt;/p&gt;

&lt;p&gt;Paste the text below, substituting in your GitHub email address.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh-keygen -t ed25519 -C "your_email@example.com"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Start SSH agent in background&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;eval "$(ssh-agent -s)"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;add key to ssh agent&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh-add ~/.ssh/id_ed25519
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Display added SSH Key&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cat ~/.ssh/id_ed25519.pub
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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