<?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: Mirko</title>
    <description>The latest articles on Forem by Mirko (@mirkosaugo).</description>
    <link>https://forem.com/mirkosaugo</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%2F232211%2F40adaea6-df96-4681-bf20-3fb601037a1c.jpg</url>
      <title>Forem: Mirko</title>
      <link>https://forem.com/mirkosaugo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/mirkosaugo"/>
    <language>en</language>
    <item>
      <title>Code Like a Human: Empathy is the Most Underrated Skill in Your Dev Toolkit</title>
      <dc:creator>Mirko</dc:creator>
      <pubDate>Sat, 11 May 2024 17:11:21 +0000</pubDate>
      <link>https://forem.com/mirkosaugo/code-like-a-human-empathy-is-the-most-underrated-skill-in-your-dev-toolkit-cma</link>
      <guid>https://forem.com/mirkosaugo/code-like-a-human-empathy-is-the-most-underrated-skill-in-your-dev-toolkit-cma</guid>
      <description>&lt;p&gt;Alright, code warriors, let's talk truth bombs. You debug problems faster than a hummingbird hopped up on Red Bull and Pixy Stix. But here's a harsh reality that might sting worse than a syntax error on line 1: being a jerk is the ultimate bug in your otherwise impressive system.&lt;/p&gt;

&lt;p&gt;Yes, your algorithms are tighter than a dragon's hoard, and your debugging skills would make Sherlock Holmes cry with envy. But coding isn't a solo rampage through the digital wilderness – it's a team lovefest, building the next big thing together.  And guess what throws a monkey wrench into that lovefest faster than a banana peel on a server rack? You, the code curmudgeon, spewing negativity like a malfunctioning spam filter.&lt;/p&gt;

&lt;h3&gt;
  
  
  Look, HR folks, technical skills are a given. Here's why you SHOULD be grilling candidates on their emotional intelligence:
&lt;/h3&gt;

&lt;p&gt;From Lone Wolf to Empathy Empath:  Imagine explaining a complex concept to a teammate who looks like they just ate a keyboard. Not exactly a recipe for innovation, is it? But with a sprinkle of empathy and the communication skills of a motivational speaker on a sugar rush, you can turn frowns upside down and confusion into "Aha!" moments. Remember, happy teammates are teammates who stick around (and don't mysteriously "forget" to attend your code reviews...or worse, passive-aggressively hide your favorite debugging unicorn mug).&lt;/p&gt;

&lt;p&gt;Bug Squashing Becomes a Group Therapy Session (Okay, Maybe Not Therapy, But Close): &lt;strong&gt;Coding is a team sport, gladiators&lt;/strong&gt;. There's a reason why "there's no I in team" isn't written in binary. When that inevitable bug rears its ugly head, you need a squad that has your back, not one cowering in fear of your withering sarcasm. Being a supportive teammate fosters a positive environment, and hey, it also means someone's there to catch you when you accidentally delete the entire database (because let's be honest, even coding gods have moments of weakness).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Love in the Air, Quality Code on the Screen:&lt;/strong&gt; Projects fueled by negativity are like a grumpy troll guarding a bridge – they might get by for a while, but they won't win any awards.  On the other hand, a team that works together with mutual respect and understanding can create magic. Suddenly, those late-night coding sessions turn into brainstorming bonanzas, and complex problems melt away like metaphorical snowflakes on a coder's warm keyboard.&lt;/p&gt;

&lt;h3&gt;
  
  
  Engineers, listen up! Coding with a side of kindness is your ultimate power move:
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Even Junior Developers with Smiles Can Outshine Jerk Geniuses:&lt;/strong&gt; Let's face it, a positive attitude is contagious, and it can make even the most complex project feel a little less like pulling teeth. A team that gels is a team that innovates, and that's the kind of team everyone wants to be on (and the kind of team that gets things done).&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;The moral of the story? &lt;u&gt;Code with kindness, communicate with clarity, and remember: a happy team is a productive team (and a much less likely source of office pranks involving disappearing keyboards and questionable cafeteria lunches). &lt;/u&gt;Now go forth and conquer the coding realm, but do it with the heart of a hero, not the temperament of a troll.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>team</category>
      <category>teamjob</category>
      <category>tech</category>
      <category>jobinterview</category>
    </item>
    <item>
      <title>Juggling Your Git Personalities: A Guide to Mastering Multiple GitHub Accounts</title>
      <dc:creator>Mirko</dc:creator>
      <pubDate>Fri, 03 May 2024 13:11:30 +0000</pubDate>
      <link>https://forem.com/mirkosaugo/juggling-your-git-personalities-a-guide-to-mastering-multiple-github-accounts-4l69</link>
      <guid>https://forem.com/mirkosaugo/juggling-your-git-personalities-a-guide-to-mastering-multiple-github-accounts-4l69</guid>
      <description>&lt;p&gt;Ever feel like you're living a double life? By day, you're a mild-mannered coder, by night... a swashbuckling Git master with a secret lair (your basement) and multiple GitHub accounts! But juggling those accounts can be a pain, like trying to wrangle kittens while wearing oven mitts. Fear not, fellow hero, for this guide will show you how to manage your GitHub personas with the grace of a seasoned spy 🕵️.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The Scenario:&lt;br&gt;
Let's say you have two GitHub identities: "WeekendWarriorRick" (because that's when all the coding magic happens) and "ProfessionalPete" (the responsible one who pays the bills). You want to seamlessly switch between them without causing any multidimensional paradoxes (or at least minimize them).&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
   Step 1: Forge Your Secret Weapons (SSH Keys)
