<?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: Maximiliano</title>
    <description>The latest articles on DEV Community by Maximiliano (@neomaxzero).</description>
    <link>https://dev.to/neomaxzero</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%2F66959%2Faa4ced88-ab74-472a-ad37-ae283b6468fa.png</url>
      <title>DEV Community: Maximiliano</title>
      <link>https://dev.to/neomaxzero</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/neomaxzero"/>
    <language>en</language>
    <item>
      <title>When Do You Say A Website is Fast?</title>
      <dc:creator>Maximiliano</dc:creator>
      <pubDate>Sun, 17 Jan 2021 11:28:57 +0000</pubDate>
      <link>https://dev.to/neomaxzero/when-do-you-say-a-website-is-fast-480p</link>
      <guid>https://dev.to/neomaxzero/when-do-you-say-a-website-is-fast-480p</guid>
      <description>&lt;p&gt;15 years ago, I remember when I saw for the first time an image rendered on a screen from the Internet and I was amazed by it. At the time, my perception was different, the 640x480 image took around 6 seconds to be fully rendered and the render experience was jaggy and progressive in a way I could only get a sense of the image 4 seconds along the loading process.&lt;/p&gt;

&lt;p&gt;Navigating through pages felt like a whole different experience. If you were aiming to click on a link and instead you clicked somewhere else, you even had time to click the "stop" button at the top of the browser and try again. Every click counted.&lt;/p&gt;

&lt;p&gt;I didn't know best, it was already amazing that in a couple of seconds I had access to so much information and we were all thrilled by the mere fact the internet was so vast and available.&lt;/p&gt;

&lt;p&gt;I remember I had to do an assignment for school and I used the internet to research. I spent an hour looking for specific information, I found what I needed it and I'd achieved what I had to.&lt;/p&gt;

&lt;p&gt;Was it fast? Definitely. It was faster than going to the local library and it was available (at that specific moment the library was closed). I was really happy with how "fast" I managed to complete my task thanks to the web.&lt;/p&gt;

&lt;p&gt;Yes, there were some pages that took a lot longer than others to load, especially when they had some images. I waited close to a minute to open a gallery of images and I waited because that type of content was only available there. My friends and I, we all waited... it was worth it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The perception of speed
&lt;/h2&gt;

&lt;p&gt;If you ask anyone today if they would wait almost a minute to open a media gallery their immediate reaction would be a solid "no!" and probably the reason behind this would be because it is "too slow".&lt;/p&gt;

&lt;p&gt;Without much effort, we build a model to say if something is slow or fast. Intuition only relies on the samples that we encounter during our lifetime and we use that information to compare and make a judgment on whether things are according to our expectations.&lt;/p&gt;

&lt;p&gt;Making objective a subjective term such as "fast", means that we have to define a set of numbers (metrics) to help us verify that intuition.&lt;/p&gt;

&lt;p&gt;The amount of traffic served globally and the bandwidth that supports it have grown exponentially and next to that also our expectations.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is a fast website today?
&lt;/h2&gt;

&lt;p&gt;Right after you listen to that question you start thinking about examples that match the statement. It is also very hard to say why do we think X is faster than Y without pointing to the very specifics of those examples. Finding a common ground to compare them goes around getting rid of the specifics of a page and finding what are the elements we can use as links between all pages.&lt;/p&gt;

&lt;p&gt;To simplify the process there is a constant debate on what we (as a community) should measure and which are the ranges that fall into the "fast" bucket. If you do a quick research on "web performance", "web optimization" or "improve website speed", to name a few, you'll find tons of posts pointing to some almost standardize the list of acceptable metrics.&lt;/p&gt;

&lt;p&gt;Google is standardizing and promoting going toward that "performant"/"fast" web experience and they have defined this subset of metrics they call &lt;strong&gt;web core vitals&lt;/strong&gt;. They've put a lot of thought and brainpower into the topic and I believe it is a great starting point.&lt;/p&gt;

&lt;p&gt;To decide the metrics and the ranges they have, quite rightly, &lt;strong&gt;compare websites&lt;/strong&gt;. I don't want to make it all about the web core vitals but, to give a more concrete example: One of the metrics is &lt;strong&gt;Largest contentful paint.&lt;/strong&gt; Your website will have a good performance according to that metric if the largest element above the fold loads faster than &lt;strong&gt;2.5 seconds.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Where is this number coming from and should I really aim for that? That came from comparing a lot of pages from the web plus investigation on cognition theory. To get to that number there is a complete explanation by the chrome team that I highly recommend reading[1] and they also made sure that the threshold is achievable.&lt;/p&gt;

&lt;p&gt;If your website it's in the "good" range that basically means your website is as fast as the fastest 10% of all the websites.&lt;/p&gt;

&lt;p&gt;Being in the green range obviously feels good but, if we think about what are all the pages that they are sampling to come to that number we can quickly realize that there is a basket full of different cookies. Which is good in some cases but really not suitable for others.&lt;/p&gt;

&lt;p&gt;By mixing all these websites together they are assuming pages are all equal in a sense and that it is the same to serve an index.html page that has a couple of H2 tags without javascript to the apple iPhone landing page that has an incredible user experience.&lt;/p&gt;

&lt;p&gt;We are literally comparing different kinds of "fruits" and I think it might be super unfair to compare them. I'm not saying that these metrics are bad. I'm very happy they exist and we have now amazing tooling and a lot more data to use.&lt;/p&gt;

&lt;p&gt;Nevertheless, the more tailor-made your comparison the better the decisions you can make whether some new target might be worth aiming to or not. Takings samples closer to you, like your main competitors, would give you a better idea of what is "fast" for your industry and it might also be that you still provide more value with a slightly "slower" website.&lt;/p&gt;

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

&lt;p&gt;The web is fast, a lot faster than 10 years ago. Maybe it's not as fast as your neighbors' web pages but you now have data to compare and if you want, you can act upon it. Don't take any metric for granted neither the process. If you want to make a good decision on if it's worth or not doing something today, have a critical view of the metrics and use them. The web core vitals is a good starting point but that's only the beginning, it might be enough.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reference
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;[1]&lt;a href="https://web.dev/defining-core-web-vitals-thresholds/"&gt;https://web.dev/defining-core-web-vitals-thresholds/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>discuss</category>
      <category>webdev</category>
      <category>performance</category>
    </item>
    <item>
      <title>The Reason I Move Away From Disqus</title>
      <dc:creator>Maximiliano</dc:creator>
      <pubDate>Wed, 06 Jan 2021 10:06:25 +0000</pubDate>
      <link>https://dev.to/neomaxzero/the-reason-i-move-away-from-disqus-1cl9</link>
      <guid>https://dev.to/neomaxzero/the-reason-i-move-away-from-disqus-1cl9</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;TLDR; Performance&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Adding comments to your blog or web app is a fairly common task. You should know that the cost of including an external service like Disqus could be high.&lt;/p&gt;

&lt;p&gt;While doing some investigation of the things that were affecting the performance of my blog, Disqus was one of the main reasons why my metrics were so inconsistent and lower than the "optimal" level suggested by the lighthouse score.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Origin of the problem: Let's go 100.
&lt;/h2&gt;

&lt;p&gt;Whenever I don't feel like writing an article for my blog I start wondering how I can improve the platform. &lt;strong&gt;Performance&lt;/strong&gt; is something I enjoy optimizing and that day I decided to start the tweaking cycle. My default tool is the chrome &lt;a href="https://developers.google.com/web/tools/lighthouse#devtools"&gt;lighthouse dev tool&lt;/a&gt; as a starting point and also &lt;a href="https://www.webpagetest.org/result/210104_DiHF_3e32446327018a163521210931ac364a/"&gt;WebPageTest&lt;/a&gt;. Lighthouse is an amazing tool that simplifies the process of diagnosis and sometimes the hints are really useful and WebPageTest it's also a great source of information.&lt;/p&gt;

&lt;p&gt;The performance metric from the lighthouse audit was far from 100 and I was aiming for the perfect score. So, I ran the performance audits from WebPageTest and lighthouse to see what was going on.&lt;/p&gt;

&lt;p&gt;In the waterfall view of all the resources being requested by the page, I saw that &lt;strong&gt;Disqus&lt;/strong&gt; on average was taking &lt;strong&gt;~500ms for TTFB and ~450ms extra to process&lt;/strong&gt;. Blocking the main thread for that long affects your metrics related to interactivity. I found that very annoying so to verify the real impact I made a version of the site without the comment box and push it to production. The results were immediate, all the metrics went green. (I should have saved more screenshots). I was convinced now that this third party library was severely taxing my site.&lt;/p&gt;

&lt;h2&gt;
  
  
  Checking alternatives
&lt;/h2&gt;

&lt;p&gt;Since I only had a few comments on a couple of articles I believed It was a good moment to check alternatives to Disqus. There was always the option to not have comments at all but I still wanted to have that feature. Furthermore, the migration of comments was not something I was really worried about. In the process, I found there is a &lt;a href="https://www.gatsbyjs.com/docs/how-to/adding-common-features/adding-comments/"&gt;nice guide for gatsby&lt;/a&gt; that includes many great alternatives.&lt;/p&gt;

