<?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 Paulo Fagiani on Medium]]></title>
        <description><![CDATA[Stories by Paulo Fagiani on Medium]]></description>
        <link>https://medium.com/@fagiani?source=rss-6368f277a5b9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*EELx29Gg4XSlmk_C.jpg</url>
            <title>Stories by Paulo Fagiani on Medium</title>
            <link>https://medium.com/@fagiani?source=rss-6368f277a5b9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 13:47:58 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@fagiani/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[this should definitely get published as it helped me a lot! keep rocking!]]></title>
            <link>https://fagiani.medium.com/this-should-definitely-get-published-as-it-helped-me-a-lot-keep-rocking-feea9e7f20bb?source=rss-6368f277a5b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/feea9e7f20bb</guid>
            <dc:creator><![CDATA[Paulo Fagiani]]></dc:creator>
            <pubDate>Wed, 27 Oct 2021 01:07:37 GMT</pubDate>
            <atom:updated>2021-10-27T01:07:37.029Z</atom:updated>
            <content:encoded><![CDATA[<p>this should definitely get published as it helped me a lot! keep rocking!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=feea9e7f20bb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Customizing an npm package]]></title>
            <link>https://fagiani.medium.com/customizing-an-npm-package-da4edc9b57a1?source=rss-6368f277a5b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/da4edc9b57a1</guid>
            <category><![CDATA[npm-package]]></category>
            <category><![CDATA[forking]]></category>
            <category><![CDATA[customization]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[patching]]></category>
            <dc:creator><![CDATA[Paulo Fagiani]]></dc:creator>
            <pubDate>Fri, 18 Dec 2020 15:27:55 GMT</pubDate>
            <atom:updated>2020-12-18T15:27:55.448Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*h-QvWTpGzwNbw4ia7259ow.png" /><figcaption>Borrowed from <a href="https://medium.com/reactbrasil/criando-sua-pr%C3%B3pria-lib-de-componentes-em-react-e-publicando-no-npm-registry-32eda41f4ec8">https://medium.com/reactbrasil/criando-sua-pr%C3%B3pria-lib-de-componentes-em-react-e-publicando-no-npm-registry-32eda41f4ec8</a></figcaption></figure><p>There is an interesting approach when dealing with customizations you make to node_modules package dependencies for your npm project. Sometimes, the changes aren&#39;t that useful to the original package as they only belong to a very specific use case you&#39;re working on. Even if it is a bug fix or an improvement that may improve the package&#39;s function, forking, changing and sending a pull request may take a long time until it gets accepted (if not ignored or rejected) and merged after eventual requested improvements by the author. Yet, the next release is not guaranteed to happen any time soon as each project has its own roadmaps and policies on when to release a new package version.</p><h4>The odds of forking a package</h4><p>Repackaging it from a fork is probably the next <strong>big</strong> step that will come to your mind. Big, because then you need to sign up to npm, change metadata to your new package, name it, build it, deploy it, and <em>specially:</em> maintain it. I don&#39;t really see that as a feasible alternative because most of the time it will actually produce more noise than signal as you will get a new npm package out there that somehow is the same of the original but with only small changes and instead of leveraging the original package which overall remains useful, once you get others using your forked package now you will be demanded to maintain that code and eventually apply downstream changes from the original package, security patches and improvements to it as other folks begin to play with it. It is now an unnecessary duplicated eternal burden you just acquired to yourself for free.</p><p>If you didn&#39;t follow the package forking path, you probably have persisted your changes somehow and eventually added the node_modules<em> </em>path to the library to your <em>git</em> repository to make sure you won&#39;t break the whole thing when you need to work on it again. In that sense, I&#39;ve been looking for a better way to do that and it came to mind an old trick used before distributed version control became popular as I never really enjoyed using CVS or SVN and other enterprise bureaucratic alternatives not worth mentioning here.</p><h4>Patching to the rescue</h4><p>The way of doing it on the golden days is called <em>patching</em>. A patch is basically a diff between the original code and the changes you&#39;ve just made. If you look closely at what <em>git </em>does internally it is pretty much the same, automated. But how can I do that in a safe and reproducible fashion?</p><p>Interestingly, <em>npm</em> itself has a specific package to do that and it&#39;s readme is both clear and straightforward about how to do patching including the <a href="https://www.npmjs.com/package/patch-package#benefits-of-patching-over-forking">benefits of patching over forking</a>, which I quote below:</p><blockquote>— Sometimes forks need extra build steps, e.g. with react-native for Android. Forget that noise.</blockquote><blockquote>— Get told in big red letters when the dependency changed and you need to check that your fix is still valid.</blockquote><blockquote>— Keep your patches colocated with the code that depends on them.</blockquote><blockquote>— Patches can be reviewed as part of your normal review process, forks probably can’t</blockquote><p>You can use the <a href="https://www.npmjs.com/package/patch-package">patch-package</a> package to achieve it. In order to get it working quickly, make your changes by hacking the code within node_modules<em> </em>of your project’s base path as you would do it otherwise, then follow some quick steps to achieve it as described below:</p><pre># run this from your project&#39;s base path<br>npx patch-package <em>&lt;changed-package-name&gt;</em></pre><p>It will create a patches/<em>&lt;changed-package-name&gt;</em>+<em>&lt;version&gt;</em>.patch file which then you can apply in the future.</p><p>A next step is to add this package as to run as a postinstall script of your package.json file as follows:</p><pre>&quot;scripts&quot;: {<br>  &quot;postinstall&quot;: &quot;patch-package&quot;<br>}</pre><p>Then you can run:</p><pre>npm i patch-package</pre><blockquote>You can read more if you’ re using yarn or if you want it to work on Heroku, for details see the <a href="https://www.npmjs.com/package/patch-package#yarn">package’s site</a>.</blockquote><p>The last step is to persist that to your git repository without the need to add the node_modules folder to it and you can do it with the commands below:</p><pre>git add package*.json<br>git commit -m &quot;Apply custom package patches when npm is run&quot;</pre><pre>git add patches/<em>&lt;changed-package-name&gt;</em>+<em>&lt;version&gt;</em>.patch<br>git commit -m &quot;Patch changes to <em>&lt;changed-package-name&gt;</em> npm package&quot;</pre><h4>That’ s all folks!</h4><p>Your changes are safe within your project’s repository and will get applied automatically and gracefully when you use npm (&gt;=5) and you don’t need to wait or rely on any other people to have a working project right away.</p><p>Hopefully that will become helpful to you on a current or future endeavor!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=da4edc9b57a1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Caso de Sucesso — Bee Delivery]]></title>
            <link>https://medium.com/tinkbrasil/caso-de-sucesso-bee-delivery-e574f75fe252?source=rss-6368f277a5b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/e574f75fe252</guid>
            <category><![CDATA[partnerships]]></category>
            <category><![CDATA[case-study]]></category>
            <category><![CDATA[success]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Paulo Fagiani]]></dc:creator>
            <pubDate>Fri, 20 Sep 2019 11:41:25 GMT</pubDate>
            <atom:updated>2019-09-20T11:41:25.622Z</atom:updated>
            <content:encoded><![CDATA[<h3>Caso de Sucesso — Bee Delivery</h3><p><em>Startup nordestina fez mais de 1 milhão de entregas usando a AWS</em></p><h3>Sobre a Bee Delivery</h3><p>A Bee Delivery é uma startup Brasileira de entrega sob demanda, fundada na cidade de Mossoró no estado do RN em 2018. Com a missão de conectar empresas com entregadores através de uma plataforma digital que permite realizar de forma rápida, fácil e segura a entrega de seus produtos aos seus clientes. Atualmente presente em 24 estados da federação e em mais de 60 cidades, já se prepara para sua expansão internacional ao recentemente alcançar a marca de 1 milhão de entregas e a parceria estratégica de integração com o iFood.</p><h3>O Desafio</h3><p>O objetivo da Bee era escalar para atender a crescente demanda de novos clientes e entregas contratadas a todo instante em sua plataforma ao mesmo tempo que precisava otimizar a performance e disponibilidade para manter o nível de qualidade e focar em garantir que tudo isso acontecesse em um ambiente seguro. A empresa estava utilizando uma infraestrutura monolítica em um datacenter e já chegando ao limite da capacidade vertical de recursos. Após entender que precisavam mudar a abordagem, em Outubro de 2018 a Bee contratou a Tink! para apoiá-los neste grande desafio.</p><h3>Nossa Abordagem</h3><p>Entendendo as necessidades da Bee, a nossa solução passou pela migração de todos os recursos para a AWS e a transformação da plataforma para que pudesse então se beneficiar da oferta de serviços gerenciados e capacidade de capilaridade com múltiplas zonas de disponibilidade para escalar horizontalmente dadas as necessidades peculiares do negócio que incluem horários de grandes picos e outros de maior ociosidade. Foram implementados ambientes de teste, homologação e produção utilizando serviços como o <em>CodeDeploy</em> em frotas de instâncias <em>EC2 Spot</em> auto escaláveis para filas e interface da plataforma web balanceadas com <em>ALBs</em> usando <em>Launch Templates</em>. Foram ainda provisionados e configurados serviços como o <em>RDS Aurora</em> para persistência com réplicas de leitura auto escaláveis, clusters <em>ElastiCache</em> para cache e o <em>S3</em> para armazenamento geral. Centralizamos todos os logs através do <em>CloudWatch</em>, definindo alarmes para alertar de condições adversas e insights.</p><h3>Os Resultados</h3><p>Em apenas duas semanas de projeto, a plataforma já passou a funcionar totalmente na AWS utilizando-se de uma infraestrutura robusta e prontos para a nova fase proposta. Ao longo destes dias, foram feitas mudanças na aplicação que permitiram o benefício de uma perspectiva de crescimento exponencial do negócio. Dentre os resultados alcançados, podemos citar:</p><ul><li>O aumento da disponibilidade da aplicação em horários de pico;</li><li>A elasticidade da infraestrutura;</li><li>Redundância dos serviços provisionados;</li><li>Política de continuidade (backup e restore);</li><li>Autonomia da equipe interna para realizar mudanças e melhorias na aplicação;</li><li>Camada de serviços integrada;</li><li>Entrega contínua de novas versões da aplicação sem interrupções;</li><li>Custo otimizado para um volume crescente de demanda;</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/696/1*14GK8g2roMDETT2e7xyzyQ.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e574f75fe252" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tinkbrasil/caso-de-sucesso-bee-delivery-e574f75fe252">Caso de Sucesso — Bee Delivery</a> was originally published in <a href="https://medium.com/tinkbrasil">tinkbrasil</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>