<?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: Pablo Marcano</title>
    <description>The latest articles on Forem by Pablo Marcano (@stiv_ml).</description>
    <link>https://forem.com/stiv_ml</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%2F78414%2F430a75e1-a00e-415d-a2d8-730cedbad1cb.jpg</url>
      <title>Forem: Pablo Marcano</title>
      <link>https://forem.com/stiv_ml</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/stiv_ml"/>
    <language>en</language>
    <item>
      <title>The Weekly Animation - 1 + 1/2</title>
      <dc:creator>Pablo Marcano</dc:creator>
      <pubDate>Wed, 11 Nov 2020 12:41:22 +0000</pubDate>
      <link>https://forem.com/stiv_ml/the-weekly-animation-1-1-2-19b</link>
      <guid>https://forem.com/stiv_ml/the-weekly-animation-1-1-2-19b</guid>
      <description>&lt;p&gt;In the &lt;a href="https://dev.to/stiv_ml/the-weekly-animation-1-dk7"&gt;previous article&lt;/a&gt; We learned how to animate the non-interactive part of &lt;a href="https://dribbble.com/shots/14495756-click-n-drag-to-start-interaction" rel="noopener noreferrer"&gt;this animation&lt;/a&gt; From &lt;a href="https://dribbble.com/lukaskus" rel="noopener noreferrer"&gt;Lukas Kus&lt;/a&gt; using GSAP Timeline. Now in order to completely replicate what was done on the dibbble it would be cool to simulate the user dragging on what we did previously to reveal an image, and that's exactly what we're doing today.&lt;/p&gt;

&lt;p&gt;Again, here's the end result. &lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/stivml/embed/GRqGRPG?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h3&gt;
  
  
  Setting up the background image
&lt;/h3&gt;

&lt;p&gt;We'll need to carefully set up the background image behind the main circle, this will depend heavily on how you first positioned your SVG on the canvas. On the example above it's done by wrapping everything on the same &lt;code&gt;div&lt;/code&gt;and absolutely positioning it using the&lt;code&gt;top&lt;/code&gt; and &lt;code&gt;left&lt;/code&gt; css properties. You can see it on line 58 of the css tab.&lt;/p&gt;

&lt;p&gt;I used &lt;a href="https://picsum.photos/" rel="noopener noreferrer"&gt;Lorem Picsum&lt;/a&gt; to fetch a different image of the height I wanted everytime to get a nicer result as well.&lt;/p&gt;

&lt;h3&gt;
  
  
  The draggable interaction
&lt;/h3&gt;

&lt;p&gt;In order to make the image move and then fade away after reaching certain threshold I'll be using a GSAP &lt;code&gt;Draggable&lt;/code&gt; which simplifies the process of making any DOM element Draggable. &lt;/p&gt;

&lt;p&gt;First of all, let's arrange our SVG in a way we could move all elements we want to be movable at the same time, as currently the &lt;code&gt;Draggable&lt;/code&gt; plugin does not support moving non-nested elements at the same time natively. &lt;/p&gt;

&lt;p&gt;To do so, I added a &lt;code&gt;&amp;lt;g&amp;gt;&lt;/code&gt; to surround the fill part of the main circle and the small orange dot that remains. See HTML line 7.&lt;/p&gt;

&lt;p&gt;After that we need to create the actual function that makes the element Draggable. It's done on line 84, let's go over the main parts of it.&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;dg&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Draggable&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#movable&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="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;x, y&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;edgeResistance&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;0.8&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;bounds&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;.inner-circle&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;inertia&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;Draggable.create&lt;/code&gt; function targets everything inside the tag with id &lt;code&gt;#movable&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;type&lt;/code&gt; parameter defines the axis we want to move on, in our case we want to freely move around so we use both &lt;code&gt;x,y&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;edgeResistance&lt;/code&gt; is a value between 0 and 1 that defines how much does the image can go outside the boundaries and the 'strength' the boundaries apply to bring the main item back.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;bounds&lt;/code&gt; is the query of an element that should contain the element we provided when creating the draggable. It's important that the element is bigger than the draggable, and that it contains it at least visually so we can actually see our animation. In this case is the inner circle we draw with the animation.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;inertia&lt;/code&gt; gives a sense of smoothness to our draggable when manipulating it with the dom.&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;el&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;dg&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="s2"&gt;drag&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="nx"&gt;e&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="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;shouldOpen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;dg&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;isActive&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;closingTl&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;play&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
      &lt;span class="nx"&gt;isActive&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&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;To make the background image appear after we pass a certain treshold we should track whether the draggable element moved the way we wanted, so we listen whenever the element is dragged and check if the position is inside the boundarieswe difine within &lt;code&gt;shouldOpen&lt;/code&gt;.&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="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;shouldOpen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;dg&lt;/span&gt;&lt;span class="p"&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;threshold&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;25&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;isOutOfXBoundaries&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
    &lt;span class="nx"&gt;dg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;dg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;minX&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;threshold&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nx"&gt;dg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;dg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;maxX&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;threshold&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;isOutOfYBoundaries&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
    &lt;span class="nx"&gt;dg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;y&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;dg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;minY&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;threshold&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nx"&gt;dg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;y&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;dg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;maxY&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;threshold&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;isOutOfXBoundaries&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nx"&gt;isOutOfYBoundaries&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;The shouldOpen function simply receives a draggable event and checks if it's within a range i arbitrarily designed, not too much to see here.&lt;/p&gt;

&lt;p&gt;If the image is outside the range we defined then we trigger a new animation that fades out the SVG and brings up the image itself. And we're done!&lt;/p&gt;

&lt;p&gt;The point where it all connects it's on line 9 where we define&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;tl&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;TimelineMax&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;repeat&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="na"&gt;onComplete&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;addDraggable&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We're using the addDragable function only after the animation completes, since we don't want the user to be able to move the animation while it's still playing.&lt;/p&gt;

&lt;p&gt;It may look like a lot of code and orchestration at firts, but just think of how much more complex it would have been using plain css animations and js. Also, by tweaking some values you could make the animation play backwards, or replay it on demand as I've done on the code example. &lt;/p&gt;

&lt;p&gt;If you liked this post, make sure to leave a like and follow me on DEV.TO and twitter as &lt;a class="mentioned-user" href="https://dev.to/stiv_ml"&gt;@stiv_ml&lt;/a&gt;&lt;/p&gt;

