<?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 Visweshwaran Suri on Medium]]></title>
        <description><![CDATA[Stories by Visweshwaran Suri on Medium]]></description>
        <link>https://medium.com/@visweshwaransuri?source=rss-c0f459464f94------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*mmSzSuKIrKbRCIiTJg7g2Q.jpeg</url>
            <title>Stories by Visweshwaran Suri on Medium</title>
            <link>https://medium.com/@visweshwaransuri?source=rss-c0f459464f94------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 02:59:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@visweshwaransuri/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[One8 Resolution]]></title>
            <link>https://medium.com/@visweshwaransuri/20-one8-resolutions-20de08933378?source=rss-c0f459464f94------2</link>
            <guid isPermaLink="false">https://medium.com/p/20de08933378</guid>
            <category><![CDATA[stay-inspired]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[new-year]]></category>
            <dc:creator><![CDATA[Visweshwaran Suri]]></dc:creator>
            <pubDate>Fri, 29 Dec 2017 11:56:39 GMT</pubDate>
            <atom:updated>2017-12-29T15:42:04.110Z</atom:updated>
            <content:encoded><![CDATA[<p>Re-solve your next year. !</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/575/1*oNZhy2XQn2MNJ6flZAj31g.png" /><figcaption>Listen a minute!</figcaption></figure><blockquote>TLDR; Resolutions are here and better done with people than alone. I have listed mine and i solicit you with matching interests to help us get it done for the coming year.</blockquote><p>New year is here and with it the tradition of setting resolutions. Thinking back to see how i fared in the current year and realized, i did have resolutions but nothing written down. I s<em>afely assumed</em> that was the reason i could not stick and follow thru on the resolutions. I wanted to try something new this year, partly inspired by community collective.</p><pre><a href="https://gizmodo.com/8-walt-disney-quotes-that-are-actually-fake-1692355588">Walt Disney</a> - If you can dream it, you can do it.</pre><p>I wanted to publish my list of resolutions for the year and see if there are anyone interested in pursuing the same and there by help each other stay on course to stick by that resolution. This is a social experiment, nevertheless , i hope for this one to be a success.</p><pre>Napoleon Hill - Whatever the mind of man can conceive and believe, it can achieve</pre><p>I wanted to set resolutions in a finite number with tangible and achievable targets, so i can quantify what i have completed and not leave it to interpretations. My list below has a couple of targets each with professional and personal aspects embedded and one that has both undertones. That gives me 5 to look towards.</p><h3>Testing as a part of everyday life.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/304/1*Eqete5eJr_8FnbrcqygzBg.png" /><figcaption>Test your way!</figcaption></figure><p>I write code for living mostly in JavaScript. I am one among the many who are yet to make unit testing a way of writing code. I want tests to become my de-facto first piece of contribution to any solution that i am coding towards. Come to think of it, the description and target for each of my resolutions is a first step in making anything i indulge on to be testable.</p><p>How do you quantify? → No code written in 2018 to be left untested with a goal of 80% to achieve.</p><h3>Read one book a month amounting a total of 12 for the year.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/268/1*Of7yCP3nICl7nc60OHFM3Q.jpeg" /></figure><p>Books used to be an integral part of my everyday life, until cell phones took over.I want to reclaim that with at the very least 12 books for the year split between biography , fiction and in particular at least one Satire, and at-least one anthology.</p><p>How do you quantify? → 12 books for the year with one anthology and one satire at least.</p><h3>Open source contribution amounting to at least 2 hours a week, totaling 100 hours at the least this year.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*Hyhie23DogGnCoPzA-47Ng.png" /></figure><p>I have been on and off Open Source circuit last 2 years, with many contributions lying half done. I think i want to do one better by setting a milestone of 100 hours in contribution for the year , with subsequent targets set at 150 and 200. I am feeling good about this one and would be most interested to have peers working in tandem on this goal to help make it a success.</p><p>How do you quantify? → 100(150/200)hours for the year.</p><h3>Walk/Run couple of miles a day, amounting to at least 730 miles for the year.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3VztsePxJ64A2-VQAGI0VQ.jpeg" /></figure><p>Another personal favorite of mine. I have recently jumped onto “healthy body = healthy mind” bandwagon. I sincerely believe , the more you strive to test your body physically and keep it fit, the more fit and agile you get mentally.</p><p>I want to talk about a great many things to do as a part of this, but as promised above to stick to achievable and tangible steps, i chose this one and would love anyone who wants to join with me on this goal. We can use google fit or Fitbit or simple chat to keep tabs on each other regularly to help push through.</p><p><em>Remember 3 mile a day, doesn’t give you a reason to take the next day off.</em></p><p>How do you quantify? → 730 Miles /1200 KM for the year.</p><h3>Send a note once in 2 weeks preferably by hand and also as email/other tools to some person who has inspired you or helped you see things differently.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*yzur1Sq4fE4SQRI-NTu3LA.png" /></figure><p>Last but not in the least bit ‘Least’, is that i have always had amazing people around me to learn things from as simple as how to pronounce a word or as complex as life’s meaning( You know who you are! ). I have always lagged in appreciating people, place and situation timely enough and that is something that definitely needs change. Adding this to what I read somewhere about “<em>physically writing things make deeper impression on mind”</em>, i want to hand-write these notes frequently and share it across to people.</p><p>How do you quantify? → 26 Notes for the year and frequency no less than one every 2 weeks.</p><p>I believe these goals are <em>fundamental</em> to me for the coming year and hope to assess and course correct every now and then, but stick with them come what may for the next year. If any of you have any common interests, feel free to reach out and lets push each other to get things done.!</p><p><strong>Happy New Year 2018!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=20de08933378" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Roll it up!]]></title>
            <link>https://medium.com/@visweshwaransuri/roll-it-up-1546861f82b7?source=rss-c0f459464f94------2</link>
            <guid isPermaLink="false">https://medium.com/p/1546861f82b7</guid>
            <category><![CDATA[babeljs]]></category>
            <category><![CDATA[rollup]]></category>
            <category><![CDATA[webpack-2]]></category>
            <category><![CDATA[rollup-js]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Visweshwaran Suri]]></dc:creator>
            <pubDate>Thu, 01 Jun 2017 07:42:51 GMT</pubDate>
            <atom:updated>2017-06-05T03:22:59.552Z</atom:updated>
            <content:encoded><![CDATA[<h4>A tell-all about how i finally arrived at a stable configuration for react with rollup.js build tool.</h4><blockquote>Now this is a story all about how<br>My life got flipped-turned upside down<br>And I’d like to take a minute<br>Just sit right there<br>I’ll tell you how I became the dunce of a tool called Roll-up</blockquote><p>There was a lot of tech chatter about <a href="https://webpack.js.org/">webpack 2</a> , <a href="https://developers.google.com/closure/compiler/">closure</a> compiler and then some one said have you checked out <a href="https://rollupjs.org/">Rollup</a>. I responded usually as how i do when i hear things for the “first” time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*kOLw3Hfs2ccvURL77KRWIw.gif" /><figcaption>vote for me!</figcaption></figure><p>I was working on creating some react components which could be used as <a href="https://www.atlassian.com/blog/git/alternatives-to-git-submodule-git-subtree">subtree</a> for parent project, when i suddenly had a thought of</p><blockquote><strong>What if i could export/ship my functional subtree as library ?</strong></blockquote><p>I know the eyes rolling all over at this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*t2yX6OUtgLf57hIYuEUHcQ.gif" /><figcaption><strong>“brand new and totally original”</strong></figcaption></figure><p><strong>idea </strong>, but please bear with me because the next 1 hour was an absolute bliss(at least for me and it shouldn’t take that long to complete this post)!</p><h3>tl;dr</h3><p>I imbibe things by trial-n-error and this is a story of how i got rollup work with a set of <a href="https://facebook.github.io/react/">react</a> components shipped as library.</p><ul><li>Roll it and almost.</li><li>includepaths plugin</li><li>babel plugin</li><li>Roll up the components into shippable library file.</li></ul><h3>The Problem</h3><p>Although the section sounds ominous, this was no problem on its own. <em>It became a problem because i had a sudden thought of what if i want to ship something that wasn’t a library as a library.</em></p><p>A set of components written in react. A small quick plug for <a href="https://medium.com/u/ec9380483526">Vinci Rufus</a> and his component design thought process. Have a look at it <a href="https://github.com/areai51/react-component-design">here</a>.</p><p>Any who the setup goes as follows.I had a directory structure like this</p><pre>-components<br>|-logo.jsx<br>|-logo.css<br>|-button.jsx<br>|-button.css<br>main.js</pre><p>and my main.js looked like</p><pre>export { default as logo } from &#39;./components/logo&#39;;<br>export { default as button } from &#39;./components/button&#39;;</pre><p>this had to now be rolled up. Rollup has a list of commands to play around with and check them in their documentation.</p><p>but when i started , i just used the cli command to follow the configurations.</p><pre>rollup main.js --format umd --name &quot;myBundle&quot; --output index.js</pre><p>i was almost ready to take home the rolled up file and then there was a twist to the story</p><pre>Could not resolve &#39;./components/logo&#39; from main.js</pre><p>and wasn’t really a big one because rollup is measured in the feedback to the user. One of the under appreciated but really handy thoughts put into by the rollup team.</p><h4>Research notes!</h4><blockquote>Quickly search how to resolve the files not in the same directory. Find that there isn’t really an issue in terms of relative path resolution but that it could be because of command line and so the first thing to do would be to use a config file.</blockquote><h3>Rollup Config</h3><p>Convert the cli command to be as simple as calling the function to use a config file. The config file if named as rollup.config.js is auto picked up , while custom names could also be given technically. I named mine bestBlunt.js and it has the following config.</p><pre><strong>import </strong>includePaths <strong>from </strong>&#39;rollup-plugin-includepaths’;</pre><pre>const includePathOptions = {<br>  include: {},<br>  paths: [’components/’],<br>  external: [],<br>  extensions: [’.js’, <strong>&#39;.jsx’</strong>]<br>};</pre><pre>export default {<br>  entry: &#39;main.js&#39;,<br>  format: &#39;umd&#39;,<br>  moduleName: &#39;blunt&#39;,<br>  plugins: [<br>   includePaths(includePathOptions),<br>  ]<br>};</pre><p>and run the command rollup -c bestBlunt.jsshould technically work but it threw another curve ball.</p><pre>Unexpected token<br>components/logo.jsx (12:4)<br>11:   return (<br>12:     &lt;div<br>        ^</pre><h4>Research notes!</h4><blockquote>So the rollup is now able to pick up the .jsx file but unable to resolve template inside. I thought babel with babel-plugin-react should resolve the issue. How to set up babel with plugins is a bit of tangent but not something new to most.</blockquote><p>So included babel plugin for rollup and my config became</p><pre><strong>import </strong>includePaths <strong>from </strong>&#39;rollup-plugin-includepaths’;<br><strong>import babel from &#39;rollup-plugin-babel&#39;;</strong></pre><pre>const includePathOptions = {<br>  ...<br>  external: [&#39;react&#39;],<br>  ...<br>};</pre><pre>export default {<br>  ...<br>  plugins: [<br>   ...<br>   babel({<br>     exclude: &#39;node_modules/**&#39;<br>   })<br>  ]<br>};</pre><p>and i was all set… almost. There was a small problem which i did not consider was the rollup cannot pick up css and roll up as module.</p><pre>(babel plugin) /Users/vsury1/WebstormProjects/React/Fusion/components/logo.css: Unexpected token (1:0)<br>undefined (1:0)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/245/1*hjKqVqrKyK65F4RzqU8m1w.gif" /><figcaption>Are you still here ?</figcaption></figure><h4>Research notes!</h4><blockquote>So there is no direct way of picking up css and shipping it as a module inside my js file from rollup. but that is a role for a plugin to take care of and after a bit of research, postcss plugin made the most sense.</blockquote><p>Add postcss-plugin to the mix and the config became.</p><pre><strong>import </strong>postcss <strong>from </strong>&#39;rollup-plugin-postcss&#39;;<br>import ...</pre><pre>const includePathOptions = {...}<br>export default {<br>  ...<br>  plugins: [<br>    postcss({<br>      extensions: [&#39;.css&#39;],<br>    }),<br>    ...]<br>  ...<br>}</pre><p>and when i ran the command again , there was absolute silence back from rollup. Yes that is one thing they should probably add, “ a success message ”</p><p>But i was done and the file had actually rolled up my components into a UMD compliant file which is now more or less ready to run anywhere( well not literally ).</p><p>Then i added uglify to obfuscate and minify the code but that’s just the way we roll ;).</p><h3>Take away?</h3><p>Rollup is absolutely powerful and true to its sense of what it wants to get done and it has started getting attention from community and it is only matter of time before it picks up pace to roll over other build tools.</p><p>React very recently merged a big PR to make rollup its official build tool. So grab a chair and be privy to upcoming build wars which is sure to make the community more richer.</p><p>Oh did i say, next in my list is <a href="https://developers.google.com/closure/compiler/">Closure</a> Compiler?. All in due time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*EsypztVCxPYCYz0tFfYlkA.gif" /><figcaption>Here’s some tater tots</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1546861f82b7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>