<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Atila Fassina on Medium]]></title>
        <description><![CDATA[Stories by Atila Fassina on Medium]]></description>
        <link>https://medium.com/@atilafassina?source=rss-69a8d3fa8504------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*TFMgpVEkmBBSUWihLAgrnQ.jpeg</url>
            <title>Stories by Atila Fassina on Medium</title>
            <link>https://medium.com/@atilafassina?source=rss-69a8d3fa8504------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 20:41:28 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@atilafassina/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Bye Medium]]></title>
            <link>https://medium.com/@atilafassina/bye-medium-744c1563953f?source=rss-69a8d3fa8504------2</link>
            <guid isPermaLink="false">https://medium.com/p/744c1563953f</guid>
            <category><![CDATA[medium]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[blog]]></category>
            <dc:creator><![CDATA[Atila Fassina]]></dc:creator>
            <pubDate>Sun, 23 Jun 2019 21:01:10 GMT</pubDate>
            <atom:updated>2019-06-23T21:01:10.208Z</atom:updated>
            <content:encoded><![CDATA[<p>For most of the time it was a fun ride.</p><p>I have now decided to stop publishing my content on Medium and completely merge my blog into my own <a href="https://atila.fassina.eu/">atila.fassina.eu</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*arf-JsuZNezBlAJ05IQ8ww.png" /><figcaption>Logo for Atila Fassina — Web Engineer</figcaption></figure><p>Though my reason is actually manifold, I guess you can pretty much summarize it around the fact that I want to fully own my content. No paywall, no extraneous tracking data, no poorly supported syntax highlighting, and no inconsiderate API integration support.</p><p>So, from now on, if you want to read me rambling about web tech, head on to <a href="https://atila.fassina.eu/">atila.fassina.eu</a>. There&#39;s a brand new post about migrating my stuff from Medium and NextJS to Gatsby + Styled-Components.</p><p>How to find my ramblings from now on:</p><ul><li>Original, first hand blog essays: <a href="https://atila.fassina.eu/">atila.fassina.eu</a></li><li>Twitter: <a href="https://twitter.com/atilafassina">twitter.com/atilafassina</a></li><li>RSS feed if you&#39;re into that stuff: <a href="https://atila.fassina.eu/rss.xml">atila.fassina.eu/rss</a></li><li>Dev.to: <a href="https://dev.to/atila">dev.to/atila</a></li></ul><p>As always, don&#39;t hesitate to send any feedback you have towards my direction. I strongly recommend you <a href="https://twitter.com/atilafassina">twitter</a> for doing so. 😉</p><p>👋</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=744c1563953f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introducing the Web Team]]></title>
            <link>https://medium.com/insiden26/introducing-the-web-team-738587760c5e?source=rss-69a8d3fa8504------2</link>
            <guid isPermaLink="false">https://medium.com/p/738587760c5e</guid>
            <category><![CDATA[test-automation]]></category>
            <category><![CDATA[server-side-rendering]]></category>
            <category><![CDATA[graphql]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Atila Fassina]]></dc:creator>
            <pubDate>Tue, 11 Sep 2018 12:03:55 GMT</pubDate>
            <atom:updated>2018-10-02T07:32:46.550Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z4WvigcrZN5Ut3jG-H1jaQ.png" /><figcaption>N26 Tech Logo</figcaption></figure><p>The web functional team is composed of 9 individuals split across different product teams. We’re responsible for the web application, the website, and the support center of <em>the bank you love to use</em> (😉). Let’s see some data about us:</p><ul><li>Nationalities: Brazil, France, Germany, Latvia, United Kingdom and Ukraine.</li><li>Gender: 5 men, 3 women, 1 non-binary person.</li><li>Age: from 22 to 36 years old.</li></ul><p><em>*only showing data from people who explicitly opted-in the poll</em></p><p>One could say we’re a rather diverse group but we see it as a process instead of a goal. In spite of that, we do have solid beliefs when it comes to our work:</p><ul><li>We all take accessibility seriously.</li><li>We are open to reevaluate any choice and process anytime. Really.</li><li>We love refactoring.</li><li>We’re passionate about user experience.</li><li>We hate <em>bikeshedding</em> but make thorough code reviews.</li><li>We take pride in daily releases, having recently reached 350 releases in 370 days 🎉.</li></ul><h3>Stack Overview</h3><p>Our mono-repository is a platform that provides the code and infrastructure for all our Web Team projects. It&#39;s hosted on Github and according to the language stats, it&#39;s <strong>99.4% JavaScript</strong>. This probably doesn&#39;t mean much regarding our stack, except that we&#39;re among the big group of web developers who always bet on JS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*saIQvfGala1fKJE7SpM1rQ.png" /><figcaption>repository statistics per language. JavaScript: 99.4% x Other 0.6%.</figcaption></figure><p>In our tools you&#39;ll find battle-tested frameworks and libraries like: <a href="https://reactjs.org/">React</a>, <a href="https://www.apollographql.com/">Apollo</a>, and <a href="https://jestjs.io/">Jest</a>. But you&#39;ll also find plenty of custom made solutions and smaller projects which simply fit the bill of what we need. Best example being our weapon of choice for CSS-in-JS: <a href="http://fela.js.org/">Fela</a>.</p><p>On top of all that, we have an internal style-guide created with <a href="https://storybook.js.org/">Storybook</a>, serving both as component documentation for ourselves and as a reference for our content editors to skim through all modules and components available to them. Our technical documentation is served with <a href="https://www.gitbook.com/">Gitbook</a>, boasting over 25000 words across 32 chapters.</p><h3>Testing</h3><p>No test is written just for the sake of coverage. Tests are written with the actual functionality in mind, thus the appropriate test is chosen. Our infrastructure offers multiple testing options:</p><ul><li>Static analysis with <a href="https://eslint.org/">ESLint</a> (+ <a href="https://prettier.io/">Prettier</a> for coding standards)</li></ul><p>Combining static analysis with enforced coding standard has worked very well for us and it prevents us from irrelevant opinionated discussions on top of all benefits provided by static analysis. As a bonus, this approach frees each developer to choose the toolset they want.</p><ul><li>Unit testing with <a href="https://jestjs.io/">Jest</a></li></ul><p>We fully unit test all our helpers and some additional relevant methods. Essentially, everything that can be isolated in a functional unit is unit-tested. At the moment of writing this article, our repository has over 1000 tests.</p><ul><li>Route testing with <a href="https://github.com/visionmedia/supertest">Supertest</a></li></ul><p>For our website, we divide routes into 2 different sets: the <em>indexed</em> and the <em>unindexed</em> ones. Our editors are free to create landing pages straight from our Content Management System (CMS), using our component library. At the time of this article, we have 400+ routes published, among <em>indexed</em> and <em>unindexed</em>, temporary and permanent redirects. We’re happy to say no code reaches production if breaking any of those routes.</p><ul><li>End-to-end tests with <a href="https://www.cypress.io/">Cypress</a></li></ul><p>Every section which receives a fair amount of user interaction, is important for conversions or is subjected to system integration resilience is a candidate for end-to-end testing. Currently, there&#39;s extensive coverage on N26 for Web, on the website call-to-actions and in our legal documents section.</p><ul><li>Accessibility tests with <a href="https://github.com/dequelabs/react-axe">React-aXe</a>, <a href="https://github.com/pa11y/pa11y">Pa11y</a>, and <a href="https://github.com/edenspiekermann/outline-audit">outline-audit</a></li></ul><p>As previously mentioned, accessibility is something taken quite seriously within the team. We have very strict guidelines and warnings assessing our code and content during development and on the build pipeline. However, it is important to understand accessibility is a constant and cross-team effort, we reckon it&#39;s our responsibility as developers to enforce good practices from the web perspective.</p><p>If you liked this article, 👏 to tell your network and friends about it. Also, feel free to always reach out to <a href="https://twitter.com/N26Careers">N26</a> (or <a href="https://twitter.com/atilafassina">me</a> directly) on Twitter.</p><h3><strong>Interested in joining one of our teams as we grow?</strong></h3><p>If you’d like to join us on the journey of building the mobile bank the world loves to use have a look at some of the roles we’re looking for here: <a href="https://n26.com/en/careers">http://n26.com/careers</a><strong>.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=738587760c5e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/insiden26/introducing-the-web-team-738587760c5e">Introducing the Web Team</a> was originally published in <a href="https://medium.com/insiden26">InsideN26</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[High Performance Apps: Multiplexing, Debouncing, System Fonts, and other tricks]]></title>
            <link>https://medium.com/free-code-camp/high-performance-apps-multiplexing-debouncing-system-fonts-and-other-tricks-37c6fd3d7b2d?source=rss-69a8d3fa8504------2</link>
            <guid isPermaLink="false">https://medium.com/p/37c6fd3d7b2d</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[tech]]></category>
            <dc:creator><![CDATA[Atila Fassina]]></dc:creator>
            <pubDate>Tue, 22 Aug 2017 17:36:58 GMT</pubDate>
            <atom:updated>2017-08-22T17:36:58.497Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y9Wf1Py9tQd3nc4l0AFsCQ.png" /></figure><p>Here are some performance tips for your client-side application that you can start using immediately.</p><p>These will boost your app’s <a href="https://en.wikipedia.org/wiki/Perceived_performance">perceived performance</a> significantly. And most of them only require quick tweaks to your app.</p><h3>Preload your resources</h3><p>rel=&quot;preload&quot; is a way of letting your browser know that a specific resource is important. This way, your browser will fetch the resource as quickly as possible. Then it will store it locally until it finds the expected reference in the DOM.</p><p>Here are some examples of using a link with this attribute:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/07c488b78f7130cb4eb36c2219836fad/href">https://medium.com/media/07c488b78f7130cb4eb36c2219836fad/href</a></iframe><p>The as attribute is mandatory here, because it tells the browser what filetype that it is fetching. This way it can interpret the request and add the proper headers. Otherwise, your request would have the incorrect mime/type so your browser wouldn’t be able to parse it.</p><p>By the way, mime/type is the file type declaration that developers use on the web. This is similar to the file extensions on your desktop operating system. If you have the incorrect mime/type, the browser won’t know how to parse the file.</p><p>Font files are a bit trickier to preload. Here are some things to keep in mind:</p><ul><li>crossorigin —The <a href="https://en.wikipedia.org/wiki/World_Wide_Web_Consortium">W3C</a> requires that font fetches be anonymous. In a nutshell, this means even when the request is coming from the same domain, it will be treated as a cross-origin request.</li><li>type — This specifies which format the browser should use when fetching the font.</li></ul><p>Also, be sure to only add the first format to your font-face declaration. Preloading multiple font formats is against best practices, is bad UX, and wastes your users’ bandwidth.</p><p>You can <a href="https://caniuse.com/#search=preload">read more about preloading here</a>.</p><h3>Use Operating System-specific fonts</h3><p>By using system fonts, it’s possible to emulate your users’ Operational System’s look and feel. This way, your application has a better chance of looking like a native one, while saving your user the trouble of downloading more resources.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e847425419b227999e1fcac0c8548bc6/href">https://medium.com/media/e847425419b227999e1fcac0c8548bc6/href</a></iframe><p>Let&#39;s analyze more closely each of these declarations:</p><ul><li><em>apple-system</em>: as the name suggests, these target OSX/iOS-related systems</li><li><em>system-ui</em>: these target the system font, regardless of the system</li><li><em>BlinkMacSystemFont</em>: Chrome’s font on MacOS</li><li><em>Segoe UI</em>: Windows/Windows Phone</li><li><em>Roboto</em>: Android</li></ul><p>This solution is widely used even though many developers don’t yet know about it. For example, at time of writing this article, it&#39;s used at:</p><ul><li>GitHub</li><li>Wordpress</li><li>Bootstrap</li><li>Medium</li><li>Ghost</li><li>Zeit</li></ul><p>And probably others that I haven&#39;t yet heard about.</p><h3>Debounce and throttle calls to your server</h3><p>Some events get fired many times more than we intend to trigger them. For example: resize, scroll, keypress/keydown/keyup, or change.</p><p>Resize and scroll, for instance, get fired on <em>every</em> pixel. That’s an awful lot of chatter if you just want to adjust some elements on breakpoint, or add a class to a header as the user scrolls down the page.</p><p>If you get an autocomplete, for example, you don’t want to fire on every key press. In most cases, it would be good to start autocompleting after the 3rd character. Especially if you plan to fetch information for that.</p><p><strong>Debounce </strong>holds up your trigger until the event stops firing for a given amount of time (usually 500 milliseconds).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6c662353c2583babf3f94985c6df8b24/href">https://medium.com/media/6c662353c2583babf3f94985c6df8b24/href</a></iframe><p><strong>Throttle</strong> holds up your trigger if it attempts to fire more often than a given interval (usually 25o milliseconds).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/21d32f9a27745eb3e127c9248a6da6f7/href">https://medium.com/media/21d32f9a27745eb3e127c9248a6da6f7/href</a></iframe><h3>Use async/defer</h3><p>Remember the good old window.onload function? Or moving all the scripts to the bottom of your HTML? Yeah, well, async and defer are here to give you some better options.</p><p><strong>Async</strong> will download your script during the HTML parsing. It will run it asynchronously (if possible) — regardless of where it’s declared.</p><p><strong>Defer</strong> will also download your script during the HTML parsing, though it will only attempt to run your script after the parser is finished. Also, declaring multiple deferred scripts guarantees that they will be executed in declaration order.</p><pre>&lt;script async src=&quot;./my-async-script.js&quot;&gt;&lt;/script&gt;<br>&lt;script defer src=&quot;./my-deferred-script.js&quot;&gt;&lt;/script&gt;</pre><h3>data:uri and &lt;svg&gt;</h3><p>When adding icons or small image files, an interesting technique is to use data-uri. A data URL is usually encoded as base64 and provides an easy way of embedding files into your DOM directly. In a similar way, you can add &lt;svg&gt; as markup. This way your SVG image will be parsed and rendered by the browser.</p><p>Note that using the &lt;svg&gt; instead of embedding as an &lt;img&gt; or icon-font brings other functionalities that are beyond the scope of this article.</p><p>Adding the files straight into your markup instead of referencing them saves you one HTTP request each time. This is nice when your file is so small that it isn’t worth the trouble of making a roundtrip to the server. Especially while on mobile networks, since <a href="https://en.wikipedia.org/wiki/Handshaking">handshakes</a> can be quite expensive.</p><h3>Use Multiplexing</h3><p>If your server is already working with HTTP2, embedding files might not be worthwhile. This happens because HTTP2 has a feature called <strong>Multiplexing.</strong></p><p>This means your browser can send multiple requests and receive multiple responses &quot;<em>bundled</em>&quot; into a single TCP connection. So the workload associated with DNS lookups and <a href="https://en.wikipedia.org/wiki/Handshaking">handshakes</a> is saved for files coming from the same server.</p><p>In addition, HTTP2 also provides you with <strong>Server Push.</strong> This means it’s possible to send files even before the user requests them. This increases the perceived performance significantly.</p><p>I hope these tips help you improve the perceived performance of your app. If you found this article helpful, give me some claps 👏. You can also give me feedback on this on <a href="https://twitter.com/atilafassina">Twitter</a>.</p><h3>Further Reading</h3><h4>On rel=preload:</h4><ul><li><a href="https://www.smashingmagazine.com/2016/02/preload-what-is-it-good-for/">SmashingMagazine — Preload What is it Good for</a></li><li><a href="https://www.zachleat.com/web/preload/">Zach Letherman — Preload</a></li></ul><h4>On system fonts:</h4><ul><li><a href="https://bitsofco.de/the-new-system-font-stack/">Bitsofcode — The New System Font Stack?</a></li><li><a href="https://github.com/necolas/normalize.css/issues/665">Normalize.css — issue#665</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=37c6fd3d7b2d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/free-code-camp/high-performance-apps-multiplexing-debouncing-system-fonts-and-other-tricks-37c6fd3d7b2d">High Performance Apps: Multiplexing, Debouncing, System Fonts, and other tricks</a> was originally published in <a href="https://medium.com/free-code-camp">We’ve moved to freeCodeCamp.org/news</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My 2017 stack ]]></title>
            <link>https://medium.com/@atilafassina/my-2017-stack-e4c6a93f977?source=rss-69a8d3fa8504------2</link>
            <guid isPermaLink="false">https://medium.com/p/e4c6a93f977</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[server-side-rendering]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[https]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Atila Fassina]]></dc:creator>
            <pubDate>Sun, 16 Jul 2017 19:17:23 GMT</pubDate>
            <atom:updated>2017-09-05T06:43:57.350Z</atom:updated>
            <cc:license>https://creativecommons.org/licenses/by-nc/4.0/</cc:license>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*64oGqB4O9KevKTQLBUV2nw.png" /></figure><p>Recently I started refactoring my website, it has reached now its 5th stack over these its 5 years of existence. From <a href="https://wordpress.com/">wordpress</a> to <a href="https://jekyllrb.com/">jekyll</a>, passing quickly through <a href="https://mozilla.github.io/nunjucks/">nunjucks</a> templates compiled first with <a href="https://gruntjs.com/">Grunt</a> then with <a href="http://gulpjs.com/">Gulp</a>, I can say I&#39;ve been through a lot of setups. Since the whole point of having a personal website for a developer is to experiment, so I think it has been serving its purpose.</p><p>As tradition goes, it&#39;s time to write about my current decisions, why I&#39;m happy about them in comparison to what I had immediately before.</p><h4>HTTPS</h4><p>Serving custom domains over <a href="https://en.wikipedia.org/wiki/HTTPS">HTTPS</a> on any free plan isn&#39;t standard:</p><ul><li><a href="https://pages.github.com/">Gh-pages</a> doesn&#39;t support it</li><li><a href="https://heroku.com/">Heroku</a> only supports https on paid plans</li><li><a href="https://surge.sh/">Surge</a> also requires paid plans</li></ul><p>With <a href="https://www.cloudflare.com/">Cloudfare</a> it&#39;s possible to serve HTTPS, plus, it provides you a hassle free dashboard to create subdomains, manage your <strong>DNS</strong>, etc.</p><p>Setting it up is a no brainer, head over there and create your free plan account. Add your domain and <a href="https://www.cloudflare.com/">Cloudfare</a> will scan it for you, configuring itself automatically and then providing you with the two <strong>nameservers</strong> assigned to you.</p><p>Then, you move on to your Registrar. Add the <strong>nameservers</strong> and <em>bam</em>. Done.</p><p>Once your <strong>DNS</strong> has propagated (can take some time, but for me it took minutes), you can go over the <strong>Page Rules</strong> settings, create a new rule (<em>Force HTTPS</em>) and on the filter you can add</p><pre>http://*.yourdomain.com*</pre><p>Your traffic will almost instantly start being redirected to HTTPS.</p><h4>Serving</h4><p>Once you successfully started using <a href="https://www.cloudflare.com/">Cloudfare</a> as a proxy to your subdomain, you can start thinking about where are you going to serve your files from. From my perspective I had 3 options to consider:</p><ul><li><a href="https://heroku.com/">Heroku</a></li></ul><p>I emphasise on frontend development, which means my playground (website) won&#39;t have much complicated backend logic, if any. So, yeah, let&#39;s not start something by over-engineering it.</p><p><strong>EDIT:</strong> Since the time I wrote this article, I decided to move on an experiment with backend tech, therefore I reevaluated hosting my website on Heroku so I can play with <a href="https://github.com/zeit/next.js">NextJS</a>, what was the deal-breaker for me is that free tier puts the <em>dyno</em> to sleep on idle hours, making the first request to take a long time. Since my website doesn&#39;t have traffic that justifies a premium account, the sleeping <em>dyno</em> became a deal-breaker</p><ul><li><a href="https://pages.github.com/">Gh-Pages</a></li></ul><p>I&#39;d been serving files through Gh-Pages since forever, it works fine, is nice and centralise your concerns. Versioning and serving are on the same place. Though, since I moved away from Jekyll, working with frontend static builds hasn&#39;t been as smooth as it could be.</p><p>Keeping your /dist on a separated branch then your /src is possible, but a bit tricky, the best way I know is working with subtrees. But then again, it could/should be simpler to have them separated.</p><ul><li><a href="https://surge.sh/">Surge.sh</a></li></ul><p>Motivated by Separation of Concerns, I decided to try leaving only versioning to Github and using Surge to serve my statics. And I have to say: I couldn&#39;t be happier with this decision.</p><p>I simply added my /out folder to the .gitignore file, and created a deploy task on my npm scripts. Done.</p><p>Plus, if I feel like it, I can just add a hook to it and run the deploy task right after git push.</p><p><a href="http://surge.sh/">Surge</a> works great and has a simple, easy to use CLI (Command Line Interface). I totally recommend you give it a try if your goal is to serve a static generated website.</p><p><strong>EDIT:</strong> I still recommend you giving Surge a try if you plan on having a static website served. But, since I&#39;m using NextJS I decided to move to <a href="https://wedeploy.com/">WeDeploy</a>. Now I my website isn&#39;t static anymore, having some logic working on the backend for server-side-rendering a react application, that stretches my playground and allow me to test with some NodeJS.</p><h4>Development</h4><p>On my daily work I&#39;ve been using <a href="https://facebook.github.io/react">React</a>, and I&#39;m quite happy with the component architecture, <strong>css-in-js</strong> approaches and all that jazz. But a SPA (Single Page Application) never felt right for my personal website.</p><p><a href="https://github.com/zeit/next.js">NextJS</a> came along and I instantly fell in love with the idea. <strong>Server-side Rendering</strong> a <a href="https://facebook.github.io/react">React</a> application is one of the best things that happened to frontend development lately. The framework itself is great, minimalistic yet powerful. <a href="https://github.com/zeit/next.js">NextJS</a> provides you an easy to customise NodeJS server, a simple CLI, <a href="https://github.com/zeit/next.js#built-in-css-support">out-of-the-box Styled-JSX</a> and, among many other things, a static website generator <a href="https://zeit.co/blog/next3-preview">as of version 3.0</a>. So that was my weapon of choice.</p><p>I&#39;ve done some other work with <a href="https://github.com/zeit/next.js">NextJS</a> and I cannot recommend it enough.</p><p>If you found this helpful, please recommend it to your network by giving me some 👏 . Also, if you feel like giving me a feedback, give me a shout on <a href="https://twitter.com/atilafassina">twitter</a>, I’ll appreciate that.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e4c6a93f977" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[React Amsterdam Review — Main track]]></title>
            <link>https://medium.com/@atilafassina/react-amsterdam-3fcfb7e6a15?source=rss-69a8d3fa8504------2</link>
            <guid isPermaLink="false">https://medium.com/p/3fcfb7e6a15</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[redux]]></category>
            <category><![CDATA[mobx]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Atila Fassina]]></dc:creator>
            <pubDate>Sun, 23 Apr 2017 13:52:07 GMT</pubDate>
            <atom:updated>2017-05-02T22:29:22.316Z</atom:updated>
            <cc:license>https://creativecommons.org/licenses/by-sa/4.0/</cc:license>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T4CCFC7oRZI-SAINmeKkVQ.jpeg" /></figure><p>React Amsterdam was one of the biggest conferences I’ve ever been, over 1000 attendees [I don’t have the exact number, but it was said to have exceeded by the hundreds. Though it was a huge event, it never felt awfully packed, the organisers manage to have a <strong>titan</strong> event and it felt like a small one in terms of attention given. I felt like this event had been organised by people who care for conferences and would’ve been just another person amongst the crowd if not organising it.</p><p>Kudos for all the attention and effort that went in making this event happen and curating the line-up with excellent talks overall.</p><h3>Getting there</h3><p>Something that otherwise wouldn’t be noticed, the way to the conference took advantage of the beautiful Amsterdam and put some elegance and charm on the way to the venue.</p><h3>Átila Fassina on Twitter</h3><p>⛴ ferry ride to #reactamsterdam it does not get any cooler than this!! 😎</p><h3>The Venue + Infrastructure</h3><p>I’m not sure what kind of place is that on regular days, it had an hangar-like vibe which brought some rough loft-like appearance. If not by the ferry ride, it was evident by the venue that React Amsterdam was showing a personality of its own.</p><p>The infrastructure was awesome, nice people, a breakfast to welcome and some nice handovers waited for us on arrival. Starting was remarkably on time even though people were arriving in waves, they manage to keep a consistent flow during check-in and everything went smoothly.</p><p>Wifi is always an issue in conferences, it’s something unavoidable, I guess. Nevertheless, for quite some time I was extremely optimistic regarding the wifi, during the biggest part of the morning connection was fluid and fast; unfortunately in the afternoon it gave in and speed/connectivity was a luxury that I didn’t experience.</p><h3>Talks</h3><p>If you’re interested on the technical content of each talk, I suggest you keeping an eye on React’s Amsterdam youtube account or giving a shoutout to the speaker. I will not try to summarize the talk as they are so many and I’m afraid I wouldn’t be able to keep fareness to each individual qualities. I will not shy myself from expressing my opinion and interpretation on highlighted subjects, though. Bare in mind that my opinions are my own and may or may not be correct, by the way, if you don’t agree please comment on this very post or give me a shout on twitter, I’ll be very happy to talk to you.</p><p>Since I’m here to express my opinions, I highlighted my 3 favourite talks and lightning talk with a ⭐️ next to each title.</p><h3>Styling React/ReactNative Applications</h3><p><a href="https://twitter.com/mxstbr">Max Stoiber</a> delivered a kickass talk to start the event at full-throttle. As one of the authors of <a href="https://styled-components.com/">Styled Components</a> he took on the difficult task to create maintainable and scalable styles. His talk pointed out that practices, even the long consolidated ones, must be always questioned in favor of finding better patterns. For example:</p><ul><li>if we can make use of the full power of Javascript to write scoped styles that are unique to each component, why not?</li><li>if each class is used only once and is tightly coupled with its component, do we really need <em>class ↔ styles</em> mapping?</li></ul><p>I really enjoyed this talk, and it gave me much to think about dealing with styles for component-based applications, I will definitely try <a href="https://styled-components.com/">Styled Components</a>, not only because of <a href="https://twitter.com/mxstbr">Max</a>’s passion on the topic and towards his project, but also for the many selling points that he intelligently argued during his talk.</p><h3>How Pinterest Switched Their Template Rendering Engine to React ⭐️</h3><p>I came to this talk full of expectations because it speaks directly to some of the work we’re doing at <a href="http://www.simplesurance-group.com/">Simplesurance</a>, <a href="https://twitter.com/missyjcat">Jessica Chan</a> delivered everything that I was expecting and more.</p><p>The main topic is how they are migrating from a Python/Jinja2+JS/Nunjucks server-side rendering stack to an isomorphic application with React/NodeJS. In order to do so, they had to come up with different solutions and creating a migration step (NodeJS/Nunjucks+JS/Nunjucks) in order to get Pinterest being isomorphic before switching templates.</p><p>She also brought a bunch of solutions they’ve had to come up during this road (which is not a short one, started in 2014) and also some <strong>metrics</strong>. For example, how they had a performance hit in the beginning of the first switch, but now after working that and started the React switch, they’re getting gains of up <strong>30%</strong> perceived performance.</p><p>As I mentioned above, all this go in line with some of our aspirations at <a href="http://www.simplesurance-group.com/">Simplesurance</a>, and after hearing her experiences with a larger app and some of her successes in that endeavour, I’m very optimistic about the decisions we’re going for over there. Luckily soon I’ll have similar stats and stories to share. 😎</p><h3>A Real-World GraphQL Application in Production</h3><p>GraphQL is something that has been on my radar for quite some time now, unfortunately I haven’t found the time to play with it yet, so you can assume I was pretty curious for this talk. <a href="https://twitter.com/stefanomasini">Stefano Masini</a> did a good job showing his stack at Balsamiq and pointing out how GraphQL is just not some <em>cool new tool with a hype</em>. It actually helps you have better code and it improves your workflow by easing test coverage and test-running performance. Definitely something I’m looking forward on testing and I’ll make use of <a href="https://twitter.com/stefanomasini">Stefano</a>’s experience as soon as I get to that!</p><h3>Lightning Talks</h3><ul><li>Advanced SSR Caching with React <br><a href="https://twitter.com/operatino">Robert Haritonov</a></li><li>Make Linting Great Again<br><a href="https://twitter.com/okonetchnikov">Andrey Okonetchnikov</a></li><li>Generating Your Client Validation Rules<br>Ronald van der Kooy</li><li>Building Applications for the Studio in the Cloud at Netflix ⭐<br><a href="https://twitter.com/featherart">Feather Knee</a> ️</li></ul><p>I’ll give these speakers a huge applause, it’s extremely difficult to get a message through in such a short amount of time. But I’m happy to say they were all able to do it. Special kudos to <a href="https://twitter.com/featherart">Feather</a> and <a href="https://twitter.com/okonetchnikov">Andrey</a> for their spot-on topics.</p><p><a href="https://twitter.com/featherart">Feather</a> showed us that you don’t need a complex stack to have a cool app. In fact, don’t overcomplicate things: if you can get by without state-managing package, then do it. Do not force <a href="http://redux.js.org/">Redux</a> or <a href="https://mobx.js.org/">MobX</a> on your project. Keep lean, well-written and easy to maintain. (also, she made me an extremely nice selling-point on <a href="https://mobx.js.org/">MobX</a> and I’m very eager to try it out ASAP!)</p><p><a href="https://twitter.com/okonetchnikov">Andrey</a> tackled linting problems like a pro. I’ll definitely try his webhook approach in order to avoid those fix lint commits. His <a href="https://github.com/okonet/lint-staged">lint-staged</a> package is also super nice and with prettier can accomplish the same linting results as <a href="https://standardjs.com/">StandardJS</a> with your own rules, totally deserves a look!</p><h3>Fun With Fiber Custom Renderers</h3><p><a href="https://twitter.com/ken_wheeler">Ken Wheeler</a>’s energy is contagious, he’s a natural on the stage and makes even dense topics easy to follow. If not only that, his talk walked us through <a href="https://github.com/acdlite/react-fiber-architecture">React Fiber</a>’s rendering engine with some cool audio demos. It’s one of those talks you watch more than once.</p><h3>Pushing Bugs to Prod Responsibly with React and Redux</h3><p><a href="https://twitter.com/castillo__io">Alex Castillo</a>’s talk was about being able to monitor your code on production in order to being able to catch bugs and issues <strong>before</strong> your users. In order to do show us how he did it, using React + <a href="http://redux.js.org/">Redux</a>, he first went through how <a href="http://redux.js.org/">Redux</a> Middleware work and how to leverage their usage to create one of your own.</p><p>By creating a Middleware to catch and log errors, they manage to get all the info from a bug and even a message sometimes even before the user is able to spot there is any inconsistency at all, therefore making them an extreme responsive team.</p><p>Super awesome work, I totally will look further into it in order to gather more info from my code problems before even trying to solve them! 😀</p><h3>Test Like It’s 2017 ⭐️</h3><p>I don’t know what Facebook has been feeding its employees, but looks like every time one of them takes the mic they’re off to change the world. <a href="https://twitter.com/MicheleBertoli">Michele Bertoli</a>’s not an exception to this rule, he showed us a testing revamp that blew minds, knocked off hats and cracked some jaws loose. Not only that, he also delivered the best quote of the conference:</p><blockquote><em>Best way of testing is not writing tests.</em></blockquote><p>WAT?! Exactly. You can have <a href="https://github.com/MicheleBertoli/react-fix-it">React-fix-it</a> write you tests. And that’s just the tip of the iceberg on his talk. He went from “Do you think testing is important?” to styleguides, documentation, coverage… everything, literally everything.</p><p>That’s another talk that I can’t wait for the video because just my personal notes won’t suffice, and I really think everyone should watch it at least once. I’ll leave you with the new code testing pyramid they’ve been using at Facebook (and that also got mentioned one more time on this event by his colleague <a href="https://twitter.com/forbeslindesay">Forbes</a>).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/917/1*Q1_AUcbY02an49FCkGvemA.jpeg" /></figure><h3>Introduction to ReactVR</h3><p>Yup. That’s it, <a href="https://twitter.com/nikgraf">Nik Graf</a> made a big showcase about how easy it can be to work with VR on web technologies, and how <a href="https://facebook.github.io/react-vr/">ReactVR</a> make’s it just like another React SPA. It’s definitely worth checking his demos and seeing what it’s all about if you’re interested in 3D modelling and the VR hype! 😉</p><p>Personally, I’m still eager to see a real-world implementation of all this. I understand that we need to explore and experiment before, but I’m curious to see what VR is capable of other than <strong>raw coolness</strong>, and <a href="https://twitter.com/nikgraf">Nik Graf</a> is probably the guy to keep an eye on and see what he’ll pull up next!</p><h3>Complexity: Divide and Conquer! ⭐️</h3><p><a href="https://twitter.com/mweststrate">Michel Weststrate</a>, one of the people behind <a href="https://mobx.js.org/">MobX</a> comes to stage to attack some paradigms. He starts his talk in a very clever way, showing how <em>Dividing</em> your adversary is well established and successful strategy to efficiently <em>Conquer</em> them. I appreciated that very much.</p><blockquote>Small , isolated problems are much easier to deal with than big intertwined problems</blockquote><p>Being <strong>complexity</strong> arguably the biggest adversary any software developer can find on his own code, that&#39;s his enemy of choice for the day. <a href="https://twitter.com/mweststrate">Michel</a> points out that we still have our view tightly coupled to our state. Which would be going against one of the principals of Reactive Programming, being that to achieve your application to be truly reactive, we must separate the behaviour from the timing in which the behaviour shall be triggered; in other words: &quot;Separate the <strong>how</strong> from the <strong>when</strong>&quot;.</p><p>So <a href="https://twitter.com/mweststrate">Michel</a> walks us through a review of how to treat your states and the flow of your application so we can have decoupled software that doesn&#39;t even requires a view to actually works.</p><p>Truly impressive and a <em>must watch</em> talk to every react developer, from beginners to advanced.</p><h3>Flow Typing a React Codebase</h3><p><a href="https://twitter.com/forbeslindesay">Forbes Lindesay</a> comes to show the advantages of using <a href="https://flow.org/">Flow</a> on your workflow. In fact, he takes a step back before even getting to it. You take another look at that pyramid for covering your code, and <a href="https://twitter.com/forbeslindesay">Forbes</a> points out the importance of <em>Static Analysis</em> in order to have a sane, maintainable and error free codebase.</p><p>Then we jump into <a href="https://flow.org/">Flow</a>, after pointing out the profits of <em>Static Analysis </em>it&#39;s only natural that he leverages the selling points of having<em> type checking</em>. I&#39;ll be totally honest now: I still have my doubts about how much profit you can take from type-checking JS, I&#39;m still a bit skeptical how it actually improves your code-base and all. But <a href="https://twitter.com/forbeslindesay">Forbes</a> got me to want to test it, which I believe was the goal of the first half of his talk.</p><p>Second part of the talk is about tips &amp; caveats on using <a href="https://flow.org/">Flow</a>. How to workaround common issues, how to <strong>not</strong> workaround common issues, and how to leverage the usage of <a href="https://flow.org/">Flow</a> to its maximum potential. This part was aimed to experience/advanced users of <a href="https://flow.org/">Flow</a>, and I believe I&#39;ll take more profit of it after starting to check it in practice.</p><h3>Surprise Talk</h3><p><a href="https://twitter.com/vincentriemer">Vincent Riemer</a> and <a href="https://twitter.com/batchass">Bruce Lane</a> climb up the stage to give a surprise last talk and close-up the conference in a big fashion.</p><p><a href="https://twitter.com/vincentriemer">Vincent</a> starts it up by pointing out he also has a passion for electronic music, and then goes on to showcase a very impressive side-project of his, he recreated in with React a web version of TR-808.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-hhGY4mDO1U7Yxwr1AUARA.jpeg" /></figure><p>The project is called <a href="https://io808.com/">io808</a>, he continues to go on of some of the difficulties he found working around all the state changes and the timing problems. It&#39;s definitely something to look up if you are interested in big complex multi-state React applications, electronic music or both!</p><p>Then comes <a href="https://twitter.com/batchass">Bruce</a>, in this electronic music vibe, he comes to a showdown of amazing skills with OpenGL shaders and electronic music on coding… <strong>live</strong>-coding.</p><p>And with the sound of coded-electronic-music we &quot;fall&quot; straight inside the after-party that takes place in the same hangar/lobby as the coffee-breaks and a very comfortable round-up for an awesome conference!</p><h3>Conclusion</h3><p>React Amsterdam was the first conference I attended since moving from Brazil to Europe, and I’d say I’m off to a great start: high-level venue, high-level talks, high-level attendees. It was a very fun day, with lots of networking and information sharing. Besides the organisers I’d like point out special thanks to the speakers: <a href="https://twitter.com/castillo__io">Alex Castillo</a>, <a href="https://twitter.com/featherart">Feather Knee</a> ️ and <a href="https://twitter.com/missyjcat">Jessica Chan</a> for the nice conversations we’ve had at the lobby. And I won’t left out my colleagues <a href="https://twitter.com/Donovan_TC">Donovan Isherwood</a>, <a href="https://github.com/lopis">João Lopes</a> and <a href="https://github.com/petromoldovan">Petro Moldovan</a> for tagging along and helping me digest all this info throughout the day. Last but not least, huge thanks to <a href="http://www.simplesurance-group.com/">Simplesurance</a> for providing us with this opportunity, it was awesome! ✨</p><h4>Live Streams links</h4><ul><li><a href="https://www.youtube.com/watch?v=JTST9iPNeLU&amp;index=1&amp;list=PLNBNS7NRGKMHxfm0CcYNuINLdRw7r4a9M">React Native Track</a></li><li><a href="https://www.youtube.com/watch?v=m_vUUgI0bo8&amp;index=2&amp;list=PLNBNS7NRGKMHxfm0CcYNuINLdRw7r4a9M">Main Track</a></li></ul><p>Any kind of feedback is welcome either here on medium or directly on <a href="https://twitter.com/atilafassina">twitter</a>. And if you liked this article, please click on the 💚 and make it available to your followers.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3fcfb7e6a15" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Custom Server & Redux on a NextJS App]]></title>
            <link>https://medium.com/@atilafassina/custom-server-redux-on-a-nextjs-app-d3a042ee3045?source=rss-69a8d3fa8504------2</link>
            <guid isPermaLink="false">https://medium.com/p/d3a042ee3045</guid>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[redux]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Atila Fassina]]></dc:creator>
            <pubDate>Fri, 17 Feb 2017 13:54:14 GMT</pubDate>
            <atom:updated>2017-02-17T13:56:02.493Z</atom:updated>
            <cc:license>http://creativecommons.org/licenses/by/4.0/</cc:license>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BUTP4qvc65dmmCy9NUcgvQ.png" /></figure><p>In case you never heard about <a href="https://zeit.co/blog/next">NextJS</a>, it’s a framework built to render React applications on the server-side, open-sourced and built by the awesome guys at <a href="https://zeit.co/">Zeit</a>.</p><h4>Quick disclaimer</h4><p>As NextJS carries a lot of very cool functionalities out-of-the-box I wouldn’t recommend you using the practices described here if you’re not 100% certain you will need them.</p><p>As <a href="https://medium.com/u/a3a8af6addc1">Dan Abramov</a> brilliantly stated <a href="https://medium.com/@dan_abramov/you-might-not-need-redux-be46360cf367#.lhbv0mh51">You might not need Redux</a>, and I’ll take the right to state that you might also don’t need a custom server on your NextJS webapp.</p><h3>Redux</h3><p>To get Redux working on your NextJS there’s only one big caveat that needs to be addressed: on rendering your page at the server you need to certify that you’ll create a different store on each hit made at your server, otherwise you might end up mixing data from different users.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/427d6b8a2f40de068e760e1aff46ed9e/href">https://medium.com/media/427d6b8a2f40de068e760e1aff46ed9e/href</a></iframe><p>By passing a boolean from the reqparameter on getInitialProps() from your component, you&#39;ll be able to identify on initStore() if you&#39;re on the client or on the server.</p><p>Additionally, for obvious reasons it’s good to check if a store hasn’t already been created if you’re on the client-side. This method assures you you’ll have one (and one only) store per user.</p><p>Taken from the <a href="https://github.com/zeit/next.js/blob/master/examples/with-redux/store.js#L17-L25">example on NextJS Repository</a>.</p><h3>Parameterised Routing with ExpressJS</h3><p>In case you just need some simple routes between views of your app, please, don’t use this solution. NextJS brings out-of-the-box the &lt;Link /&gt; component that can be used to navigate across the different .js files you define as views (more on <a href="https://github.com/zeit/next.js/#with-link">NextJS Readme</a>), even with a cool <strong>prefetch</strong> alternative.</p><p>So, when to use <strong>Parameterised Routing</strong> ?</p><p>First idea that comes to my mind is when you have one view that will be rendered with different states (think about a template that will be extend just to display different contents), in this case <strong>Parameterised Routing</strong> can be a solution for you.</p><h4>Setup Custom Server</h4><p>To get parameterised routing working, you first need to setup your custom server, specify the routes for it to listen, return and the properties to be forwarded to your template. May sound complicated, but it’s very straight forward.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c1d44efb79b15931f3176b9d298c8379/href">https://medium.com/media/c1d44efb79b15931f3176b9d298c8379/href</a></iframe><p>Above you may find a simplified snippet from an example app, as you may notice: it’s using <a href="http://expressjs.com/">Express</a>, though it’s not mandatory and you may find other alternatives, I strongly recommend it specially for its simplicity.</p><p>As you may be wondering, the 4th parameter on our app.render()method is the object to be passed on to our component through getInitialProps()and mate.jswill deal internally with the content to render.</p><h4>Run NextJS with a custom server</h4><p>Could not be simpler, you just need to go to your package.json and change</p><pre>{<br>    scripts: {</pre><pre>&quot;start&quot;: &quot;next&quot;<br>    }</pre><pre>}</pre><p>to</p><pre>{</pre><pre>scripts: {</pre><pre>&quot;start&quot;: &quot;node server.js&quot;</pre><pre>}</pre><pre>}</pre><p>Assuming, of course, the server.js is at the root of your project.</p><h3>Deploy</h3><h4>Now</h4><p>With <a href="https://zeit.co/now">Now</a> it could not be any easier, considering you have it installed globally and have a registered account, you can just type nowat your terminal. Done.</p><h4>Heroku</h4><p>For deployment on <a href="https://dashboard.heroku.com/login">Heroku</a> you have the very good <a href="https://github.com/mars/heroku-nextjs">heroku-nextjs</a> that make it seamless as well. Of course, you will also need an active account on Heroku, then commit your changes and git push heroku master.</p><h4>Test-case Repository:</h4><ul><li>Test App that originated this article: <a href="https://github.com/atilafassina/next-seo-test">https://github.com/atilafassina/next-seo-test</a></li></ul><p>If you liked this article, recommend it to your network by clicking on the 💚. This also provides me with a much appreciated feedback, of course, if you feel like providing a more extended one, the comment/response section is at your service!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d3a042ee3045" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Truly scalable styles]]></title>
            <link>https://medium.com/@atilafassina/truly-scalable-styles-512445a4e9a6?source=rss-69a8d3fa8504------2</link>
            <guid isPermaLink="false">https://medium.com/p/512445a4e9a6</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[coding-style]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[scalability]]></category>
            <category><![CDATA[itcss]]></category>
            <dc:creator><![CDATA[Atila Fassina]]></dc:creator>
            <pubDate>Mon, 26 Dec 2016 19:37:43 GMT</pubDate>
            <atom:updated>2016-12-26T19:37:43.797Z</atom:updated>
            <cc:license>http://creativecommons.org/licenses/by/4.0/</cc:license>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gu7RQ0k6nFGGPAymjgC6zQ.png" /></figure><p>Styles architecture are one of the most tricky aspects of building complex application for scaling. I think that comes from a conjunction of different factors the major ones being:</p><ul><li><strong>Beginner-friendly</strong>: upon a try/error approach you can get anything done in a couple of hours. If after that you&#39;ll be able to read it is another story. CSS can be harder to read than compiled Perl. (ok, maybe not, but feels like that sometimes).</li><li><strong>There&#39;s no defined structure on how you should write your code</strong>. CSS is like that passive-aggressive person that makes all concessions and never complains while secretly is about to burst. You can basically override anything at any given moment of the code and get what you need done, if you&#39;re not on the look-out one day those side-effects come to bite you on your behind, but that&#39;s not your <em>present self</em> business, right?</li></ul><p>There are of course other specifics that you can think of. But while any other <em>inconsistent, feature-lacking, buggy</em> nuance is being, quickly or not, addressed (and it is, take a look on how we used to write code not a few years back and you&#39;ll probably agree) these two aspects are what makes CSS so awesome.</p><h4>Code degradation over time</h4><p>Being beginner-friendly and having no concise structure make a dangerous combination to any language. You build your code, you ship it. We all know that&#39;s how ☠️ <strong>legacy code</strong> ☠️ is born.</p><p>Once the code is out there it&#39;s extremely hard to face the Technical Debt and refactor it. So, if you need to update/change/rebuild something, you end up doing it punctually. As time goes by product grows, your team grows and suddenly it&#39;s not feasible to understand where to change and how to maintain it, you may find yourself playing some <strong>short blanket.</strong></p><blockquote><strong>Short blanket</strong> is when you pull the sheets up to cover your head and your toes slip out, then the other way around.</blockquote><p>In software developing it happens when, by working-around a bug, you create another one to which you also work-around. Fortunately, there is a metric that have shown to ease code maintenance and decrease the degradation of your code over time.</p><h3>Specificity Graph</h3><p>What make selectors strong or weak is their specificity, for example</p><pre>.btn {<br>  /* props 1 */<br>}</pre><pre>.btn.active {<br>  /* props 2 /*<br>}</pre><p>Whenever there&#39;s a concurrency among them<strong>, Props2</strong> will override <strong>Props1</strong>. The<strong> </strong>main reason is the selector for <strong>Props2</strong> ( .btn.active) is more specific than the selector for <strong>Props1</strong> (.btn<em> </em>). It actually speaks louder than the <em>Cascading</em> nature of CSS — which basically states that whatever comes later is preponderant to what comes before.</p><p>So, to the graph now!</p><p><strong>Specificity Graph</strong> is an analysis made on your whole stylesheet and drawn upon a <a href="https://en.wikipedia.org/wiki/Cartesian_coordinate_system">Cartesian Plane</a>. The<em> y-axis</em> being the specificity of each selector while the<strong> </strong><em>x-axis</em> is its location on the stylesheet (top → bottom).</p><p>Check the following example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jpl7LUHSmAEs18Re4kdDIQ.png" /><figcaption>Specificity x Place on Stylesheet</figcaption></figure><blockquote>Your graph should behave on a continuous increasing line with the least spikes as possible.</blockquote><h4>Spikes ratio x Maintainability</h4><p>Having spikes allocated according to design as we normally do makes our code unpredictable, therefore unreliable. Thinking from other languages, you usually have pieces of your code where you can expect values to be returned, endpoints, etc. Basically you can predict where each module will affect the next one, that makes your code more maintainable: worst case scenario, you can refactor it all keeping consistent with the expected output (please, if so make a proper refactor later 😉).</p><p>If you&#39;re able to know beforehand the location of your styles major outputs at least, you <strong>may</strong> be able to stop being afraid of <em>!important .</em></p><h3>ITCSS</h3><p>In play comes the <strong>Inverted Triangle CSS</strong>, the methodology originated with <a href="https://twitter.com/csswizardry">Harry Roberts</a>, it&#39;s a bit tricky to find resources over the methodology, but I promise to leave on the <a href="#2daa">References</a> what I have (and please, if you&#39;ve written or know more, feel free to add in the comments).</p><p>In this article, I&#39;ll explain basically about how I&#39;m using it with some minor adaptations I&#39;ve managed for my current workflow.</p><h4>The Paradigm</h4><p>As I said before, we&#39;ve been writing CSS wrong because we&#39;ve been trying to replicate page structure in our code, this doesn&#39;t respect the cascading nature of CSS.</p><p>The idea behind ITCSS is to organise your styles in a flow that respects their strength, and <strong>aims to</strong> <strong>decrease</strong> <strong>specificity spikes</strong>. In other words, say goodbye to header.css<em>, </em><em>footer.css , </em><em>sidebar.css</em> ,etc.</p><h4>Inverted Triangle</h4><p>The idea behind this concept is to follow from <strong>low specificity </strong>to<strong> high specificity</strong>. This modification of ITCSS that I prefer to use works with 5 layers of styles, with a possible 6th ramification (more on that later). If you&#39;re working on a small to medium application, these layers may be the modules themselves, but in bigger applications you can treat them as levels, categories, groups or <strong>layers </strong>of styles.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/533/1*OH__3yW9g-j20_3O0_re5g.png" /><figcaption>the layers of ITCSS</figcaption></figure><ul><li><strong>settings</strong></li></ul><p>If you use a preprocessor of any kind, first goes your variables and other basic/global configurations. Nothing gets straight to the DOM from here.</p><ul><li><strong>tools</strong></li></ul><p><em>mixins</em>, <em>functions</em> and <em>placeholders </em>(no classes, never extend classes!). Still, keep it out of the DOM.</p><ul><li><strong>base</strong></li></ul><p>Finally you’re ready to start writing something that will effectively affect your mark-up: resets and/or basic definitions. And by basic, I mean <strong>basic. </strong>Here you give the look and feel of your default elements, it&#39;s the place where you can/should use <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Type_selectors">Type Selectors</a>.</p><ul><li><strong>components</strong></li></ul><p>At this point, you start with specifics. If your working with <a href="http://bradfrost.com/blog/post/atomic-web-design/">Atomic Design</a>, for example, here you&#39;d start with your <em>Molecules</em> and <em>Organisms.</em></p><p>As I said, you can have a 6th layer. If your application is big enough, I&#39;d recommend having a <em>general</em><strong> </strong>layer<strong> before</strong> your<strong> </strong>components layer, there you can have the common styles for different components.</p><p>Here you should be using <strong>Classes</strong> and maybe some <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Descendant_selectors">Descendant Selectors</a> (not too much, if you go to up to 3 levels or more, you might want to re-think your approach).</p><ul><li><strong>overrides</strong></li></ul><p>And, as the name says ( <em>trumps</em> in the original ITCSS), it&#39;s where you put everything that is supposed to override something else. For example, states. Your .btn[data-active=true]or .btn.active goes here, etc…</p><p>And, as I said, if you follow this structure, here is the place where you can stop being afraid of !important . As they will all linger at the end of your code, and very close to each other it will be easier to spot any bugs you create down the line by using it. (not the you should use it, I&#39;m just pointing it out! 😜)</p><p>If you liked this article, recommend it to your network by clicking on the 💚. This also provides me with a much appreciated feedback, of course, if you feel like providing a more extended one, I&#39;m all ears (or eyes!) on the comment/response section!</p><h3>References</h3><ul><li><a href="http://csswizardry.com/2014/10/the-specificity-graph/">Specificity Graph</a></li><li><a href="https://jonassebastianohlsson.com/specificity-graph/">Specificity Graph Generator</a></li><li><a href="https://www.xfive.co/blog/itcss-scalable-maintainable-css-architecture/">ITCSS Scalable Maintainable CSS Architecture</a></li><li><a href="https://www.youtube.com/watch?v=1OKZOV-iLj4">Harry Roberts — Managing CSS Projects with ITCSS</a></li></ul><h4>Honorable Mention</h4><ul><li><a href="http://itcss.io/">ITCSS</a> Project page. (no content at time of publication)</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=512445a4e9a6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Let's start with Yarn]]></title>
            <link>https://medium.com/@atilafassina/lets-start-with-yarn-890687bb1902?source=rss-69a8d3fa8504------2</link>
            <guid isPermaLink="false">https://medium.com/p/890687bb1902</guid>
            <category><![CDATA[npm]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[yarn]]></category>
            <category><![CDATA[package-management]]></category>
            <dc:creator><![CDATA[Atila Fassina]]></dc:creator>
            <pubDate>Wed, 12 Oct 2016 21:28:45 GMT</pubDate>
            <atom:updated>2016-10-24T08:00:43.735Z</atom:updated>
            <cc:license>http://creativecommons.org/licenses/by/4.0/</cc:license>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m6zlwvyKm9BPeFQCKvGQEQ.png" /></figure><p><a href="https://yarnpkg.com/">Yarn</a> is a new <strong>dependency manager</strong> created by the cool guys at Facebook and a bunch of other contributors.</p><h3>Why?</h3><p>We, as developers, need to ask ourselves this question constantly. After all, our job is to solve problems, so if you start a project you need to be solving a problem somebody&#39;s having, if not you.</p><p>And that&#39;s the idea that propelled the guys at Facebook to create from scratch a new manager for their packages (<a href="https://code.facebook.com/posts/1840075619545360/yarn-a-new-package-manager-for-javascript/">you can read it more extensively on their article</a>).</p><p>As <a href="https://twitter.com/wycats">Yehuda Katz</a> well put in his <a href="http://yehudakatz.com/2016/10/11/im-excited-to-work-on-yarn-the-new-js-package-manager-2/">recent article</a>, npm client does its job reasonably well, some of you might never have bumped into a problem while working extensively with npm packages and managing them through NPM client. But there were issues to be addressed, and that&#39;s where Yarn excels.</p><h3>Main differences</h3><ul><li>Open-source.</li></ul><p>There&#39;s no much arguing with that, Yarn is created by the community and for the community, as you can see by its <a href="https://github.com/yarnpkg">Organisation</a> on Github, it&#39;s there for you to submit issues, make pull requests, share and learn.</p><ul><li>Multiple registries</li></ul><p>Yarn supports multiple registries, which means you will be able to manage your Bower Packages with the same dependency manager as your NPM Packages.</p><ul><li>Deterministic</li></ul><p>Yarn assures that every time you run <em>yarn</em> on a project it will install its dependencies on the same order, I mean, the internal structure of your <em>node_modules</em> will always be the same, avoiding some very hard to spot bugs.</p><ul><li>Offline mode</li></ul><p>Yarn works very well with caches in order to make any package once installed by you available offline.</p><p>And there&#39;s more, check the documentation to see about Network Resilience, Network Performance and <a href="https://yarnpkg.com/en/compare">some comparisons</a>.</p><h3>Installation</h3><p>Yarn broke the process into 3 steps, making the interface with the enduser much clearer and nicer.</p><ol><li><strong>Resolution:</strong> Make the requests and look-up dependencies.</li><li><strong>Fetching:</strong> Check if the dependency is available at the <em>Global cache</em> (offline mode), if it&#39;s not, fetches from the repository and places it there to be available offline later.</li><li><strong>Linking:</strong> Finishes everything up by bringing everything from the <em>Global cache</em> to the <em>node_modules</em> folder.</li></ol><h3>Start using it!</h3><p>And to start using it couldn&#39;t be any simpler:</p><pre>npm i -g yarnpkg</pre><p>Done. You have it now. <a href="https://yarnpkg.com/en/docs/migrating-from-npm">Here</a> is a quick list with npm commands and their Yarn respectives.</p><h3>Freebies</h3><p>I&#39;ve just started playing with Yarn, and I&#39;ve merely scratched the surface, but here are 2 commands that I&#39;ve found super cool I recommend you to use them.</p><pre>yarn clean</pre><p><a href="https://yarnpkg.com/en/docs/cli/clean">removes unnecessary files from your dependencies</a>.<br>(it&#39;s kind of magical when you run it the first time! :P).</p><pre>yarn why &lt;package&gt;</pre><p><a href="https://yarnpkg.com/en/docs/cli/why">Identify why you installed a package</a>. Pointing it as a sub-dependency among your modules or if directly specified by you as a dependency.</p><h3>Conclusion</h3><p>I&#39;ve slowly started using Yarn today, but I got to be honest, it&#39;s cli interface, and it&#39;s performance are so nice that I felt completely dragged, now I can say I&#39;ve completely migrated to Yarn, let&#39;s see what happens. What about you?</p><p><em>PS.: if you liked it, click on the 💚 for recommending it to people you know.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=890687bb1902" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introducing: Blogium]]></title>
            <link>https://medium.com/@atilafassina/introducing-blogium-d6ee1a343919?source=rss-69a8d3fa8504------2</link>
            <guid isPermaLink="false">https://medium.com/p/d6ee1a343919</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[medium]]></category>
            <category><![CDATA[blogging]]></category>
            <category><![CDATA[writing]]></category>
            <dc:creator><![CDATA[Atila Fassina]]></dc:creator>
            <pubDate>Fri, 07 Oct 2016 10:11:00 GMT</pubDate>
            <atom:updated>2017-10-02T09:58:17.054Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9lKf1_GJ_OtAYuiJCSsCKQ.png" /></figure><p><strong><em>EDIT</em></strong>: this project is currently <strong>DEPRECATED</strong>.<br>Please, refer to <a href="https://github.com/atilafassina/blogium-service">Blogium-Service</a>, you&#39;ll soon find examples on using it together with vanilla JS, as Blogium was supposed to be, plus with the most common JS Frameworks.</p><p><em>Soon to come a follow-up about </em><a href="https://github.com/atilafassina/blogium-service"><em>Blogium-Service</em></a><em>.</em></p><p>What if I told you that a <strong>~3Kb script can turn your static website into a blog, </strong>requiring only one configuration line from you?</p><p>Yes, in simple terms and thanks to Medium, that&#39;s what <a href="http://atilafassina.com/blogium"><em>Blogium</em></a> does. ;)</p><h3>How?</h3><p><a href="http://atilafassina.com/blogium"><em>Blogium</em></a><em> </em>works more as an rss reader<em> than anything else</em>. You provide your information on the configuration object (at least your Medium username) and it will fetch your rss <strong>xml</strong>, convert with <a href="http://rss2json.com/">RSStoJSON</a> API and then render it in a default template (if you choose to use it), or deliver to you as a JSON object so you can render it the way it suits you best.</p><p>Out-of-the-box <a href="http://atilafassina.com/blogium"><em>Blogium</em></a> also comes with a infinite scroll feature, you set a limit (default is 5) of posts per view, and renders them 5 by 5 (don&#39;t worry, still only one request, posts are cached).</p><h3>But, why Medium?</h3><p>There&#39;s a number of reasons for it, I&#39;ll try to keep succinct as I list them:</p><ul><li>Responsive dashboard with a cool app the helps you publish your stories anywhere you please</li><li>SEO friendly responsive interface. No need to hassle your head around mark-up optimizations, link-building, etc, etc…</li><li>Easily notify your network you&#39;ve publish something.</li></ul><p>And, of course, Medium is cool and a very well-thought service.</p><p><a href="http://atilafassina.com/blogium"><em>Blogium</em></a> was born on my intention to have my personal website (<a href="http://atilafassina.com/">atilafassina.com</a>) as a personal hub of my posts, projects, etc.</p><h3>Ok. How do I use it now?</h3><p>You can install it as a dependency on your project with Bower or NPM, or also just link it as an external script.</p><p>To launch it, just instantiate <em>Blogium</em> class:</p><pre>const blog = new Blogium({<br>  username: @my-username<br>});</pre><p>Done. This will launch the request, and serve your posts. You can let <em>Blogium</em> handle that with the default config, or make more advanced adjustments by adding another layer for rendering the posts.</p><blockquote>For a more extensive explanation, please refer to <a href="http://atilafassina.com/blogium"><em>Blogium project page</em></a><em>.</em></blockquote><h3>It&#39;s missing something</h3><p>For sure it&#39;s still missing a lot, there&#39;s much work to be done from tests coverage to new features.</p><p>If you are a developer and feel like helping, the project is completely open-source on <a href="https://github.com/atilafassina/blogium">github</a> and any help is much appreciated.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d6ee1a343919" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From AMD to ES2015]]></title>
            <link>https://medium.com/@atilafassina/from-amd-to-es2015-dbed7213ebfb?source=rss-69a8d3fa8504------2</link>
            <guid isPermaLink="false">https://medium.com/p/dbed7213ebfb</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[babeljs]]></category>
            <category><![CDATA[webpack]]></category>
            <category><![CDATA[es6]]></category>
            <category><![CDATA[es2015]]></category>
            <dc:creator><![CDATA[Atila Fassina]]></dc:creator>
            <pubDate>Wed, 21 Sep 2016 12:50:35 GMT</pubDate>
            <atom:updated>2016-09-21T12:50:35.664Z</atom:updated>
            <cc:license>http://creativecommons.org/publicdomain/zero/1.0/</cc:license>
            <content:encoded><![CDATA[<p>I believe the gist about how ES2015 Modules work is enough to get anybody sold on using them right now. So, on this post I&#39;ll share my experience on migrating an ES5 AMD using <a href="http://requirejs.org/">Require.js</a> codebase to ES2015 using <a href="https://webpack.github.io/">Webpack</a> and <a href="https://babeljs.io/">Babel</a>.</p><p><em>Quick disclaimer: I share here my experience and opinions, you&#39;re free to use them at your own risk, but please don&#39;t consider it as a tutorial as there might be caveats I haven&#39;t encountered or your use-case may totally different! ;)</em></p><h3>Strategic approach</h3><p>Every time I have a big task ahead of me, I try to follow some principles and get a macro view of where I stand and where I want to be. Giving this step back before you start is what helps me to create a direct path as free of distractions as possible and have an <a href="https://www.quora.com/What-is-a-minimum-viable-product">MVP</a> of what I <strong>really</strong> need. That lead us directly to the first step.</p><h3><a href="https://en.wikipedia.org/wiki/KISS_principle">KISS</a> your codebase</h3><p>You&#39;re not only migrating code but also a whole workflow, that will bring you enough caveats for you to work on, so don&#39;t go all creative using new interesting features that you&#39;re not sure of. So, be sure of every tool you&#39;re choosing, always take preference to the ones you&#39;re already experienced. It will make easier to spot if the bug is in the compiling step, is in the new syntax or at the logic.</p><p>Also, by looking at legacy code it&#39;s really easy to get distracted with old patterns and want to start a &quot;quick&quot; refactoring. Seriously, this is not the time for that. Create a task, drink a coffee (<a href="https://en.wikipedia.org/wiki/Club-Mate">club-mate</a> in my case) and create a task or write on a post-it or whatever you need to do to remember to get back to it <strong>later</strong>!</p><h3>Mind the differences</h3><p>Now, there are some fundamental changes that you may keep in mind. Please, check my previous post about <a href="https://medium.com/@atilafassina/es2015-modules-101-d9977dc4d4c7#a6e5">ES2015 on the catches section</a> for some ES2015 specific caveats.</p><p>Also, bare in mind that in order to transpile this into CommonJS, Babel and Webpack change all variable declarations (unless you specifically requires it to stay the same, but save it for really specific cases).</p><p>As basic rules:</p><ul><li>Avoid globals (seriously, if you were using them up to this point, now is the time to stop!)</li><li>Carefull with undeclared dependencies: on other module systems it was possible to &quot;just get things working&quot; if you missed a direct dependency but it was declared at another place, now it will break surely.</li></ul><h3>Migrating Old Modules</h3><p>Now we&#39;re reaching the &quot;no comeback point&quot; of our migration, and if you did took care of the basic differences, Webpack will basically make it as smooth as you can imagine.</p><ul><li>Remove the function wrap, not necessary anymore.</li><li>Don&#39;t bother with the <em>&#39;use strict&#39;</em>, by default every ES2015 module runs in strict mode.</li><li>On AMD, exported variables were sent to the upper scope by a <em>return</em> statement, now you can <em>export</em> as many data (variables) as you want. Just choose the <a href="https://medium.com/@atilafassina/es2015-modules-101-d9977dc4d4c7#28f8">correct syntax and declaration</a>.</li><li>If your code is changing imported variables on runtime, stop. ES2015 imported variables are <em>read-only</em>, remember that! If you really need to do that, make a copy, also for better practice, it&#39;s tricky to change imported variables, as you probably can imagine…</li></ul><h3>Libraries</h3><p>So, if you have a library that should be compiled with the Babel/Webpack set there are some keys that need to be set in your webpack.config inside the library so your namespace remain unchanged:</p><pre>// webpack config<br>// ...<br>output: {<br>  filename: &#39;library.js&#39;, // output compiled file<br>  libraryTarget: &#39;umd&#39;,   // which mod definitions to support<br>  library: &#39;foo&#39;,         // lib namespace<br>  umdNamedDefine: true    // well, if the define is named<br>}<br>// ...</pre><p>With the above config, your library namespace will be available as <em>foo</em> and supporting both CommonJS and AMD (which if you&#39;re using Webpack on your main project shouldn&#39;t be a concern). You just need to add the <em>library.js</em> file as a dependency of your main project and include it where necessary as any regular module.</p><p>So, this is what I&#39;ve learned when migrating my codebase from AMD to ES2015. Feel free to share your findings or give any feedback, just post them here or call me out on <a href="https://twitter.com/atilafassina">twitter</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dbed7213ebfb" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>