</description>
      <category>css</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>The Weekly Animation - 1</title>
      <dc:creator>Pablo Marcano</dc:creator>
      <pubDate>Mon, 09 Nov 2020 12:49:38 +0000</pubDate>
      <link>https://forem.com/stiv_ml/the-weekly-animation-1-dk7</link>
      <guid>https://forem.com/stiv_ml/the-weekly-animation-1-dk7</guid>
      <description>&lt;p&gt;In my journey to add tools to my belt as a web developer, and find fun and nice looking projects to do on the way, I came across two courses on &lt;a href="https://frontendmasters.com" rel="noopener noreferrer"&gt;Frontend Masters&lt;/a&gt; that caught my eye. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://frontendmasters.com/courses/canvas-webgl/" rel="noopener noreferrer"&gt;Creative Coding by Matt DesLauriers&lt;/a&gt; and &lt;a href="https://frontendmasters.com/courses/svg-essentials-animation/" rel="noopener noreferrer"&gt;SVG essentials and animations by Sarah Drasner&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When completing them I was stoked and excited to apply my new knowledge on something practical, so I went to &lt;a href="https://dribbble.com/" rel="noopener noreferrer"&gt;dribbble&lt;/a&gt; and looked for a nice animation to remix. As I learned a lot along the way, and plan to keep doing a similar process for some time so I decided to share my experiences on a weekly installment, following &lt;a href="https://www.swyx.io/learn-in-public/" rel="noopener noreferrer"&gt;Shawn's learn in public approach&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Today, we're going to be remixing &lt;a href="https://dribbble.com/shots/14495756-click-n-drag-to-start-interaction" rel="noopener noreferrer"&gt;this animation&lt;/a&gt; From &lt;a href="https://dribbble.com/lukaskus" rel="noopener noreferrer"&gt;Lukas Kus&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Prerequisites
&lt;/h3&gt;

&lt;p&gt;I've used GreenSock's &lt;a href="https://greensock.com/draggable/" rel="noopener noreferrer"&gt;Draggable&lt;/a&gt;, and &lt;a href="https://greensock.com/drawsvg/" rel="noopener noreferrer"&gt;TweenMax DrawSVG&lt;/a&gt; products, which are usually paid, but can be used freely on &lt;a href="https://codepen.io/" rel="noopener noreferrer"&gt;codepen&lt;/a&gt;. I also used Adobe Illustrator for preparing the svg, but any editor that allows creating and exporting SVGs.&lt;/p&gt;

&lt;p&gt;That said, some basic knowledge on greesock and css animations could be helpful along the way, but it's not something too big to worry about.&lt;/p&gt;

&lt;h3&gt;
  
  
  What We'll be doing
&lt;/h3&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/stivml/embed/GRqGRPG?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h3&gt;
  
  
  The setup
&lt;/h3&gt;

&lt;p&gt;The first thing I did to work on the animation based off the original video was recreating all of the elements I can distinguish from it. I identified 2 main groups, the outer circles that load across the center and the ripple.&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%2F3zti04830dhxf1bmnrqg.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%2F3zti04830dhxf1bmnrqg.png" alt="Adobe illustrator canvas, and layers, with the circle to be animated" width="800" height="557"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Making sure everything it's present and correctly grouped simplifies the work a lot on the animation phase, so make sure you're setting everything up properly! (I had to start from scratch 3 times after animating because I forgot a piece of the svg, so do as I say not as I do). Also, don't worry about hiding things in this phase, that's something we can handle later.&lt;/p&gt;

&lt;p&gt;Make sure you export the image as an SVG, and copy and paste it into codepen, you should have something similar to this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;svg&lt;/span&gt; &lt;span class="na"&gt;xmlns=&lt;/span&gt;&lt;span class="s"&gt;"http://www.w3.org/2000/svg"&lt;/span&gt; &lt;span class="na"&gt;viewBox=&lt;/span&gt;&lt;span class="s"&gt;"0 0 450 400"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;g&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"all"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;g&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"circles"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
          &lt;span class="nt"&gt;&amp;lt;path&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"cls-1 fill-circle"&lt;/span&gt; &lt;span class="na"&gt;d=&lt;/span&gt;&lt;span class="s"&gt;"M357.26,187.32a165.19,165.19,0,1,1,0-5"&lt;/span&gt; &lt;span class="na"&gt;transform=&lt;/span&gt;&lt;span class="s"&gt;"translate(-19.57 -10.81)"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
          &lt;span class="nt"&gt;&amp;lt;path&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"cls-2 outer-circle"&lt;/span&gt; &lt;span class="na"&gt;d=&lt;/span&gt;&lt;span class="s"&gt;"M357.26,187.32a165.19,165.19,0,1,1,0-5"&lt;/span&gt; &lt;span class="na"&gt;transform=&lt;/span&gt;&lt;span class="s"&gt;"translate(-19.57 -10.81)"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;path&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"cls-1 inner-circle"&lt;/span&gt; &lt;span class="na"&gt;d=&lt;/span&gt;&lt;span class="s"&gt;"M357.26,187.32a165.19,165.19,0,1,1,0-5"&lt;/span&gt; &lt;span class="na"&gt;transform=&lt;/span&gt;&lt;span class="s"&gt;"translate(-19.57 -10.81)"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;/g&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;g&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"ripple"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;circle&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"center"&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"cls-3"&lt;/span&gt; &lt;span class="na"&gt;cx=&lt;/span&gt;&lt;span class="s"&gt;"337.73"&lt;/span&gt; &lt;span class="na"&gt;cy=&lt;/span&gt;&lt;span class="s"&gt;"171"&lt;/span&gt; &lt;span class="na"&gt;r=&lt;/span&gt;&lt;span class="s"&gt;"10"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;circle&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"cls-4"&lt;/span&gt; &lt;span class="na"&gt;cx=&lt;/span&gt;&lt;span class="s"&gt;"337.7"&lt;/span&gt; &lt;span class="na"&gt;cy=&lt;/span&gt;&lt;span class="s"&gt;"171.07"&lt;/span&gt; &lt;span class="na"&gt;r=&lt;/span&gt;&lt;span class="s"&gt;"30"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;circle&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"cls-4"&lt;/span&gt; &lt;span class="na"&gt;cx=&lt;/span&gt;&lt;span class="s"&gt;"337.7"&lt;/span&gt; &lt;span class="na"&gt;cy=&lt;/span&gt;&lt;span class="s"&gt;"171.03"&lt;/span&gt; &lt;span class="na"&gt;r=&lt;/span&gt;&lt;span class="s"&gt;"50"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;/g&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/g&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/svg&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The friendlier the names of your layers and group in Illustrator are, the easier it would be to work with them. &lt;/p&gt;