&lt;/h2&gt;

&lt;p&gt;First things first, we need some digital secret weapons: SSH keys. Imagine them as your Batarangs, but for secure communication with GitHub. Navigate to your .ssh folder (like a digital Batcave) using this handy command:&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;cd&lt;/span&gt; ~/.ssh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, whip up some unique SSH keys for each account with this fancy code (replace the email addresses with your own, unless you want Rick to be fixing bugs for your boss):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh-keygen &lt;span class="nt"&gt;-t&lt;/span&gt; rsa &lt;span class="nt"&gt;-C&lt;/span&gt; &lt;span class="s2"&gt;"weekendwarriorrick@yahoo.com"&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; &lt;span class="s2"&gt;"WeekendWarriorRick"&lt;/span&gt;
ssh-keygen &lt;span class="nt"&gt;-t&lt;/span&gt; rsa &lt;span class="nt"&gt;-C&lt;/span&gt; &lt;span class="s2"&gt;"professionalpete@boringcorp.com"&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; &lt;span class="s2"&gt;"ProfessionalPete"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Important Note: When prompted for a passphrase (like a password for your secret lair), you can leave it blank for convenience, but remember, with great power comes great responsibility (and the risk of anyone accessing your accounts).&lt;/p&gt;




&lt;h2&gt;
  
  
   Step 2: Train Your Digital Butler (SSH Agent)
&lt;/h2&gt;

&lt;p&gt;The SSH Agent is like your Alfred – it keeps track of your SSH keys so you don't have to juggle them yourself. To add your spanking new keys, use these commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh-add &lt;span class="nt"&gt;-K&lt;/span&gt; ~/.ssh/WeekendWarriorRick
ssh-add &lt;span class="nt"&gt;-K&lt;/span&gt; ~/.ssh/ProfessionalPete 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
   Step 3: Plant Your Flag on GitHub (Public Keys)
&lt;/h2&gt;

&lt;p&gt;Now, head over to your GitHub accounts and add the public keys (the shiny counterparts of your private keys) like planting flags on conquered territories. You can find instructions on how to do this in GitHub's deepest, darkest secrets... I mean, documentation (it's probably under "SSH and GPG keys").&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pbcopy &amp;lt; ~/.ssh/WeekendWarriorRick.pub
pbcopy &amp;lt; ~/.ssh/ProfessionalPete.pub 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Sign in to Github Account&lt;/li&gt;
&lt;li&gt;Go to Settings &amp;gt; SSH and GPG keys &amp;gt; New SSH Key&lt;/li&gt;
&lt;li&gt;Paste your copied public key and give it a Title of your choice.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
   Step 4: Craft Your Master Control Panel (SSH Config File)
&lt;/h2&gt;

&lt;p&gt;The SSH config file is your mission control. Here, you'll set up aliases for each GitHub account so you can switch between them with ease. Create the file (if it doesn't exist) with a touch of your fingers (or this command):&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;touch &lt;/span&gt;config
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, open it in your preferred code editor (I use VSCode):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;code config
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, paste this code snippet into the file, replacing the usernames with your actual ones:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# WeekendWarriorRick to the rescue!
Host github.com-WeekendWarriorRick
  HostName github.com
  User git
  IdentityFile ~/.ssh/WeekendWarriorRick

# ProfessionalPete swoops in!
Host github.com-ProfessionalPete
  HostName github.com
  User git
  IdentityFile ~/.ssh/ProfessionalPete
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
   Step 5: Deploy Your Skills (Cloning Repositories)
&lt;/h2&gt;

&lt;p&gt;Finally, the moment of truth! Let's clone a repository using your newfound power. Navigate to your desired directory and unleash this command, replacing the username and repository name with your target:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone git@github.com-WeekendWarriorRick:WeekendWarriorRick/MyWeekendProject.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Remember:&lt;/p&gt;