&lt;p&gt;One of the libraries I found most interested and suited my needs was &lt;a href="https://utteranc.es/"&gt;Utterances&lt;/a&gt;. It saves comments as Github issues. That means it's public, aim for developers and performant (?).&lt;/p&gt;

&lt;p&gt;It was very straightforward to include this library in my blog. After pushing these new changes to production I saw these new metrics for the utterance: &lt;strong&gt;~200ms TTFB and ~20ms to process&lt;/strong&gt;, with the addition that there's an extra call to the GitHub issues API that takes &lt;strong&gt;~250ms&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The answer was conclusive: &lt;strong&gt;Utterance&lt;/strong&gt; was significantly faster and I was happy with it.&lt;/p&gt;

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

&lt;p&gt;Disqus it's an exhaustive solution for including comments to your site but sometimes it's maybe too much for what you need. There are a few lighter alternatives that you can use that won't hurt performance as much.&lt;/p&gt;

</description>
      <category>blog</category>
      <category>comments</category>
      <category>disqus</category>
    </item>
    <item>
      <title>Snowpack: A promising bundler</title>
      <dc:creator>Maximiliano</dc:creator>
      <pubDate>Sun, 03 Jan 2021 10:23:44 +0000</pubDate>
      <link>https://dev.to/neomaxzero/snowpack-a-promising-bundler-2j2l</link>
      <guid>https://dev.to/neomaxzero/snowpack-a-promising-bundler-2j2l</guid>
      <description>&lt;p&gt;I remember some time ago I wrote a &lt;a href="https://blog.m4x.io/023-quickreviews-introduction/"&gt;quickreview&lt;/a&gt; about a library called &lt;a href="https://blog.m4x.io/024-quickreviews-pikaweb/"&gt;pikaweb&lt;/a&gt;. I was interested in its proposal yet didn't entirely understand what they were about. My initial thoughts were not that positive and although I believed it had some potential I failed to see why I would choose to use this library over a more mature one like webpack. Six months later, I checked a "new library" called Snowpack. It turned out to be a &lt;strong&gt;revamped version of pika&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why changing names?
&lt;/h2&gt;

&lt;p&gt;To my eyes, there is no other reason than bringing a new wave of attention to the library and I think the execution was done amazingly well. The library has evolved and with it, almost everything has changed. Only the core of the product has remained the same. The original intention of Snowpack was to leverage from the &lt;strong&gt;browser native module&lt;/strong&gt; API and that is still something seen in Snowpack.&lt;/p&gt;

&lt;h2&gt;
  
  
  What changed from pika/web?
&lt;/h2&gt;

&lt;p&gt;The last time I checked, pika's documentation was almost nonexistent with quite a few examples and overall hard to understand what it was trying to deliver.&lt;/p&gt;

&lt;p&gt;Today, the naming similarity with webpack makes you immediately understand that we are now talking about &lt;strong&gt;another module bundler&lt;/strong&gt; with a promise of being performant.&lt;/p&gt;

&lt;p&gt;The resemblances with webpack are notorious. Having such a clear winner of the module bundler "market" brings two clear benefits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We are familiar with configuration-based bundlers and we are likely to quickly pick up how to work with them.&lt;/li&gt;
&lt;li&gt;Having a plugin system like webpack also helps the community ease the migration of some good packages to the Snowpack ecosystem.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why would I choose to go for Snowpack instead of Webpack?
&lt;/h2&gt;

&lt;p&gt;If you believe in &lt;strong&gt;following industry standards&lt;/strong&gt; this is a valid reason to try Snowpack. Webpack has a significant learning curve and I see Snowpack as a valid bridge from a module-bundler-ruled world to a "no bundler at all" situation. Maybe at some point, we would get rid of all of the module bundlers (dreaming is free).&lt;/p&gt;

&lt;p&gt;I was thinking why isn't this a feature of Webpack and I guess that with any new ideas it is easier to create something from scratch to prove it is worth it instead of including it in a big project widely used by the community. Opinions are always strong and the maturity of the project comes with some costs associated.&lt;/p&gt;

&lt;p&gt;I believe Snowpack is showing the benefits of using web standards and like what happened with Parcel it can only improve the ecosystem showing that there are still many things to improve for the community.&lt;/p&gt;

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

&lt;p&gt;Snowpack is delivering a new flavor of module bundler with a twist. Is it reinventing the wheel? Maybe. You can still decide to continue going with webpack, parcel, or whatever makes you happy. I'm trying Snowpack myself with a personal project and it's going great. Let's see what happens in six months. Maybe a new name? Who knows...&lt;/p&gt;

&lt;p&gt;Check it here: &lt;a href="https://www.snowpack.dev/"&gt;Snowpack&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>bundlers</category>
      <category>snowpack</category>
    </item>
    <item>
      <title>How to improve the UX by optimizing your fonts</title>
      <dc:creator>Maximiliano</dc:creator>
      <pubDate>Sun, 16 Aug 2020 19:15:17 +0000</pubDate>
      <link>https://dev.to/neomaxzero/how-to-improve-the-ux-by-optimizing-your-fonts-5g8l</link>
      <guid>https://dev.to/neomaxzero/how-to-improve-the-ux-by-optimizing-your-fonts-5g8l</guid>
      <description>&lt;p&gt;Lately, I have been interested in improving the speed of my blog. The main reason why I wanted to do that was because I love seeing the content instantly. I was checking some performance audit tools and a common sign that every tool was giving was that the way I was requesting the fonts was hurting the speed of my site.&lt;/p&gt;

&lt;p&gt;I found two main questions needed answers to come up with a better approach:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Where are your fonts hosted?&lt;/li&gt;
&lt;li&gt;What's your font display strategy?&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Source of your fonts assets
&lt;/h2&gt;

&lt;p&gt;My fonts were coming from a CDN. This is a common approach and it's very easy to integrate to any webpage because you copy paste a couple of lines and you have it working.&lt;/p&gt;

&lt;p&gt;Using your fonts from a CDN have some implications you should be aware of:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;CDN could be &lt;strong&gt;slow&lt;/strong&gt; or in the worst-case scenario &lt;strong&gt;down&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Performance penalty because of network negotiation: DNS, TCP, TLS.

&lt;ol&gt;
&lt;li&gt;The browser needs to create a new connection because the target resource is outside of your domain.&lt;/li&gt;
&lt;/ol&gt;


&lt;/li&gt;
&lt;li&gt;Prioritization of resources is not optimal.

&lt;ol&gt;
&lt;li&gt;HTTP2 is more efficient with resources from the same domain.&lt;/li&gt;
&lt;/ol&gt;


&lt;/li&gt;
&lt;li&gt;Caching policy is decided by the CDN.&lt;/li&gt;
&lt;li&gt;Security could be compromised and you'll deliver malicious fonts.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The other approach is to &lt;strong&gt;host your fonts&lt;/strong&gt;. - Serve your fonts assets from the same domain where your site is host -.&lt;/p&gt;

&lt;p&gt;You don't have the disadvantages that I mentioned before and it's not a lot of work.&lt;/p&gt;

&lt;h2&gt;
  
  
  Font display strategy
&lt;/h2&gt;

&lt;p&gt;Once you have included your fonts in your project you need to load it into your page. You can change the behaviour of how your fonts load with the property &lt;code&gt;font-display&lt;/code&gt; . Depending on what you want I'll recommend you to take a look at these two options:&lt;/p&gt;

&lt;h3&gt;
  
  
  font-display: "optional"
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;The browser starts by showing nothing &lt;em&gt;(no text).&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;The browser will start downloading the main font.&lt;/li&gt;
&lt;li&gt;The browser will wait for a very short period of time to the main font to be downloaded (~100ms).&lt;/li&gt;
&lt;li&gt;If the main font is available it will show that one otherwise it will show the fallback and stick to that.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  font-display: "swap"
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;The browser starts by showing the fallback font &lt;em&gt;(content is shown)&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;The browser will start downloading the main font.&lt;/li&gt;
&lt;li&gt;The browser will wait for the main font to be downloaded (Any time).&lt;/li&gt;
&lt;li&gt;After it is downloaded the browser will switch to the main font.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A couple of things worth mentioning. &lt;code&gt;font-display: swap&lt;/code&gt; will make your content shift from the "web-safe" font to your main font meanwhile &lt;code&gt;font-display: optional&lt;/code&gt; won't show any content at all.&lt;/p&gt;

&lt;p&gt;I went for &lt;code&gt;font-display: optional&lt;/code&gt; because this gave the user-experience I was aiming to. My blog is full text and the glitch of &lt;code&gt;font-display: swap&lt;/code&gt; was really bad.&lt;/p&gt;

&lt;h3&gt;
  
  
  Check your fallback
&lt;/h3&gt;

&lt;p&gt;With &lt;code&gt;font-display: swap&lt;/code&gt; is critical to select the correct fallback. If you have a "serif" kind of font and your fallback is "Times new Roman" then it will look very funny.&lt;/p&gt;

&lt;h2&gt;
  
  
  Implementation for Gatsby with styled-components
&lt;/h2&gt;