&lt;p&gt;I like to separate my css from the html, so i'd paste whatever is in the &lt;code&gt;&amp;lt;style&amp;gt;&lt;/code&gt; tag embedded in the svg on the css tab&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.cls-1&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="py"&gt;fill&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;none&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;stroke&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;stroke-width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0.5px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.cls-1&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;span class="nc"&gt;.cls-2&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="py"&gt;stroke-miterlimit&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.cls-2&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="py"&gt;fill&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;none&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;stroke&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#ff911f&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;stroke-linecap&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;round&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;stroke-width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;20px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.cls-3&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;span class="nc"&gt;.cls-4&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="py"&gt;fill&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#ffa20a&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.cls-4&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;opacity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0.3&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;svg&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;500px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;500px&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;h3&gt;
  
  
  The animation
&lt;/h3&gt;

&lt;p&gt;Here's where most of the hard work happens, since you'll do a lot of tweaking to the animation times/easings/durations. First of all, start by isolating parts and animating them individually. This will make it easier to debug if something breaks or doesn't work as expected.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Make sure you included the GSAP, DRAWSVG and Draggable plugins into codepen JS Tab&lt;br&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%2Fp96o52njbx78ohv734nl.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%2Fp96o52njbx78ohv734nl.png" alt="Settings for js tab including gsap, drawsvg and Draggable imports" width="800" height="728"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  Step By Step
&lt;/h4&gt;

&lt;p&gt;The inner circle only job is to go around the main fill color, we can achieve this behavior using &lt;code&gt;DrawSVG&lt;/code&gt; plugin.&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="nx"&gt;tl&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;innerCircle&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;drawSVG&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;0%&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;easing&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Power2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;easeOut&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At the same time, the fill circle animation grows to fill the line boundaries, we use the &lt;code&gt;scale&lt;/code&gt; transform property. Make sure &lt;code&gt;transformOrigin&lt;/code&gt; is set to &lt;code&gt;50% 50%&lt;/code&gt;, else, your animation may start from the top left corner.&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="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nx"&gt;fillCircle&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;scale&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="na"&gt;opacity&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="na"&gt;transformOrigin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;50% 50%&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;easing&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Power2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;easeIn&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;The animation from the outer circle is similar to the inner one, but it starts from a different point and fades in as it moves instead of just filling the path. For this, we can use the &lt;code&gt;fromTo&lt;/code&gt; GSAP method, that takes an initial and ending argument.&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="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fromTo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nx"&gt;outerCircle&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="mf"&gt;1.2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;drawSVG&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;20% 30%&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;easing&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Power2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;easeOut&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;opacity&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="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;drawSVG&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;99.9% 100%&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;easing&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Power2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;easeIn&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;opacity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&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;With the DrawSVG plugin, you can fill just a section of the path by indicating two separate values within it, &lt;code&gt;"20% 30%"&lt;/code&gt; represents that we just want to fill 10% of the path then.&lt;/p&gt;

&lt;p&gt;We also don't want to close the whole path and make it disappear, since it will aid the animation of the ripple appearing, that's why we leave it on &lt;code&gt;99.9%&lt;/code&gt; for the second value.&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="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;to&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nx"&gt;innerCircle&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="mf"&gt;0.7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;drawSVG&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;100% 100%&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;easing&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Power2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;easeInOut&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;Once we finish with the animation for the outer path, the thinner path also closes&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="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;staggerFrom&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;.cls-4, .cls-3&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="mf"&gt;0.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;scale&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="na"&gt;transformOrigin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;50% 50%&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="mf"&gt;0.1&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;staggerTo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nx"&gt;ripple&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="mf"&gt;0.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;opacity&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="mf"&gt;0.1&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With &lt;code&gt;staggerFrom&lt;/code&gt; and &lt;code&gt;staggerTo&lt;/code&gt; we can animate all matching query items with a delay from one another, that's really useful for adding a ripple effect once our paths close. Here we're making the circles grow and then disappear.&lt;/p&gt;

&lt;p&gt;At this point our whole animation should be close to done, but something is wrong. Things appear one after another, and that's not how motion works. That's why we need to tweak the starting times for our animations in order for them to look natural. Feel free to take a look at the codepen and copy the values I've used for this. If you have any doubts on how this work, you can look at &lt;a href="https://greensock.com/position-parameter/" rel="noopener noreferrer"&gt;this page&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Next Steps
&lt;/h2&gt;

&lt;p&gt;At this point our animation should look pretty smooth, but in order for it to completely replicate the video we need to add some interaction to it. This would be covered on the next post in this series, since I don't want the experience to be overwhelming.&lt;/p&gt;

&lt;h2&gt;
  
  
  Extra practice
&lt;/h2&gt;