&lt;p&gt;For existing repositories, you might need to set the correct user email and name:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config user.email &lt;span class="s2"&gt;"weekendwarriorrick@yahoo.com"&lt;/span&gt;
git config user.name &lt;span class="s2"&gt;"Weekend Warrior Rick"&lt;/span&gt;

&lt;span class="c"&gt;# Repeat for ProfessionalPete with his info&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Bonus Tip:
&lt;/h2&gt;

&lt;p&gt;Add remotes with aliases to your repositories so you can push and pull with ease:&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="c"&gt;# git remote add origin git@{mySSHHostUser}:{githubUser}/{repositoryName}.git&lt;/span&gt;
git remote add origin git@github.com-WeekendWarriorRick:WeekendWarriorRick/MyWeekendProject.git

&lt;span class="c"&gt;# Repeat for ProfessionalPete's remote&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you can push and pull like a pro using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git push
git pull
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Congratulations 🥳, code warrior! You can now seamlessly switch between your GitHub accounts and conquer the digital world, one commit at a time.&lt;/p&gt;

</description>
      <category>git</category>
      <category>github</category>
      <category>webdev</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Astro? Let's try it</title>
      <dc:creator>Mirko</dc:creator>
      <pubDate>Thu, 05 Jan 2023 14:51:53 +0000</pubDate>
      <link>https://forem.com/mirkosaugo/astro-lets-try-it-23m2</link>
      <guid>https://forem.com/mirkosaugo/astro-lets-try-it-23m2</guid>
      <description>&lt;p&gt;DEMO: &lt;a href="https://astro-rickandmorty.netlify.app/" rel="noopener noreferrer"&gt;https://astro-rickandmorty.netlify.app/&lt;/a&gt;&lt;br&gt;
CODE: &lt;a href="https://github.com/mirkosaugo/Astro-RAM" rel="noopener noreferrer"&gt;https://github.com/mirkosaugo/Astro-RAM&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Why this project
&lt;/h2&gt;

&lt;p&gt;As a developer I think it's important to jump in new challenges sometimes, not only because I have fun to try new technologies, but also because is a great opportunity to update my skills and have a full panoramic on what's going on out there.&lt;br&gt;
Today I want to share with you my feedback about a new framework called Astro.&lt;br&gt;
I'm not a good writer and the goal of this article is not to generate content, so I'll be very brief focusing on some framework principles, explaining my demo and at the end outline pros and cons.&lt;/p&gt;
&lt;h2&gt;
  
  
  What is Astro?
&lt;/h2&gt;

&lt;p&gt;As the payoff in homepage says Astro is a "web framework for building fast, content-focused websites".&lt;br&gt;
It's pretty new in this market, but I saw a lot of enthusiasm around it.&lt;br&gt;
Astro is a new kind of static site builder that renders your entire page to static HTML, removing all JavaScript from your final build by default. You can compose your website using differents UI components from your favorite JavaScript framework (React, Svelte, Vue, etc) extending your vite configuration with these plugins.&lt;/p&gt;
&lt;h2&gt;
  
  
  Main Concept: Islands
&lt;/h2&gt;

&lt;p&gt;"Astro Islands represent a leading paradigm shift for frontend web architecture."&lt;br&gt;
This principles allows Astro to deliver less javascript in the page, because it loads a small piece of code of a specific component only when become interactive (for example when react components enter in the viewport). So, there isn't a huge bundle size of unused javascript.&lt;/p&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%2Fxcxjiqmvt90489p3k1jx.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%2Fxcxjiqmvt90489p3k1jx.png" alt="Islands Architecture" width="800" height="677"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And, as the figure shows sometimes a lot of components in a website are pure static content, and in that case you don't want to ship unused javascript to the user right? (think about a blog post page, maybe the user click on google link and he/she visit only that page. So, why load all the entire JS bundle?).&lt;br&gt;
&lt;a href="https://docs.astro.build/en/concepts/islands/" rel="noopener noreferrer"&gt;Read more about Astro Islands&lt;/a&gt;.&lt;/p&gt;


&lt;h2&gt;
  
  
  The project
&lt;/h2&gt;