&lt;p&gt;Because I use gatsby with styled-components (emotion) for my blog I will show you how I self-hosted and configured my fonts:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Download your font.&lt;/li&gt;
&lt;li&gt;Copy that to your project. &lt;code&gt;e.g. static/fonts/Romoto.woff2&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Create a js file where we import our fonts.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// fonts.js&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;RomotoWoff&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../static/fonts/Romoto.woff&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;RomotoWoff2&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../static/fonts/Romoto.woff2&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;RomotoWoff&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;RomotoWoff2&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt; Create a global styled-component where you will import your fonts.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// globalFonts.js&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Global&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;css&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@emotion/core&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;fonts&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./fonts&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;GlobalFonts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Global&lt;/span&gt;
    &lt;span class="nx"&gt;styles&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;css&lt;/span&gt;&lt;span class="s2"&gt;`
      @font-face {
        font-family: 'Romoto';
        font-style: normal;
        font-weight: 400;
        font-display: optional;
        src: url("&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;fonts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;RomotoWoff2&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;") format('woff2'),url("&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;fonts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;RomotoWoff&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;") format('woff');
      }
    `&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;GlobalFonts&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt; Inject your font into your layout.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// layout.js&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;GlobalFonts&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./globalFonts&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;Layout&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;children&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="o"&gt;&amp;lt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;GlobalFonts&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;children&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="nx"&gt;Layout&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;propTypes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;children&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;PropTypes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;node&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;isRequired&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;Layout&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Use your self-hosted font
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;font-family&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Romoto&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;sans-serif&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;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Self-host your fonts and think about your font-loading strategy. We should consider performance but if this means giving a non-optimal UX you should think this twice.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reference
&lt;/h2&gt;

&lt;p&gt;Docs: &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display"&gt;font-display&lt;/a&gt;&lt;/p&gt;

</description>
      <category>performance</category>
      <category>gatsby</category>
    </item>
    <item>
      <title>UI: explicit vs implicit actioners</title>
      <dc:creator>Maximiliano</dc:creator>
      <pubDate>Sun, 19 Jul 2020 13:20:53 +0000</pubDate>
      <link>https://dev.to/neomaxzero/ui-explicit-vs-implicit-actioners-1h73</link>
      <guid>https://dev.to/neomaxzero/ui-explicit-vs-implicit-actioners-1h73</guid>
      <description>&lt;p&gt;If you ever used JIRA. This very powerful tool is riddled with features. The tool is so powerful that the designers have an incredibly hard time trying to cram all the functionality on a page.&lt;/p&gt;

&lt;p&gt;There are only so many buttons and messages that you can convey on a page before you go beyond the understanding threshold. I always complain about the number of features it has only to discover there's even more.&lt;/p&gt;

&lt;p&gt;I was thinking about this and figured that there are two very immediate mechanisms we use when looking for elements and exploring a page.&lt;/p&gt;

&lt;h2&gt;
  
  
  Visual scan
&lt;/h2&gt;

&lt;p&gt;Imagine that you are in a remote call and you have JIRA open. Someone might try to guide you and teach you how to use the tool, after 5 mins you are both tired of saying "there! / where?". At this point, you probably gave up and let someone else try to continue with the task.&lt;/p&gt;

&lt;p&gt;You don't want any of your UIs to go this same path.&lt;/p&gt;

&lt;p&gt;The feeling an app leaves you when you see more elements than what you can handle is &lt;strong&gt;Visual fatigue&lt;/strong&gt;. A good UI design will do a great job at guiding you to what would be the optimal approach to the actions that are optimized for.&lt;/p&gt;

&lt;p&gt;When a component is setting somewhere in your screen at plain sight I call this: &lt;strong&gt;Explicit actioners&lt;/strong&gt; (CTA). This means that I only have to use my eyes and my interpretation of the elements to figure out what is it going to do after I interact with it.&lt;/p&gt;

&lt;p&gt;You go to a page, you wait for all the elements to load, after that, you start scanning the page until you find the text or visual cue (icon/color/animation) that represents the action you want to perform on your page.&lt;/p&gt;

&lt;p&gt;If you have a lot of elements this can be &lt;em&gt;A LOT&lt;/em&gt; of work. If you combine this with the visual hierarchy given by Font / Color / Size / Spacing / Symbols you can imagine why this could be super confusing at times.&lt;/p&gt;

&lt;h2&gt;
  
  
  Motion scan
&lt;/h2&gt;

&lt;p&gt;Another great tool we have at our disposal is the mouse.&lt;/p&gt;

&lt;p&gt;In a device with a mouse, you can use the mouse to hover over elements and see when changes happen either to your cursor or the page. Sometimes there are even elements similar to drawers (hamburger icons/ dropdown menus/ inline pop-ups). After you interact with them you have even more elements that were once hidden to you.&lt;/p&gt;

&lt;p&gt;All these elements that need an extra step to be accessible I'd like to call them: &lt;strong&gt;Implicit actioners&lt;/strong&gt; (I-CTA).&lt;/p&gt;

&lt;p&gt;In a mobile device, you can't hover over pages (yet) so you need to rely on your intuition and the correct communication of the elements to guide you in the navigation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Visual vs Motion
&lt;/h2&gt;

&lt;p&gt;Every app is a different world and I would be lying to you if I say I know exactly the perfect combination of explicit vs implicit actioners you should have on your page.&lt;/p&gt;

&lt;p&gt;What I do know is that there's a limit and a relationship between the number of elements and the time users need to understand and later act over your pages.&lt;/p&gt;

&lt;p&gt;What is too much? Is really hard to tell until you try it. If you have thousands of users you can rely on your data an A/B test every little decision you make but this is a time consuming and long process.&lt;/p&gt;

&lt;p&gt;If you are on the early development process of a project you might want to see examples of what are the "big leagues" doing because they have already spent quite some money on testing what's more likely to succeed.&lt;/p&gt;

&lt;p&gt;With a big disclaimer that what works for others might not work for you, I'd say it's good to at least be familiar with the current state of UI art. By this I mean, there's some collective knowledge that you should really use.&lt;/p&gt;

&lt;p&gt;A great example of these are hamburger menus: If you see three bars somewhere on a page you expect that to open or show a list of more elements. If you use the same icon on your page to for example make a noise, that might be quite unexpected.&lt;/p&gt;

&lt;h2&gt;
  
  
  Some ending thoughts
&lt;/h2&gt;

&lt;p&gt;I noticed that I tend to go for explicit-CTAs rather than implicit ones. I guess the trade-off of having too many explicit elements is that you can very quickly reach the visual fatigue for your app and that's when you have to be smart and consider rethinking your use cases to &lt;strong&gt;make it better for the vast majority.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let me know what you think. I'm very interested in knowing what are your thoughts on the subject.&lt;/p&gt;

</description>
      <category>ux</category>
    </item>
    <item>
      <title>A few words on SEO for client-side rendered apps</title>
      <dc:creator>Maximiliano</dc:creator>
      <pubDate>Thu, 16 Jul 2020 19:22:43 +0000</pubDate>
      <link>https://dev.to/neomaxzero/a-few-words-on-seo-for-client-side-rendered-apps-3lhn</link>
      <guid>https://dev.to/neomaxzero/a-few-words-on-seo-for-client-side-rendered-apps-3lhn</guid>
      <description>&lt;p&gt;SEO and server-side rendering (SSR) work well together. Every search engine started by optimizing this technique.&lt;/p&gt;

&lt;p&gt;In the beginning, JS was used to enhance our pages and improve the experience for the end-user but that changed.&lt;/p&gt;

&lt;p&gt;We went full JS rockstar mode and we pushed it to the extreme. We went from adding a layer of dynamism to the HTML/CSS to using JS to create HTML/CSS in the browser in real-time while downloading the resources.&lt;/p&gt;

