<?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: Alessandro</title>
    <description>The latest articles on DEV Community by Alessandro (@alessandrogiuzio).</description>
    <link>https://dev.to/alessandrogiuzio</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%2F635088%2Ff285759e-53b6-4b68-a7c5-8f2e056bbf31.jpg</url>
      <title>DEV Community: Alessandro</title>
      <link>https://dev.to/alessandrogiuzio</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/alessandrogiuzio"/>
    <language>en</language>
    <item>
      <title>Grow your shop</title>
      <dc:creator>Alessandro</dc:creator>
      <pubDate>Tue, 28 Dec 2021 12:01:15 +0000</pubDate>
      <link>https://dev.to/alessandrogiuzio/grow-your-shop-32ff</link>
      <guid>https://dev.to/alessandrogiuzio/grow-your-shop-32ff</guid>
      <description>&lt;h2&gt;
  
  
  Today’s era of digital connection requires more than just providing a good service to sell - you have to market it, too. Regardless of the type of business you run, a robust online presence can increase the awareness of your brand, grow your audience, engage customers, and assist you in increasing sales.
&lt;/h2&gt;

&lt;p&gt;Having a website that resonates with your target audience is the doorway to all of this. Websites are usually the first point of contact between your business and your customers. A well-designed website can serve as an interface for delivering products and services and a lead-generation tool.&lt;/p&gt;

&lt;p&gt;However, your visitors will likely shut down your site if it takes too long to load, has a confusing layout, or is not optimized for mobile devices - and will leave with a negative impression of your brand – forever! Thankfully, a web designer can assist you in providing a smooth user experience while also looking good.&lt;/p&gt;

&lt;p&gt;Still, a good website's components are not just visible to the bare eyes but overall users' experience. The days when a developer's primary concern was fitting a website into a single screen are long gone. With the introduction of various mobile devices, the requirement for a website that works flawlessly on all of them has become critical.&lt;/p&gt;

&lt;p&gt;And with balancing search engine optimization (SEO) and graphic design as one of the most difficult aspects of modern website design, you need more than just any designer/developer. Unfortunately, too many businesses neglect this kind of user-experience issue on their websites, which costs them a lot of money in the long run. This doesn’t have to be your case hence why I’m sharing the biggest website misses’ businesses face and how to address them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Out of Date Mobile Experience
&lt;/h2&gt;

&lt;p&gt;As previously said, With the popularity of mobile devices on the rise, it's critical that customers can simply access your website while on the go, either on desktop/laptop screens and mobile hand-held devices as they voyage on the bus, in a meeting, or even at home. Furthermore, responsive web design eliminates the need to spend money building for each and every device on the market when one can suffice effectively.&lt;/p&gt;

&lt;h2&gt;
  
  
  Not SEO - Optimized
&lt;/h2&gt;

&lt;p&gt;The importance of having a search engine optimized website in today's highly competitive online business world cannot be overstated. A good SEO website design provides online business owners with cost-effective options for optimizing their websites to become search engine friendly. On the other hand, SEO website design presents both an opportunity and a challenge. Obviously, every website owner wishes to rank in search engine results pages (SERPs). At the same time, they want an attractive website. The Holy Grail of web design is where SEO and SERP optimization meets to give high-quality experience, which is where many designers fail. If your ultimate objective is to optimize your website for organic search engine traffic, you'll want to make sure your designer builds with SEO in mind.&lt;/p&gt;

&lt;h2&gt;
  
  
  Unclear Information
&lt;/h2&gt;

&lt;p&gt;With the thought of a new website comes the desire to look cool and show off aesthetically pleasing designs – which is normal. However, your design should align with the messaging been passed across. Look at your website. Can your target audience identify you at a glance? Do the design cause distractions to onboarding reading? Your designer or developer must have a keen eye for these details as they can make or mar your online presence as well.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.agencyga.com/blog.html"&gt;Original posted here&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Learning Svelte Part # 5</title>
      <dc:creator>Alessandro</dc:creator>
      <pubDate>Sun, 21 Nov 2021 06:54:07 +0000</pubDate>
      <link>https://dev.to/alessandrogiuzio/learning-svelte-part-5-ici</link>
      <guid>https://dev.to/alessandrogiuzio/learning-svelte-part-5-ici</guid>
      <description>&lt;h2&gt;
  
  
  Arrays &amp;amp; Objects