&lt;p&gt;Okay, now let's jump in a real case.&lt;br&gt;
I developed this project using the &lt;a href="https://rickandmortyapi.com/" rel="noopener noreferrer"&gt;RickAndMortyAPI&lt;/a&gt; (I'm a big fan of it), typescript and tailwind.&lt;br&gt;
You can find the code in my Github repo and the demo at &lt;a href="https://github.com/mirkosaugo/Astro-RAM" rel="noopener noreferrer"&gt;this link&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In Astro components you can write js code in 2 different ways. On top of the page that is compiled at build time (server side) or inside a normal script tag for client actions:&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="o"&gt;---&lt;/span&gt;
&lt;span class="c1"&gt;// Server Side (compiled on build process)&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Contact&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../components/Contact.jsx&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Location&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../components/Location.astro&lt;/span&gt;&lt;span class="dl"&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;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://randomuser.me/api/&lt;/span&gt;&lt;span class="dl"&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;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&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;randomUser&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;results&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="o"&gt;---&lt;/span&gt;
&lt;span class="c"&gt;&amp;lt;!--&lt;/span&gt; &lt;span class="nx"&gt;Markup&lt;/span&gt; &lt;span class="o"&gt;--&amp;gt;&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h2&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;randomUser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;first&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;randomUser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;last&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h2&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;button&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;interactivity&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Click&lt;/span&gt; &lt;span class="nx"&gt;Me&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/button&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;
&lt;span class="c"&gt;&amp;lt;!--&lt;/span&gt; &lt;span class="nx"&gt;JS&lt;/span&gt; &lt;span class="nx"&gt;Client&lt;/span&gt; &lt;span class="nx"&gt;Side&lt;/span&gt; &lt;span class="o"&gt;--&amp;gt;&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;script&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;button&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;interactivity&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;button&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;click&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;alert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Hello World!&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;lt;&lt;/span&gt;&lt;span class="sr"&gt;/script&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the first case, that part is used to fetch and display content when the page is rendered and/or to read props passed from another component.&lt;br&gt;
These components are oriented to be static, so you don't have access to states in page (like detect outside the component when a menu is open or closed) or custom events handling like &lt;code&gt;onClick&lt;/code&gt; in react, but you can use the classic querySelector to trigger events and knows the status of the DOM.&lt;/p&gt;

&lt;h2&gt;
  
  
  Examples
&lt;/h2&gt;

&lt;h4&gt;
  
  
  Astro components and Framework components (in my case, react)
&lt;/h4&gt;

&lt;p&gt;Astro components are very easy to use, BUT you can't use it inside a framework components (like react).&lt;br&gt;
In my case I ran into this when i created a static component &lt;code&gt;&amp;lt;CharacterCard /&amp;gt;&lt;/code&gt; where i could use also a useful astro plugin to generate blurred images on lazy images in the character card.&lt;br&gt;
I used those cards in HomePage where the data comes from a fetch at build time and the content is static.&lt;br&gt;
But, let's say that i want to create a search component in react (you can see it in HomePage) and loop all the items after the response. Well, in this case I can't reuse the same component to render the list because you can't use astro static components inside framework components. Or better, you can use the &lt;code&gt;&amp;lt;slot /&amp;gt;&lt;/code&gt; property to render html inside of it, but you can't pass props to another astro component or loop it, so it's pretty useless in my opinion.&lt;br&gt;
&lt;a href="https://docs.astro.build/en/core-concepts/framework-components/" rel="noopener noreferrer"&gt;Read more about Astro and UI Frameworks&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Do you ship less for real?
&lt;/h2&gt;

&lt;p&gt;The performance are unbeatable if compared with NextJS for example, but actually Astro always import js code in the document, when is written in the script tag inside an Astro component, even if the component is not in the viewport or called (like for framework components).&lt;br&gt;
So it isn't like &lt;a href="https://qwik.builder.io/" rel="noopener noreferrer"&gt;Qwik&lt;/a&gt; where js is loaded only when a specific element in the dom becomes interactive and is awake by the user.&lt;/p&gt;




&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;h4&gt;
  
  
  PROS
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Easy to understand and use&lt;/li&gt;
&lt;li&gt;Better performance compared for example with NextJS&lt;/li&gt;
&lt;li&gt;You can use your favorite framework (react, vue, svelte, etc) with Astro&lt;/li&gt;
&lt;li&gt;Good community: There are a lot of useful plugins to use in Astro (like the plugin to generate blurred images for lazy images)&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
   CONS
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;You cant combine SSR pages and SSG pages in Astro (for example if you want to read params from a search form you need to transform your entire project in SSR: this causes a big issue for SEO because you lose the power of the static content)&lt;/li&gt;
&lt;li&gt;Framework components (like react) cant use Astro (static) components&lt;/li&gt;
&lt;li&gt;Astro components aren't reactive, so you cannot manage states when they change&lt;/li&gt;
&lt;li&gt;if Framework components are in client:idle or client:load mode, they import the entire code when the page is loaded (I would like to have the client:load mode in the build process and then serve it as client:visible mode)&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%2F0a3ghk04l8g1tay5fgiw.gif" 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%2F0a3ghk04l8g1tay5fgiw.gif" alt="Image description" width="1024" height="1024"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;At the end, in my opinion and in poor words, Astro is good for small blogs and static/creative websites, but not for web applications where, for example, interactivity is the main focus (like: searching, filtering, ordering, shared states ecc...) because in that case you lost the real power of Astro.&lt;/p&gt;

</description>
      <category>emptystring</category>
    </item>
  </channel>
</rss>