&lt;p&gt;Browsers became monsters. 😋&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;We moved the rendering process from the server to the client.&lt;/strong&gt; We did this because ... (I'm not gonna enter this area in this post). The result of that: A gazillion UI frameworks started to emerge.&lt;/p&gt;

&lt;h2&gt;
  
  
  What makes it so different from client-side rendering?
&lt;/h2&gt;

&lt;p&gt;With frameworks like Angular, React, Vue. We serve an almost empty HTML with a few references to some 2MB JS files which do all the magic.&lt;/p&gt;

&lt;p&gt;That turns the SEO process to looks as follow:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Browser: GET &lt;a href="https://pugmark.io/dashboard"&gt;https://pugmark.io/dashboard&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Server: Send 1Kb of HTML.&lt;/li&gt;
&lt;li&gt;Browser: GET &lt;code&gt;bundle.js(2MB)&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Browser x100: GET &lt;code&gt;endpoints A-Z / css / moar JS&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Server x100: Send all the resources.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We can immediately see how much more work the browser needs to do. The server can go without any template renderer, serve a static file and you can have dynamic pages without many costs on the server-side.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;But there are still costs, and those are being transferred to the browser, to the client. 😉&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;What's with SEO then? A search engine is mimicking a user, if it wants to crawl the content of the page it needs to wait, and sometimes a lot, to see the final content.&lt;/p&gt;

&lt;p&gt;This bring some major implications for SEO. People at google are smart and the google-bot is good enough to do this.&lt;/p&gt;

&lt;p&gt;But that is not free.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's the impact?
&lt;/h2&gt;

&lt;p&gt;To deal with this, Google introduced a &lt;a href="https://developers.google.com/search/docs/guides/javascript-seo-basics"&gt;rendering queue&lt;/a&gt;. If your page is SSR google can make a request to that page, crawl the HTML and eventually show on the web results page. This works and I read almost no-one has any problems with google understanding their pages.&lt;/p&gt;

&lt;p&gt;If your page is client-side rendered then you are queued. Google needs a rendering engine that understand JS and execute the heavy lifting process of your framework before it can crawl the dynamically generated HTML.&lt;/p&gt;

&lt;p&gt;This is very expensive for our fellow google-bot: Energy and, by that we mean, Money.&lt;/p&gt;

&lt;p&gt;It can take from hours to weeks to be picked up from the queue. You need to compete with the same resources that are used by sites that probably have a lot more SEO authority than you and we don't really know when this is going to happen.&lt;/p&gt;

&lt;p&gt;You also don't have guarantees that the crawler is gonna visit your site. There are many examples of client-side rendered apps that are dropped for some reason and never ended up in the search results.&lt;/p&gt;

&lt;p&gt;Having a longer time to market is not something you should take lightly. It can change some business decisions and could be one of the key factors for your application.&lt;/p&gt;

&lt;h2&gt;
  
  
  Should I go fully SSR?
&lt;/h2&gt;

&lt;p&gt;SSR/CSR it's like a knob. You might not need your site to be available in search engines. SEO is only one of the considerations when we choose frontend technologies.&lt;/p&gt;

&lt;p&gt;Javascript SEO is still under development and I was very surprised google had this power already. (Not really working that well)&lt;/p&gt;

&lt;p&gt;Going SSR is not the only solution if you have a fully client-side rendered app and you want to be part of the search results.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pre-rendering
&lt;/h2&gt;

&lt;p&gt;Taking a snapshot of your HTML and saving it as the initial-load for your user and google-bot is another technique that can be used to solve this problem. Again, it's not easy but it might be worth it if you need a middle ground.&lt;/p&gt;

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

&lt;p&gt;Google-bot can crawl your Single-page application but it will have some implications:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Slower time-to-market&lt;/li&gt;
&lt;li&gt;Crawling limited to google.&lt;/li&gt;
&lt;li&gt;No guarantees your pages will be crawled.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.onely.com/blog/ultimate-guide-javascript-seo/"&gt;https://www.onely.com/blog/ultimate-guide-javascript-seo/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developers.google.com/search/docs/guides/javascript-seo-basics"&gt;https://developers.google.com/search/docs/guides/javascript-seo-basics&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>javascript</category>
      <category>seo</category>
      <category>spa</category>
    </item>
    <item>
      <title>Chaos as an exploration tool</title>
      <dc:creator>Maximiliano</dc:creator>
      <pubDate>Sat, 13 Jun 2020 09:08:48 +0000</pubDate>
      <link>https://dev.to/neomaxzero/chaos-as-an-exploration-tool-7l0</link>
      <guid>https://dev.to/neomaxzero/chaos-as-an-exploration-tool-7l0</guid>
      <description>&lt;p&gt;&lt;strong&gt;Originally published on &lt;a href="https://blog.m4x.io/2020/life-chaos-exploration-and-technology/"&gt;blog.m4x.io&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Have you ever been in this situation where you don't know what had happened to your day and it's already gone? You have this feeling of under achievement because either you've planned a lot and that was the end of it or you have done everything on your list but still you don't have the fulfillment you expected.&lt;/p&gt;

&lt;p&gt;I've been there. I was there yesterday, I don't really know about today and I might be there tomorrow.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Chaos&lt;/em&gt; help me find joyment when I take decisions I find myself not commiting to.&lt;/p&gt;

&lt;p&gt;I want to share some thoughts, random thoughts, you could even consider this &lt;em&gt;chaotic&lt;/em&gt;... that's the whole point.&lt;/p&gt;

&lt;h2&gt;
  
  
  The negative connotation
&lt;/h2&gt;

&lt;p&gt;When you hear that someone is a chaotic person, you might immediately think negatively. I also thought like this the vast majority of my life because since my childhood, structure and order was one of the main values my family and institutions taught me and Chaos is the opposite. (Isn't it?)&lt;/p&gt;

&lt;p&gt;When we hear about chaos we tend to extrapolate to the extreme. That makes it very easy for us to get the concept but this doesn't necessarily need to be black and white.&lt;/p&gt;

&lt;p&gt;Depending on the situation, extreme chaos can be something that adds value. If we take as an example a painting, there are many situations where we see a painter forget all the "rules" and go along with what we perceive as chaos...In the end, this could be a master piece.&lt;/p&gt;

&lt;p&gt;If we go to the other side of the spectrum and we are extremely organized, you could end up in some behavior that could lead to be so off it can be considered O.C.D. A Harmful act instead of one that supports the situation trying to remediate.&lt;/p&gt;

&lt;p&gt;But, for some reason now this side of the spectrum is sociable accepted with more ease because maybe of the misuse of the word and sometimes even brought to job interviews and other places you wouldn't have listened before.&lt;/p&gt;

&lt;p&gt;The version of chaos I'm trying to convey here is closer to what we consider "Creativity".&lt;/p&gt;

&lt;p&gt;Let me illustrate this with a small diagram where I show the "spectrum":&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--f4c0kjcH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github.com/neomaxzero/blog/blob/master/src/images/chaos-window.png%3Fraw%3Dtrue" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--f4c0kjcH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github.com/neomaxzero/blog/blob/master/src/images/chaos-window.png%3Fraw%3Dtrue" alt="chaos-window"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When everything we do, everything we decide, everything we say it's in line with what we plan we are on the "order" side of the range. If we plan, organize and act based on these premises outcomes are more deterministic and that helps on making future ideas a reality.&lt;/p&gt;

&lt;p&gt;When going to the "negative" side of the order range you will find chaos, before reaching the extreme of self-destruction and total entropy you'll find many steps that can help you to be more creative, try new stuff, re-discover yourself. The key here is to know when to look for that side, when to expand your "chao-window" and how to do it. I'm going to tell you what works for me but I'm pretty sure it won't work for you... It can maybe serve you for inspiration.&lt;/p&gt;

&lt;p&gt;I want you to remember that to keep this scoped, I want to focus and use as an example the following topic: &lt;strong&gt;Technology and Frontend Engineering&lt;/strong&gt;, which are the things I spent some time thinking and doing last 5 years.&lt;/p&gt;

&lt;h2&gt;
  
  
  How chaos lead me to where I am now
&lt;/h2&gt;

&lt;p&gt;When I was looking for my first job, I didn't know what I wanted to do (that doesn't mean I really know by now). My mindset at the time was:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I need a job, I don't care about the technology, don't really care that much about the salary, I want to enter the job market.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;After a few interviews, I got a &lt;em&gt;.NET developer&lt;/em&gt; position as first dev job. I learnt A LOT in the process and I can assure you, &lt;strong&gt;chaos was the main driver&lt;/strong&gt;. I can add reasoning behind most of the things that I did but I would be lying to my self If I said I got everything planned and I knew exactly that 5 years on I will be where I am today.&lt;/p&gt;

&lt;p&gt;There was some UI development required for the job and that wasn't planned, I was originally designated to do "backend" web services but literal chaos at work put me into the situation It needed to add some buttons to an old VB6 application, it was not easy, it was not hard, it was fun.&lt;/p&gt;

&lt;p&gt;Another task came and it was in this case adding a button to one of the WebApps we were maintaining. Again, not planned from my side but I enjoyed it a lot.&lt;/p&gt;

&lt;p&gt;There was some small part of the design that was not decided, I had the opportunity to design how to display it and then later implement . I'm a very visual person, and &lt;strong&gt;I found a lot more joy&lt;/strong&gt; at doing this tasks than the SQL queries I was doing before.&lt;/p&gt;

&lt;p&gt;A combination of many things, specially chaos put tasks and challenges on the way that help me &lt;strong&gt;discover&lt;/strong&gt; a new field I didn't know I liked that much.&lt;/p&gt;

&lt;p&gt;There is one thing I didn't tell you until now, I'm a person of hobbies, I like MANY things, I don't have time to do everything I want to do. At any specific time I think I know what I like but there are so many things I'm more than sure I have so much more to discover about myself.&lt;/p&gt;

&lt;p&gt;When we do like something we tend to dedicate time to it. Maybe we discover how much we like about something and we start increasing our available time until there is not much budget for that. If we use ALL our budget we are limiting ourselves into this discovery process.&lt;/p&gt;

&lt;p&gt;Trying to make sense of how I came from my first .NET job to my liking for UI I found chaos in the process, plenty of it. At that time I unintentionally use chaos and helped my way into the Frontend development. I continued with my chaotic behavior and learnt A LOT about how much little I know about everything.&lt;/p&gt;

&lt;p&gt;If you are a developer, you can probably relate to the fact that the amount of jargon and libraries, frameworks, books, techniques, concepts that you need to get a grasp to be able to move in this world can be incredible overwhelming. Fortunately, many good people have created content that help you organize yourself into a plan that is less overwhelming. If you are in an early stage of your development career ORDER is a must and thank god we have so many awesome content creators covering this side.&lt;/p&gt;

&lt;p&gt;On the other hand, If you passed through that phase (In any specific area), the plan you create for yourself has to pretty much be tailor made. YOU and only YOU know about yourself and the things that work for someone else might not work for you. When we learnt how to organize the next thing we want to learn, the book we want to read and to follow plans. You should start considering &lt;strong&gt;chaos is a powerful tool and can play on your favor if you know how to use it&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Deliberate chaos
&lt;/h2&gt;

&lt;p&gt;There is Chaos we face on absolutely everything we do, chaos is not something like diamonds you need to dig a lot to find it. Right now, take a glance at your desk... do you see that cable that is off? that paper from last week that is due, that dust on top of the screen? Ok, you get the point.&lt;br&gt;
This are physical examples, easy to acknowledge. The "non-physical" side of things can live in any form that you can imagine. E.g.Trying to think how to solve your folder structure but "random" quotes of Breaking bad pop on your mind, opening your phone calendar to check something and immediately switching to twitter without even doing what you intended to. I can continue but I'd be revealing way too much about myself. xD&lt;/p&gt;

&lt;p&gt;These are example of chaos that we don't control, we don't necessarily ask for it. It just happen because it happens.&lt;/p&gt;

&lt;p&gt;When you have worked for years to maintain order in this world full of chaos, you might have became way too good at organizing some specific stuff. In those areas that you are too experienced and room for error has been decreased to a minimum you might want to add CHAOS! :O&lt;/p&gt;

&lt;p&gt;What the actual *functional-programming are you talking about? If you have been on the same field for years, you learnt your way into that field. You know how to learn "quickly" enough, what matters to you, what matters to the market, how you &lt;em&gt;react&lt;/em&gt; to "new" libraries/ frameworks, new roles: From 'Webmaster' to 'Frontend Developer' to 'UI React Engineer' to 'UI React Native Engineer', to 'UI React Native Redux Engineer', etc.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;*functional-programming = The F word&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;You are creating a mental model of how things are and how they should be. This is very hard to break unless you deliberately try to.&lt;/p&gt;

&lt;p&gt;I'll say it : &lt;strong&gt;You might need chaos&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;But not the kind of chaos we already face daily, &lt;em&gt;the chaos that will help you explore&lt;/em&gt; and learn more about yourself and the world we live in, but specially about yourself.&lt;/p&gt;

&lt;h2&gt;
  
  
  You might not need &lt;del&gt;Redux&lt;/del&gt; Chaos
&lt;/h2&gt;

&lt;p&gt;This is not for everyone, to everything at anytime. Like many things, there's a moment, a subject, where adding chaos makes sense. Nobody knows about your inner motivations more than yourself and probably a handful of other people (Could be). What I do notice is that everyone in one way or another is using chaos. When we feel unhappy, chaos help us. When we are bored, chaos strikes again. When we have to make an essay and we are playing League of legends, chaos is right there next to you.&lt;/p&gt;

&lt;h2&gt;
  
  
  How I use chaos
&lt;/h2&gt;

&lt;p&gt;Because this is my story and to make justice a little bit to the title.&lt;/p&gt;

&lt;h3&gt;
  
  
  How chaos can be used as an exploration tool and how I create deliberate chaos in my life?
&lt;/h3&gt;

&lt;p&gt;As a Frontend developer I like "knowing" or getting a sense of what's the new next thing. Is Svelte gonna conquer the world? Is Service worker really the future? Is JQuery dead? This questions came from chaos.&lt;/p&gt;

&lt;p&gt;How I add chaos to my frontend mind?&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- I follow on twitter to people that drive the faith of our frontend community. The big names, the ones that say: People jump and 100k frontenders do. (Including myself :P)
- I'm subscribed to many newsletters. Github, JavascriptWeekly, PonyFoo.
- I watch UI "opinions" in several youtube channels.
- I check what "tech stack" are people using on new startup projects.
- I experiment with new libraries and frameworks that I think are worth checking into.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;I'm pretty sure you might do the same. It's very hard to talk to some other frontenders if you are not up to date with the new shiny Future proof framework.&lt;/p&gt;

&lt;p&gt;Although, that doesn't really create the chaos and exploration level I meant by the title, it's one level of chaos. This creates exploration, not at the level it will really help you rediscover yourself.&lt;/p&gt;

&lt;p&gt;What if I ask you?&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- Do you like Animations?
- Do you like 3D design?
- Do you like DevOPS?
- Do you like Machine learning?
- Do you like AWS?
- Do you like VR?
- Do you like Mobile development?
- Do you like Management?
- Do you like IoT?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;You can answer yes or no to each of this questions, I know. But have you really tried it?&lt;br&gt;
The more away you are from the field you are in (your comfort zone) your discovery process enlarge it, the more chaos you bring to your life because &lt;em&gt;each of these&lt;/em&gt; can change your career if you &lt;em&gt;really&lt;/em&gt; like it.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If you find more happiness than what you have with what you are currently doing. You should probably do something about it and you probably will.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I don't want to encourage people to GO CHANGE, I want you to &lt;strong&gt;think&lt;/strong&gt;, I'm constantly checking what do makes me happy today. In my spare time I also experiment and try to go out of my comfort zone as much as I can. I find fascinating people that come from other completely unrelated fields like Dancers, Doctors, Biologists. These people know how to explore and take big risks.&lt;/p&gt;

&lt;p&gt;Ask yourself bigger questions, explore more, re-define yourself over and over again and be happy!&lt;/p&gt;

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

&lt;p&gt;When we are learning how to learn we learn about chaos and how to control it. We should also learn about how to create it back and use it on our favor.&lt;/p&gt;

&lt;p&gt;You probably already have enough chaos in your life, but consider that you could probably use this as your new power. Next time chaos is consuming your time and energy, think about how deliberately this happens. Maybe you discover what make you really happy. :D&lt;/p&gt;

&lt;p&gt;I'm very interested if you deliberately use chaos, &lt;em&gt;chaos management&lt;/em&gt; is not a thing yet but I think it should. What do you think?&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>career</category>
      <category>devlife</category>
      <category>chaos</category>
    </item>
    <item>
      <title>How to equalize your rows in react</title>
      <dc:creator>Maximiliano</dc:creator>
      <pubDate>Sat, 28 Mar 2020 19:24:14 +0000</pubDate>
      <link>https://dev.to/neomaxzero/how-to-equalize-your-rows-in-react-16lo</link>
      <guid>https://dev.to/neomaxzero/how-to-equalize-your-rows-in-react-16lo</guid>
      <description>&lt;p&gt;&lt;strong&gt;Originally published on &lt;a href="https://blog.m4x.io/2020/how-to-equalize-your-rows-in-react/"&gt;blog.m4x.io&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  How to equalize your rows in react.
&lt;/h1&gt;

&lt;p&gt;As frontenders, sometimes when we are building grids we run into a very annoying but common issue, &lt;strong&gt;Unalignment&lt;/strong&gt;. When the items of a grid are not aligned correctly it is time for trouble.&lt;/p&gt;

&lt;p&gt;As human beings, we are very good at detecting these irregularities. An issue like this immediately jumps into our attention.&lt;/p&gt;

&lt;p&gt;The problem is easier to grasp with an image so let me show you in a glance what we are talking about.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kvZ6cZNO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/neomaxzero/react-equalize/master/assets/explanation-problem.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kvZ6cZNO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/neomaxzero/react-equalize/master/assets/explanation-problem.png" alt="react equalize problem description image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I hope that the problem is now more clear. I was looking into any library that would help me on my quest since I'm working in react but no luck.&lt;/p&gt;

&lt;p&gt;In vanilla javascript, I have done this a bunch of times already but it was gonna be the first time I do this in React.&lt;/p&gt;

&lt;p&gt;I've created a very small library to solve this and I hope you'll find it useful.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/neomaxzero/react-equalize"&gt;&lt;br&gt;
    &lt;p&gt;&lt;br&gt;
        &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6Ta4ObYn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github.com/neomaxzero/react-equalize/blob/master/assets/react-equalize.png%3Fraw%3Dtrue" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6Ta4ObYn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github.com/neomaxzero/react-equalize/blob/master/assets/react-equalize.png%3Fraw%3Dtrue" alt="react-equalize"&gt;&lt;/a&gt;&lt;br&gt;
    &lt;/p&gt;

&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How it works?
&lt;/h2&gt;

&lt;p&gt;First, you need to specify what's going to be the grid or element you want this component to act on.&lt;/p&gt;

&lt;p&gt;This wrapper container will keep track of the position of the elements you want to equalize the height.&lt;/p&gt;

&lt;p&gt;Secondly, with the &lt;em&gt;Equalize&lt;/em&gt; component, you'll have to wrap the components you want to have on the same line.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Equalize will get the height of all the elements that are on the same line and will apply the correct height to it&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;I found this solution worked out quite well at the beginning but then I realized there was one small issue.&lt;/p&gt;

&lt;p&gt;If the elements of the lists changed it, the state of the heights needed to be reset. To do this, I added a prop to the container to which you can send an array that would trigger a re-render of the layout.&lt;/p&gt;

&lt;p&gt;Problem solved!&lt;/p&gt;

&lt;p&gt;Let me know what you think, maybe you also have a use case I can support. I'm more than happy to help!&lt;/p&gt;

&lt;p&gt;You can check out the library here: &lt;a href="https://github.com/neomaxzero/react-equalize"&gt;React-equalize&lt;/a&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>frontend</category>
      <category>library</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Frontend Architecture: Installing vs Writing modules</title>
      <dc:creator>Maximiliano</dc:creator>
      <pubDate>Sun, 01 Mar 2020 10:52:11 +0000</pubDate>
      <link>https://dev.to/neomaxzero/frontend-architecture-installing-vs-writing-modules-3if4</link>
      <guid>https://dev.to/neomaxzero/frontend-architecture-installing-vs-writing-modules-3if4</guid>
      <description>&lt;p&gt;&lt;strong&gt;Originally published on &lt;a href="https://blog.m4x.io/en/frontend-architecture-install-vs-write/"&gt;blog.m4x.io&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When working in an application we are constantly solving small problems to complete a task. Sometimes these issues are common among different use cases we run upon and with the experience we start noticing patterns.&lt;/p&gt;

&lt;p&gt;If the problem is generic enough, probably someone else has also encountered it and solved it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Whenever this happen we face a dilemma.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Should I write my own solution, or should I use this existing module that seems to solve it?&lt;/p&gt;

&lt;h2&gt;
  
  
  And the answer is YES
&lt;/h2&gt;

&lt;p&gt;In some cases, the YES is more towards writing your own solution and in other cases to install an existing module. In the world of frontend, we have a gazillion of alternatives and options and one npm package/second is born as we speak. (xD)&lt;/p&gt;

&lt;p&gt;If you work for a company that has strict rules about how to deal with this sort of decision, this was already sorted out. I haven't had an experience like that myself before so, I'll try to summarize my thoughts when deciding what is more adequate for each particular context:&lt;/p&gt;

&lt;h2&gt;
  
  
  Context-awareness
&lt;/h2&gt;

&lt;p&gt;When taking this kind of decisions always gathering data about the context is very useful. So for that, we need to identify what it's in the scope of your app and what it is not.&lt;/p&gt;

&lt;p&gt;We need to grab the magnifying glass and take a look at the dependencies of the project.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"Module decisions" are always context-dependant.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It's not the same trying to add a library to a repository where all the dependencies are only "very well known" and tested by the industry(express, react, jest, etc) than to a repository where there is not a clear pattern on what are all the considerations taken for the external modules currently being used.&lt;/p&gt;

&lt;p&gt;This is the first step and what will eventually help you in defining the answer to the question "Should I write or should I install?🎵".&lt;/p&gt;

&lt;p&gt;Keeping the scope in mind it's easier say than to do, but it's key we don't lose track of it because it changes the outcome of your decision and the importance you give to each point you have to juggle with.&lt;/p&gt;

&lt;p&gt;A list of questions I ask myself and I find helpful are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How important is this feature for the business?&lt;/li&gt;
&lt;li&gt;Do we know if there is already a plan involving a high level of customization?&lt;/li&gt;
&lt;li&gt;Was this issue already solved by other colleagues?&lt;/li&gt;
&lt;li&gt;Are we ready to solve this specific issue on our own?&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  1. How important is this feature for the business?
&lt;/h3&gt;

&lt;p&gt;It's very likely that if you are implementing a core feature for the business, this will change over time. Evolution of every part of your app is one of the constants in software development, there are going to be parts that grow more than others and the speed at which you can move on with the core features are probably going to have a direct impact to your business.&lt;/p&gt;

&lt;p&gt;Asserting how important is what you are going to work on for the business is also going to be affected by the state of your company. When your company is at the phase of testing an idea and the resources are limited,&lt;strong&gt;the focus should be on making sure our implementation tests the idea and that's it.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You don't want to spend hundreds of hours on a prototype that might be discarded because of the lack of market or because you developed something the market didn't want. Believe me, been there done that.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. High level of customization upcoming
&lt;/h3&gt;

&lt;p&gt;Sometimes, we know that in the coming future we'll face some changes for the implementation we are today working on. Even in mature companies with mature products the roadmap is more of a guideline than a plan. The further in the roadmap you see a feature coming, the least you need to worry about how your current implementation is connected with that future. The likeliness of you working on a feature that is set on the roadmap is directly proportional to how close it is to the current date. Use this on your advantage and at the moment of taking a decision: &lt;em&gt;Spend time on what is more important today.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;If you see that something is inevitable don't look aside and wait for the chaos to come at you.&lt;strong&gt;Speak up and save time&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;How is this related to modules? The decision to add a module today might be tempting, but if you look a little bit ahead you'll realize it doesn't make sense to add it because in a couple of months you'll have double the work.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Was this already solved by some other colleague?
&lt;/h3&gt;

&lt;p&gt;If you work long enough for a company you'll start noticing there are requirements that are going to be similar to others.&lt;/p&gt;

&lt;p&gt;At some point, either your team or someone external will start asking questions like, doesn't this look like that? When that happens, It's time to stop the wheel for a short moment and talk about the differences.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Similar problems might have similar solutions in their backbones&lt;/strong&gt; and your more experienced colleagues are pretty likely to be really good at spotting the similarities and advantages of your problems and solutions.&lt;/p&gt;

&lt;p&gt;If you are not sure, go ask, talk to them. This can only give you and your team an advantage because you will not only solve your problem with the best input, you'll also learn A LOT in the process.&lt;/p&gt;

&lt;p&gt;Additionally to this, you'll get to know them better and start understanding how your solution will fit in the ecosystem.&lt;/p&gt;

&lt;p&gt;At some point, you'll find someone that says &lt;em&gt;yes&lt;/em&gt;. I have this module that does exactly that, or I have this module that can be extended and what you have to do fits there.&lt;/p&gt;

&lt;p&gt;Then there it is! you are a lucky man.&lt;/p&gt;

&lt;p&gt;Start from your team, and then keep on asking inside your company. Don't run directly to google and &lt;code&gt;npm install&lt;/code&gt; the first result.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Are we ready to solve this specific issue on our own?
&lt;/h3&gt;

&lt;p&gt;It could be that when you go ask in your company what's being used to solve X, the answer is that the solution was taken from the open-source community.&lt;/p&gt;

&lt;p&gt;Its needed a lot of repetition to become a master on something, there are some very complex problems that you need years of experience to start feeling comfortable with.&lt;/p&gt;

&lt;p&gt;When you are at a point that you feel really comfortable and ready to add extra value to your company, you should consider implementing your own modules.&lt;/p&gt;

&lt;p&gt;You can even think about going beyond that if your company is open-source friendly and contribute to the community.&lt;/p&gt;

&lt;p&gt;A module could go from a function that gives you a sum of two numbers to a web framework.&lt;/p&gt;

&lt;p&gt;This decision generally happens when the use case you need to support is not really solved by any of the options available today plus you are an expert on a subject.&lt;/p&gt;

&lt;p&gt;Disclaimer: If you are not an expert you might become one after solving it but, this comes at a cost.&lt;strong&gt;A LOT of time.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  It's all about control
&lt;/h2&gt;

&lt;p&gt;After we have identified the context in which we are taking this sometimes tough decision. We can now focus on the repo where this new module needs to exist.&lt;/p&gt;

&lt;p&gt;When working with a repository, you'll start familiarizing yourself with the list of external dependencies used to solve specific issues. If you are new to the team, you can go to the list of dependencies and take a look at what it was "agreed" to use externally.&lt;/p&gt;

&lt;p&gt;Don't take things for granted!&lt;/p&gt;

&lt;p&gt;It's very important you question the decisions of your team to understand what were the thoughts that lead your team to decide on importing something externally when you feel that it should not have.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Whatever it is imported from an external package manager on our project it's not directly on our control so we bring all the decisions of that external dependency with us.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Luckily, there are people that have been working for YEARS in solving very specific issues and build amazing solutions.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Gray area of dependencies
&lt;/h2&gt;

&lt;p&gt;What problem do you really want to solve?&lt;/p&gt;

&lt;p&gt;So, when the borders are not clear we are lost. In a repo, the flexibility we have to install whatever we want whenever we can could be nice at the beginning, but at some points you need to start adding constraints so it becomes super evident what is really the problem this project is solving.&lt;strong&gt;The code you want to maintain should be the core of the solution you are trying to solve.&lt;/strong&gt; The "potential" your repo has at solving problems could be increased by including external libraries.&lt;/p&gt;

&lt;p&gt;With this said, you should be careful and not go to the extreme, you don't want to kill a mosquito with a bazooka, that's not efficient. (It's fun though)&lt;/p&gt;

&lt;p&gt;This gray area that I find incredibly hard to explain is something that we are constantly changing by introducing or removing dependencies from our repos.&lt;/p&gt;

&lt;p&gt;To make myself a little bit clear I'll give a couple of examples of modules and how I do approach them:&lt;/p&gt;

&lt;h2&gt;
  
  
  Example case 1: isNull (lodash) - Utility Library
&lt;/h2&gt;

&lt;p&gt;When you start to familiarize more with Javascript, you get to know its peculiarities and, you might say, lack of features. Operating with different types of variables (adding, subtracting, comparing) behaves differently as you would expect and there are tons of examples. Let's imagine you need to check if a variable is null. What do we do?&lt;/p&gt;

&lt;p&gt;Case 1: Lodash is already a dependency. We import the function we need and we are done.&lt;br&gt;
Case 2: We don't have any "utility" library that can help us so we have to decide.&lt;/p&gt;

&lt;p&gt;Do we want to add lodash to only use isNull? Luckily today you can install &lt;code&gt;lodash.isNull&lt;/code&gt; and you are settled again. But you could be in a situation that you need a banana and you install the jungle.&lt;/p&gt;

&lt;p&gt;Code you write is code you have to maintain and if you are in a code base that has coverage you'll have to add a battery of tests as well, and the more underestimated feature: &lt;strong&gt;Documentation&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In the case of &lt;code&gt;isNull&lt;/code&gt; I would say it seems even ridiculous since the function is extremely small: (&lt;code&gt;const isNull =&amp;gt; value =&amp;gt; value === null&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;The function can be written in seconds. Over analyzing this is already wasting time. The process of npm installing is maybe more work than creating a function.&lt;/p&gt;

&lt;h2&gt;
  
  
  Example case 2: Formatting dates - Utility Library
&lt;/h2&gt;

&lt;p&gt;At some point, we have to show a date in our application and when we show it to our stakeholders they say it has to look prettier than &lt;code&gt;Fri Feb 21 2020 08:27:13 GMT+0100&lt;/code&gt;. So we notice we have to do quite some work to make it work in a prettier, more custom made format.&lt;/p&gt;

&lt;p&gt;Again, we could start with learning the Date API in javascript and at some point, we are going to realize how much of a hassle it is to do simple stuff.&lt;/p&gt;

&lt;p&gt;There are multiple options for this and I'd say it is worth spending time reading what some libraries provide and how much it's the cost at the moment of importing them.&lt;/p&gt;

&lt;p&gt;Dealing with dates is hard. If you have plenty of experience with this it might be good for you at the moment to build a custom made library for this, but this decision is not only going to affect you in the future, it will also your team.&lt;/p&gt;

&lt;h2&gt;
  
  
  Example case 3: React - UI Library
&lt;/h2&gt;

&lt;p&gt;We are entering the level of complexity and kind of problem which is generic enough A LOT of developers encounter. When this happens the options tend to increase, the number of opinions as well. When A LOT of very capable people gather together and solve a complex problem the solution tends to be complex as well.&lt;/p&gt;

&lt;p&gt;With this, I'm saying flavors are all over the place and today, as an example, one of the options you have to build your UI is React.&lt;/p&gt;

&lt;p&gt;What does it do for you? A lot.&lt;/p&gt;

&lt;p&gt;The problem of creating a performant, UI library that abstracts you from manipulating the dom is very complex.&lt;/p&gt;

&lt;p&gt;It is so complex that you would need to spend a significant amount of time to build something relatively close to what React does.&lt;/p&gt;

&lt;p&gt;Trust me, there are people that breathe this kind of problem day and night so you can focus on what matters to your business.&lt;/p&gt;

&lt;p&gt;I agree with you it is cool to create a UI library but holy Santa molly it's a hell of a job. Giants of the industry have collaborated to create something that works pretty well. There is an entire team dedicated to this solo job.&lt;/p&gt;

&lt;p&gt;In the end, you might not even need a UI library at all. You could do a lot of stuff with a couple of utilities.&lt;/p&gt;

&lt;p&gt;I don't know your use case, you do.&lt;/p&gt;

&lt;p&gt;When we are talking about this amount of complexity, I wouldn't even think about using modules vs creating my own. If there is something you could use, &lt;strong&gt;try it out.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Evaluate the options you have, maybe even extend one library, contribute to making it easier for someone else. You are not Facebook, you are not google… and If you are, don't let the challenge discourage you from building the next unicorn UI library.&lt;/p&gt;

&lt;h2&gt;
  
  
  Example case 4: Next JS - UI Framework
&lt;/h2&gt;

&lt;p&gt;Modules are abstractions on top of abstraction, on top of abstractions. The more layers you have on your app the easier it is for you to focus on what really matters to your business. But, this doesn't come without costs. Decisions have been made and you have to live with those. Next.JS is a framework built on top of react that provides you with server-side rendering and a file routing mechanism, &lt;a href="https://nextjs.org/"&gt;and a lot more&lt;/a&gt;. These guys and girls did an incredible job of making sure the framework is extensible enough to let you access the layers underneath and give the control back to the developers.&lt;/p&gt;

&lt;p&gt;This was not done on a single night, the company ZEIT is putting significant energy and time on maintaining the framework. This is not their main business, but somehow they managed to change the state of the art in the terms of UI libraries and make it into their business..&lt;/p&gt;

&lt;p&gt;They are a clear example that if you have the right people and all the conditions. You can contribute to the community and create a profitable business..&lt;/p&gt;

&lt;p&gt;With all this said, I think you should not rush the idea of creating your own framework. You should definitely start involving more and more of the relevant participants and make sure you are all on the same page before you spend a minute writing a single line of code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Decisions, decisions and more decisions (Snowball effect)
&lt;/h2&gt;

&lt;p&gt;Install vs Writing modules is a decision kind of problem and although we take thousand of decisions every day without even thinking, we are bad at it. We struggle a lot with non-trivial decisions that have plenty of options to choose from. To improve your decision-making process you need to practice, you need to get involved and make calls yourself.&lt;/p&gt;

&lt;p&gt;And why sometimes it's so scary to take these decisions because if we take the wrong ones it could and will bite us in the ass. And you know what? That's OK. It's a learning process and if you can't learn from more senior developers around maybe you are the senior that has to commit the mistakes to teach the rest.&lt;/p&gt;

&lt;p&gt;I didn't want to conclude this article without mentioning something I always encounter. There is a &lt;em&gt;snowball effect of modules&lt;/em&gt; from the very first decisions you made for a project. If today you install dependencies for absolutely everything and that's something that you breathe and take with you, the people that trust you and also take a look at the project start doing the same. This changes when a whole team is re-build again, especially if decisions are not well documented.&lt;/p&gt;

&lt;p&gt;I know this is not only a frontend kind of problem but the rapidly growing ecosystem of npm packages in the frontend community it's a double-edged sword and we are constantly dealing with it.&lt;/p&gt;

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

&lt;p&gt;The more complex the problem, the more effort we have to put on evaluating if you should include or not something to our project. Therefore, at some point, it's easier to just try out libraries instead of even think about solving a problem ourselves.&lt;/p&gt;

&lt;p&gt;By being more conscious and spending extra time on this subject you will learn a lot.&lt;/p&gt;

&lt;p&gt;When In doubt, maybe you can meditate a couple of seconds and ask yourself a few questions to determine the context for this issue. This will limit your options and help you with the outcome.&lt;/p&gt;

&lt;p&gt;The difference between an experienced developer and a not that experienced one is that the more experienced one is more likely to make the right decisions at the right time and because of this, avoid extra costs.&lt;/p&gt;

&lt;p&gt;The more experience you get, you'll maximize the amount of time spent on the right implementation.&lt;/p&gt;

&lt;p&gt;Be aware of the gray area of your repo, be a positive factor in reducing uncertainty and help yourself and your team in the future. It's really fine to not know at the beginning, but if you want to move faster and get good at it, give a third thought before you npm install.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;And what about you? How do you decide on what to spend time when it's about modules?&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>frontend</category>
      <category>architecture</category>
      <category>modules</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Add disqus to your react app in a glance</title>
      <dc:creator>Maximiliano</dc:creator>
      <pubDate>Wed, 27 Nov 2019 22:02:29 +0000</pubDate>
      <link>https://dev.to/neomaxzero/add-disqus-to-your-react-app-in-a-glance-p</link>
      <guid>https://dev.to/neomaxzero/add-disqus-to-your-react-app-in-a-glance-p</guid>
      <description>&lt;p&gt;&lt;strong&gt;Originally published on &lt;a href="https://blog.m4x.io/add-disqus-to-your-react-app-in-a-glance/"&gt;m4x.io&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I recently started adding more content to my blog and in the process I decided having a communication channel with my audience, if there's any, would be quite useful.&lt;/p&gt;

&lt;p&gt;Disqus it's a &lt;em&gt;"comment as a service"&lt;/em&gt; platform that give you all the tools you need to have this feature on your application in &lt;em&gt;literally 5 mins&lt;/em&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Let's get it on
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Create a disqus account, if you don't have it yet.&lt;/li&gt;
&lt;li&gt;Add the component that is going to load the disqus comment box to your app.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Comments.js&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useEffect&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;Comments&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;fullUrl&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;id&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="nx"&gt;useEffect&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;DISQUS_SCRIPT&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;disq_script&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;sd&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;DISQUS_SCRIPT&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="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;sd&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;disqus_config&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;fullUrl&lt;/span&gt;
        &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;identifier&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;id&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;d&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;d&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;createElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;script&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;src&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://MYDISQUS.disqus.com/embed.js&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="c1"&gt;// REPLACE THIS LINE WITH YOUR DISQUS LINE&lt;/span&gt;
      &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;DISQUS_SCRIPT&lt;/span&gt;
      &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
      &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;setAttribute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;data-timestamp&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;

      &lt;span class="nx"&gt;d&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;appendChild&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;)&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="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;DISQUS&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;reset&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
        &lt;span class="na"&gt;reload&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="na"&gt;config&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;disqus_config&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;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;[])&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;disqus_thread&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;Comments&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Use it in your app whenever you want to add comments:D
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Post.js&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Comments&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./Comments&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;Post&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;id&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="o"&gt;&amp;lt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;RestOfThePost&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Comments&lt;/span&gt; &lt;span class="nx"&gt;fullUrl&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;Post&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Make sure you add the url of the page you are taking comments for and an id.&lt;/li&gt;
&lt;li&gt;Wait for the awesome comments from your followers.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Is that all I need?
&lt;/h2&gt;