&lt;/h2&gt;

&lt;p&gt;Hello developers and welcome back to this series about how i am learning Svelte.&lt;br&gt;
In today's post i will explain how to update Arrays and Objects, the update happen reactively when we change values.&lt;/p&gt;

&lt;p&gt;Let’s try with an example:&lt;/p&gt;

&lt;p&gt;First of all, we’re going to declare a new variable called frameworks.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;script&amp;gt;
let frameworks = ["Vue", "React","Angular", "Ember"];
&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And we will loop trough it, in th HTML section:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;ul&amp;gt;
{#each frameworks as framework}
  &amp;lt;li&amp;gt;{framework}&amp;lt;/li&amp;gt;
{/each}
&amp;lt;/ul&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Essentially we are creating a new list item for each one out of our Frameworks, the result in our html file:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dQOJV_4G--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cmls1iq8bsi73l1rytrm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dQOJV_4G--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cmls1iq8bsi73l1rytrm.png" alt="Html result" width="289" height="146"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now to demonstrate the reactivity we are going to add another item to our list, let’s say after a 3 seconds delay.&lt;/p&gt;

&lt;p&gt;To do that we need a new function:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jYh01yvz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mlermz72ru999rq999p7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jYh01yvz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mlermz72ru999rq999p7.png" alt="Function" width="630" height="150"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We would expect now to have the last item added to our list, but it's not the case, we need another step before accomplishing the result.&lt;/p&gt;

&lt;p&gt;Svelte it's not able to catch the change yet, so it's not reflected inside the list.&lt;/p&gt;

&lt;p&gt;To make Svelte to pick up the change we only need to write another line of code on our function, that it's going to work because we will use an equal operator that it's re-assigning the value of &lt;strong&gt;frameworks&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The new function: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3gPN4FZc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2de7v4twalx7t8rmlcna.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3gPN4FZc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2de7v4twalx7t8rmlcna.png" alt="frameworks" width="438" height="163"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now the result is the one expected:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_2HGXTvv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ngsx20m05ducxf46owy0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_2HGXTvv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ngsx20m05ducxf46owy0.png" alt="Adde Svelte" width="135" height="201"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Another way to achieve the same result it's using the spread syntax in our variable: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Ew8nuJp0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/92ojyqx7fxuzksoc0uof.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ew8nuJp0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/92ojyqx7fxuzksoc0uof.png" alt="spread operator" width="447" height="109"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is the equivalent to using "push", also we use the equal operator.&lt;/p&gt;

&lt;p&gt;For the Objects it's the same but just a little bit easier: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--og_1CqHi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7q6yztykg0bwxt180dlx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--og_1CqHi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7q6yztykg0bwxt180dlx.png" alt="Object operator" width="334" height="265"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is it for my weekly update, see you next Sunday, until then you can find me on &lt;a href="https://twitter.com/giuzioale"&gt;Twitter&lt;/a&gt;&lt;/p&gt;

</description>
      <category>svelte</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>100daysofcode</category>
    </item>
    <item>
      <title>Learning Svelte Part #4</title>
      <dc:creator>Alessandro</dc:creator>
      <pubDate>Sun, 14 Nov 2021 18:44:14 +0000</pubDate>
      <link>https://dev.to/alessandrogiuzio/learning-svelte-part-4-155m</link>
      <guid>https://dev.to/alessandrogiuzio/learning-svelte-part-4-155m</guid>
      <description>&lt;h2&gt;
  
  
  Props and Components
&lt;/h2&gt;

&lt;p&gt;Hello developers, welcome back to my series of articles about my journey to learn Svelte, this is my 4th post about it, and so far it’s very helpful for my learning, writing down my steps make it public make a good contribution to my knowledge.&lt;/p&gt;

&lt;p&gt;Today I am writing about Props and Components.&lt;/p&gt;

&lt;p&gt;Normally, a Svelte website is made with of many different components: App.svelte, Header.svelte, Content.svelte, Footer.svelte and so on. &lt;br&gt;
All this components will be structured to make up the full page, the root component it’s the App.svelte, this component will be directly deployed in the Dom by the main.JS file.&lt;/p&gt;

&lt;p&gt;We will nest all the others components with it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DnYMp9QD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ikujhpxpf5hked6f6dnm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DnYMp9QD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ikujhpxpf5hked6f6dnm.png" alt="Svelte components structure" width="800" height="452"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The question is: why we need to split our webapp in so many different pieces and not write all the code in the App.svelte root component?&lt;br&gt;
The main reason is to keep your code easy to read, tidy and modular.&lt;br&gt;
 Imagine we put everything in one module, the chances that our code will be disorganized are very high.&lt;/p&gt;

&lt;p&gt;Another reason to split in different modules is that with this method we can easily reuse it, we can create components to use whenever we need.&lt;/p&gt;

&lt;p&gt;We can easily import our components in the App.svelte  using the syntax import&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--c8dL33G0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5je3lsnog2qy3xmc0cmf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--c8dL33G0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5je3lsnog2qy3xmc0cmf.png" alt="Script hero" width="595" height="125"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And then we will display it in our  HTML like in the follow example:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--myzrrzjb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qyzubw0y8283hlo6bq6n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--myzrrzjb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qyzubw0y8283hlo6bq6n.png" alt="hero" width="634" height="101"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If we want to change any data in the reused component, we can do that, using props.&lt;/p&gt;

&lt;p&gt;How can we pass props to a component?&lt;/p&gt;

&lt;p&gt;We need to declare the props we want to pass in, in the component itself, we can call it how we like it and we need to set it to a value that ca be: a string, an object, could be an integer. When the components it’s created it will read the props and the value&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--OfY34D8T--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u5mxcy99yy3w8iu77c2r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OfY34D8T--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u5mxcy99yy3w8iu77c2r.png" alt="properties " width="632" height="102"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To access the prop inside the Footer component we need to declare that we are going to use that variable called “prop” (you can name it how you like most) &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NMj5UGqu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jsbtde7r3rf66x2xwp4y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NMj5UGqu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jsbtde7r3rf66x2xwp4y.png" alt="Image description" width="633" height="255"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We declare the variable “prop”,  and set to “export” , so now this way we can access the value outside the component.&lt;/p&gt;

&lt;p&gt;That’s it for my contribution today, it’s difficult for me write in English but I will keep going, please feel free to leave a comment and roast my explanation.&lt;/p&gt;

</description>
      <category>svelte</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Learning Svelte</title>
      <dc:creator>Alessandro</dc:creator>
      <pubDate>Sun, 07 Nov 2021 17:10:01 +0000</pubDate>
      <link>https://dev.to/alessandrogiuzio/learning-svelte-2enb</link>
      <guid>https://dev.to/alessandrogiuzio/learning-svelte-2enb</guid>
      <description>&lt;h1&gt;
  
  
  Input Data Binding
&lt;/h1&gt;

&lt;p&gt;Hello friends, this is my third blog post ever, and to tell the truth it's quite difficult for me keeping this challenge up and running, the big problem, i think it's that my mother language it's italian but every day i speak spanish!&lt;/p&gt;

&lt;p&gt;But i am here, and i need to do it, it's help me on my journey to become web developer one day soon.&lt;/p&gt;

&lt;p&gt;This is post it's very short, i will publish another one about Data Binding, next week to complete my "lesson".&lt;/p&gt;

&lt;p&gt;As you now, Svelte is a “radical new approach to building user interfaces”, according to the official documentation. &lt;/p&gt;

&lt;p&gt;In practice, Svelte is quite similar to JavaScript frameworks like React, Vue etc.&lt;/p&gt;

&lt;p&gt;Today i will write about Input data binding.&lt;/p&gt;

&lt;p&gt;Input bindings are essentially just a way you can keep variables inside your components in sync with input fields.&lt;/p&gt;

&lt;p&gt;They are very handy when design forms  or having any form of data entry.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;bind:property&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let’s start with the most common form of binding you’ll often use, which you can apply using bind:value. You take a variable from the component state, and you bind it to a form field:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; &amp;lt;script&amp;gt;

 Let name = “Alessandro”

 &amp;lt;/script&amp;gt;

 &amp;lt;p&amp;gt; Your name is: {name}

 &amp;lt;input bind:value = {name}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now if name changes the input field will update its value. And the opposite is true, as well: if the form is updated by the user, the name variable value changes.&lt;/p&gt;

&lt;p&gt;We successfully binded name variable to the input field, when the user makes change to the input field it is going to update the data within your components, this is the most basic example .&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;bind:value&lt;/strong&gt; works on all flavors of input fields (type="number", type="email" and so on), but it also works for other kind of fields, like &lt;strong&gt;textarea&lt;/strong&gt; and &lt;strong&gt;select&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;Let's see an example:&lt;/p&gt;



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

&amp;lt;script&amp;gt;
let coffeeOrigins = ["Ethiopia","Colombia","Sumatra","India","Nicaragua"];
let selected;
&amp;lt;/script&amp;gt;

&amp;lt;main&amp;gt;

&amp;lt;p&amp;gt; Your have choose: {selected || 'nothing'}&amp;lt;/p&amp;gt;

{#each coffeeOrigins as origin}

&amp;lt;label&amp;gt;
&amp;lt;input type="radio" bind:group={selected} value={origin}/&amp;gt;
{origin}
&amp;lt;/label&amp;gt;
{/each}

&amp;lt;/main&amp;gt;


Thank you for reading, see you next sunday!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>svelte</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>100daysofcode</category>
    </item>
    <item>
      <title>Beginner to beginner introduction to Svelte</title>
      <dc:creator>Alessandro</dc:creator>
      <pubDate>Sun, 31 Oct 2021 08:31:24 +0000</pubDate>
      <link>https://dev.to/alessandrogiuzio/beginner-to-beginner-introduction-to-svelte-part-2-3kgh</link>
      <guid>https://dev.to/alessandrogiuzio/beginner-to-beginner-introduction-to-svelte-part-2-3kgh</guid>
      <description>&lt;h2&gt;
  
  
  Conditional Rendering
&lt;/h2&gt;

&lt;p&gt;Hello friends, this is the second chapter of my series about Svelte, a new idea of framework.&lt;/p&gt;

&lt;p&gt;This series of posts are not intended to teach anyone, they are basically a way for me to learn better the topic, so be free to roast me or help me where I make mistakes.&lt;/p&gt;

&lt;p&gt;What is Conditional Rendering?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--a4wtG5GC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7w57qbjzxfjg7t9seo29.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--a4wtG5GC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7w57qbjzxfjg7t9seo29.png" alt="Question mark" width="295" height="307"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As the official documentation says:&lt;br&gt;
 &lt;strong&gt;“ Whereas traditional frameworks like React and Vue do the bulk of their work in the browser, Svelte shifts that work into a compile step that happens when you build your app“&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;I can’t really say my opinion on other frameworks, I am really new in this area, so I’ll take it to granted!&lt;/p&gt;

&lt;p&gt;In the last few days, I’ve been playing with it, and I can tell you that it’s really easy to grasp it and hold it and at the same time if you are new to frameworks, the syntax it’s easy to learn.&lt;/p&gt;

&lt;p&gt;For me the difficult part it’s, no it’s not difficult, let’s say unusual, it’s working with different components.&lt;/p&gt;

&lt;p&gt;I usually play with single app or a single page with a single style sheet and another for JavaScript, but I see the convenience and speed of working on small chunks of code and puzzle it together, I like it!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Remember that this is all new for me, using the JavaScript power in this way it’s vitalizing my knowledge about it.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Today i am writing about: Conditional Rendering&lt;/p&gt;

&lt;p&gt;Conditional rendering means the way we show or hide elements from the Dom, based on JavaScript conditions, that we write directly in the HTML.&lt;/p&gt;

&lt;p&gt;Render a component is extremely simple:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;main&amp;gt;

&amp;lt;h1&amp;gt;Hello World &amp;lt;/h1&amp;gt;

&amp;lt;/main&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Basic &lt;code&gt;if&lt;/code&gt; conditions start with a special syntax:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{#if isActive} // we open the condition with "#"

&amp;lt;h1&amp;gt; Your title goes here &amp;lt;/h1&amp;gt; // HTML

{/if}  // We close the condition with "/"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The full example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;script&amp;gt;
  Let isActive = true;
&amp;lt;/script&amp;gt;
&amp;lt;main&amp;gt;
{#if isActive}
&amp;lt;h1&amp;gt; Show your title &amp;lt;/h1&amp;gt;
{/}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We render the h1 element into the dom if isActive property is true.&lt;/p&gt;

&lt;p&gt;Now we can chain differents statements, another &lt;code&gt;else&lt;/code&gt;block or an &lt;code&gt;else if&lt;/code&gt; block and so on.&lt;/p&gt;

&lt;p&gt;A very good place to play with Svelte is the REPL on the Svelte official page, the follow link is related for the &lt;a href="https://svelte.dev/repl/b023c56cdf0d42819fe7ccc38ea75c41?version=3.44.0"&gt;Conditional Rendering&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That’s it for my contribution about conditional rendering, there is a lots more to add to it, but this set of my first post will be not very long, because I am still not use to it, but I promise I will improve my writer skills along my improvements with Svelte .&lt;/p&gt;

&lt;p&gt;Happy Halloween! &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GVgCatUa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0uuz9pbjoe66335646e1.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GVgCatUa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0uuz9pbjoe66335646e1.jpeg" alt="halloween pumpkin" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;See you next Sunday, during the week you can find me on &lt;a href="https://twitter.com/giuzioale"&gt;Twitter&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>svelte</category>
      <category>100daysofcode</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>My Svelte Journey</title>
      <dc:creator>Alessandro</dc:creator>
      <pubDate>Sun, 24 Oct 2021 16:31:35 +0000</pubDate>
      <link>https://dev.to/alessandrogiuzio/my-svelte-journey-n17</link>
      <guid>https://dev.to/alessandrogiuzio/my-svelte-journey-n17</guid>
      <description>&lt;p&gt;&lt;a href="https://media.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%2Frwtumvon4uavpyqkdujs.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Frwtumvon4uavpyqkdujs.jpg" alt="person holding a Svelte logo"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Beginner to beginner Introduction to Svelte
&lt;/h2&gt;

&lt;p&gt;The goal for this tutorial is to share my learning experience with Svelte, also this is my first post in this platform, roast me but ... be nice!&lt;/p&gt;

&lt;p&gt;In November 2020 I decided to change my career and started to learn to code. At first I was decided to prepare the exams for: &lt;br&gt;
CCNA 200-301, but then I realized that I wanted to learn web development, so I started with the basics: HTML, CSS, JavaScript and so many tools that are needed for the job!&lt;/p&gt;

&lt;p&gt;After these first 11 months it's time for the JS frameworks!&lt;br&gt;
I decided to start with Svelte because I think it's gonna be implemented in vaste scale in the next years, and so many people are talking about it right now!&lt;/p&gt;

&lt;p&gt;One of these people is Mike from &lt;a class="mentioned-user" href="https://dev.to/htmleverything"&gt;@htmleverything&lt;/a&gt;.&lt;br&gt;
 Probably you know him from the podcast: &lt;a href="https://www.htmlallthethings.com/podcast" rel="noopener noreferrer"&gt;HTML All The Things&lt;/a&gt;.&lt;br&gt;
Mike is very enthusiastic about Svelte, and I have to confess that I have chosen this framework following his words.&lt;/p&gt;

&lt;p&gt;This post it's mostly a follow up of Mike's course, so all the credits goes to him, for me this is just another way to keep learning by writing and "teaching" others.&lt;/p&gt;

&lt;p&gt;For my first post I will cover just the setup and first step, more weekly updates will follow my study.&lt;/p&gt;
&lt;h2&gt;
  
  
  Svelte it's simple to use and allows us create and build apps very fast.
&lt;/h2&gt;

&lt;p&gt;Svelte is not a library or a framework, it is a compiler.&lt;/p&gt;

&lt;p&gt;This means that your code is not shipped in combination with packages to a browser, but it gets compiled to something else, this something is shipped to the browser. &lt;/p&gt;

&lt;p&gt;Because all code gets compiled, the total size decreases, but the performance increases. &lt;/p&gt;

&lt;p&gt;Besides, it allows you to break away from writing everything inside a JavaScript function, and have its optimized format.&lt;/p&gt;
&lt;h2&gt;
  
  
  The Setup step by step
&lt;/h2&gt;

&lt;p&gt;The only tool required it's &lt;a href="//Node.js"&gt;Node.js&lt;/a&gt; installed in your machine and your code editor of choice&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Setting up the project directory using &lt;a href="https://vitejs.dev/" rel="noopener noreferrer"&gt;Vite&lt;/a&gt; &lt;br&gt;
   &lt;code&gt;npm init vite@latest&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;In the Svelte project: &lt;code&gt;npm install&lt;/code&gt; and &lt;code&gt;npm run dev&lt;/code&gt; &lt;/p&gt;

&lt;p&gt;After that we will stop the server with control + c&lt;/p&gt;

&lt;p&gt;Next thing installing &lt;a href="https://tailwindcss.com/" rel="noopener noreferrer"&gt;Tailwindcss&lt;/a&gt; &lt;code&gt;npx svelte-add@latest  tailwindcss&lt;/code&gt;&lt;br&gt;
   This will add some dependencies to our project folder&lt;/p&gt;

&lt;p&gt;Again we will &lt;code&gt;npm -i&lt;/code&gt; and after that &lt;code&gt;npm run dev&lt;/code&gt; to restart the server&lt;/p&gt;

&lt;p&gt;Importing &lt;a href="https://daisyui.com/" rel="noopener noreferrer"&gt;DaisyUI&lt;/a&gt; (component library) with: &lt;code&gt;npm i daisyui&lt;/code&gt; and we will paste in the plugins of the tailwind.config.cjs file &lt;code&gt;require('daisyui'),&lt;/code&gt; and save&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Delete all the CSS, HTML and Scripts already present in the file and the folder: "lib".&lt;/p&gt;

&lt;p&gt;That's it to set up the project, let's now dive in the components format and how to use it,&lt;/p&gt;
&lt;h2&gt;
  
  
  Components
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Svelte it's a single file components architecture.&lt;/strong&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Script, Html , Style .
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;script&amp;gt;
 JavaScript goes here
 &amp;lt;/script&amp;gt;


HTML  goes here


&amp;lt;style&amp;gt;
styles goes here
&amp;lt;/style&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The &lt;code&gt;script&lt;/code&gt; block contains the JavaScript that we are gonna use to run a component instance.&lt;/p&gt;

&lt;p&gt;All the variables declared (or imported) are visible and linkable to the markup section.&lt;/p&gt;

&lt;p&gt;The code we write in the components it can be shared between multiple instances.&lt;br&gt;
 To made reactive statement (to access their value), we prefix with a: &lt;code&gt;$&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let count = 0
$: doubled = count * 2;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Anytime the value of &lt;code&gt;count&lt;/code&gt; change, the &lt;code&gt;doubled&lt;/code&gt;value change as well, the dollar sign make reactive the component.&lt;/p&gt;

&lt;p&gt;That's it for my first post about Svelte, and my first blog post ever.&lt;/p&gt;

&lt;p&gt;I will try to keep this as an opportunity to learn and write constantly every week or so depending on my progress on this framework.&lt;/p&gt;

&lt;p&gt;Next week i will write about: Conditional Rendering.&lt;/p&gt;

</description>
      <category>svelte</category>
      <category>beginners</category>
      <category>100daysofcode</category>
    </item>
  </channel>
</rss>
