<?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 Nithin C Valappil on Medium]]></title>
        <description><![CDATA[Stories by Nithin C Valappil on Medium]]></description>
        <link>https://medium.com/@nithincvpoyyil?source=rss-10cfff240f7b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*i23MgKKLShYPg21LqaNyVQ.png</url>
            <title>Stories by Nithin C Valappil on Medium</title>
            <link>https://medium.com/@nithincvpoyyil?source=rss-10cfff240f7b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 15 Nov 2026 02:20:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nithincvpoyyil/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[PnP JS caching — Indexed DB support]]></title>
            <link>https://medium.com/@nithincvpoyyil/pnp-js-caching-indexed-db-support-fdbd573a0ecc?source=rss-10cfff240f7b------2</link>
            <guid isPermaLink="false">https://medium.com/p/fdbd573a0ecc</guid>
            <category><![CDATA[spfx]]></category>
            <category><![CDATA[caching]]></category>
            <category><![CDATA[indexeddb]]></category>
            <category><![CDATA[pnpj]]></category>
            <category><![CDATA[sharepoint-spfx]]></category>
            <dc:creator><![CDATA[Nithin C Valappil]]></dc:creator>
            <pubDate>Mon, 08 Aug 2022 12:45:17 GMT</pubDate>
            <atom:updated>2022-08-08T12:54:28.679Z</atom:updated>
            <content:encoded><![CDATA[<h3>PnP JS caching — Indexed DB support</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EAl_REbBI0BNVacYHkqSLQ.png" /></figure><p>Our team is developing a content-heavy SharePoint site, which needs caching of some content on the client side for fast navigation and page loading. Initially, we’ve tried <strong><em>useCaching()</em></strong> with localStorage-PnPStorgareWrapper, however, this allows us to store a maximum of 10Mb (varies with browser) data per domain/host. Due to this limitation, PnPStorageWrapper is throwing a ‘storage quota exceeded’ error if the localStorage limit is exceeded for the domain. So, I’ve decided to create an indexedDB caching wrapper for the PnPJS, to overcome this storage quota error and publish it to npm.</p><p>I would like to introduce <a href="https://www.npmjs.com/package/@simpletech/pnp-idb-cache"><strong>@simpletech/pnp-idb-cache</strong> </a>package, a library that helps you to use indexedDB as cache storage on your Sharepoint sites. It can be installed via npm or yarn using the following command,</p><blockquote>yarn add @simpletech/pnp-idb-cache</blockquote><pre>import { IDBCaching } from &quot;@simpletech/pnp-idb-cache&quot;;</pre><pre>function getItems() {<br>    sp = spfi().using(SPFx(this.context));<br><br>    // get all the items from a list<br>    sp.web.lists<br>      // go with default cache params and expiry(24 hours) function<br>      .using(IDBCaching())<br>      .getByTitle(&quot;someListNameInTheSPSite&quot;)<br>      .items()<br>      .then(<br>        (items) =&gt; {<br>          console.log(&quot;data fetch completed&quot;, items);<br>        },<br>        () =&gt; {<br>          console.log(&quot;data fetch failed&quot;);<br>        }<br>      );<br><br>  }</pre><p><strong>Key features:</strong></p><ul><li>It allows us to add indexedDB as cache storage</li><li>Only supports browsers (NodeJS — not supported).</li><li>Deletes expired items</li><li>Customizable cache expiry, cache key functions &amp; DB parameters</li></ul><p>Links :</p><p><a href="https://github.com/nithincvpoyyil/PnPIDBCache">https://github.com/nithincvpoyyil/PnPIDBCache</a></p><p><a href="https://www.npmjs.com/package/@simpletech/pnp-idb-cache">https://www.npmjs.com/package/@simpletech/pnp-idb-cache</a></p><p>As always, I welcome your<strong> feedback, suggestions, and comments</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fdbd573a0ecc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I solved `xlink:href ` issue in IE11 without using svgx polyfill]]></title>
            <link>https://medium.com/@nithincvpoyyil/how-i-solved-xlink-href-issue-in-ie11-without-using-svgx-polyfill-afab49c5969f?source=rss-10cfff240f7b------2</link>
            <guid isPermaLink="false">https://medium.com/p/afab49c5969f</guid>
            <category><![CDATA[ie11-compatibility]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[svg]]></category>
            <category><![CDATA[svgx]]></category>
            <category><![CDATA[xlinks]]></category>
            <dc:creator><![CDATA[Nithin C Valappil]]></dc:creator>
            <pubDate>Sun, 03 Nov 2019 11:49:59 GMT</pubDate>
            <atom:updated>2019-11-11T05:15:43.809Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1012/1*QX3HQGWIn9VeqdvREl9ZaQ.png" /><figcaption>IE11 xlink:href issue solution without svgx</figcaption></figure><p>In our <strong>create-react-app based </strong>application, we are using several SVG icons with different gradients and colours, and importing SVG file as <strong>React Components</strong>.</p><p>We have a collection of SVG files and build an Icon component system. After going through many dev sites, we have decided to go with SVG sprite approach by importing <em>symbol</em> definitions using <strong>&lt;use&gt; </strong>tag<strong> </strong>and<strong> ‘<em>xlink:href’ </em></strong><em>(deprecated as of now) OR </em><strong><em>‘href’ </em></strong><em>attributes</em><strong><em>.</em></strong></p><pre><strong>&lt;!-- Sprite SVG File having gradient and icon definitions</strong> <strong>--&gt;</strong></pre><pre>&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;  <br>  <br>&lt;defs&gt;    <br>  &lt;linearGradient <strong>id=&quot;app-gradient-default&quot;</strong>&gt;   <br>    &lt;stop offset=&quot;5%&quot;  stop-color=&quot;gold&quot; /&gt;<br>    &lt;stop offset=&quot;95%&quot; stop-color=&quot;red&quot; /&gt;   <br>  &lt;/linearGradient&gt; <br>&lt;/defs&gt;</pre><pre>&lt;symbol <strong>id=&quot;delete-icon&quot;</strong> viewBox=&quot;0 0 32 32&quot;&gt;    <br>    &lt;!-- &lt;path&gt;s and whatever other shapes in here --&gt;  <br>&lt;/symbol&gt;  <br>  <br>&lt;symbol <strong>id=&quot;save-icon&quot;</strong> viewBox=&quot;0 0 32 32&quot;&gt;    <br>   &lt;!-- &lt;tilte&gt;, &lt;decription&gt;, &lt;path&gt;s here --&gt;  <br>&lt;/symbol&gt;<br>&lt;/svg&gt;</pre><p><strong>The `Problem` with IE11 and SVGX</strong></p><p>Everything was perfect until the client asked for IE11 support, so we have decided to go with an excellent <a href="https://icomoon.io/svgxuse-demo/">polyfill</a> developed by Icomoon team called <strong>svgx. </strong>But, we have observed that in<strong> </strong>IE11, svgx<strong> </strong>using ajax call to load SVG file to the DOM. And we don&#39;t like to add <em>1 more polyfill + 1 more Ajax call</em>.</p><p>Then, we have changed our approach slightly as below,</p><ol><li>Render the <strong>SVG Sprite</strong> file as the first component in the application.</li><li>Use these<strong> symbol </strong>and<strong> gradient definitions from the sprite component </strong>to building the Icon components for the app.</li></ol><p>Thus, we can get rid of svgx polyfill because there is no external SVG file loaded.</p><p><strong>App Component</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/02a6f20326e86356d3c10d8b73eb79ad/href">https://medium.com/media/02a6f20326e86356d3c10d8b73eb79ad/href</a></iframe><p><strong>Icon Component</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/508ce9b36d84200bf467fc2da7c29e53/href">https://medium.com/media/508ce9b36d84200bf467fc2da7c29e53/href</a></iframe><p><strong>Pros</strong></p><ol><li>It enables the reuse of symbol and gradient definitions</li><li>Fast loading</li><li>No polyfills</li><li>No extra loading of components</li><li>Scalable &amp; easy to maintain</li></ol><p><strong>Cons</strong></p><ol><li>More codes</li><li>Increase in the bundle size depends on your sprite file component size.</li></ol><p>Thanks for reading, and please share your thoughts.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=afab49c5969f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[5 Useful Angular CLI Tips For The Beginners]]></title>
            <link>https://medium.com/@nithincvpoyyil/5-useful-angular-cli-tips-for-the-beginners-b8ecc2ad877a?source=rss-10cfff240f7b------2</link>
            <guid isPermaLink="false">https://medium.com/p/b8ecc2ad877a</guid>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[beginner]]></category>
            <category><![CDATA[angular-cli]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[tips]]></category>
            <dc:creator><![CDATA[Nithin C Valappil]]></dc:creator>
            <pubDate>Wed, 07 Nov 2018 12:47:33 GMT</pubDate>
            <atom:updated>2018-11-08T23:30:54.831Z</atom:updated>
            <content:encoded><![CDATA[<h3>5 Useful Angular CLI Tips For Beginners</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yQUuzPLJPEMuK5Z_GgNNYQ.png" /></figure><blockquote>Before I start, I want to thank the Angular team for providing a very good tool which saves a lot of time on every new project..❤️ Also, Please have a look into this excellent <a href="https://medium.com/@tomastrajan/6-best-practices-pro-tips-for-angular-cli-better-developer-experience-7b328bc9db81"><strong>article</strong></a> by <a href="https://medium.com/u/360cd444e1fc">Tomas Trajan</a> <em>for the </em><strong><em>best practices and pro-tips </em></strong><em>in angular</em></blockquote><h4>What are we going to learn</h4><ol><li>Adding global styles, variables, and media query mixin</li><li>Getting all configs before app initialization</li><li>Skipping HTTP interceptor for HTTP calls</li><li>Setting up <strong>JSON Server</strong> for testing</li><li>Adding <strong>compodoc</strong> for document generation</li></ol><h4><strong>1. Adding global styles and variables</strong></h4><p>It is a best practise to keep a global file with all your SASS variables and mixins etc in the project. And instead of importing this global file in each components, we can use ‘<strong><em>includePaths</em>’ </strong>of ‘<strong><em>stylePreprocessorOptions</em>’</strong> config in <strong>angular.json </strong>to define a global path as shown below.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/497812d0b0aad4c4ff9c06a5c162bc95/href">https://medium.com/media/497812d0b0aad4c4ff9c06a5c162bc95/href</a></iframe><p><em>If you like to add bootstrap like simple media queries in your project,</em><strong><em> </em></strong><a href="https://glennmccomb.com/articles/useful-sass-scss-media-query-mixins-for-bootstrap/#the-entire-code"><strong><em>this code snippet </em></strong></a><em>will be much helpful.</em></p><h4>2. Getting configs/settings before app initialisation</h4><p>This is a common scenario in app development. While initialising the application, it may need to fetch the initial configurations like API constants or 3rd party service tokens from server. In order to achieve this, angular provides an injection token called ‘<strong><em>APP_INITIALISER</em></strong>’ in <strong><em>@angular/core.</em></strong><em> </em>A function that will be executed when app is initialised.</p><p>As described below, keeping it in a separate module will be better in design perspective.</p><p><strong>a) </strong>Create a config loader module and import it in main app module</p><p><strong>b) </strong>Create an angular service class to fetch the config from server</p><p><strong>c) </strong>Create factory functions which will be called by the config loader module on app initialisation. Use getters to get the value from services.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/34be302fd6b6e7efe2e7f0960c27c8ec/href">https://medium.com/media/34be302fd6b6e7efe2e7f0960c27c8ec/href</a></iframe><p><em>For more detailed information, please see this </em><a href="https://www.intertech.com/Blog/angular-4-tutorial-run-code-during-app-initialization/"><strong><em>article </em></strong></a><em>by </em><strong><em>Rich</em></strong></p><h4>3. Skipping HTTP Interceptor</h4><p><strong>Problem</strong>: Injected interceptor in the app module is intercepting all the HTTP calls from the app. But I want to intercept the calls only in a particular module or want to skip the interception in a particular scenario.</p><p>Solution for above scenario can be done in two ways,</p><p><strong>a) </strong>Adding a <strong>header in the request</strong> and based on this header identify the requests to skip.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7b6725566bda53b45f3f09b1613d22a0/href">https://medium.com/media/7b6725566bda53b45f3f09b1613d22a0/href</a></iframe><p><strong>b)</strong> Use HTTPClient by passing <strong>HttpBackend handler.</strong></p><p>By injecting <strong>http backend handler </strong>in<strong> </strong>HttpClient will make http client to dispatch all the requests directly to the backend, without going through the interceptor chain, so that all HTTP calls will be skipped. (I believe, this is the easiest and cleaner way of getting this work done)</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a4f37769b77a3b5eece5fec2aad1beee/href">https://medium.com/media/a4f37769b77a3b5eece5fec2aad1beee/href</a></iframe><h4>4. Setting up J<strong>SON Server</strong> for testing</h4><p>This is helpful when we want to simulate a backend REST service to deliver some data in JSON format to the front-end application and make sure everything is working as expected.</p><p>We can use <a href="https://github.com/typicode/json-server"><strong>JSON Server</strong> </a>package which will help us to setup Restful CRUD operations very fast. To integrate this with angular cli app, we need to create JSON server and add proxy configs as below,</p><p><strong>a) </strong>Create a <a href="https://github.com/nithincvpoyyil/ng-seed/blob/master/src/json-server/server.js">JSON server</a> and <a href="https://github.com/nithincvpoyyil/ng-seed/blob/master/src/json-server/data.json">data.json</a> file</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7f34b21a8a558840debdbfe8c92197ea/href">https://medium.com/media/7f34b21a8a558840debdbfe8c92197ea/href</a></iframe><p><strong>b)</strong> Create a proxy config file and pass as an argument in <strong>ng serve</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1a55aeb0381993c691250fac524858c9/href">https://medium.com/media/1a55aeb0381993c691250fac524858c9/href</a></iframe><p><strong>c)</strong> Use ‘<a href="https://www.npmjs.com/package/concurrently"><strong>concurrently</strong></a><strong>’</strong> for running cli commands &amp; JSON server together. Create mock-server, dev-proxy and dev scripts in package.json as below. concurrently used to run multiple npm scripts together.</p><pre>// <strong>package.json</strong><br>......<br>&quot;scripts&quot;: {<br>  &quot;<strong>mock-server</strong>&quot;: &quot;node ./src/json-server/server.js&quot;,<br>  &quot;<strong>dev-proxy</strong>&quot;: &quot;ng serve --proxy-config proxy.conf.json&quot;,<br>  &quot;<strong>dev</strong>&quot;: &quot;<strong>concurrently</strong> --kill-others \&quot;<strong>npm run mock-server</strong>\&quot; <br>           \&quot;<strong>npm run dev-proxy</strong>\&quot; &quot;</pre><pre>}<br>.....</pre><h4>5. Setup <a href="https://compodoc.app/">compodoc </a>for documentation</h4><p>This tool helps you to generate the documentation of your angular project with in seconds.</p><pre>// <strong>package.json</strong><br>......<br>&quot;scripts&quot;: {<br>  &quot;<strong>doc</strong>&quot;: &quot;./node_modules/.bin/compodoc -p src/tsconfig.app.json&quot;<br>}<br>.....</pre><p>Full source code is available in <a href="https://github.com/nithincvpoyyil/ng-seed"><strong>this repository</strong></a>. Enjoy Coding !!!!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b8ecc2ad877a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>