&lt;p&gt;Yes! Incredible, that's all that you need to use disqus. Make sure to add comments yourself to be sure you are sending the right url and id. Stay longer if you want the rest of the story...&lt;/p&gt;

&lt;h2&gt;
  
  
  Extra: Juice of the story
&lt;/h2&gt;

&lt;p&gt;While doing some research on how to add this I encounter a couple of options that I could try on:&lt;/p&gt;

&lt;p&gt;First,I tried adding the snippet of code that it's in the disqus wizzard.&lt;/p&gt;

&lt;p&gt;I turned into a component with the famous &lt;code&gt;dangerouslySetInnerHTML&lt;/code&gt; and It looked like this&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="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;Comments&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;fullUrl&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;id&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;html&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`
  &amp;lt;div id="disqus_thread"&amp;gt;&amp;lt;/div&amp;gt;
  &amp;lt;script&amp;gt;
  var disqus_config = function () {
  this.page.url = '&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;fullUrl&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;';
  this.page.identifier = '&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;';
  };
  (function() {
  var d = document, s = d.createElement('script');
  s.src = 'https://MYDISQUS.disqus.com/embed.js';
  s.setAttribute('data-timestamp', +new Date());
  (d.head || d.body).appendChild(s);
  })();
  &amp;lt;/script&amp;gt;
  `&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;dangerouslySetInnerHTML&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{{&lt;/span&gt; &lt;span class="na"&gt;__html&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;html&lt;/span&gt; &lt;span class="p"&gt;}}&lt;/span&gt; &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;Comments&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But, this didn't work out of the box. Every time the client side routing was switching components it was behaving quite awful. Also, I was adding a new script everytime the component was mounting. &lt;/p&gt;

&lt;p&gt;Yes, I know it was waaay to mvp. But it worked, 2 out 10 times :P&lt;/p&gt;

&lt;p&gt;Second tried was using the npm module &lt;a href="https://github.com/disqus/disqus-react"&gt;disqus-react&lt;/a&gt; that disqus provides but I was skeptical of how would this be much different from the web approach and if you look at the code...&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="c1"&gt;// file: https://github.com/disqus/disqus-react/blob/master/src/DiscussionEmbed.jsx&lt;/span&gt;

&lt;span class="c1"&gt;// ..lots of react code&lt;/span&gt;
 &lt;span class="nx"&gt;loadInstance&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;doc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;document&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="nb"&gt;window&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;DISQUS&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;doc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;dsq-embed-scr&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="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;DISQUS&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;reset&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
                &lt;span class="na"&gt;reload&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="na"&gt;config&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getDisqusConfig&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;config&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;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;disqus_config&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getDisqusConfig&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;disqus_shortname&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;shortname&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="nx"&gt;insertScript&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`https://&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;shortname&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;.disqus.com/embed.js`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;dsq-embed-scr&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;doc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&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;span class="c1"&gt;// ..lots of react code&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;...and if you look at the code, It isn't.&lt;/p&gt;

