<?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 rajaraodv on Medium]]></title>
        <description><![CDATA[Stories by rajaraodv on Medium]]></description>
        <link>https://medium.com/@rajaraodv?source=rss-2af670e1ee6f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*HIuWP_7gy9QvnssCalFT4g.png</url>
            <title>Stories by rajaraodv on Medium</title>
            <link>https://medium.com/@rajaraodv?source=rss-2af670e1ee6f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 16 Jun 2026 19:51:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rajaraodv/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[How To Master Anything | Actionable Insights in 2-minutes]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://rajaraodv.medium.com/how-to-master-anything-actionable-insights-in-2-minutes-e00c34aa7066?source=rss-2af670e1ee6f------2"><img src="https://cdn-images-1.medium.com/max/2600/1*A_-auJU7jlunFQCjw3NrfA.png" width="4580"></a></p><p class="medium-feed-snippet">Many people with 10&#x2013;20 years of experience in a given field are no better than people with 2&#x2013;4 years of experience. This is because once&#x2026;</p><p class="medium-feed-link"><a href="https://rajaraodv.medium.com/how-to-master-anything-actionable-insights-in-2-minutes-e00c34aa7066?source=rss-2af670e1ee6f------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://rajaraodv.medium.com/how-to-master-anything-actionable-insights-in-2-minutes-e00c34aa7066?source=rss-2af670e1ee6f------2</link>
            <guid isPermaLink="false">https://medium.com/p/e00c34aa7066</guid>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[self-improvement]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[leadership]]></category>
            <dc:creator><![CDATA[rajaraodv]]></dc:creator>
            <pubDate>Mon, 09 Jan 2023 20:50:13 GMT</pubDate>
            <atom:updated>2023-01-09T20:50:13.215Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Learn the Pomodoro Technique in 2-minutes and take control of time and life!]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://rajaraodv.medium.com/learn-the-pomodoro-technique-in-2-minutes-and-take-control-of-time-and-life-3728c2944ba7?source=rss-2af670e1ee6f------2"><img src="https://cdn-images-1.medium.com/max/2600/1*0eho-46_xBorddFKR0e8Lg.png" width="4580"></a></p><p class="medium-feed-snippet">I read the classic Pomodoro Technique book and below are the actionable insights.</p><p class="medium-feed-link"><a href="https://rajaraodv.medium.com/learn-the-pomodoro-technique-in-2-minutes-and-take-control-of-time-and-life-3728c2944ba7?source=rss-2af670e1ee6f------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://rajaraodv.medium.com/learn-the-pomodoro-technique-in-2-minutes-and-take-control-of-time-and-life-3728c2944ba7?source=rss-2af670e1ee6f------2</link>
            <guid isPermaLink="false">https://medium.com/p/3728c2944ba7</guid>
            <category><![CDATA[life-lessons]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[life]]></category>
            <category><![CDATA[time-management]]></category>
            <dc:creator><![CDATA[rajaraodv]]></dc:creator>
            <pubDate>Sun, 08 Jan 2023 02:56:04 GMT</pubDate>
            <atom:updated>2023-01-08T02:56:04.541Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[JavaScript Symbols, Iterators, Generators, Async/Await, and Async Iterators — All Explained Simply]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://rajaraodv.medium.com/some-of-javascripts-most-useful-features-can-be-tricky-let-me-explain-them-4003d7bbed32?source=rss-2af670e1ee6f------2"><img src="https://cdn-images-1.medium.com/max/2600/1*UovxjrPZdmpuy_P4w-5I5A.jpeg" width="4160"></a></p><p class="medium-feed-snippet">Some JavaScript (ECMAScript) features are easier to understand than others. Generators look weird &#x2014; like pointers in C/C++. Symbols manage&#x2026;</p><p class="medium-feed-link"><a href="https://rajaraodv.medium.com/some-of-javascripts-most-useful-features-can-be-tricky-let-me-explain-them-4003d7bbed32?source=rss-2af670e1ee6f------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://rajaraodv.medium.com/some-of-javascripts-most-useful-features-can-be-tricky-let-me-explain-them-4003d7bbed32?source=rss-2af670e1ee6f------2</link>
            <guid isPermaLink="false">https://medium.com/p/4003d7bbed32</guid>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[apps]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[rajaraodv]]></dc:creator>
            <pubDate>Fri, 11 May 2018 23:16:55 GMT</pubDate>
            <atom:updated>2021-07-04T23:33:55.031Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Here are examples of everything new in ECMAScript 2016, 2017, and 2018]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://rajaraodv.medium.com/here-are-examples-of-everything-new-in-ecmascript-2016-2017-and-2018-d52fa3b5a70e?source=rss-2af670e1ee6f------2"><img src="https://cdn-images-1.medium.com/max/2600/1*Z-9unq6Am3vekNOa5fD1xg.png" width="2846"></a></p><p class="medium-feed-snippet">It&#x2019;s hard to keep track of what&#x2019;s new in JavaScript (ECMAScript). And it&#x2019;s even harder to find useful code examples.</p><p class="medium-feed-link"><a href="https://rajaraodv.medium.com/here-are-examples-of-everything-new-in-ecmascript-2016-2017-and-2018-d52fa3b5a70e?source=rss-2af670e1ee6f------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://rajaraodv.medium.com/here-are-examples-of-everything-new-in-ecmascript-2016-2017-and-2018-d52fa3b5a70e?source=rss-2af670e1ee6f------2</link>
            <guid isPermaLink="false">https://medium.com/p/d52fa3b5a70e</guid>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[rajaraodv]]></dc:creator>
            <pubDate>Tue, 03 Apr 2018 06:04:39 GMT</pubDate>
            <atom:updated>2018-04-18T13:30:31.970Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Check out these useful ECMAScript 2015 (ES6) tips and tricks]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://rajaraodv.medium.com/check-out-these-useful-ecmascript-2015-es6-tips-and-tricks-6db105590377?source=rss-2af670e1ee6f------2"><img src="https://cdn-images-1.medium.com/max/2600/1*W5vbBi1Nah40KGMRIE1GJw.jpeg" width="4076"></a></p><p class="medium-feed-snippet">EcmaScript 2015 (aka ES6) has been around for couple of years now, and various new features can be used in clever ways. I wanted to list&#x2026;</p><p class="medium-feed-link"><a href="https://rajaraodv.medium.com/check-out-these-useful-ecmascript-2015-es6-tips-and-tricks-6db105590377?source=rss-2af670e1ee6f------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://rajaraodv.medium.com/check-out-these-useful-ecmascript-2015-es6-tips-and-tricks-6db105590377?source=rss-2af670e1ee6f------2</link>
            <guid isPermaLink="false">https://medium.com/p/6db105590377</guid>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[rajaraodv]]></dc:creator>
            <pubDate>Fri, 16 Mar 2018 11:21:58 GMT</pubDate>
            <atom:updated>2018-04-03T11:36:10.691Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Jazz Up Your “ZSH” Terminal In Seven Steps — A Visual Guide]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://rajaraodv.medium.com/jazz-up-your-zsh-terminal-in-seven-steps-a-visual-guide-e81a8fd59a38?source=rss-2af670e1ee6f------2"><img src="https://cdn-images-1.medium.com/max/2600/1*Sk54-oKGwIS_3BRk1S4N7A.png" width="2860"></a></p><p class="medium-feed-snippet">In this blog I&#x2019;ll cover installing ITerm2, ZSH shell, &#x201C;oh my ZSH&#x201D;, Themes, ITerm2 color schemes, &#x201C;oh my ZSH&#x201D; plugins and enable &#x201C;ligature&#x201D;&#x2026;</p><p class="medium-feed-link"><a href="https://rajaraodv.medium.com/jazz-up-your-zsh-terminal-in-seven-steps-a-visual-guide-e81a8fd59a38?source=rss-2af670e1ee6f------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://rajaraodv.medium.com/jazz-up-your-zsh-terminal-in-seven-steps-a-visual-guide-e81a8fd59a38?source=rss-2af670e1ee6f------2</link>
            <guid isPermaLink="false">https://medium.com/p/e81a8fd59a38</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[design]]></category>
            <dc:creator><![CDATA[rajaraodv]]></dc:creator>
            <pubDate>Tue, 13 Mar 2018 06:42:49 GMT</pubDate>
            <atom:updated>2018-03-25T19:08:24.168Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[How to Jazz Up Your Bash Terminal — A Step By Step Guide With Pictures]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://rajaraodv.medium.com/jazz-up-your-bash-terminal-a-step-by-step-guide-with-pictures-80267554cb22?source=rss-2af670e1ee6f------2"><img src="https://cdn-images-1.medium.com/max/2438/1*QRJ9_60oCmcwRGfYqCbqSw.png" width="2438"></a></p><p class="medium-feed-snippet">In this blog I&#x2019;ll go over steps to add Themes, Powerline, fonts, and powerline-gitstatus to make your regular Bash Terminal look beautiful&#x2026;</p><p class="medium-feed-link"><a href="https://rajaraodv.medium.com/jazz-up-your-bash-terminal-a-step-by-step-guide-with-pictures-80267554cb22?source=rss-2af670e1ee6f------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://rajaraodv.medium.com/jazz-up-your-bash-terminal-a-step-by-step-guide-with-pictures-80267554cb22?source=rss-2af670e1ee6f------2</link>
            <guid isPermaLink="false">https://medium.com/p/80267554cb22</guid>
            <category><![CDATA[bash]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[git]]></category>
            <dc:creator><![CDATA[rajaraodv]]></dc:creator>
            <pubDate>Fri, 02 Mar 2018 17:41:49 GMT</pubDate>
            <atom:updated>2018-03-25T19:06:03.381Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[A Fascinating And Messy History of the Web and JavaScript, Explained with Video]]></title>
            <link>https://medium.com/free-code-camp/a-fascinating-and-messy-history-of-the-web-and-javascript-video-8978dc7bda75?source=rss-2af670e1ee6f------2</link>
            <guid isPermaLink="false">https://medium.com/p/8978dc7bda75</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[history]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[rajaraodv]]></dc:creator>
            <pubDate>Sat, 11 Nov 2017 18:50:47 GMT</pubDate>
            <atom:updated>2018-03-25T19:09:57.375Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DP-EDtA_Ii80f2RaqO9H9Q.png" /></figure><p>The history of the web and JavaScript is truly fascinating. 😲</p><p>So I created this 19-minute video to help web developers understand it and learn from it.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fa2e3cAc4Ux4%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Da2e3cAc4Ux4&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fa2e3cAc4Ux4%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/e78c0020ef2f274378a6b2e63c5c8adf/href">https://medium.com/media/e78c0020ef2f274378a6b2e63c5c8adf/href</a></iframe><p>In summary, you’ll learn the following:</p><ul><li>What JavaScript, the DOM, and CSS are, and how they came about.</li><li>What ECMAScript, W3C, and TC39 are, and how they came about.</li><li>That the evolution of these technologies didn’t happen in straight lines. There will be periods of chaos, periods of stagnation, periods of innovation, and so on.</li><li>Contrary to the myth that “startups innovate and big companies don’t do much”, big companies do innovate a lot. But they also have strategic interests. And history shows that big companies actually run the show.</li><li>Don’t wed yourself to a framework or a library.</li><li><strong>Standards are created to democratize innovations. </strong>Understanding standards, and participating in things like W3C and TC39 help everyone.</li></ul><p>Further, you’ll learn that although there is a lot going on in the JavaScript world, things will be better in the coming future:</p><ol><li>Expect “standards” to emerge</li><li>Expect future tools to abstract away a complexities (like create-react-app did)</li><li>Expect “simpler” and “smaller” frameworks to emerge. They will be much simpler than React, Vue, and current leading frameworks!</li></ol><p>Note that this talk mainly focuses on the perspective of the creators of browser and JavaScript itself. It doesn’t talk about evolution of servers or mobile technologies.</p><p>Thank you for watching! 🙏🏼</p><p>You can <a href="https://www.twitter.com/rajaraodv">follow me on Twitter</a> and tweet any questions you may have about this to me.</p><p>🙏🏼 Thank you!</p><h4>If this was useful, please click the clap 👏 button down below a few times to show your support! ⬇⬇⬇ 🙏🏼</h4><h3>My Other Posts</h3><h4>ECMAScript 2015+</h4><ol><li><a href="https://medium.freecodecamp.org/check-out-these-useful-ecmascript-2015-es6-tips-and-tricks-6db105590377"><em>Check out these useful ECMAScript 2015 (ES6) tips and tricks</em></a></li><li><a href="https://medium.com/@rajaraodv/5-javascript-bad-parts-that-are-fixed-in-es6-c7c45d44fd81#.7e2s6cghy"><em>5 JavaScript “Bad” Parts That Are Fixed In ES6</em></a></li><li><a href="https://medium.com/@rajaraodv/is-class-in-es6-the-new-bad-part-6c4e6fe1ee65#.4hqgpj2uv"><em>Is “Class” In ES6 The New “Bad” Part?</em></a></li></ol><h4>Terminal Improvements</h4><ol><li><a href="https://medium.freecodecamp.org/jazz-up-your-bash-terminal-a-step-by-step-guide-with-pictures-80267554cb22"><em>How to Jazz Up Your Terminal — A Step By Step Guide With Pictures</em></a></li><li><a href="https://medium.freecodecamp.org/jazz-up-your-zsh-terminal-in-seven-steps-a-visual-guide-e81a8fd59a38"><em>Jazz Up Your “ZSH” Terminal In Seven Steps — A Visual Guide</em></a></li></ol><h4>WWW</h4><ol><li><a href="https://medium.freecodecamp.org/a-fascinating-and-messy-history-of-the-web-and-javascript-video-8978dc7bda75"><em>A Fascinating And Messy History Of The Web And JavaScript</em></a></li></ol><h4>Virtual DOM</h4><ol><li><a href="https://medium.com/@rajaraodv/the-inner-workings-of-virtual-dom-666ee7ad47cf"><em>Inner Workings Of The Virtual DOM</em></a></li></ol><h4>React Performance</h4><ol><li><a href="https://medium.com/@rajaraodv/two-quick-ways-to-reduce-react-apps-size-in-production-82226605771a#.6lepbl7ae"><em>Two Quick Ways To Reduce React App’s Size In Production</em></a></li><li><a href="https://medium.com/@rajaraodv/using-preact-instead-of-react-70f40f53107c#.7fzp0lyo3"><em>Using Preact Instead Of React</em></a></li></ol><h4>Functional Programming</h4><ol><li><a href="https://medium.com/@rajaraodv/javascript-is-turing-complete-explained-41a34287d263#.6t0b2w66p"><em>JavaScript Is Turing Complete — Explained</em></a></li><li><a href="https://medium.com/@rajaraodv/functional-programming-in-js-with-practical-examples-part-1-87c2b0dbc276#.fbgrmoa7g"><em>Functional Programming In JS — With Practical Examples (Part 1)</em></a></li><li><a href="https://medium.freecodecamp.org/functional-programming-in-js-with-practical-examples-part-2-429d2e8ccc9e"><em>Functional Programming In JS — With Practical Examples (Part 2)</em></a></li><li><a href="https://medium.com/@rajaraodv/why-redux-needs-reducers-to-be-pure-functions-d438c58ae468#.bntrywxrf"><em>Why Redux Need Reducers To Be “Pure Functions”</em></a></li></ol><h4>WebPack</h4><ol><li><a href="https://medium.com/@rajaraodv/webpack-the-confusing-parts-58712f8fcad9#.6ot6deo2b"><em>Webpack — The Confusing Parts</em></a></li><li><a href="https://medium.com/@rajaraodv/webpack-hot-module-replacement-hmr-e756a726a07#.y667mx4lg"><em>Webpack &amp; Hot Module Replacement [HMR]</em></a><em> (under-the-hood)</em></li><li><a href="https://medium.com/@rajaraodv/webpacks-hmr-react-hot-loader-the-missing-manual-232336dc0d96#.fbb1e7ehl"><em>Webpack’s HMR And React-Hot-Loader — The Missing Manual</em></a></li></ol><h4>Draft.js</h4><ol><li><a href="https://medium.com/@rajaraodv/why-draft-js-and-why-you-should-contribute-460c4a69e6c8#.jp1tsvsqc"><em>Why Draft.js And Why You Should Contribute</em></a></li><li><a href="https://medium.com/@rajaraodv/how-draft-js-represents-rich-text-data-eeabb5f25cf2#.hh0ue85lo"><em>How Draft.js Represents Rich Text Data</em></a></li></ol><h4>React And Redux :</h4><ol><li><a href="https://medium.com/@rajaraodv/step-by-step-guide-to-building-react-redux-apps-using-mocks-48ca0f47f9a#.s7zsgq3u1"><em>Step by Step Guide To Building React Redux Apps</em></a></li><li><a href="https://medium.com/@rajaraodv/a-guide-for-building-a-react-redux-crud-app-7fe0b8943d0f#.g99gruhdz"><em>A Guide For Building A React Redux CRUD App</em></a><em> (3-page app)</em></li><li><a href="https://medium.com/@rajaraodv/using-middlewares-in-react-redux-apps-f7c9652610c6#.oentrjqpj"><em>Using Middlewares In React Redux Apps</em></a></li><li><a href="https://medium.com/@rajaraodv/adding-a-robust-form-validation-to-react-redux-apps-616ca240c124#.jq013tkr1"><em>Adding A Robust Form Validation To React Redux Apps</em></a></li><li><a href="https://medium.com/@rajaraodv/securing-react-redux-apps-with-jwt-tokens-fcfe81356ea0#.xci6o9s6w"><em>Securing React Redux Apps With JWT Tokens</em></a></li><li><a href="https://medium.com/@rajaraodv/handling-transactional-emails-in-react-redux-apps-8b1134748f76#.a24nenmnt"><em>Handling Transactional Emails In React Redux Apps</em></a></li><li><a href="https://medium.com/@rajaraodv/the-anatomy-of-a-react-redux-app-759282368c5a#.7wwjs8eqo"><em>The Anatomy Of A React Redux App</em></a></li><li><a href="https://medium.com/@rajaraodv/why-redux-needs-reducers-to-be-pure-functions-d438c58ae468#.bntrywxrf"><em>Why Redux Need Reducers To Be “Pure Functions”</em></a></li><li><a href="https://medium.com/@rajaraodv/two-quick-ways-to-reduce-react-apps-size-in-production-82226605771a#.6lepbl7ae"><em>Two Quick Ways To Reduce React App’s Size In Production</em></a></li></ol><p>If you have questions, please feel free to ask me on Twitter: <a href="https://twitter.com/rajaraodv">https://twitter.com/rajaraodv</a></p><h4>If this was useful, please click the clap 👏 button below a few times to show your support! ⬇⬇⬇ 🙏🏼</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8978dc7bda75" width="1" height="1" alt=""><hr><p><a href="https://medium.com/free-code-camp/a-fascinating-and-messy-history-of-the-web-and-javascript-video-8978dc7bda75">A Fascinating And Messy History of the Web and JavaScript, Explained with Video</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[The Inner Workings Of Virtual DOM]]></title>
            <link>https://rajaraodv.medium.com/the-inner-workings-of-virtual-dom-666ee7ad47cf?source=rss-2af670e1ee6f------2</link>
            <guid isPermaLink="false">https://medium.com/p/666ee7ad47cf</guid>
            <category><![CDATA[angularjs]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[preact]]></category>
            <dc:creator><![CDATA[rajaraodv]]></dc:creator>
            <pubDate>Sun, 11 Dec 2016 20:59:06 GMT</pubDate>
            <atom:updated>2018-03-25T19:12:34.252Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TF0TZszVwpYc1Pba7Dbk7Q.png" /><figcaption>Flow-chart showing how VDOM works in Preact</figcaption></figure><p>Virtual DOM (VDOM aka VNode) is magical ✨ but is also complex and hard to understand😱. <a href="https://facebook.github.io/react/">React</a>, <a href="https://preactjs.com">Preact</a> and similar JS libraries use them in their core. Unfortunately I couldn’t find any good article or doc that explains it in a detailed-yet-simple-to-understand fashion. So I thought of writing one myself.</p><blockquote>Note: This is a LONG post. I’ve added tons of pictures to make it simple but it also makes the post appear even longer.</blockquote><blockquote>I’m using <a href="https://github.com/developit/preact/">Preact’s</a> code and VDOM as it is small and you can look at it yourself with ease in the future.<strong> But I think most of the concepts applies to React as well.</strong></blockquote><blockquote><strong>My hope is that once you read this, you’ll be able to better understand and hopefully contribute to libraries like React and Preact.</strong></blockquote><p>In this blog, I’ll take a simple example and go over various scenarios to give you an idea as to how they actually work. Specifically, I’ll go over:</p><ol><li>Babel and JSX</li><li>Creating VNode — A single virtual DOM element</li><li>Dealing with components and sub-components</li><li>Initial rendering and creating a DOM element</li><li>Re-rendering</li><li>Removing DOM element.</li><li>Replacing a DOM element.</li></ol><h3>The app:</h3><p>The app a simple <a href="http://codepen.io/rajaraodv/pen/BQxmjj">filterable Search app</a> that contains two components “<strong>FilteredList</strong>” and “<strong>List</strong>”. The List renders a list of items (default: “California” and “New York”). The app has a search field that filters the list based on the characters in the field. Pretty straight forward.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VKN_mqVAzDfqcTU1PM47wg.png" /><figcaption>Picture of the app (Click to zoom and see the details)</figcaption></figure><blockquote>Live app: <a href="http://codepen.io/rajaraodv/pen/BQxmjj">http://codepen.io/rajaraodv/pen/BQxmjj</a></blockquote><h3>The Big Picture</h3><p>At a high-level, we write components in JSX(html in JS), that gets converted to pure JS by CLI tool <a href="http://babeljs.io">Babel</a>. Then Preact’s “h” (<a href="https://github.com/dominictarr/hyperscript">hyperscript</a>) function, converts it into VDOM tree (aka VNode). And finally Preact’s Virtual DOM algorithm, creates real DOM from the VDOM that creates our app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*imVzO1P2k1cIuf04_rGYGw.png" /><figcaption>The big picture</figcaption></figure><p><strong>Before we get into the weeds of the VDOM lifecycle, let’s understand JSX as it provides the starting point for the library.</strong></p><h3>1. Babel And JSX</h3><p>In React, Preact like libraries, there is no HTML and instead<strong> everything is JavaScript</strong>. So we need to write even the HTML in JavaScript. But writing DOM in pure JS is a nightmare!😱</p><p>For our app we’ll have to write HTML like below:</p><blockquote>Note: I’ll explain “h” soon</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KExHlJcp3om5h1JFA09Ahw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uOSYO2xCEcuGWNzKNjKUnA.png" /></figure><p>That’s where JSX comes in. JSX essentially allows us to write HTML in JavaScript! And also allows us to use JS within that by curly braces{}.</p><p>JSX helps us easily write our components like below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zUYkQpIdUdPp_SIOnEX8Bg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xc92YmYZeaJ6oX0PCGYfyw.png" /></figure><h4>Converting JSX tree to JavaScript</h4><p>JSX is cool but it’s not a valid JS, but ultimately we need REAL DOM. JSX only helps in writing a <em>representation</em> of real DOM and otherwise it’s useless.</p><p>So we a way need to convert into a corresponding JSON object (VDOM, which is also a tree) so we can eventually use it as an input to create real DOM. We need a function to do that.</p><p>And that function is the <a href="https://github.com/developit/preact/blob/master/src/h.js">“h” function</a> in Preact. It’s the equivalent to “<a href="https://facebook.github.io/react/docs/react-api.html#createelement">React.createElement</a>” in React.</p><blockquote>“h” stands for <a href="https://github.com/dominictarr/hyperscript">hyperscript</a> — one of the first libs to create HTML in JS (VDOM)</blockquote><p>But how to convert JSX into “h” function calls? And that’s where <a href="http://babeljs.io">Babel</a> comes in. Babel simply goes through each JSX node and converts them to “h” function calls.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TC2uwjc4mBrVHzOd0AeShw.png" /></figure><h4><strong>Babel JSX (React Vs Preact)</strong></h4><p>By default, Babel converts JSX to React.createElement calls because it defaults to React.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ylur5c7_DCWyJ_RHS_ndYg.png" /><figcaption>LEFT: JSX RIGHT: React version of JS (click to Zoom)</figcaption></figure><p>But we can easily change the name of the function to anything we want (like “h” for Preact) by adding “<a href="https://babeljs.io/docs/plugins/transform-react-jsx/">Babel Pragma</a>” like below:</p><pre>Option 1:<br>//.babelrc<br>{   &quot;plugins&quot;: [<br>      [&quot;transform-react-jsx&quot;, { &quot;pragma&quot;: &quot;h&quot; }]<br>     ] <br>}</pre><pre>Option 2:<br>//Add the below comment as the 1st line in every JSX file<br>/** @jsx h */</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LmJWuVB_5OIXOW99b5_Yfg.png" /><figcaption>“h” —With Babel Pragma (Click to Zoom)</figcaption></figure><h4>Main Mount To real DOM</h4><p>Not only the code in “render” methods of the components are converted to “h” functions, but also the starting mount!</p><p><strong>And this is where the execution start and everything begins!</strong></p><pre>//Mount to real DOM<br>render(&lt;FilteredList/&gt;, document.getElementById(‘app’));</pre><pre>//Converted to &quot;h&quot;:<br>render(<strong>h(FilteredList)</strong>, document.getElementById(‘app’));</pre><h4>The Output of “h” function</h4><p>The “h” function takes the output of JSX and creates something called a “VNode” (React’s “createElement” creates ReactElement). A Preact’s “VNode” (or a React’s “Element”) is simply a JS object representation of a single DOM node with it’s properties and children.</p><p>It looks like this:</p><pre>{<br>   &quot;nodeName&quot;: &quot;&quot;,<br>   &quot;attributes&quot;: {},<br>   &quot;children&quot;: []<br>}</pre><p>For example, VNode for our app’s Input looks like this:</p><pre>{<br>   &quot;nodeName&quot;: &quot;input&quot;,<br>   &quot;attributes&quot;: {<br>    &quot;type&quot;: &quot;text&quot;,<br>    &quot;placeholder&quot;: &quot;Search&quot;,<br>    &quot;onChange&quot;: &quot;&quot;<br>   },<br>   &quot;children&quot;: []<br>  }</pre><blockquote><strong>Note: “h” function doesn’t create the entire tree! </strong>It simply creates JS object for a given node. But since the “<strong>render</strong>” method already has the DOM JSX in a tree fashion, the end result will be a VNode with children and grand children that looks like a tree.</blockquote><blockquote><strong><em>Reference Code:</em></strong></blockquote><blockquote><strong><em>“h” :</em></strong><em> </em><a href="https://github.com/developit/preact/blob/master/src/h.js"><em>https://github.com/developit/preact/blob/master/src/h.js</em></a></blockquote><blockquote><strong>VNode</strong>: <a href="https://github.com/developit/preact/blob/master/src/vnode.js">https://github.com/developit/preact/blob/master/src/vnode.js</a></blockquote><blockquote><strong><em>“render”: </em></strong><a href="https://github.com/developit/preact/blob/master/src/render.js"><em>https://github.com/developit/preact/blob/master/src/render.js</em></a></blockquote><blockquote><strong>“buildComponentFromVNode: </strong><a href="https://github.com/developit/preact/blob/master/src/vdom/diff.js#L102">https://github.com/developit/preact/blob/master/src/vdom/diff.js#L102</a></blockquote><p>OK, let’s see how Virtual DOM works.</p><h3>Virtual DOM Algorithm Flowchart For Preact</h3><p>In the flowchart below shows how components (and child components) are created, updated and deleted by Preact. It also shows when lifecycle events like “componentWillMount” and so on are called.</p><blockquote>Note: We’ll go over each section in a step-by-step manner so don’t worry if it looks complicated</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TF0TZszVwpYc1Pba7Dbk7Q.png" /></figure><p>Yes, it’s hard to understand all at once. So let’s go over various sections of the flowchart by going through various scenarios in a step-by-step manner.</p><blockquote>Note: I’ll highlight sections of the lifecycle in “yellow” when discussing specific steps.</blockquote><h3>Scenario 1: Initial Creation Of The App</h3><h4>1.1 — Creating VNode (Virtual DOM) For A Given Component</h4><p>The highlighted section shows the initial loop that creates VNode (Virtual DOM) tree for a given component. Note that this doesn’t create VNode for sub-components (that’s a different loop).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JVwKJe82S1wHFqzr17DQ4g.png" /><figcaption>Yellow highlight shows the VNode creation</figcaption></figure><p>The picture below shows what happens when our app loads for the first time. The library ends up creating a VNode with children and attributes for the main FilteredList component.</p><blockquote>Note: Along the way it also calls “componentWillMount” and “render” lifecycle methods (see the green blocks in the picture above).</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CI75nMf-7j4ldxPJQ8nciQ.png" /><figcaption>(click to zoom)</figcaption></figure><p>At this point, we have a VNode that has a “<strong>div</strong>” parentNode that has an “<strong>input</strong>” and a “<strong>List</strong>” child nodes.</p><blockquote><strong>Reference code:</strong></blockquote><blockquote><em>Most lifecycle events like: componentWillMount, render and so on: </em><a href="https://github.com/developit/preact/blob/master/src/vdom/component.js#L101"><em>https://github.com/developit/preact/blob/master/src/vdom/component.j</em></a><em>s</em></blockquote><h4>1.2 — If Not A Component, create a REAL DOM</h4><p>In this step, it’ll simply create real DOM for the parent node (div) and repeat process for child nodes (“input” and “List”).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X1tcv3n47OuAExoTBu3Q5A.png" /><figcaption>Highlighted loop shows REAL DOM creation for child components</figcaption></figure><p>At this point, we have just “div” as shown in the picture below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l-FmgMheFRYFuhCJQA4gcQ.png" /></figure><blockquote><strong>Reference code:</strong></blockquote><blockquote>document.createElement: <a href="https://github.com/developit/preact/blob/master/src/dom/recycler.js">https://github.com/developit/preact/blob/master/src/dom/recycler.js</a></blockquote><h4>1.3 — Repeat for all children</h4><p>At this point, the loop is repeated for all children. In our app, it’ll be repeated for “input” and “List” items.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XadPNReNXRQyIl6FJOpPlQ.png" /><figcaption>Loop for each children</figcaption></figure><h4>1.4 — Process Child And Append To Parent.</h4><p>In this step, we’ll process leaf. Since “input” has a parent (“div”), we’ll append input as a child to div. Then the control stops and return to create “List” (which is the 2nd child of “div”).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iLQQTuRdKIhlsh5Vgaox0w.png" /><figcaption>Finish processing leaf</figcaption></figure><p>At this point, our app looks like below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uyA28eM-UBnU0SSX8vPSdg.png" /></figure><blockquote>Note: that after “input” is created, since it doesn’t have any children, it doesn’t immediately loop and create “List”! Instead it’ll first append “input” to the parent “div” and then goes back to process “List”</blockquote><blockquote><strong>Reference code:</strong></blockquote><blockquote>appendChild: <a href="https://github.com/developit/preact/blob/master/src/vdom/diff.js">https://github.com/developit/preact/blob/master/src/vdom/diff.js</a></blockquote><h4>1.5 Process child component(s)</h4><p>The control goes back to step 1.1 and starts all 0ver again for “List” component. But since “List” is a component, it calls the <strong>render</strong> method of the “List” component to get new set of VNodes that look like below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XadPNReNXRQyIl6FJOpPlQ.png" /><figcaption>Repeat everything for a child “component”</figcaption></figure><p>That loop completes for the List component and returns List’s VNode that looks like below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/884/1*PbgdX1qNPoHh5Ok3yY83gQ.png" /></figure><blockquote><strong>Reference Code:</strong></blockquote><blockquote><strong>“buildComponentFromVNode: </strong><a href="https://github.com/developit/preact/blob/master/src/vdom/diff.js#L102">https://github.com/developit/preact/blob/master/src/vdom/diff.js#L102</a></blockquote><h4>1.6 Repeat steps 1.1 through 1.4 for all the Child Nodes</h4><p>It’ll repeat the above steps again for each node. Once it reaches the leaf node, it appends it to the node’s parent and repeats the process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Pwkyw7P2bbpEL9zQB1YaMA.png" /><figcaption>Keep doing the same until all child and parent are created and appended</figcaption></figure><p>The below picture shows how each node is added (hint: depth-first).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e6rihM5IE3PRedd311iinA.png" /><figcaption>How REAL DOM tree is created by the VDOM algorithm</figcaption></figure><h4>1.7 Finish processing</h4><p>At this point, It’s done processing. It simply calls “componentDidMount” for all the components (starting from child components to parent components) and stops.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xRspRlx0WM-y2Au0zyegog.png" /></figure><blockquote><strong>Important Note: </strong>Once everything is done, a reference to the real DOM is added to each of the component instances. This reference is used for remaining updates (create, update, delete) to compare and avoid recreating the same DOM nodes.</blockquote><h3>SCENARIO 2: Delete Leaf Node</h3><p>Say we typed “cal” and hit enter. This will remove the 2nd list node, a leaf node (New York) while keeping all other parent nodes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*AyQmTTZFnfC_VKv23D8FrA.png" /></figure><p>Let’s see how the flow looks for this scenario.</p><h4>2.1 Create VNodes like before.</h4><p>After initial rendering, every change in the future is an “update”. When it comes to creating VNodes, the update cycle works very similar to create cycle and <strong>creates VNodes all over again.</strong></p><p>But since it’s an update (and not creation) of the component, it makes “componentWillReceiveProps”, “shouldComponentUpdate”, and “componentWillUpdate” calls to each component and sub-component.</p><p><strong>In addition, update cycle, doesn’t recreate DOM elements if those elements are already there.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pCYNGbZL_zT1gbMtXYVt9A.png" /><figcaption>Updating component lifecycle</figcaption></figure><blockquote><strong>Reference Code</strong></blockquote><blockquote><strong>removeNode: </strong><a href="https://github.com/developit/preact/blob/master/src/dom/index.js#L9">https://github.com/developit/preact/blob/master/src/dom/index.js#L9</a></blockquote><blockquote><strong>insertBefore:</strong> <a href="https://github.com/developit/preact/blob/master/src/vdom/diff.js#L253">https://github.com/developit/preact/blob/master/src/vdom/diff.js#L253</a></blockquote><h4>2.2 Use the reference real DOM node and avoid creating duplicate nodes</h4><p>As mentioned earlier, each component has a reference to corresponding real DOM tree that was created during initial loading. The picture below shows how references look for our app at this point.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JjV4E5Ag9ogDvH9ILWDO2Q.png" /><figcaption>Showing references b/w previous DOM and each component</figcaption></figure><p>And when VNodes created, each VNode’s attributes are compared w/ the attributes of the REAL DOM at that node<strong>. If real DOM exists, the loop moves on to the next node.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fHYrhlaGOJKnWTzn0YrQ8g.png" /><figcaption>Real DOM “already exists” lifecycle (during update)</figcaption></figure><blockquote><strong>Reference Code</strong></blockquote><blockquote>innerDiffNode: <a href="https://github.com/developit/preact/blob/master/src/vdom/diff.js#L185">https://github.com/developit/preact/blob/master/src/vdom/diff.js#L185</a></blockquote><h4>2.3 Remove node if there are extra nodes in the REAL DOM</h4><p>The picture below shows the difference in REAL DOM V/s VNode.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ALjitFLcW_lIHvaswCp0GA.png" /><figcaption>(click to zoom)</figcaption></figure><p>And since there is a difference, the “New York” node in REAL DOM is removed by the algorithm as shown in the workflow below. The algorithm also calls “componentDidUpdate” lifecycle event once everything is done.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m74VaQdTuuonA_R-LkT3xw.png" /><figcaption>Remove DOM node lifecycle</figcaption></figure><h3>SCENARIO 3 — Unmounting Entire Component</h3><p>Use case: Let’s say if we typed <strong>blabla</strong> in the filter, since it doesn’t match “California” or “New York”, we won’t render the child component “List” at all. This means, we need to unmount the entire component.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/552/1*Ki5tKGKiRI4P_ma_fz3chQ.png" /><figcaption>List component is not removed if there are no results</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5GheZk3dZ7st_mvBcWG4nw.png" /><figcaption>“render” method of FilteredList</figcaption></figure><p>Deleting a component is similar to Deleting a single node. Except, when we delete a node that has a reference to a component, then the framework calls “componentWillUnmount” and then recursively deletes all the DOM elements. After all the elements are removed from the real DOM, it calls “componentDidUnmount” method of the referenced component.</p><p>The picture below shows the reference to “List” component on the real DOM “ul”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yZ3TSnTRf95mGSoR-HiwHw.png" /><figcaption>sadf</figcaption></figure><p>The below picture highlights the section in the flowchart to show how deleting/unmounting a component works.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QGGL_W7zEr3FtR1VODXt_w.png" /><figcaption>Remove and unmount component</figcaption></figure><blockquote><strong>Reference code</strong></blockquote><blockquote>unmountComponent: <a href="https://github.com/developit/preact/blob/master/src/vdom/component.js#L250">https://github.com/developit/preact/blob/master/src/vdom/component.js#L250</a></blockquote><h4><strong>Final Notes:</strong></h4><p>I hope that this post gave you enough idea as to how Virtual DOM works (at least in Preact).</p><p>Please note that while these scenarios covers major ones, I haven’t covered some of the optimizations in the code.</p><p>🙏🏼 Thank you!</p><h4>If this was useful, please click the clap 👏 button down below a few times to show your support! ⬇⬇⬇ 🙏🏼</h4><h3>My Other Posts</h3><h4>ECMAScript 2015+</h4><ol><li><a href="https://medium.freecodecamp.org/check-out-these-useful-ecmascript-2015-es6-tips-and-tricks-6db105590377"><em>Check out these useful ECMAScript 2015 (ES6) tips and tricks</em></a></li><li><a href="https://medium.com/@rajaraodv/5-javascript-bad-parts-that-are-fixed-in-es6-c7c45d44fd81#.7e2s6cghy"><em>5 JavaScript “Bad” Parts That Are Fixed In ES6</em></a></li><li><a href="https://medium.com/@rajaraodv/is-class-in-es6-the-new-bad-part-6c4e6fe1ee65#.4hqgpj2uv"><em>Is “Class” In ES6 The New “Bad” Part?</em></a></li></ol><h4>Terminal Improvements</h4><ol><li><a href="https://medium.freecodecamp.org/jazz-up-your-bash-terminal-a-step-by-step-guide-with-pictures-80267554cb22"><em>How to Jazz Up Your Terminal — A Step By Step Guide With Pictures</em></a></li><li><a href="https://medium.freecodecamp.org/jazz-up-your-zsh-terminal-in-seven-steps-a-visual-guide-e81a8fd59a38"><em>Jazz Up Your “ZSH” Terminal In Seven Steps — A Visual Guide</em></a></li></ol><h4>WWW</h4><ol><li><a href="https://medium.freecodecamp.org/a-fascinating-and-messy-history-of-the-web-and-javascript-video-8978dc7bda75"><em>A Fascinating And Messy History Of The Web And JavaScript</em></a></li></ol><h4>Virtual DOM</h4><ol><li><a href="https://medium.com/@rajaraodv/the-inner-workings-of-virtual-dom-666ee7ad47cf"><em>Inner Workings Of The Virtual DOM</em></a></li></ol><h4>React Performance</h4><ol><li><a href="https://medium.com/@rajaraodv/two-quick-ways-to-reduce-react-apps-size-in-production-82226605771a#.6lepbl7ae"><em>Two Quick Ways To Reduce React App’s Size In Production</em></a></li><li><a href="https://medium.com/@rajaraodv/using-preact-instead-of-react-70f40f53107c#.7fzp0lyo3"><em>Using Preact Instead Of React</em></a></li></ol><h4>Functional Programming</h4><ol><li><a href="https://medium.com/@rajaraodv/javascript-is-turing-complete-explained-41a34287d263#.6t0b2w66p"><em>JavaScript Is Turing Complete — Explained</em></a></li><li><a href="https://medium.com/@rajaraodv/functional-programming-in-js-with-practical-examples-part-1-87c2b0dbc276#.fbgrmoa7g"><em>Functional Programming In JS — With Practical Examples (Part 1)</em></a></li><li><a href="https://medium.freecodecamp.org/functional-programming-in-js-with-practical-examples-part-2-429d2e8ccc9e"><em>Functional Programming In JS — With Practical Examples (Part 2)</em></a></li><li><a href="https://medium.com/@rajaraodv/why-redux-needs-reducers-to-be-pure-functions-d438c58ae468#.bntrywxrf"><em>Why Redux Need Reducers To Be “Pure Functions”</em></a></li></ol><h4>WebPack</h4><ol><li><a href="https://medium.com/@rajaraodv/webpack-the-confusing-parts-58712f8fcad9#.6ot6deo2b"><em>Webpack — The Confusing Parts</em></a></li><li><a href="https://medium.com/@rajaraodv/webpack-hot-module-replacement-hmr-e756a726a07#.y667mx4lg"><em>Webpack &amp; Hot Module Replacement [HMR]</em></a><em> (under-the-hood)</em></li><li><a href="https://medium.com/@rajaraodv/webpacks-hmr-react-hot-loader-the-missing-manual-232336dc0d96#.fbb1e7ehl"><em>Webpack’s HMR And React-Hot-Loader — The Missing Manual</em></a></li></ol><h4>Draft.js</h4><ol><li><a href="https://medium.com/@rajaraodv/why-draft-js-and-why-you-should-contribute-460c4a69e6c8#.jp1tsvsqc"><em>Why Draft.js And Why You Should Contribute</em></a></li><li><a href="https://medium.com/@rajaraodv/how-draft-js-represents-rich-text-data-eeabb5f25cf2#.hh0ue85lo"><em>How Draft.js Represents Rich Text Data</em></a></li></ol><h4>React And Redux :</h4><ol><li><a href="https://medium.com/@rajaraodv/step-by-step-guide-to-building-react-redux-apps-using-mocks-48ca0f47f9a#.s7zsgq3u1"><em>Step by Step Guide To Building React Redux Apps</em></a></li><li><a href="https://medium.com/@rajaraodv/a-guide-for-building-a-react-redux-crud-app-7fe0b8943d0f#.g99gruhdz"><em>A Guide For Building A React Redux CRUD App</em></a><em> (3-page app)</em></li><li><a href="https://medium.com/@rajaraodv/using-middlewares-in-react-redux-apps-f7c9652610c6#.oentrjqpj"><em>Using Middlewares In React Redux Apps</em></a></li><li><a href="https://medium.com/@rajaraodv/adding-a-robust-form-validation-to-react-redux-apps-616ca240c124#.jq013tkr1"><em>Adding A Robust Form Validation To React Redux Apps</em></a></li><li><a href="https://medium.com/@rajaraodv/securing-react-redux-apps-with-jwt-tokens-fcfe81356ea0#.xci6o9s6w"><em>Securing React Redux Apps With JWT Tokens</em></a></li><li><a href="https://medium.com/@rajaraodv/handling-transactional-emails-in-react-redux-apps-8b1134748f76#.a24nenmnt"><em>Handling Transactional Emails In React Redux Apps</em></a></li><li><a href="https://medium.com/@rajaraodv/the-anatomy-of-a-react-redux-app-759282368c5a#.7wwjs8eqo"><em>The Anatomy Of A React Redux App</em></a></li><li><a href="https://medium.com/@rajaraodv/why-redux-needs-reducers-to-be-pure-functions-d438c58ae468#.bntrywxrf"><em>Why Redux Need Reducers To Be “Pure Functions”</em></a></li><li><a href="https://medium.com/@rajaraodv/two-quick-ways-to-reduce-react-apps-size-in-production-82226605771a#.6lepbl7ae"><em>Two Quick Ways To Reduce React App’s Size In Production</em></a></li></ol><p>If you have questions, please feel free to ask me on Twitter: <a href="https://twitter.com/rajaraodv">https://twitter.com/rajaraodv</a></p><h4>If this was useful, please click the clap 👏 button below a few times to show your support! ⬇⬇⬇ 🙏🏼</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=666ee7ad47cf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using Preact Instead Of React]]></title>
            <link>https://rajaraodv.medium.com/using-preact-instead-of-react-70f40f53107c?source=rss-2af670e1ee6f------2</link>
            <guid isPermaLink="false">https://medium.com/p/70f40f53107c</guid>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[redux]]></category>
            <category><![CDATA[angularjs]]></category>
            <dc:creator><![CDATA[rajaraodv]]></dc:creator>
            <pubDate>Fri, 02 Dec 2016 20:27:16 GMT</pubDate>
            <atom:updated>2017-12-05T17:34:12.702Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wE6Ap_dbBfwwY6NZR4aTQg.png" /></figure><p>If you are concerned about React’s size and performance (especially for mobile-web apps), there are several React clone libraries that have <strong>exact</strong> <strong>same APIs as React</strong> but with tiny size and claim to perform better than React. <a href="https://preactjs.com/">Preact</a> is one such library.</p><p>As for as the performance goes (for a Todo app), it looks pretty AMAZING! Almost same as Mithril is just incredible!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5ojdO-TAEqnRE2OQyVHpSw.png" /><figcaption><a href="https://developit.github.io/preact-perf/">https://developit.github.io/preact-perf/</a></figcaption></figure><blockquote>You can run the perf test in your own browser by going <a href="https://developit.github.io/preact-perf/">here</a></blockquote><p><strong>So I was curious to see how well it worked for my </strong><a href="https://github.com/rajaraodv/react-redux-blog"><strong>demo app</strong></a><strong> (</strong><a href="https://protected-escarpment-79486.herokuapp.com/"><strong>live</strong></a><strong>). Mainly I wanted to see:</strong></p><ol><li>How easy it was to swap React w/ Preact.</li><li>If it all the features in my app that use other libs like redux, redux-forms and so on, still work.</li><li>How much smaller the overall size reduces.</li><li>How much better it performs</li></ol><h4><strong>Here are the results:</strong></h4><h3>1. How easy it was to swap React w/ Preact.</h3><p>It was surprising to see that all I had to do was to install preact and preact-compat. Then simply add preact-compat as an alias to React and React-DOM in Webpack!</p><blockquote><strong>Note</strong> preact-compat is a 2kb layer on top of preact (3kb) that makes Preact a drop-in replacement.</blockquote><ol><li>npm install -save preact preact-compat</li><li>Add alias like below:</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/704/1*vtPX8Z6dAVruCNLB-AcgwQ.png" /></figure><h3>2. If all the features in my app still work</h3><p>I don’t have tests in my app but since my app is small, I manually tested it and everything worked!</p><p>I also tried <a href="https://github.com/Lucifier129/react-lite">react-lite</a> but it threw bunch of errors for my app. So I won’t recommend it.</p><h3>3. How much smaller the app became?</h3><p>The gzip size went down from <strong>91.8kb(React) to 58.2kb(Preact)</strong>. Actual code went down from 379kb(React) to 263kb(Preact).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IyDtt2ZPcZ3MOuBa4q1YHQ.png" /><figcaption><strong>React</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YKroxIgqa5BRO0VThxhvKg.png" /><figcaption><strong>Preact</strong></figcaption></figure><h3>4. How much better my app performs</h3><p>I couldn’t tell the difference because my app is so tiny. I’d imagine it would probably be similar to Todo app.</p><h3>BONUS:</h3><ol><li>Preact is so small, you can actually read its code much more easily than React’s! It’s pretty cool!</li><li>Preact comes with some nifty features like <a href="https://preactjs.com/guide/linked-state">Linked State</a> and so on.</li></ol><h3>CAUTION:</h3><ol><li>Make sure to test your app thoroughly before switching over.</li></ol><p>2. You may lose some capabilities of React.</p><p><strong>But if your app works better with Preact, then why not?</strong></p><p><em>🎉🎉🎉 </em><strong><em>If you like this post, please 1. </em>💚 <em>it on Medium and 2. please share it on Twitter</em></strong><em>🎉🎉🎉</em></p><h3>My Other Posts</h3><p><strong>LATEST: </strong><a href="https://medium.com/@rajaraodv/the-inner-workings-of-the-browser-for-javascript-web-developers-course-d26f11270f41"><em>The Inner workings of the Browser — for JavaScript &amp; Web Developers </em></a><strong><em>Use code: INNER15 and get 50% off!</em></strong></p><h4>React Performance:</h4><ol><li><a href="https://medium.com/@rajaraodv/two-quick-ways-to-reduce-react-apps-size-in-production-82226605771a#.6lepbl7ae"><em>Two Quick Ways To Reduce React App’s Size In Production</em></a></li><li><a href="https://medium.com/@rajaraodv/using-preact-instead-of-react-70f40f53107c#.7fzp0lyo3"><em>Using Preact Instead Of React</em></a></li><li><a href="https://medium.com/@rajaraodv/the-inner-workings-of-virtual-dom-666ee7ad47cf#.gn2im2cqb"><em>The Inner Workings Of Virtual DOM (With Lots Of Pictures)</em></a></li></ol><h4>Functional Programming</h4><ol><li><a href="https://medium.com/@rajaraodv/javascript-is-turing-complete-explained-41a34287d263#.6t0b2w66p"><em>JavaScript Is Turing Complete — Explained</em></a></li><li><a href="https://medium.com/@rajaraodv/functional-programming-in-js-with-practical-examples-part-1-87c2b0dbc276#.fbgrmoa7g"><em>Functional Programming In JS — With Practical Examples (Part 1)</em></a></li><li><a href="http://Functional%20Programming%20In%20JS — With%20Practical%20Examples%20%28Part%202%29"><em>Functional Programming In JS — With Practical Examples (Part 2)</em></a></li><li><a href="https://medium.com/@rajaraodv/why-redux-needs-reducers-to-be-pure-functions-d438c58ae468#.bntrywxrf"><em>Why Redux Need Reducers To Be “Pure Functions”</em></a></li></ol><h4>ES6</h4><ol><li><a href="https://medium.com/@rajaraodv/5-javascript-bad-parts-that-are-fixed-in-es6-c7c45d44fd81#.7e2s6cghy"><em>5 JavaScript “Bad” Parts That Are Fixed In ES6</em></a></li><li><a href="https://medium.com/@rajaraodv/is-class-in-es6-the-new-bad-part-6c4e6fe1ee65#.4hqgpj2uv"><em>Is “Class” In ES6 The New “Bad” Part?</em></a></li></ol><h4>WebPack</h4><ol><li><a href="https://medium.com/@rajaraodv/webpack-the-confusing-parts-58712f8fcad9#.6ot6deo2b"><em>Webpack — The Confusing Parts</em></a></li><li><a href="https://medium.com/@rajaraodv/webpack-hot-module-replacement-hmr-e756a726a07#.y667mx4lg"><em>Webpack &amp; Hot Module Replacement [HMR]</em></a><em> (under-the-hood)</em></li><li><a href="https://medium.com/@rajaraodv/webpacks-hmr-react-hot-loader-the-missing-manual-232336dc0d96#.fbb1e7ehl"><em>Webpack’s HMR And React-Hot-Loader — The Missing Manual</em></a></li></ol><h4>Draft.js</h4><ol><li><a href="https://medium.com/@rajaraodv/why-draft-js-and-why-you-should-contribute-460c4a69e6c8#.jp1tsvsqc"><em>Why Draft.js And Why You Should Contribute</em></a></li><li><a href="https://medium.com/@rajaraodv/how-draft-js-represents-rich-text-data-eeabb5f25cf2#.hh0ue85lo"><em>How Draft.js Represents Rich Text Data</em></a></li></ol><h4>React And Redux :</h4><ol><li><a href="https://medium.com/@rajaraodv/step-by-step-guide-to-building-react-redux-apps-using-mocks-48ca0f47f9a#.s7zsgq3u1"><em>Step by Step Guide To Building React Redux Apps</em></a></li><li><a href="https://medium.com/@rajaraodv/a-guide-for-building-a-react-redux-crud-app-7fe0b8943d0f#.g99gruhdz"><em>A Guide For Building A React Redux CRUD App</em></a><em> (3-page app)</em></li><li><a href="https://medium.com/@rajaraodv/using-middlewares-in-react-redux-apps-f7c9652610c6#.oentrjqpj"><em>Using Middlewares In React Redux Apps</em></a></li><li><a href="https://medium.com/@rajaraodv/adding-a-robust-form-validation-to-react-redux-apps-616ca240c124#.jq013tkr1"><em>Adding A Robust Form Validation To React Redux Apps</em></a></li><li><a href="https://medium.com/@rajaraodv/securing-react-redux-apps-with-jwt-tokens-fcfe81356ea0#.xci6o9s6w"><em>Securing React Redux Apps With JWT Tokens</em></a></li><li><a href="https://medium.com/@rajaraodv/handling-transactional-emails-in-react-redux-apps-8b1134748f76#.a24nenmnt"><em>Handling Transactional Emails In React Redux Apps</em></a></li><li><a href="https://medium.com/@rajaraodv/the-anatomy-of-a-react-redux-app-759282368c5a#.7wwjs8eqo"><em>The Anatomy Of A React Redux App</em></a></li><li><a href="https://medium.com/@rajaraodv/why-redux-needs-reducers-to-be-pure-functions-d438c58ae468#.bntrywxrf"><em>Why Redux Need Reducers To Be “Pure Functions”</em></a></li><li><a href="https://medium.com/@rajaraodv/two-quick-ways-to-reduce-react-apps-size-in-production-82226605771a#.6lepbl7ae"><em>Two Quick Ways To Reduce React App’s Size In Production</em></a></li></ol><h4>Salesforce</h4><ol><li><a href="https://medium.com/@rajaraodv/developing-react-redux-apps-in-salesforce-s-visualforce-3ad7be560d1c#.f6bao6mtu"><em>Developing React Redux Apps In Salesforce’s Visualforce</em></a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=70f40f53107c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>