&lt;p&gt;Feel free to change the values of the timings and animation properties and see if you get to a result you like more! (If you do so, send me a link. I'd love to see it!)&lt;/p&gt;

&lt;p&gt;Go on dribbble and find an animation you would like to remix, if you're having trouble reach out to me and maybe it could become a Weekly Animation blog as well!&lt;/p&gt;

&lt;p&gt;If you liked this post, make sure to leave a like and follow me on DEV.TO and twitter as &lt;a href="https://twitter.com/stiv_ml" rel="noopener noreferrer"&gt;@Stiv_ml&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>codepen</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Over-engineering in React</title>
      <dc:creator>Pablo Marcano</dc:creator>
      <pubDate>Thu, 20 Aug 2020 15:28:29 +0000</pubDate>
      <link>https://forem.com/stiv_ml/over-engineering-in-react-4gjb</link>
      <guid>https://forem.com/stiv_ml/over-engineering-in-react-4gjb</guid>
      <description>&lt;p&gt;React can be so simple and so powerful that it is one of the first choices when it comes to building a web app nowadays. But with great power comes great responsibility. Being so widespread and used, it's easy to find tons of results when looking for solutions that fulfill developer needs, but the most popular solution may not always be the best for every case.&lt;/p&gt;

&lt;p&gt;In this article I’m going to cover some common patterns and tools developers tend to blindly stick to without assessing whether they actually apply to their specific use case or not.&lt;/p&gt;

&lt;h2&gt;
  
  
  Using a Library for State Management
&lt;/h2&gt;

&lt;p&gt;Don’t get me wrong, correct state management is a fundamental part of building a reliable, scalable, and futureproof application. It’s particularly important to take it into account early on in our projects, but you might want to think twice before just starting with a template based off of  [insert popular state management library here]. There are a several reasons why I think this way:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It forces you to think and model your application in the library's way of doing things, instead of making choices that could reflect the business reality in a more accurate way. Whether you use redux or mobx (or nothing at all) should depend on if it makes sense for your use case, and not simply on what’s trendier.&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%2Frepn6x397tj8t8knk31p.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%2Frepn6x397tj8t8knk31p.png" alt="Tweet by Dan Abramov" width="707" height="413"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;You may be making your app less performant. Bundle sizes and performance on lower end devices are metrics that we as developers tend to gloss over, but can end up making a huge difference on the way your users interact with your product. Also, there’s more library code that when used incorrectly may lead to unwanted re-renders, thus making your app less responsive.&lt;br&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%2Fie4lzqnpvx7gyg6drpd2.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%2Fie4lzqnpvx7gyg6drpd2.png" alt="Bar chart comparison of state management libraries sizes" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;At the end of the day, it’s something new you need to learn, document, teach, maintain, and upgrade over time. This is the key factor when deciding to use a state management library or not: will it save you enough time and make your life that much easier in the long run that it’s worth teaching it to every new developer that joins the project? Will you have the time to document a specific scenario where you do things differently? Are you willing to upgrade all of your codebase because of a breaking change? If the answer to all of these questions is yes, then go ahead.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Creating Too Many Files/Folders
&lt;/h2&gt;

&lt;p&gt;If you come from a framework like angular, you may be familiar with the idea of creating a couple of files and a folder just to organize your independent UI components. Add modules, routing files, indexes, and services and you’ll end up with a lot of boilerplate to make things work the way you want in any given scenario. Boilerplate is not a bad thing per-se, but with React we’re not required to have this much ceremony in order to build our apps.&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%2F7aafrpenzsd5zpl40sbb.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%2F7aafrpenzsd5zpl40sbb.png" alt="Folder view of an angular project" width="800" height="780"&gt;&lt;/a&gt;&lt;br&gt;
Now, I’m not saying you should go and delete all of your .js files and bake everything in the same file, but embracing the flexibility the framework gives you will help you create apps that are easier to navigate through, and therefore, are more maintainable. The &lt;a href="https://reactjs.org/docs/faq-structure.html" rel="noopener noreferrer"&gt;official React documentation&lt;/a&gt; even encourages this approach, and provides us with some guidelines to take into account when laying out our app structure.&lt;/p&gt;

&lt;h5&gt;
  
  
  Here are some things I do to avoid unnecessary nesting/file creation:
&lt;/h5&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Don’t create boundaries where there are none:&lt;/strong&gt; While it’s pretty common to  consider that everything apps are made of is screens and components, what actually differentiates one from another? What you think of today as a component may become a screen down the road, or vice versa. Whenever your domain makes it clear that some things should belong to a folder, then go for it. Creating an extra file folder before the need comes up just creates extra work. Dan Abramov talks more about this in &lt;a href="https://medium.com/@dan_abramov/smart-and-dumb-components-7ca2f9a7c7d0" rel="noopener noreferrer"&gt;this article&lt;/a&gt; where he clarifies the difference between presentational and container components—but beware! You’ll actually find a disclaimer where he talks about how his views have changed since the writing of that article.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Leverage the power of hooks:&lt;/strong&gt; You may be tempted to create new files as new complex components start forming, and eventually you might want to put together components that share similar logic in a folder. The thing is, you may be able to avoid all of the added complexity of similar-yet-specific components by using hooks to properly reuse your logic.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Use Styled Components:&lt;/strong&gt; Styled Components can help keep all the styling and the logic related to it within the same file most of the time. This depends greatly on each use case, but they’ve gained popularity because of their flexibility and simplicity to setup, read, and maintain across my apps.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Testing the Wrong Places
&lt;/h2&gt;

&lt;p&gt;While a robust testing suite should be a priority whenever you ship a product that will continue being developed in the future, testing the wrong places could be the source of many frustrations and time wastes, especially on the frontend. Let’s first define what these “wrong places” are and aren’t.&lt;/p&gt;

&lt;p&gt;Kent Dodds writes in &lt;a href="https://kentcdodds.com/blog/how-to-know-what-to-test" rel="noopener noreferrer"&gt;How to know what to test&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“When writing code, remember that you already have two users that you need to support: End users, and developer users. Again, if you think about the code rather than the use cases, it becomes dangerously natural to start testing implementation details. When you do that, your code now has a third user.” &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In this post we’re talking about how to make the “developer users” happier. If you’re able to write tests that will actually detect bugs in the future, you’ll inevitably be happier. How do you achieve this? By testing your app the way the users would, avoiding high-effort/low-value code chunks, and writing concise and understandable tests. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Let’s break these down one by one:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Testing the way users would use the app:&lt;/strong&gt; Here I strongly recommend reading Kent Dodds &lt;a href="https://kentcdodds.com/blog/testing-implementation-details" rel="noopener noreferrer"&gt;Testing Implementation Details&lt;/a&gt;, who elaborates on how testing implementation details can lead to error prone tests that aren’t actually very useful for catching bugs.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Avoid high-effort/low-value code chunks:&lt;/strong&gt; If you’re solely using code coverage as your metric to determine the quality of tests (which has its own problems), you’ll often find there’s some code dependant on a third party library that doesn’t quite work as you expected and drags the coverage down. In this case you’ll have to weigh how critical the feature is to the application vs the amount of time you’ll have to spend coding, maintaining, and replicating the functionality across several sections of your app.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Write concise and understandable tests:&lt;/strong&gt; The more simple, explicit, and understandable a test is can reflect how well a functionality is written. While you should avoid making your implementation more complex just to simplify the tests, if your test can describe what the end goal of a functional piece is, a new maintainer might find it easier to read and make changes to the codebase.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;While there are no rules set in stone for writing perfect React code, following these guidelines has saved me time and spared me from bugs and unnecessary meetings in my career. I hope it does the same for you. &lt;/p&gt;

&lt;p&gt;Do you have any examples of over-engineering in your favorite framework? How do you usually solve them? Feel free to reach out to me with your examples or with any questions!&lt;/p&gt;

&lt;p&gt;&lt;span&gt;Photo by &lt;a href="https://unsplash.com/@scienceinhd?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Science in HD&lt;/a&gt; on &lt;a href="https://unsplash.com/?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>redux</category>
    </item>
    <item>
      <title>Writing e2e tests for React Native using Expo</title>
      <dc:creator>Pablo Marcano</dc:creator>
      <pubDate>Fri, 15 May 2020 17:00:36 +0000</pubDate>
      <link>https://forem.com/stiv_ml/writing-e2e-tests-for-react-native-using-expo-2ia8</link>
      <guid>https://forem.com/stiv_ml/writing-e2e-tests-for-react-native-using-expo-2ia8</guid>
      <description>&lt;p&gt;End to End (e2e) testing is a technique that helps ensure the quality of an app on an environment as close as real life as possible, testing the integration of all the pieces that integrate a software. On a mobile app, this could be particularly useful given the diversity of devices and platforms our software is running on top of.&lt;/p&gt;

&lt;p&gt;Due to the cross-platform nature of React Native, e2e testing proves to be particularly messy to work on, since we have to write all of our tests with this in mind, changing the way we access to certain properties or query elements no matter the tool we use for connecting to it. Still, tools like Appium and WebdriverIO allow us to work over a common and somewhat standard interface.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The following instructions assume we already have a React Native app built with expo, and use Jest for our unit-testing solution.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Disclaimer: The following instructions are based on a windows machine running an android emulator, output/commands may vary slightly on different architectures.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting Up Appium
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt; Install required dependencies
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ npm i -D webdriverio babel-plugin-jsx-remove-data-test-id concurently
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;WebdriverIO&lt;/strong&gt; will work as our “client” for the appium server in the case of JS. More to come on how to use other clients such as python.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;babel-plugin-jsx-remove-data-test-id&lt;/code&gt; will help us remove unwanted accessibilityLabels from our app, since that’s the preferred way of targeting elements for both IOS and Android platforms&lt;/p&gt;

&lt;p&gt;&lt;code&gt;concurrently&lt;/code&gt; will help us automate the running of appium and jest to do our e2e tests&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Install Appium Doctor
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ npm install appium-doctor -g
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will help us identify if we have all of the needed dependencies to correctly run appium in an emulator.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Run Appium Doctor&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Depending on the host OS we want to test in, we could run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ appium-doctor --android
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ appium-doctor --ios
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For this particular case I’ll be running the android version. This will prompt us with some output on the console, if we have all the required dependencies installed we should see a message similar to the following:&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%2Fi%2Fnoz2663ri80m9bvj9f4m.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%2Fi%2Fnoz2663ri80m9bvj9f4m.png" alt="Dependencies requirements" width="646" height="182"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If not all &lt;strong&gt;necessary&lt;/strong&gt; dependencies are met at this point, instead of checkmarks before any given item you’ll see a red &lt;strong&gt;X&lt;/strong&gt; symbol. Check the end of the input for more information on how to fix the particular Issues you’re prompted. &lt;/p&gt;

&lt;p&gt;We’re not going to fix the optional requirements that appium-doctor prompts us for the time being, feel free to go over those once you have the testing solution working.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Run Appium&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By this point, you should be able to run appium without any issues, in order to do so just type&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;You should see something similar to&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%2Fi%2F0fh39fslgpmgqe5nuk00.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%2Fi%2F0fh39fslgpmgqe5nuk00.png" alt="All dependencies met" width="516" height="94"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you do so, &lt;strong&gt;Congrats!&lt;/strong&gt; you have correctly set up appium.&lt;/p&gt;

&lt;p&gt;Now, lets set up our tests.&lt;/p&gt;

&lt;h2&gt;
  
  
  Write tests once, run in any platform
&lt;/h2&gt;

&lt;p&gt;One of the key features of react native is its ability to write code once and run it in both iOS and Android, so we want our tests to behave in the same way. There are some limitations for this, since the only way we can write a selector for both platforms is through the accessibilityLabel attribute in react native. This may become an issue if your app depends on accessibility features, make sure to use correct, semantic and descriptive accessibility labels at any place you intend to use them. &lt;/p&gt;

&lt;p&gt;If a great accessibility is not on the scope of your current project &lt;a href="https://www.interaction-design.org/literature/article/accessibility-usability-for-all" rel="noopener noreferrer"&gt;(it should)&lt;/a&gt;, you can use accessibilityLabel as a perfect target for querying your elements, just make sure you don’t accidentally worsen the experience of people using screen readers or any other assistive technology. In order to do this we’re going to configure our babel setup to remove the accessibility labels whenever we build for production.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/// babel.config.js

module.exports = function() {
  return {
    presets: ['babel-preset-expo'],
    env: {
      production: {
        plugins: [
          [
            'babel-plugin-jsx-remove-data-test-id',
            { attributes: 'accessibilityLabel' },
          ],
        ],
      },
    },
  };
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Let’s write our first test now:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I’ve created a called &lt;code&gt;LoginTest.spec.js&lt;/code&gt; inside a new folder called &lt;code&gt;e2e&lt;/code&gt;, inside the file I have the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// myapp/e2e/LoginTest.spec.js

import wdio from 'webdriverio';

jasmine.DEFAULT_TIMEOUT_INTERVAL = 60000;

const opts = {
  path: '/wd/hub/',
  port: 4723,
  capabilities: {
    platformName: 'android',
    deviceName: 'emulator-5554',
    app: 'my-app-name.apk',
    automationName: 'UiAutomator2',
  },
};

describe('Expo test example', function() {
  let client;
  beforeAll(async function() {
    client = await wdio.remote(opts);
    await client.pause(3000);
    const pack = await client.getCurrentPackage();
    const activity = await client.getCurrentActivity();
    await client.closeApp();
    await client.startActivity(pack, activity); //Reload to force update
    await client.pause(3000);
  });

  afterAll(async function() {
    await client.deleteSession();
  });

  it('should allow us to input username', async function() {
    // Arrange
    const field = await client.$('~username');
    const visible = await field.isDisplayed();
    // Act
    await field.addValue('testUsername');
    // Assert
    expect(visible).toBeTruthy();
    expect(await field.getText()).toEqual('testUsername');
  });
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That may be a lot of new code to digest at once, so let’s go line by line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import wdio from 'webdriverio';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;First, we import the WebdriverIO client. This is the main package that will include the functionality we need to query elements from the app and simulate events on the emulator.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;jasmine.DEFAULT_TIMEOUT_INTERVAL = 60000;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will tell our test runner (in this case jest) to make the tests error after a certain amount of ms has passed. Here we’re setting it explicitly in the test, but if you’re using jest you can modify the &lt;code&gt;testTimeout&lt;/code&gt; property on your jest configuration. If you’re using any other test runner I’d recommend going through their documentation, most of them have a similar property.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const opts = {
  path: '/wd/hub/',
  port: 4723,
  capabilities: {
    platformName: 'android',
    deviceName: 'emulator-5554',
    app: 'my-app-name.apk',
    automationName: 'UiAutomator2',
  },
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These are the configurations for our driver to know what to look for when using the appium interface to query for elements and save elements. You can read more about them &lt;a href="https://webdriver.io/docs/options.html#capabilities" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You can get the device name going to your emulator &amp;gt; help &amp;gt; about&lt;/p&gt;

&lt;p&gt;In order to generate an apk from expo, you have to run the command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;expo build:android    
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And wait in the queue for it to build.&lt;/p&gt;

&lt;p&gt;In this case, I placed the downloaded apk in the root folder for my project, and renamed it my-app-name.apk.&lt;/p&gt;

&lt;p&gt;Since we’re using WebdriverIO, the &lt;code&gt;automationName&lt;/code&gt; will be &lt;code&gt;UiAutomator2&lt;/code&gt;, since that’s how appium recognizes it.&lt;/p&gt;

&lt;p&gt;Since lines 18-33 is mostly setup, we won’t focus on that for now, next part focuses on line 34 and forward&lt;/p&gt;

&lt;h3&gt;
  
  
  Writing the actual test
&lt;/h3&gt;

&lt;p&gt;The idea of this test is just to showcase a normal flow on a test, therefore we will be dealing with a fairly simple use case: Checking that we have a valid username input&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const field = await client.$('~username');
const visible = await field.isDisplayed();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first line allow us to query an item by accesibilityLabel as I previously mentioned, for more information about specific selectors go to &lt;a href="http://appium.io/docs/en/commands/element/find-elements/" rel="noopener noreferrer"&gt;the appium documentation&lt;/a&gt; and &lt;a href="https://webdriver.io/docs/api/element/$.html" rel="noopener noreferrer"&gt;the WebdriverIO documentation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The second line checks whether our previously selected item is visible on the current screen, &lt;a href="https://webdriver.io/docs/api/element/isDisplayed.html" rel="noopener noreferrer"&gt;more information here.&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;await field.addValue('testUsername');
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This line simulates user typing into the selected field, in this case, we’re inserting the ‘testUsername’ text inside the previously selected username field.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;expect(visible).toBeTruthy();
expect(await field.getText()).toEqual('testUsername');
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Lastly, we use Jest to check that the field is indeed visible on our Login Screen, and that the text on the given username field is the same as the one we wrote in it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Running the test
&lt;/h3&gt;

&lt;p&gt;Since we’re using Jest as our test runner on our react app, I’ve set up a command on my package.json to run both the appium server and run Jest in watch mode, it looks like this:&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%2Fi%2Fi8lgx9tmyhu34zxxmbml.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%2Fi%2Fi8lgx9tmyhu34zxxmbml.png" alt="Command for running appium and jest at the same time" width="800" height="68"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here we’re using &lt;code&gt;concurrently&lt;/code&gt;, a simple npm package that allows us to run several npm scripts at the same time, in this case we run the appium server and jest in watch mode, add their names and different colors to easily recognize them in the console, and pass the standard input to the jest command, so we can narrow down our tests or do things like run coverage reports.&lt;/p&gt;

&lt;p&gt;With this done, we simply have to run &lt;code&gt;npm run test:e2e&lt;/code&gt; on our console, and expect something like this&lt;br&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%2Fi%2Fyo4iirod751m08ntbjad.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%2Fi%2Fyo4iirod751m08ntbjad.png" alt="Example output of running npm run test:e2e" width="640" height="133"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;to be run, and something like this&lt;/p&gt;

&lt;p&gt;&lt;a href="/content/images/2020/05/5.png" class="article-body-image-wrapper"&gt;&lt;img src="/content/images/2020/05/5.png" alt="Example output when all tests are successful"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;to be the output. If so, congratulations, you’ve correctly set up your integration tests for your react native app&lt;/p&gt;

&lt;h3&gt;
  
  
  Wrapping up
&lt;/h3&gt;

&lt;p&gt;While we’re far away from calling it a day on our e2e testing solution, the main setup It’s done. Next steps include integrating it with a CI/CD pipeline, and making it work on IOS platforms.&lt;/p&gt;

&lt;h3&gt;
  
  
  Further Reading
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://webdriver.io/" rel="noopener noreferrer"&gt;https://webdriver.io/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://discuss.appium.io/" rel="noopener noreferrer"&gt;https://discuss.appium.io/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="http://appium.io/" rel="noopener noreferrer"&gt;http://appium.io/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Photo by freestocks on Unsplash&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>reactnative</category>
      <category>react</category>
      <category>testing</category>
    </item>
    <item>
      <title>Speed Up Your Web Development: Sass</title>
      <dc:creator>Pablo Marcano</dc:creator>
      <pubDate>Thu, 06 Sep 2018 22:30:03 +0000</pubDate>
      <link>https://forem.com/stiv_ml/speed-up-your-web-development-sass-4mj3</link>
      <guid>https://forem.com/stiv_ml/speed-up-your-web-development-sass-4mj3</guid>
      <description>&lt;p&gt;This is the first of a series of posts that aim to make your life easier and enhance your productivity while developing websites, by giving you useful and industry proven tools and tips. &lt;/p&gt;




&lt;p&gt;The scenario is simple, you're developing a website or web app, and for sure you want it to look as good as you can, which is obviously accomplished by using CSS. Then you find yourself repeating tag names, properties, colors, and having a gigantic main.css file (or maybe a lot of  &lt;code&gt;&amp;lt;src rel="stylesheet"&amp;gt;&lt;/code&gt; tags in your HTML header?). And what if you want to change something as the main color of your website? Dozens of lines changed just because &lt;code&gt;#7a19a8&lt;/code&gt; seemed slightly better than &lt;code&gt;#7211a0&lt;/code&gt;.&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%2Fzn7gbuz7sycksapv22en.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%2Fzn7gbuz7sycksapv22en.png" alt="Imgur" width="800" height="404"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Is there even a difference?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Well, to solve all of this and more, in 2006 the Syntactically awesome style sheets were created, Sass for the friends. Sass is a preprocessor scripting language that is interpreted or compiled into simple CSS. What all of this means is that Sass extends the CSS syntax, using a similar structure, with a lot more fuctionality.&lt;/p&gt;
&lt;h3&gt;
  
  
  Usage
&lt;/h3&gt;

&lt;p&gt;All installation steps are covered in &lt;a href="https://sass-lang.com/install" rel="noopener noreferrer"&gt;Sass' official install guide&lt;/a&gt;. In this post, I'm going to show you some basic syntax so you can make your CSS better since day one.&lt;/p&gt;
&lt;h4&gt;
  
  
  &lt;em&gt;Variables&lt;/em&gt;
&lt;/h4&gt;

&lt;p&gt;Variables are a core part of Sass, the premise is that you declare any data in the form of a &lt;a href="https://www.sitepoint.com/data-types-in-sass/" rel="noopener noreferrer"&gt;valid data type&lt;/a&gt; in Sass, and you can use it all along your stylesheet. Here is the syntax:&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%2Fgv1309jd0nf1ktgyv5s3.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%2Fgv1309jd0nf1ktgyv5s3.png" alt="Imgur" width="585" height="418"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  &lt;em&gt;Nested Selectors&lt;/em&gt;
&lt;/h4&gt;

&lt;p&gt;With Sass Selector nesting we can transform this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scss"&gt;&lt;code&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Some properties for a div&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; 
&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="nt"&gt;span&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Some properties for a span tag inside a div&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="nt"&gt;p&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Some properties for a p tag inside a div&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Into:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scss"&gt;&lt;code&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Some div properties&lt;/span&gt;

    &lt;span class="nt"&gt;span&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="c1"&gt;// Some properties of a span tag inside a div     &lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="nt"&gt;p&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="c1"&gt;// Some properties of a p tag inside a div&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;Basically, you can nest selectors within selectors to avoid repeating tags each time you may need to go deeper in order to win specificity.&lt;/p&gt;

&lt;p&gt;You can also add pseudo elements and modify parent selectors inside themselves with the &lt;strong&gt;&amp;amp;&lt;/strong&gt; symbol, this way:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scss"&gt;&lt;code&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// div properties&lt;/span&gt;
  &lt;span class="k"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nc"&gt;.steve&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// properties of a div with steve class&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;h4&gt;
  
  
  &lt;em&gt;Mixins&lt;/em&gt;
&lt;/h4&gt;

&lt;p&gt;A mixin is a Sass feature that allows you to define reusable pieces of code, and even allows parameters, just as functions, in order to modify its behavior without having to draw upon semantic classes as &lt;code&gt;.margin-box-size-1&lt;/code&gt;. Let's see them:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scss"&gt;&lt;code&gt;&lt;span class="k"&gt;@mixin&lt;/span&gt; &lt;span class="nf"&gt;box-size&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$size&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1em&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;$size&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;$size&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;You define a mixin by using &lt;code&gt;@mixin&lt;/code&gt;, then you name it, in this case is &lt;code&gt;box-size&lt;/code&gt; and write down the parameters it will receive, if any. In this case we also have a default parameter &lt;code&gt;$size: 1em&lt;/code&gt;. The variables will be replaced with their value at build time, and everything inside the mixin will be placed wherever is used across the stylesheet. You call the mixin function by using &lt;strong&gt;&lt;a class="mentioned-user" href="https://dev.to/include"&gt;@include&lt;/a&gt;&lt;/strong&gt; followed by the mixin name.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scss"&gt;&lt;code&gt;
&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;@include&lt;/span&gt; &lt;span class="nd"&gt;box-size&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;3em&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// Will be replaced by&lt;/span&gt;

&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;3em&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;3em&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;h4&gt;
  
  
  &lt;em&gt;Control Directives&lt;/em&gt;
&lt;/h4&gt;

&lt;p&gt;With Sass we can bring common programming sentences into stylesheets, with control directives as &lt;code&gt;@if&lt;/code&gt;, &lt;code&gt;@for&lt;/code&gt;, &lt;code&gt;@each&lt;/code&gt; and &lt;code&gt;@while&lt;/code&gt;, we can sort out, repeat and take from a map or list any piece of code. Lets take a brief look over each syntax.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;code&gt;@if&lt;/code&gt;
&lt;/h4&gt;

&lt;p&gt;The &lt;code&gt;@if&lt;/code&gt; directive takes any &lt;a href="http://sass-lang.com/documentation/file.SASS_REFERENCE.html#sassscript" rel="noopener noreferrer"&gt;SassScript&lt;/a&gt; truthy or false expression and executes whichever code sections applies:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scss"&gt;&lt;code&gt;&lt;span class="k"&gt;@if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// This code will always run&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;@else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// this code will never run&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  &lt;code&gt;@for&lt;/code&gt;
&lt;/h4&gt;

&lt;p&gt;The &lt;code&gt;@for&lt;/code&gt; directive is pretty straight forward, it runs the code inside the braces for a determined amount of times. The syntax is as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scss"&gt;&lt;code&gt;&lt;span class="c1"&gt;// We declare a variable $i for the iterator, which starts at [from] and ends in [trough] values&lt;/span&gt;
&lt;span class="k"&gt;@for&lt;/span&gt; &lt;span class="nv"&gt;$i&lt;/span&gt; &lt;span class="ow"&gt;from&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt; &lt;span class="ow"&gt;through&lt;/span&gt; &lt;span class="m"&gt;6&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;$i&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="nb"&gt;px&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;h4&gt;
  
  
  &lt;code&gt;@while&lt;/code&gt;
&lt;/h4&gt;

&lt;p&gt;The &lt;code&gt;@while&lt;/code&gt; directive works pretty much as the &lt;code&gt;@for&lt;/code&gt; directive, with the difference that the condition of the loop to execute is entirely on us, and not only an incremental operator.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scss"&gt;&lt;code&gt;&lt;span class="nv"&gt;$execute&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="bp"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;@while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$execute&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;@debug&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$execute&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;h4&gt;
  
  
  Tip
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;@debug()&lt;/code&gt; will print out any value to the console while building, as its name says, its awesome for debugging!&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;code&gt;@each&lt;/code&gt;
&lt;/h4&gt;

&lt;p&gt;Last but not least, &lt;code&gt;@each&lt;/code&gt; works slightly different from the other directives, as it goes trough a collection such a map or a list instead of simply a condition, and exposes the current value for you to use.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scss"&gt;&lt;code&gt;&lt;span class="nv"&gt;$colors&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;red&lt;/span&gt; &lt;span class="no"&gt;green&lt;/span&gt; &lt;span class="no"&gt;blue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;@each&lt;/span&gt; &lt;span class="nv"&gt;$color&lt;/span&gt; &lt;span class="n"&gt;in&lt;/span&gt; &lt;span class="nv"&gt;$colors&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;$color&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;And that's it! With this easy tool you can start to write cleaner and more maintainable CSS from now on.&lt;/p&gt;

&lt;p&gt;If you have any doubts you can find me on twitter as &lt;a href="https://twitter.com/stiv_ml" rel="noopener noreferrer"&gt;@stiv_ml&lt;/a&gt;. I will be more than pleased to answer any question!&lt;/p&gt;

&lt;p&gt;This post was originally published in &lt;a href="https://blog.kzsoftworks.com/" rel="noopener noreferrer"&gt;Kaizen Softworks Blog&lt;/a&gt;, that also happens to be where I work at! If you want to check more of my content you can click &lt;a href="https://blog.kzsoftworks.com/author/pablo/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>productivity</category>
      <category>css</category>
      <category>opensource</category>
    </item>
    <item>
      <title>How to get started on functional programming?</title>
      <dc:creator>Pablo Marcano</dc:creator>
      <pubDate>Wed, 05 Sep 2018 03:34:47 +0000</pubDate>
      <link>https://forem.com/stiv_ml/how-to-get-started-on-functional-programming-20i8</link>
      <guid>https://forem.com/stiv_ml/how-to-get-started-on-functional-programming-20i8</guid>
      <description>&lt;p&gt;I do not know anything about FP, and have done OOP all my developers life. I thought it would be a good idea to explore other paradigms just to learn. Could you give me some resources to start learning Functional programming? Which language should i use to do so? I have a background in Js and C# .Net. &lt;br&gt;
Thanks!&lt;/p&gt;

</description>
      <category>learning</category>
      <category>carreer</category>
      <category>junior</category>
      <category>functional</category>
    </item>
    <item>
      <title>How to get rid of the junior mentality</title>
      <dc:creator>Pablo Marcano</dc:creator>
      <pubDate>Thu, 14 Jun 2018 00:55:05 +0000</pubDate>
      <link>https://forem.com/stiv_ml/how-to-get-rid-of-the-junior-mentality-2l8c</link>
      <guid>https://forem.com/stiv_ml/how-to-get-rid-of-the-junior-mentality-2l8c</guid>
      <description>&lt;p&gt;Hello there!&lt;/p&gt;

&lt;h3&gt;
  
  
  Who are you?
&lt;/h3&gt;

&lt;p&gt;I've been working as a developer for around 1 year professionally, i'm currently studying CS and always loved the idea of making things work as i wantby writing code. My current stack at work is mostly JS (Angular 2+, Node), and have worked with C# (.Net).&lt;/p&gt;

&lt;p&gt;As a young developer being in the industry since so early, i've been really curious about how we developers define ourselves by 'Ranks', when do you become a senior developer? how do you do it? what you should do/know?, I still don't have answers to those questions, but i realized there's a key factor that influences every developer carreer, no matter how much time and experience they have...&lt;/p&gt;

&lt;h3&gt;
  
  
  Mentality
&lt;/h3&gt;

&lt;p&gt;When I was just starting, i had to fight with the overwhelming ammount of things that seemed necessary to learn in order to call myself even a developer, let alone working as one. This takes us to the first point:&lt;/p&gt;

&lt;h2&gt;
  
  
  Don't be afraid of what you don't know
&lt;/h2&gt;

&lt;p&gt;Nobody knows everything, and this is specially true in programming. No matter how many years of experience or how many languages a developer claims to know, what really matters is how do he/she approaches learning new things. And this is an attitude that will open you a huge ammount of opportunities. Don't be afraid of spending hours on a problem that might seem the simplest of them all, just because you don't know how does x thing work, as long as they are spent researching and actively working on understanding it. In the end, you might have learned more than what you were first looking for. It's also important to have in mind that ...&lt;/p&gt;

&lt;h2&gt;
  
  
  Things may take time
&lt;/h2&gt;

&lt;p&gt;As every other discipline, being proficient as a developer will take time, understanding some things will take time, and making things work will take time, but you should always loow forward to complete what you're doing, because stress and fatigue may come, but will always pays off in the long run. You will be a better developer, and may be able to complete any similar task in a better faster and cleaner way sometime in the future.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ask what needs to be asked!
&lt;/h2&gt;

&lt;p&gt;And I can't stress this enough. Asking other developers when you're new into programming is one of the best and most enriching things you can do, because most of the time people will be eager to help you and you may learn a whole lot of things in a way it's really hard to reproduce any other way. Most experienced developers also make questions all the time. Not knowing something doesn't make you less of a developer.&lt;/p&gt;

&lt;h4&gt;
  
  
  What else would you add to this list? when did you stopped feeling as a junior?Leave it in the comments!
&lt;/h4&gt;




&lt;p&gt;Pablo Marcano&lt;br&gt;
Full Stack developer Working @ &lt;a href="https://kzsoftworks.com" rel="noopener noreferrer"&gt;Kaizen Softworks&lt;/a&gt; in Montevideo, Uruguay &lt;/p&gt;

</description>
      <category>junior</category>
      <category>carreer</category>
      <category>growth</category>
    </item>
  </channel>
</rss>