&lt;p&gt;I didn't install the npm module and tried it out because at this point I have learnt enough about what I need to do to make it work without another black box in my proyect.&lt;/p&gt;

&lt;p&gt;So, a couple of tries more and I ended up with this small, in house component that does exactly that. - &lt;a href="https://github.com/neomaxzero/useDisqus"&gt;useDisqus&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this story of adding a "simple" component. I hope you can relate with the thought process to decide what to do at any given time when picking a new library.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If you read this far, thank you and give me a sign ( like, comment, email, etc) that you want to keep reading about my day to day struggles.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I have a tendency of over analyzing simple stuff which sometimes are good for stories but not that much for your productivity.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;PS:&lt;/em&gt; it took me more than 50 mins to add disqus and I hope you can do it in 5 mins. (10x factor)?&lt;/p&gt;

</description>
      <category>react</category>
      <category>disqus</category>
      <category>comments</category>
      <category>blog</category>
    </item>
    <item>
      <title>What is react concurrent mode, really?</title>
      <dc:creator>Maximiliano</dc:creator>
      <pubDate>Sat, 23 Nov 2019 20:29:47 +0000</pubDate>
      <link>https://dev.to/neomaxzero/what-is-react-concurrent-mode-really-2en1</link>
      <guid>https://dev.to/neomaxzero/what-is-react-concurrent-mode-really-2en1</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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Flud57jkboujptn01pnq1.png" 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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Flud57jkboujptn01pnq1.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Originally published on &lt;a href="https://blog.m4x.io/en/what-is-concurrent-mode/" rel="noopener noreferrer"&gt;m4x.io&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Concurrent mode is now with us and came to stay. The last feature was launched in an experimental mode and promise an improvement in the overall performance of your web apps.&lt;/p&gt;

