<?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 Uday Vunnam on Medium]]></title>
        <description><![CDATA[Stories by Uday Vunnam on Medium]]></description>
        <link>https://medium.com/@udayvunnam?source=rss-fa724b23938c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*_-IOgtca74ElBOkEEV24Tg.jpeg</url>
            <title>Stories by Uday Vunnam on Medium</title>
            <link>https://medium.com/@udayvunnam?source=rss-fa724b23938c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 23:51:10 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@udayvunnam/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[Top 5 things to consider when creating an Angular library]]></title>
            <link>https://medium.com/ngyou/https-medium-com-udayvunnam-be-the-thanos-of-your-angular-library-320f93ddc9ec?source=rss-fa724b23938c------2</link>
            <guid isPermaLink="false">https://medium.com/p/320f93ddc9ec</guid>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web]]></category>
            <category><![CDATA[beginner]]></category>
            <category><![CDATA[learning]]></category>
            <dc:creator><![CDATA[Uday Vunnam]]></dc:creator>
            <pubDate>Wed, 26 Jun 2019 17:48:16 GMT</pubDate>
            <atom:updated>2020-01-01T03:57:47.089Z</atom:updated>
            <content:encoded><![CDATA[<iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fplay.ht%2Fembed%2F%3Farticle_url%3Dhttps%3A%2F%2Fmedium.com%2F_p%2Fhttps-medium-com-udayvunnam-be-the-thanos-of-your-angular-library-320f93ddc9ec&amp;url=https%3A%2F%2Fplay.ht%2Farticles%2F320f93ddc9ec&amp;image=https%3A%2F%2F1%2AJn_FvN4FaqYw3IN9Zxs8xw.jpeg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=play" width="700" height="185" frameborder="0" scrolling="no"><a href="https://medium.com/media/5637901cbb886bebf5aa141dd6d3cb42/href">https://medium.com/media/5637901cbb886bebf5aa141dd6d3cb42/href</a></iframe><blockquote>Essential checklist and best practices for beginners in creating and releasing your first Angular library</blockquote><p><strong>Note: I have cross-posted this article at </strong><a href="https://dev.to/udayvunnam/be-the-thanos-of-your-angular-library-11oe"><strong>dev.to</strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c7UEClLpAMm3yBsFvhWE-Q.png" /><figcaption>Angular library plan — setup — release</figcaption></figure><p>If you are planning to create a library, don’t wait. The time is now. The current open source tools make everything so seamless. Below are the steps I followed to release my first library. As we go along, you can check the <a href="https://github.com/udayvunnam/xng-breadcrumb">GitHub repo</a> for reference.</p><ul><li>Plan the library</li><li>Set up Angular workspace for library and a demo-app</li><li>Empathize with your users and fellow developers</li><li>Configure CICD</li><li>Announce it to the world</li></ul><h4>✅ Plan your Library</h4><p>Have a simple design of how the library works and the contract it provides.</p><p>The usual prefixes for Angular are ng or ngx(say no to ng2, ng4, ng7, etc. They seem tied to a specific version). ng and ngx prefixes are taken for most of the Angular libraries, so I have used xng prefix.</p><p>After choosing the name of your library, create a simple folder with package.json and publish it to npm under your account. <a href="https://docs.npmjs.com/creating-and-publishing-unscoped-public-packages">guide to publishing npm packages with a basic setup.</a> (This ensures package name is available and your ownership of it). You can even use scoped packages @scope/package-name if the regular package name of your wish isn’t available.</p><p>Try to create a unique library that can do any of the following</p><ul><li>makes a particular task easy</li><li>provides a configurable solution</li><li>tweaks a functionality</li><li>offers a visual UI component</li><li>simplifies a process</li></ul><p>Library API design — The right things have to be the defaults of your library. We don’t need the user specifying the redundant configuration, which otherwise is a default.</p><p>I have planned <strong>xng-breadcrumb</strong> with the following API design -</p><ol><li>Add breadcrumb selector in html, wherever the user wants to show breadcrumbs.</li><li>Show default breadcrumb same as the path, if no configuration is provided. The user just needs to add &lt;breadcrumb&gt;&lt;/breadcrumb&gt; for a quick start.</li><li>Declarative: Add a custom label to a route by directly defining it in route configuration of App.</li><li>Dynamic: provide a service to update a route label lazily. Ex: In product details page we show product id in URL but want to show product name in the breadcrumb, which is fetched asynchronously from the server.</li><li>Skip specific path from displaying in the breadcrumb. Come path even though it appears in URL has no meaning in the breadcrumb. We have to provide a way to hide it.</li></ol><p>Start with releasing useful features first and iterate from user feedback and feature requests.</p><h4>✅ Setup Angular library and a demo app</h4><p>With Angular CLI you are just a few commands away from setting up a library and a demo app. You can test your library usage along with the demo app. Thanks to Angular CLI 😍.</p><p>You have already chosen a unique name for your library. For me, it is xng-breadcrumb. Below are the basic commands for initiating an Angular workspace with a library and its demo app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ioXBKYKRezMVmpsbJ4Wjxg.png" /><figcaption>Angular library and demo app setup</figcaption></figure><ol><li>ng new xng-breadcrumb --createApplication=false generates a blank Angular workspace. If createApplication is not false, the unique library name is actually applied to demo app and later you would need to rename it in angular.json. To avoid this just start as above. We can create both the library and demo apps under the projects folder in the next steps.</li><li>ng g application xng-breadcrum-app --style=scss creates a demo app under projects, for testing your library alongside the app.</li><li>ng g library xng-breadcrumb --prefix=xng creates a library inside the projects folder with all the necessary build and packaging steps.</li><li>git init inside the workspace to move it to a git repo, so that you can track everything from the start.</li><li>During development, run npm link inside the compiled project folder (./dist/library) and npm link library-name at the project root. npm link symlinks compiled package folder to the npm package and any changes you make to the library reflects immediately in the demo app</li></ol><p>xng-breadcrumb’s <a href="https://xng-breadcrumb.netlify.com/">demo app</a> to showcase library usage-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*egYlSnxCxKgWMWdgJoZIUQ.gif" /><figcaption>xng-breadcrumbs demo app called as TechUnroll</figcaption></figure><h4>✅ Empathize with your users and fellow developers</h4><p>No matter how great your library is, people, won&#39;t use it unless you provide good documentation so, provide a README with -</p><ul><li>Q<em>uick Start — T</em>he simplest way possible to use your library. Make it as easy as it can be to start with your library.</li><li><em>Usage and API —library API, </em>features and common patterns of doing usual things should be documented. Good documentation can save a lot of time for users. They don’t have to dig deep into the code or choose an additional library or implement a custom solution when its already offered with the library.</li><li><em>Demo URL</em> — provide a playground of your working library within an App.</li><li><em>Development guide</em>, C<em>ontribution guidelines</em> will look welcoming for other developers to contribute.</li><li><em>Badges</em> — Add badges to show deployment status, test status, release version, and other repo activities</li></ul><p>A clear license gives the confidence to use your library. MIT is the defacto standard for opensource. To know the importance of licensing read <a href="https://thenextweb.com/dd/2017/09/25/facebook-re-licenses-react-mit-license-developer-backlash/">React’s license change from its own custom license to MIT after developer backlash.</a></p><p><strong>Schematics</strong></p><p>Provide Schematics<strong> </strong>to the library(specific to Angular). Users can easily use ng add to include a base version of your library into their project.</p><p>xng-breadcrumb schematic on ng add will do the following.</p><ol><li>Installs and adds the library to package.json</li><li>Imports the BreadcrumbModule to root Module.</li><li>Places &lt;breadcrumb&gt;&lt;/breadcrumb&gt; tag at root html.</li><li>Auto updates library with ng update .</li></ol><p>There is already great documentation from Angular on <a href="https://angular.io/guide/schematics-authoring">Schematic authoring</a> and <a href="https://angular.io/guide/creating-libraries">Library creation</a>.</p><h4>✅ Configure CICD</h4><p>CICD is the norm of software development. Automate everything —linting, build, tests, publishing to npm and demo app deployment. You only have to set it up once to make life easier. Test your code but not the users :)</p><ul><li><strong><em>Prettier</em></strong> and <strong><em>Husky </em></strong>for linting automatically on git commit</li><li><strong><em>CircleCI</em></strong><em> </em>or <strong><em>Travis</em></strong><em> </em>for configuring CICD</li><li><strong><em>Netlify</em></strong> for hosting demo App</li></ul><p>xng-breadcrumb is configured with below steps using <a href="https://github.com/udayvunnam/xng-breadcrumb/blob/master/.circleci/config.yml">CircleCI</a> and demo app is hosted on <a href="https://xng-breadcrumb.netlify.com/">Netlify</a>.</p><ol><li><strong>build</strong> and <strong>test</strong> every commit of every branch.</li><li><strong>deploy</strong> demo app(netlify deploy) only if the code is pushed or PR is merged to the master branch. build and tests should succeed to deploy.</li><li><strong>publish</strong> to npm(npm publish), whenever a new release is tagged in the repo using git tag vX.Y.Z</li></ol><h4>✅ Announce it to the world</h4><p>You have put in a lot of effort. Now it’s time to showcase it to the world for use. Announce it on LinkedIn, Twitter, Reddit and any platform with your target audience.</p><p>Be open about contributions, bug fixes, and feature requests.</p><p>Once your library is found useful and attains enough users, Google takes care of rest.</p><p>If you plan to add breadcrumbs to your Angular project, try <a href="https://github.com/udayvunnam/xng-breadcrumb">xng-breadcrumb</a>. Check the <a href="https://github.com/udayvunnam/xng-breadcrumb">Git repo</a>, if you wish to create an Angular library with complete setup. Contributions, issues, and feature requests are welcome.</p><p><strong>Note: If you liked the article, make sure to 👏 below. For more updates on JavaScript, Angular and React connect on </strong><a href="http://www.linkedin.com/in/udayvunnam"><strong>LinkedIn</strong></a><strong> and </strong><a href="https://github.com/udayvunnam"><strong>GitHub</strong></a><strong>. Happy coding!</strong></p><p><a href="https://medium.com/dsinjs/implementing-lru-cache-in-javascript-94ba6755cda9">Implementing LRU cache in JavaScript</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=320f93ddc9ec" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ngyou/https-medium-com-udayvunnam-be-the-thanos-of-your-angular-library-320f93ddc9ec">Top 5 things to consider when creating an Angular library</a> was originally published in <a href="https://medium.com/ngyou">NgYou</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Implementing LRU cache in JavaScript]]></title>
            <link>https://medium.com/dsinjs/implementing-lru-cache-in-javascript-94ba6755cda9?source=rss-fa724b23938c------2</link>
            <guid isPermaLink="false">https://medium.com/p/94ba6755cda9</guid>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[beginner]]></category>
            <category><![CDATA[data-structures]]></category>
            <dc:creator><![CDATA[Uday Vunnam]]></dc:creator>
            <pubDate>Sat, 16 Jun 2018 11:20:18 GMT</pubDate>
            <atom:updated>2021-06-06T04:42:24.555Z</atom:updated>
            <content:encoded><![CDATA[<iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fplay.ht%2Fembed%2F%3Farticle_url%3Dhttps%3A%2F%2Fmedium.com%2F_p%2Fimplementing-lru-cache-in-javascript-94ba6755cda9&amp;url=https%3A%2F%2Fplay.ht%2Farticles%2F94ba6755cda9&amp;image=https%3A%2F%2Fd262ilb51hltx0.cloudfront.net%2Ffit%2Fc%2F300%2F300%2F1%2AhcmmknOsAcxwf2Zu73uSow.jpeg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=play" width="700" height="185" frameborder="0" scrolling="no"><a href="https://medium.com/media/052dfa4f081e8c0fc80b6280e753fb10/href">https://medium.com/media/052dfa4f081e8c0fc80b6280e753fb10/href</a></iframe><blockquote>LRU is the acronym of <em>Least Recently Used</em> cache. The cache is used everywhere, let’s try to implement that in Javascript.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dyMzxNfKmnkzxguk9IWFiA.png" /><figcaption>A programmer trying to find the best solution for LRU Cache</figcaption></figure><p>In Simple steps —</p><ol><li>Create a data structure to hold the cache data with an initial limit.</li><li>Provide functionalities for adding to cache, getting an element from the cache, removing the least used element from the cache, and iterating through the cache.</li><li>We implement the functionality by mimicking Doubly LinkedList<em> </em>and a<em> </em>Map(Object)</li></ol><p>Read and write operations have to be O(1) in time complexity. <br>DoublyLinkedList for <strong>write/remove</strong> and Map(object) for <strong>read</strong> makes this possible.</p><p><strong>Identifying least recently used item from the cache:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sXq2W2FnlpV98RxJkA4uBA.png" /><figcaption><strong>LRU Cache visualized as map and LinkedList</strong></figcaption></figure><p>In a Doubly Linked list make head as most recently used and tail as least recently used.</p><ol><li>Do every insertion at the head.</li><li>On every read or update operation detach the node from its position and attach it at the head of the LinkedList. Remember, LRU is indicated in terms of both read and write operations to the cache.</li><li>When cache limit exceeds remove a node from the tail</li><li>Store key: Node relation in an object, so that retrieval is possible in O(1).</li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c165bb287d4fe4e34d098e6f1b979d11/href">https://medium.com/media/c165bb287d4fe4e34d098e6f1b979d11/href</a></iframe><p><strong>Usage</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6a713c662d565a10a419f1b8946ffa7d/href">https://medium.com/media/6a713c662d565a10a419f1b8946ffa7d/href</a></iframe><p>As we are adding the 4th element in a cache with limit 3, which element do you think is removed ????????????</p><p>Yes, it is<strong> b.</strong></p><p>Since <strong>a</strong> is read recently and <strong>c</strong> is the last added item. <strong>b</strong> becomes the element that isn’t used recently by either read or write operations and hence available for deletion from the cache.</p><p>If you want to take it to the next level implement the LRU cache with a time limit. When no read and write operations are performed on LRU for a certain time invalidate the cache, Even better invalidate only a specific node when there is no operation on that node for a certain time.</p><p><strong>Note: This article is cross-posted on </strong><a href="https://dev.to/udayvunnam/implementing-lru-cache-in-javascript-3c8g"><strong>Dev.to</strong></a></p><p><strong>Note: If you liked the article, make sure to 👏 below. For more updates on JavaScript, Angular and React connect on LinkedIn and GitHub. Happy coding!</strong></p><p><a href="https://medium.com/@udayvunnam/https-medium-com-udayvunnam-be-the-thanos-of-your-angular-library-320f93ddc9ec">Top 5 things to consider when creating an Angular library</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=94ba6755cda9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dsinjs/implementing-lru-cache-in-javascript-94ba6755cda9">Implementing LRU cache in JavaScript</a> was originally published in <a href="https://medium.com/dsinjs">DSinJS</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Things I learned by upgrading to Angular 6]]></title>
            <link>https://medium.com/ngyou/things-i-learned-in-upgrading-to-angular-6-277e4c9ec516?source=rss-fa724b23938c------2</link>
            <guid isPermaLink="false">https://medium.com/p/277e4c9ec516</guid>
            <category><![CDATA[angular-6]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[upgrade]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[upgrade-to-angular6]]></category>
            <dc:creator><![CDATA[Uday Vunnam]]></dc:creator>
            <pubDate>Fri, 01 Jun 2018 03:52:30 GMT</pubDate>
            <atom:updated>2019-06-22T15:55:21.368Z</atom:updated>
            <content:encoded><![CDATA[<iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fplay.ht%2Fembed%2F%3Farticle_url%3Dhttps%3A%2F%2Fmedium.com%2F_p%2Fthings-i-learned-in-upgrading-to-angular-6-277e4c9ec516&amp;url=https%3A%2F%2Fplay.ht%2Farticles%2F277e4c9ec516&amp;image=https%3A%2F%2F1%2AhcmmknOsAcxwf2Zu73uSow.jpeg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=play" width="700" height="185" frameborder="0" scrolling="no"><a href="https://medium.com/media/3cbf21ef9cd00766027d1e18a0bf9c96/href">https://medium.com/media/3cbf21ef9cd00766027d1e18a0bf9c96/href</a></iframe><p>It’s been a while since Angular 6 has been released and I was so eager to upgrade to enjoy the awesome benefits it provides. This article shows issues we encounter during upgrade and how to resolve them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a6_sbrvTDYosGotYmcd7rw.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/photos/dns3RODBZoc?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Lyndsey Marie</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><ol><li>Update your node version to 8 or above and Install Angular cli latest globally by <em>npm i -g @angular/cli@latest</em></li><li>Angular 6 uses <em>angular.json </em>as configuration file instead of <em>.anguar-cli.json.</em><strong> </strong>Also<strong> </strong>tslint has been changed. Check <a href="https://github.com/angular/angular-cli/wiki/angular-workspace"><em>https://github.com/angular/angular-cli/wiki/angular-workspace</em></a><em> </em>for latest configuration details<em>. </em>You have to move any of your existing configuration to new configuration file.</li><li>To do this create another dummy project with latest cli using <em>ng new ‘your-project’ </em>and same defaults such as prefix, style etc you used earlier for your project. Create new project with cli <a href="https://github.com/angular/angular-cli/wiki/new"><em>https://github.com/angular/angular-cli/wiki/new</em></a></li><li>Use <a href="https://update.angular.io/"><em>https://update.angular.io/</em></a> to check what has been changed from your current version of Angular → Angular 6. It provides usage of how to change/fix them.</li><li>Follow the steps above and copy/update the angular.json file created in step2. Do <em>npm i </em>in your project to get all dependencies and do <em>npm update</em></li><li>Now comes the big part. RxJS upgrade and resolving conflicts. RxJS has standardised imports of operators and Observable creators with this release. Do <em>npm i -g rxjs-tslint </em>and add below lint configuration in tslint.json</li></ol><pre>{<br>  &quot;rulesDirectory&quot;: [<br>    &quot;node_modules/rxjs-tslint&quot;<br>  ],<br>  &quot;rules&quot;: {<br>    &quot;rxjs-collapse-imports&quot;: true,<br>    &quot;rxjs-pipeable-operators-only&quot;: true,<br>    &quot;rxjs-no-static-observable-methods&quot;: true,<br>    &quot;rxjs-proper-imports&quot;: true<br>  }<br>}</pre><p>7.Now run <em>ng lint --fix. </em>This fixes few items but most of the remaining issues will be highlighted and you have to fix it manually.</p><p><strong>Operators Name change:</strong></p><ol><li>do -&gt; tap</li><li>catch -&gt; catchError</li><li>switch -&gt; switchAll</li><li>finally -&gt; finalize</li></ol><p><strong>All operators moved to ‘rxjs/operators&#39;</strong></p><pre>import { map, filter, reduce } from &#39;rxjs/operators&#39;;</pre><p><strong>Observable creation methods are moved to ‘rxjs’</strong></p><pre>import { Observable, Subject, of, from } from &#39;rxjs&#39;;</pre><p>You are all set. Welcome to Angular 6 :)</p><p>Connect with me on <a href="http://www.linkedin.com/in/udayvunnam">LinkedIn</a>. Happy Coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=277e4c9ec516" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ngyou/things-i-learned-in-upgrading-to-angular-6-277e4c9ec516">Things I learned by upgrading to Angular 6</a> was originally published in <a href="https://medium.com/ngyou">NgYou</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>