<?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 Ashwinibm on Medium]]></title>
        <description><![CDATA[Stories by Ashwinibm on Medium]]></description>
        <link>https://medium.com/@ashwinibm88?source=rss-61a7702a6ce7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ReLsa-YDo8oiTZou-xxIug.jpeg</url>
            <title>Stories by Ashwinibm on Medium</title>
            <link>https://medium.com/@ashwinibm88?source=rss-61a7702a6ce7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 04:03:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ashwinibm88/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[Microfrontend or the Goldilocks solution]]></title>
            <link>https://engineering.instawork.com/microfrontend-or-the-goldilocks-solution-1efb6f142e8?source=rss-61a7702a6ce7------2</link>
            <guid isPermaLink="false">https://medium.com/p/1efb6f142e8</guid>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Ashwinibm]]></dc:creator>
            <pubDate>Thu, 15 Dec 2022 17:50:37 GMT</pubDate>
            <atom:updated>2022-12-15T17:50:37.525Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6P3QlE9OkAFWlDYKNLgPtQ.png" /><figcaption>Illustration by <a href="https://medium.com/u/9821095650c9">Monica Dahiya</a></figcaption></figure><p>At Instawork, we connect two sides of the marketplace. The business Partners and the Professionals.</p><p>Our Professionals form a large majority of the user base. They interact with Instawork through their mobile app, and we’ve invested a lot on the technology stack there to get it right for them.</p><p>For Partners, we have a web dashboard. A few years ago, we adopted a combination of <em>Django Templates</em> + <em>Intercooler</em> + <em>jQuery</em> for our web frontend (<strong>FE</strong>) to “iterate with simplicity” (read more <a href="https://engineering.instawork.com/iterating-with-simplicity-evolving-a-django-app-with-intercooler-js-8ed8e69d8a52">here</a>). <a href="https://intercoolerjs.org/">Intercooler</a> is a client-side library that makes it easy to define AJAX requests via HTML attributes. We were experimenting with a new, rapidly evolving product. So it made sense to prioritize speed and simplicity.</p><p>This approach to the web dashboard also inspired us to build a server-driven mobile app framework, <a href="https://hyperview.org/">Hyperview</a>, which has aged well and gained full adoption on our mobile app.</p><h3>The Problem</h3><p>The HTML + Intercooler + JS driven FE stack served us well for 3+ years. It let us quickly add several key pages and build a full-fledged dashboard to serve the majority of our partners’ needs.</p><p>Then our web product matured. The requirements demanded complex and rich FE features. Relying solely on jQuery, Intercooler, and one-off, completely handwritten static JS files started to limit our FE capabilities. Some pain points were:</p><ul><li>No state management across long flows</li><li>Inefficient page reloads since client-side validations, updates, etc was limited</li><li>Events and side effects via Intercooler/JS were not co-located, making it hard to follow the code and debug</li><li>Limited tooling and testing capabilities</li></ul><p>The result? The pace of development slowed down; Experimentation, iterations, and refactors became difficult. Even smaller features caused unintended side effects that were hard to trace and resolve.</p><h3>Ideal solution</h3><p>We wanted a solution to solve the pain points listed above. Additionally, we wanted to isolate and decouple different modules. We wanted to avoid the treacherous full rewrite and instead make incremental upgrades when required. This would let us continue to deliver features in parallel.</p><h4>Applying the fundamentals</h4><p>As a first step, we modernized our FE tooling and put good practices into place. This included:</p><ul><li>Manage bundling with Webpack</li><li>Enable static typing by introducing Typescript</li><li>Establish good code practices and patterns using Static Linting</li><li>Ship faster, with assured quality through unit &amp; integration tests</li></ul><h3>Leveling up FE</h3><p>Next, we evaluated different approaches to modernize and boost our FE capabilities, keeping in mind the following guiding principles:</p><p><strong>Long term:</strong> Does this get us on a path to an FE platform that will serve us well 2 years down the line? Does it present us with a reasonable strategy for the migration of existing pages or letting them co-exist?</p><p><strong>Short term:</strong> Can it start improving the way we do FE sooner? Can we decide on a case-by-case basis whether to isolate a section of the product and incrementally upgrade?</p><h4>Approach 1 — Fully client rendered</h4><p>Create a single, fully client-rendered app with a modern framework like React/Vue.</p><p>Leverage the existing JSON APIs we had built for the mobile app for the web.</p><p>This approach was out of the reckoning almost immediately because it would involve a long, arduous migration. And would force us to sacrifice some of that speed and simplicity I talked about at the beginning.</p><h4>Approach 2 — <a href="https://blog.xoxzo.com/2020/08/05/vue-with-django-getting-started/">Vue Templating</a></h4><p>Create Vue components to address rich, interactive FE requirements, and plug these Vue components into any Django templates.</p><p>This was a real contender since it would let us build complex UI components but still continue with our current set up, affording us speed and simplicity.</p><pre>{% extends &#39;base_layout.html&#39; %}<br><br>{% block main_content %}<br><br>&lt;h1&gt;Hello, world&lt;/h1&gt;<br><br>&lt;!-- load the Vue component --&gt;<br><br>&lt;demo-component&gt;&lt;/demo-component&gt;<br><br>{% endblock %}</pre><h4>Approach 3 —<a href="https://martinfowler.com/articles/micro-frontends.html"> Micro FE</a> (Goldilocks solution)</h4><p>This approach resembles the philosophy of microservices for the backend. Only, here we have loosely coupled “micro frontend apps”.</p><p>They can co-exist with the existing web app, making transitioning legacy pages as required, much easier.</p><p>They can each be full-fledged apps with all the capabilities of a modern React app. Is this the best of both worlds? 🤩</p><h4>Approach decision</h4><p>Since Approaches 2 and 3 were serious contenders, we did a deep-dive comparison of various factors like tooling &amp; testing support, the extent of framework capabilities, developer experience, etc. See the comparison matrix below.</p><p>We developed PoCs for both that let us discover things we might have missed in a purely theoretical evaluation. Ultimately, it emerged that we’d need to build a lot of custom tooling and capabilities to make Vue Templating half as powerful. And it might still not be extensible.</p><p><strong>Comparison Matrix</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/72185eaa8ffe9083209dc1827f41371c/href">https://medium.com/media/72185eaa8ffe9083209dc1827f41371c/href</a></iframe><h4><strong>Framework decision</strong></h4><p>Once we settled on the approach, we did a similar evaluation for the framework: Vue vs React. Our team was already well-versed in React: we use React Native for our mobile apps and Hyperview framework. Since React and React Native share the same API and libraries, using the same library on mobile and web makes full-stack development more productive.</p><h3>First Migration</h3><h4>The right candidate</h4><p>We put our preferred approach to a litmus test — migrating the first module to Micro FE. Just like killer apps increase the value of the system, we needed a killer feature to ascertain the power of Micro FE.</p><p>We picked the “booking flow” for the following reasons:</p><ul><li>It is one of the most <strong>complex</strong> flows full of rich UI/UX features. We’d already reached a point where making changes was becoming too fraught and the UX was starting to break.</li><li>It was broad in scope and <strong>encompassed many of our real FE problems</strong>. If the solution worked for this flow, it would give us confidence that Micro FE is the right fit.</li><li><strong>Impact:</strong> booking flow gets used every day, and literally turns the wheels of our business. It had also been long due for an overhaul.</li><li><strong>Product interest and alignment:</strong> our Product team was planning a major redesign for this flow so we had their support. It was something that would continue to have a lot of iterations and evolve.</li></ul><h4>Some notes on the initial setup</h4><ul><li>Added all the tooling (linting, testing stack, storybook) right away</li><li>Added critical 3rd party libraries for state management, making requests, managing forms, etc.</li><li>Built common reusable components</li><li>Design system: Our existing design system is in bootstrap. We used react-bootstrap which let us simply import the entire design system and use the familiar bootstrap utilities</li><li>API design: Functional vs REST or JSON? We chose functional APIs since there is a great deal of business logic in the booking flow. This way, we could reuse a lot of the backend services and methods. Another team could easily use REST or JSON for any other Micro FE app! Just one example of how teams need not be beholden to choices made for a specific module</li></ul><h4>Project execution</h4><p>Big migrations can seem overwhelming and get plagued by missed milestones. A few things that worked for us and made for a smoother transition.</p><ol><li><strong>Meticulous planning:</strong> <br>a. We did a tear-down of the flow to ensure we cover all the workflows.<br>b. Prioritized the features within the flow and cut out the legacy cruft.<br>c. Planned all the milestones, task breakdown, and orchestration</li><li><strong>The A team</strong>: assembled a complementary mix of the experts, the reliable and committed, and part time contributors.</li><li><strong>Mode of work</strong>: We were a geographically distributed team with members in 3 time zones. We flew everyone in, huddled together in the same room, and built momentum and rapport the first 2 weeks. Then we went back to our respective countries and continued. Since each task was fully mapped out, we were working through the task pipeline in Kanban style. We also eliminated all other distractions (non-essential meetings :)) during this project.</li><li><strong>Tight collaboration</strong>: Close collaboration with other functions like QA, and Product helped us merge features incrementally and roll out in phases.</li></ol><h3>Coda</h3><p>With this foundation, we were able to redesign the entire booking flow, handling very complex interactions and delighting our users! We were able to iterate faster but still with simplicity. Refactors and experimentation now happen at a much faster pace, and other teams have started adopting Micro-FE to build new features.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*9uv6a0zciAhBN97vIDn0Vg.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c2LsVeCCNap2iio34U-fMA.gif" /><figcaption>Old booking flow — — New booking flow</figcaption></figure><h4>Reflections</h4><ul><li>Be critical and thorough about evaluation. Make decisions about what is the right fit for you in your specific circumstances.</li><li>Solicit a lot of feedback to benefit from a wealth of past experiences. Some of the key decisions and libraries came out of these conversations.</li><li>Timelines: treat milestones as sacrosanct. Have frequent check-in and revise/double down when at risk.</li><li>Monitoring: set up services like Sentry early on. We got blindsided by some bugs and having this would’ve helped us debug much faster.</li><li>Tech debts are a trade-off but should be followed up on.</li><li>Collaboration: fostering a shared sense of the goal helped everyone on the team help each other.</li><li>Disseminate knowledge and get more champions: this drives more adoption, gets improvements, and inculcates a shared responsibility</li><li>When NOT to Micro-FE? If you have a hybrid FE setup like ours, resist the temptation to use Micro-FE for everything. General rule of thumb: the candidate should be isolated and have clear entry and exit points.</li></ul><h4>What’s ahead</h4><p>We’re making improvements based on learning along the way, establishing the right patterns, and documenting all the good stuff!</p><p>Watch this space for more in-depth posts about technical challenges and how we addressed them. Would love to hear about your frontend tales as well!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1efb6f142e8" width="1" height="1" alt=""><hr><p><a href="https://engineering.instawork.com/microfrontend-or-the-goldilocks-solution-1efb6f142e8">Microfrontend or the Goldilocks solution</a> was originally published in <a href="https://engineering.instawork.com/">Instawork Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>