&lt;p&gt;This feature originally was not created to support &lt;code&gt;suspense&lt;/code&gt;, but this mode, consequently allows &lt;code&gt;suspense&lt;/code&gt; to be possible.&lt;/p&gt;

&lt;p&gt;In my words,&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Concurrent mode it's a flag that allows react's engine to decide when to commit to the DOM when in presence of several simultaneous changes&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In essence, this mode makes react smarter.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why there is so much hype around this feature?
&lt;/h2&gt;

&lt;p&gt;When the core of react was re-written entirely in &lt;a href="https://github.com/acdlite/react-fiber-architecture" rel="noopener noreferrer"&gt;React fiber&lt;/a&gt;, one of the main benefits was the possibility to keep track of several "virtual threads" (fibers) which are tagged with a priority. In a very general way, react now can give top priority to components the user was interacting with and assign a lower priority to the rest.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;React fiber&lt;/em&gt; sat down the foundations on which concurrent mode works. When multiple elements are changing at the same time, react can now smartly decide which elements of the virtual dom have priority to be rendered.&lt;/p&gt;

&lt;p&gt;In a few words, react can handle multiple changes "at the same time".&lt;/p&gt;

&lt;h2&gt;
  
  
  How is this different from the "normal" mode of react?
&lt;/h2&gt;

&lt;p&gt;In the let's say, dumb version (synchronous mode) of react, React render the screen taking as a premise that everything that is going to be rendered depends on synchronous content and have the same priority. After &lt;a href="https://reactjs.org/docs/reconciliation.html" rel="noopener noreferrer"&gt;react's magic algorithm&lt;/a&gt;, the dom is efficiently mutated and we immediately see the representation of the new state.&lt;/p&gt;

&lt;p&gt;In the case the screen or component depends on an asynchronous source of data, and also this source is incredible fast, react will be true to its behavior and &lt;strong&gt;will render every intermediate state our component transition, even for a split second&lt;/strong&gt;. This will result in the user seeing a &lt;strong&gt;flash of "unloaded"&lt;/strong&gt; state (?FOUS :D) on every component tide to this source.&lt;/p&gt;

&lt;p&gt;The key difference is that in normal mode, once react has committed to render a fiber, it can not be interrupted anymore, with concurrent mode, it can.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wait, wait, wait... Explain as if I were your old grandma (non-programmer)
&lt;/h2&gt;

&lt;p&gt;Pre-concurrent mode react is not able to interrupt the rendering process of components. Additionally to this, it doesn't have any idea that there are a lot of dependencies to "external" services (mainly APIs) and then it cannot do anything to optimize the user experience.&lt;/p&gt;

&lt;p&gt;Post-concurrent mode we let react's engine interrupt components and in combination with suspense know our dependencies with external services so it can smartly make use of this information and decide what it's more convenient to render at each time.&lt;/p&gt;

&lt;p&gt;An example, very skewed to the suspense feature. We have a section on our screen that is going to show a spinner while fetching data from an API. This API only needs 20ms to return a value. In synchronous react we are going to see a spinner for a small fraction of time which turns out to be very "inefficient" because after the browser renders that It has to recalculate the new layout with the result of the endpoint.&lt;/p&gt;

&lt;p&gt;It would be way more convenient to wait a couple of milliseconds more to make a efficient use of the resources and also present to the user a final state of the UI instead of the, sometimes very annoying, intermediate state.&lt;/p&gt;

&lt;p&gt;This last strategy is possible thanks to &lt;a href="https://reactjs.org/docs/concurrent-mode-intro.html" rel="noopener noreferrer"&gt;React concurrent mode&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>react</category>
      <category>frontend</category>
      <category>opinion</category>
    </item>
  </channel>
</rss>
