<?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 Himanshu Sanecha on Medium]]></title>
        <description><![CDATA[Stories by Himanshu Sanecha on Medium]]></description>
        <link>https://medium.com/@8769063451sanecha?source=rss-d2eed9f5d01f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*ViGRJ3WDHJcuh_yR</url>
            <title>Stories by Himanshu Sanecha on Medium</title>
            <link>https://medium.com/@8769063451sanecha?source=rss-d2eed9f5d01f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 06:26:42 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@8769063451sanecha/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[Complete AI Workflow for Coding in 2026]]></title>
            <link>https://medium.com/@8769063451sanecha/complete-ai-workflow-for-coding-in-2026-f5770b39a62b?source=rss-d2eed9f5d01f------2</link>
            <guid isPermaLink="false">https://medium.com/p/f5770b39a62b</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[ai-engineering-2026]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[ai-coding]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Himanshu Sanecha]]></dc:creator>
            <pubDate>Fri, 27 Nov 2026 13:46:51 GMT</pubDate>
            <atom:updated>2026-11-27T13:46:51.288Z</atom:updated>
            <content:encoded><![CDATA[<p><strong><em>You’ve probably read a dozen posts about coding with AI.</em></strong> Most of them say the same thing: write good instructions, write tests, keep your code clean. They tell you <strong>what</strong> to do. They rarely show you <strong>how</strong>.</p><p>So you tried. You wrote long instructions. The AI still wrote a second copy of a function you already had. It still ignored the rules you wrote in capital letters.</p><p>This post is the simple workflow I’d give a friend<strong>.</strong> It works whether you code in Python, JavaScript, or anything else.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QoRgYFTOB1-JmlveFexd3w.png" /></figure><h3>Why does AI keep writing messy, repeated code?</h3><p><strong>It can’t reuse what it can’t find.</strong> The AI looks at a few files, misses the helper you wrote last month, and writes a new one. Asking it “please don’t repeat code” won’t fix that.</p><p><strong>It treats your instructions as suggestions.</strong> Even Anthropic, the company behind Claude, says its assistant may decide an instruction doesn’t apply. Sooner or later, it will skip the one rule that mattered.</p><p><strong>It takes the quickest path to “done”.</strong> Copying code is faster than understanding the code that’s already there. So that’s what it does.</p><p>This shows up in the data too. A 2026 study by GitClear looked at <strong>623 million code changes</strong> and found <strong>81% more repeated code</strong> than before AI tools became common.</p><blockquote><strong>The big idea: instructions help, but automatic checks are what actually stop mistakes.</strong></blockquote><h3>Step 1: Write a short instruction file</h3><p><strong>Give the AI one short file that tells it what it can’t figure out on its own.</strong> Most AI coding tools read a file called AGENTS.md (Claude Code reads CLAUDE.md) at the start of every task.</p><p><strong><em>Keep it short.</em></strong> Anthropic’s own advice: if the AI could learn something by reading your code, leave it out. A 2026 research paper found these files often didn’t improve results and made the AI over 20% more expensive to run. The parts that did help were the project’s unusual rules.</p><p>What to put in it:</p><ul><li><strong>How to run and test the project.</strong> The exact commands.</li><li><strong>Rules that aren’t obvious.</strong> For example: “Prices are stored in cents.”</li><li><strong>Where things already live.</strong> This is the part most people skip, and it’s the best cure for repeated code.</li></ul><p>Here’s a simple example of root CLAUDE.md or AGENTS.md:</p><pre>## Commands<br>- Run tests: npm test<br>- Check everything before you finish: npm run check</pre><pre>## Where things already live (look here before writing something new)<br>- Talking to other websites/APIs: src/lib/http.js<br>- Dates and times: src/lib/dates.js<br>- Prices: src/lib/money.js (always in cents)</pre><pre>## Rules<br>- Before writing a new function, search for one that already does the job.<br>  If you find one, use it and tell me which one you used.</pre><p><strong><em>Tip:</em></strong> if you use more than one AI tool, keep everything in AGENTS.md and make CLAUDE.md a single line: @AGENTS.md. Now every tool reads the same rules.</p><h3>Step 2: Turn your important rules into automatic checks</h3><p><strong>If a rule really matters, don’t just write it down. Make the computer check it.</strong> A written rule can be ignored. A check that fails can’t.</p><p>I learned this the hard way. In one project, an important safety rule was written clearly in the instructions, in bold. It was still missed everywhere it mattered. A small automatic test fixed it for good.</p><p>There are two easy checks to add.</p><p><strong><em>1. A copy-paste detector.</em></strong> A free tool called <a href="https://github.com/kucherenko/jscpd">jscpd</a> finds repeated code in almost any language. Run it before every merge:</p><p>npx jscpd src --min-lines 5 --threshold 2</p><p>That line means: <em>fail if more than 2% of the code is repeated blocks of 5 lines or more.</em></p><p><strong><em>2. A “there’s only one of these” test.</em></strong> Pick something that should exist in only one place, like the code that talks to outside APIs. Then write a tiny test that fails if it shows up anywhere else:</p><pre># Fails if any file other than http.py imports the &quot;requests&quot; library<br>from pathlib import Path<br><br>def test_only_http_py_calls_the_internet():<br>    files = [<br>        f for f in Path(&quot;app&quot;).rglob(&quot;*.py&quot;)<br>        if f.name != &quot;http.py&quot; and &quot;import requests&quot; in f.read_text()<br>    ]<br>    assert files == [], f&quot;Use app/lib/http.py instead. Found in: {files}&quot;</pre><p><strong>Notice the last line.</strong> When the test fails, its message tells the AI exactly how to fix it. The AI reads that and corrects itself, without you stepping in.</p><h3>Step 3: Let the AI ask you questions before it codes</h3><p><strong>Most bad AI code comes from a decision nobody made.</strong> You say “add team invites”. The AI has to guess: Do invites expire? Who can send them? What if someone is invited twice? Every guess is code you didn’t ask for.</p><p><strong>So flip it around. Ask the AI to interview you first.</strong> Paste this before any new feature:</p><pre>Before writing any code, ask me questions about this feature.<br>Ask one question at a time, and suggest your own answer for each.<br>When everything is decided, write a short plan in PLAN.md.</pre><p>Then start a <strong>fresh chat</strong> and ask it to build from PLAN.md. Anthropic recommends this same flow.</p><p><strong><em>One more trick: agree on names.</em></strong> If half your code says “client” and the other half says “customer”, the AI may build two versions of the same thing. Keep a short word list:</p><pre># WORDS.md<br>Customer: a company that pays us. (Don&#39;t say: client, account)<br>User: a person who logs in. (Don&#39;t say: member)</pre><h3>Step 4: Build in small steps, and test each one</h3><p><strong>One small test, then just enough code to pass it. Repeat.</strong> When the AI writes twenty tests at once, they often check the wrong things and pass for the wrong reasons.</p><p><strong>Watch out for fake tests.</strong> Here’s one AI writes a lot:</p><pre>// Fake: it does the same math as the code, so it can never fail<br>expect(applyDiscount(100, 0.2)).toBe(100 - 100 * 0.2);<br><br>// Real: the answer is written out, so a bug would show up<br>expect(applyDiscount(100, 0.2)).toBe(80);</pre><p><strong>Ask for proof, not promises.</strong> “All tests pass” means little on its own. Add this line to your instruction file: <strong><em>“When you finish, show me the test command you ran and its output.”</em></strong></p><h3>Step 5: Get a second opinion</h3><p><strong>Never let the AI review its own code in the same chat.</strong> It just wrote that code, and it will defend it. Open a fresh chat and give it only the changes and your plan.</p><p>Ask it to check two separate things:</p><ul><li><strong><em>Did it follow the rules?</em></strong> Your instruction file and word list.</li><li><strong><em>Did it build what was asked?</em></strong> Nothing missing, nothing extra.</li></ul><p>Here’s a review prompt you can copy:</p><pre>Review the changes on this branch. Don&#39;t fix anything yet.<br>1. For every new function, search the project for one that already<br>   does the same job. List any you find.<br>2. List anything PLAN.md asked for that is missing.<br>3. List anything that was built but not asked for.<br>For each problem, tell me the file, the line, and how you checked it.</pre><p><strong><em>“How you checked it”</em></strong> is the key line. It stops the AI from confidently reporting problems that aren’t real.</p><h3>Step 6: Fix repeated mistakes for good</h3><p><strong>Each time the AI repeats a mistake, make the fix a little stronger.</strong></p><ol><li><strong>First time:</strong> correct it in the chat.</li><li><strong>Second time:</strong> add one line to your instruction file.</li><li><strong>Third time:</strong> turn it into an automatic check (Step 2).</li><li><strong>A rule nobody has broken in months:</strong> delete it. Short files work better.</li></ol><p><strong>End long sessions with a quick question.</strong> Ask the AI: <em>“What in this project confused you or slowed you down today? Suggest one fix.”</em> Keep the best idea and ignore the rest.</p><h3>Your one-week checklist</h3><p><strong><em>Do these in order. Each one helps on its own.</em></strong></p><ol><li><strong>Day 1:</strong> Write a short AGENTS.md with commands, key rules, and where things live.</li><li><strong>Day 1:</strong> Add the copy-paste detector to your checks.</li><li><strong>Day 2:</strong> Write one “there’s only one of these” test for the thing the AI repeats most.</li><li><strong>Day 3:</strong> Start a short word list.</li><li><strong>Every new feature:</strong> let the AI interview you, build in a fresh chat, test in small steps.</li><li><strong>Before every merge:</strong> get a second opinion in a fresh chat.</li><li><strong>Every week:</strong> move repeated mistakes up the ladder from Step 6.</li></ol><h3>Where to start tonight</h3><p><strong>Pick the one mistake your AI made most this week, and turn it into a test that fails.</strong> Make the failure message explain the fix. That one test will do more than ten new lines of instructions.</p><p>Want ready-made versions of Steps 3 to 6? Matt Pocock has published free “skills” for AI coding tools that do exactly this. Install them with npx skills@latest add mattpocock/skills.</p><h3>Sources</h3><ul><li><a href="https://code.claude.com/docs/en/best-practices">Anthropic: Claude Code best practices</a></li><li><a href="https://arxiv.org/abs/2602.11988">Evaluating AGENTS.md (research paper, 2026)</a></li><li><a href="https://leaddev.com/ai/code-maintainability-plummets-in-the-ai-coding-era">LeadDev: Code maintainability plummets in the AI coding era (GitClear data, 2026)</a></li><li><a href="https://github.com/mattpocock/skills">Matt Pocock: Skills For Real Engineers</a></li><li><a href="https://github.com/kucherenko/jscpd">jscpd: copy-paste detector</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f5770b39a62b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI-Powered GitHub Explainer]]></title>
            <link>https://medium.com/@8769063451sanecha/ai-powered-github-explainer-d480a728a76b?source=rss-d2eed9f5d01f------2</link>
            <guid isPermaLink="false">https://medium.com/p/d480a728a76b</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[architecture]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[repositories]]></category>
            <dc:creator><![CDATA[Himanshu Sanecha]]></dc:creator>
            <pubDate>Mon, 24 Mar 2025 17:09:01 GMT</pubDate>
            <atom:updated>2025-03-24T21:41:51.838Z</atom:updated>
            <content:encoded><![CDATA[<p>Have you ever felt lost in a maze of code when diving into a new GitHub repository? Trying to understand the structure, dependencies, and overall architecture can be incredibly time-consuming, especially when you’re dealing with unfamiliar technologies or poorly documented projects.</p><p>That’s why we built the <strong>AI-Powered GitHub Explainer</strong> — a tool to help you instantly grasp the essence of <em>any</em> GitHub repository, starting with a <em>visual representation</em> of its architecture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FtEJAtlCK6zNIarKQZ2_vw.png" /><figcaption>AI powered github explainer in action</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sEdtz929u7_s6sU9KvPPMQ.png" /><figcaption>AI powered architectural summary and component analysis</figcaption></figure><p><strong>The Problem: GitHub Codebase Analysis is a Time Sink</strong></p><p>Let’s face it: diving into a new GitHub codebase can be <em>daunting</em>. Large projects often contain hundreds or even thousands of files, each with its own purpose and dependencies. Untangling this complexity can slow down <em>everything</em>, from onboarding new team members to performing code reviews or deciding whether to use a particular library. Time spent struggling to understand the code is time <em>not</em> spent building.</p><p><strong>Introducing the AI-Powered GitHub Explainer</strong></p><p>The GitHub Explainer is an AI-powered tool designed to rapidly accelerate your understanding of GitHub repositories. Just paste the URL of any public GitHub repository, and the AI will:</p><ul><li><strong>Deep Analysis:</strong> It goes beyond simply listing files to identify core modules, dependencies, and key design patterns.</li><li><strong>Visually Generate an Architecture Diagram:</strong> This is where the magic happens. The app will automatically create a diagram representing the relationships between the major components of the repository.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XlYBFg9XuQ8MYa1ZkgwFEA.png" /><figcaption>Mermaid js diagram generated by AI</figcaption></figure><ul><li><strong>Instant Results:</strong> Get a comprehensive explanation in minutes, not in hours.</li><li><strong>Detail Repository Analysis:</strong> Giving you the Main Components and Purposes, System Organization and Structure, Key Design Patterns and Principles, Core Components, and more.</li></ul><p>Visit <a href="https://app.gitex.space/"><strong><em>app.gitex.space</em></strong></a> and try the GitHub Explainer today! We’d love to hear your feedback and suggestions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d480a728a76b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Comic : Caching & Its types (Part 3)]]></title>
            <link>https://medium.com/@8769063451sanecha/comic-caching-its-types-part-3-05d01367e413?source=rss-d2eed9f5d01f------2</link>
            <guid isPermaLink="false">https://medium.com/p/05d01367e413</guid>
            <category><![CDATA[web]]></category>
            <category><![CDATA[cache]]></category>
            <category><![CDATA[web-dev-resources]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[caching]]></category>
            <dc:creator><![CDATA[Himanshu Sanecha]]></dc:creator>
            <pubDate>Sun, 26 Jan 2025 10:37:39 GMT</pubDate>
            <atom:updated>2025-01-26T10:39:44.656Z</atom:updated>
            <content:encoded><![CDATA[<h3>Comic : Caching &amp; Its types (Part 3)</h3><p>Previously, In <a href="https://medium.com/@8769063451sanecha/part-1-caching-and-its-types-comic-d7263afd2ad5">Part 1</a> and <a href="https://medium.com/p/42b56f188a5b">Part 2</a> , we explored caching, its functionality, and the two primary types: <br>- <strong>In-memory cache<br>- Browser cache</strong></p><p>In this post, we’ll dive into the concept of <strong>Distributed Cache </strong>and how it plays a crucial role in optimizing performance and scalability for modern applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EOjV23ExfBJkL_1Lp8YolQ.png" /><figcaption>Distributed cache &amp; distribution</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mmYcZPyXhKHYaNu0vnv2VA.png" /><figcaption>Partitioning functions</figcaption></figure><p>That wraps up Part 3! Stay tuned for the next adventure, where we’ll meet a Cache management office, which has teams (various algorithms) which helps in management of cache in RAM!🌟</p><p><em>I welcome your suggestions, feedback, improvements, and collaboration! Your input is invaluable, and I hope you will join me on this exciting journey as we explore new ideas and grow together!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=05d01367e413" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Caching & Its types: Comic (Part 2)]]></title>
            <link>https://medium.com/@8769063451sanecha/caching-its-types-comic-part-2-42b56f188a5b?source=rss-d2eed9f5d01f------2</link>
            <guid isPermaLink="false">https://medium.com/p/42b56f188a5b</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[caching]]></category>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[web]]></category>
            <category><![CDATA[web-dev-simplified]]></category>
            <dc:creator><![CDATA[Himanshu Sanecha]]></dc:creator>
            <pubDate>Wed, 15 Jan 2025 08:34:30 GMT</pubDate>
            <atom:updated>2025-01-15T08:34:30.562Z</atom:updated>
            <content:encoded><![CDATA[<p>If you missed <a href="https://medium.com/@8769063451sanecha/part-1-caching-and-its-types-comic-d7263afd2ad5">Part 1</a>, make sure to check it out before diving in!</p><p>In today’s comic, we’ll introduce you to the <em>Cache Family</em> — a quirky group of characters living in the bustling city of <strong>DataVille</strong>. Get ready to explore how they work together to speed up your digital life, one cache at a time! 🚀</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vEkmRM_oUKCncf9VGJQikQ.jpeg" /><figcaption>Dataville city and the flash of the city (cache)</figcaption></figure><p>Lets explore about In-memory cache</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QX2BM3eA05Gs13KgpP5p0w.jpeg" /><figcaption>In-memory cache</figcaption></figure><p>Well the family tree of cache (the fastest man alive in Dataville city) is interesting, let’s go on another journey to learn about browser cache</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wJzYhgsgQiqZ5-hpNQL6qg.jpeg" /><figcaption>Browser cache saving websites &amp; browser</figcaption></figure><p>That wraps up Part 2! Stay tuned for the next adventure, where we’ll meet a new superhero — <em>Distributed Cache</em> — and dive deeper into caching algorithms as the story of <strong>DataVille</strong> unfolds. More exciting discoveries are on the way! 🌟</p><p><em>I welcome your suggestions, feedback, improvements, and collaboration! Your input is invaluable, and I hope you will join me on this exciting journey as we explore new ideas and grow together!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=42b56f188a5b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Part 1: Caching and its types (Comic)]]></title>
            <link>https://medium.com/@8769063451sanecha/part-1-caching-and-its-types-comic-d7263afd2ad5?source=rss-d2eed9f5d01f------2</link>
            <guid isPermaLink="false">https://medium.com/p/d7263afd2ad5</guid>
            <category><![CDATA[caching]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[cache]]></category>
            <category><![CDATA[cache-its-types]]></category>
            <category><![CDATA[caching-comic]]></category>
            <dc:creator><![CDATA[Himanshu Sanecha]]></dc:creator>
            <pubDate>Tue, 07 Jan 2025 14:56:04 GMT</pubDate>
            <atom:updated>2025-01-07T14:56:04.062Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Welcome to the First Part of Learning with Himanshu: Exploring Caching and Its Types Through a Comic Book!</strong></p><p>Hello and welcome! I’m excited to introduce the very first part of my “Learning with Himanshu” series. In this comprehensive learning journey, I’ll be teaching you everything you need to know about various topics — all with the help of <strong>mini comic books</strong>!</p><p>As a child, I was always fond of comic books and the way they taught us and made us giggle…..</p><p>So after reliving those memories, Here is the first part of caching and its types as a comic book.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JolR439TmobjbwA1v4dc1Q.png" /><figcaption>Comic illustration explaining the concept of caching</figcaption></figure><p><em>I welcome your suggestions, feedback, improvements, and collaboration! Your input is invaluable, and I hope you will join me on this exciting journey as we explore new ideas and grow together!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d7263afd2ad5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Saving React Development Effort by using In-House library -JSON2React]]></title>
            <link>https://medium.com/naukri-engineering/saving-react-development-effort-by-using-in-house-library-json2react-f579a2bfb877?source=rss-d2eed9f5d01f------2</link>
            <guid isPermaLink="false">https://medium.com/p/f579a2bfb877</guid>
            <category><![CDATA[deployment]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[no-code]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[efficient-coding]]></category>
            <dc:creator><![CDATA[Himanshu Sanecha]]></dc:creator>
            <pubDate>Wed, 27 Mar 2024 10:07:13 GMT</pubDate>
            <atom:updated>2024-03-27T10:07:13.361Z</atom:updated>
            <content:encoded><![CDATA[<p>React development has undoubtedly revolutionized the way we create dynamic and interactive user interfaces. However, as developers, we often find ourselves grappling with the challenge of making small changes in the front end and then dealing with the cumbersome process of deployment. The traditional approach involves modifying code, recompiling, and redeploying the entire application, even for minor updates. This not only consumes time but also introduces the risk of errors and disruptions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3dTWlMHKBcrcUFm7gjYyTw.jpeg" /><figcaption>React development</figcaption></figure><p>Consider a scenario where you need to update a simple text label or tweak the styling of a button. In a typical Frontend application, this seemingly minor change might trigger a chain reaction that involves updating the codebase, running the build process, and deploying the entire application. The process is not only time-consuming but can also lead to unintended consequences if not managed meticulously.</p><p>This is where JSON2React emerges as a game-changer. By enabling developers to render entire webpages dynamically using JSON, it eliminates the need for traditional deployment hassles for small updates. In this blog, we’ll explore the intricacies of traditional React development, the challenges posed by the deployment process, and how JSON2React provides a solution that aligns with the dynamic nature of front-end development.</p><p>Although there are many approaches regarding saving static websites in a JSON format with different stylings &amp; various elements like different website builders do provide (WIX, WordPress etc.) still, there is always a need for more than just dragging &amp; dropping components to build pages. Therefore, We tried to solve the problem of dynamic rendering and minimize development &amp; deployment by creating this <strong>in-house library.</strong></p><p><strong>Why Library?</strong></p><p>In a standard React development workflow, making even the slightest change in the frontend often triggers a series of steps that can be cumbersome:</p><ol><li><strong>Code Modification:</strong> When a small change is required, developers need to locate and modify the corresponding code in the application.</li><li><strong>Recompilation:</strong> After making changes, the application must be recompiled to reflect the updates. This involves running build scripts, which can take a considerable amount of time, especially in larger projects.</li><li><strong>Deployment:</strong> Once the application is recompiled, it needs to be deployed to the server or hosting platform. This process typically involves copying files, updating configurations, and ensuring that the changes are reflected in the live environment.</li><li><strong>Testing:</strong> With deployment, testing becomes crucial to catch any unintended side effects. Developers need to ensure that the changes do not break existing functionality and that the application behaves as expected.</li></ol><p>This traditional deployment process, while necessary for major updates and feature releases, becomes an overhead when dealing with minor adjustments or fixes. It can slow down development cycles and make the iterative process more cumbersome than it needs to be.</p><p><strong>JSON2React: A Dynamic Solution</strong></p><p>JSON2React addresses this challenge by introducing a dynamic approach to rendering webpages. Instead of making changes directly in the code, developers can leverage JSON configurations to modify the structure, content, and appearance of the webpage. This means that small updates can be achieved by simply adjusting the JSON data, eliminating the need for a full-scale deployment.</p><p>Consider the following example:</p><pre>// JSON2React configuration for button <br><br>{<br>  &quot;name&quot;: &quot;submit&quot;,<br>  &quot;type&quot;: &quot;button&quot;,<br>  &quot;label&quot;: &quot;Upload&quot;,<br>  &quot;className&quot;: &quot;bg-red-500 hover:bg-green-200 text-white font-bold py-2 px-8 rounded&quot;,<br>  &quot;disabled&quot;: false<br>}</pre><p>With JSON2React, making a small change to the label of a button is as simple as updating the corresponding JSON configuration. This change is reflected dynamically without requiring a lengthy deployment process.</p><p><strong>Key Features of JSON2React</strong></p><ol><li><strong>JSON-Driven Design</strong></li></ol><p>The cornerstone of JSON2React lies in its JSON-driven design, allowing developers to define the structure, components, and content of React pages in a clean, human-readable JSON format. This departure from traditional JSX coding introduces a level of simplicity and clarity that can significantly reduce the chances of errors. Let’s compare a traditional JSX approach with the equivalent JSON2React representation:</p><p><strong><em>Traditional JSX:</em></strong></p><pre>&lt;div className=&quot;flex flex-col h-full bg-gray-100 shadow-lg rounded-lg max-w-full md:mt-5 md:ml-5 md:mr-5 pb-8 pt-6&quot;&gt;<br>      &lt;div className=&quot;flex flex-row justify-center items-center&quot;&gt;<br>        &lt;div className=&quot;p-4&quot;&gt;<br>          &lt;input<br>            type=&quot;radio&quot;<br>            name=&quot;id&quot;<br>            value=&quot;companyId&quot;<br>            id=&quot;companyId&quot;<br>          /&gt;<br>          &lt;label htmlFor=&quot;companyId&quot;&gt;Company ID&lt;/label&gt;<br>        &lt;/div&gt;<br>        &lt;div className=&quot;p-4&quot;&gt;<br>          &lt;input<br>            type=&quot;radio&quot;<br>            name=&quot;id&quot;<br>            value=&quot;groupId&quot;<br>            id=&quot;groupId&quot;<br>          /&gt;<br>          &lt;label htmlFor=&quot;groupId&quot;&gt;Group ID&lt;/label&gt;<br>        &lt;/div&gt;<br>      &lt;/div&gt;<br>    &lt;/div&gt;</pre><p><strong><em>JSON2React Equivalent:</em></strong></p><pre>{<br>    &quot;type&quot;: &quot;div&quot;,<br>    &quot;className&quot;: &quot;flex flex-col h-full bg-gray-100 shadow-lg rounded-lg max-w-full md:mt-5 md:ml-5 md:mr-5 pb-8 pt-6&quot;,<br>    &quot;schema&quot;: [<br>      {<br>        &quot;type&quot;: &quot;div&quot;,<br>        &quot;className&quot;: &quot;flex flex-row justify-center items-center&quot;,<br>        &quot;schema&quot;: [<br>          {<br>            &quot;type&quot;: &quot;radio&quot;,<br>            &quot;options&quot;: [<br>              {<br>                &quot;label&quot;: &quot;Company ID&quot;,<br>                &quot;value&quot;: &quot;companyId&quot;<br>              },<br>              {<br>                &quot;label&quot;: &quot;Group ID&quot;,<br>                &quot;value&quot;: &quot;groupId&quot;<br>              }<br>            ],<br>            &quot;label&quot;: &quot;radioLabel&quot;,<br>            &quot;className&quot;: &quot;p-4&quot;,<br>            &quot;name&quot;: &quot;id&quot;<br>          }<br>        ]<br>      }<br>}</pre><p>The JSON format provides a concise and structured representation of React components.</p><p>2. <strong>Basic Component Library</strong></p><p>JSON2React doesn’t just simplify; it also empowers developers with a basic library of pre-built, customizable components. From interactive forms to responsive layouts, this library covers a wide spectrum of use cases.</p><p>With JSON2React, creating sophisticated web applications becomes a breeze with reusable, customizable components.</p><p>Below are the components offered by the library — <br>1. Button <br>2. Dropdown <br>3. Loading <br>4. Number <br>5. Input <br>6. Radio <br>7. Text Input</p><p>All component comes with customizable styling according to your application, you can use the className key in JSON to specify CSS classes for styling all components of the JSON2React library.</p><p><strong>3. Seamless Integration</strong></p><p>JSON2React doesn’t disrupt your workflow; it seamlessly integrates into existing React projects or becomes an integral part of new ones. This flexibility ensures that developers can adopt JSON2React without overhauling their current practices. Here’s a simplified example of how you can integrate JSON2React into a React component:</p><pre>import React, {useState} from &quot;react&quot;;<br>import {Page} from &quot;json2react&quot;;<br><br>const App = ({schema}) =&gt; {<br>  const [values, setValues] = useState({});<br>  const [schema, setSchema] = useState(schema);<br>  const onChange = (changedValues) =&gt; {<br>    setValues({<br>      ...changedValues<br>    });<br>  };<br>  <br>  return (<br>    &lt;Page<br>        schema={schema}<br>        onChange={onChange}<br>        values={values}<br>    /&gt;<br>  )<br>}</pre><p>Integration is as simple as incorporating the library into your existing components.</p><p><strong>4. Conditional Rendering</strong></p><p>A standout feature of JSON2React is its support for conditional rendering. By utilizing the ‘if’ key in your JSON data, you can dynamically display content based on specified conditions. This feature significantly enhances user experiences and interactivity. Let’s see it in action:</p><pre>{<br>  &quot;type&quot;: &quot;div&quot;,<br>  &quot;if&quot;: &quot;values[&#39;file&#39;] != null&quot;,<br>  &quot;schema&quot;: [<br>    {<br>      &quot;type&quot;: &quot;div&quot;,<br>      &quot;className&quot;: &quot;flex flex-row justify-center items-center&quot;,<br>      &quot;schema&quot;: [<br>        {<br>          &quot;type&quot;: &quot;div&quot;,<br>          &quot;className&quot;: &quot;p-4&quot;,<br>          &quot;schema&quot;: [<br>            {<br>              &quot;name&quot;: &quot;submit&quot;,<br>              &quot;type&quot;: &quot;button&quot;,<br>              &quot;label&quot;: &quot;Upload&quot;,<br>              &quot;className&quot;: &quot;bg-red-500 hover:bg-green-200 text-white font-bold py-2 px-8 rounded&quot;,<br>              &quot;disabled&quot;: false<br>            }<br>          ]<br>        },<br>        {<br>          &quot;type&quot;: &quot;div&quot;,<br>          &quot;className&quot;: &quot;p-4&quot;,<br>          &quot;schema&quot;: [<br>            {<br>              &quot;name&quot;: &quot;remove&quot;,<br>              &quot;type&quot;: &quot;button&quot;,<br>              &quot;label&quot;: &quot;Remove&quot;,<br>              &quot;className&quot;: &quot;p-4 bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-8 rounded&quot;<br>            }<br>          ]<br>        }<br>      ]<br>    }<br>  ]<br>}</pre><p>JSON2React library takes values as one of the props and based on the values object if it contains a file then only the div component would be rendered.</p><p><strong>5. Nested HTML Elements</strong></p><p>JSON2React allows for the easy nesting and structuring of HTML elements within your JSON data. This capability empowers developers to create complex layouts and achieve fine-grained control over webpage structures, all through an intuitive JSON format.</p><pre>{<br>  &quot;type&quot;: &quot;div&quot;,<br>  &quot;className&quot;: &quot;flex flex-col h-full bg-gray-100 shadow-lg rounded-lg max-w-full md:mt-5 md:ml-5 md:mr-5 pb-8 pt-6&quot;,<br>  &quot;schema&quot;: [<br>    {<br>      &quot;type&quot;: &quot;div&quot;,<br>      &quot;className&quot;: &quot;flex flex-row justify-center items-center&quot;,<br>      &quot;schema&quot;: [<br>        {<br>          &quot;type&quot;: &quot;radio&quot;,<br>          &quot;options&quot;: [<br>            {<br>              &quot;label&quot;: &quot;Company Name&quot;,<br>              &quot;value&quot;: &quot;companyName&quot;<br>            },<br>            {<br>              &quot;label&quot;: &quot;Group Name&quot;,<br>              &quot;value&quot;: &quot;groupName&quot;<br>            }<br>          ],<br>          &quot;className&quot;: &quot;p-4&quot;,<br>          &quot;name&quot;: &quot;id&quot;<br>        }<br>      ]<br>    }<br>  ]<br>}</pre><p>The structured nesting simplifies the representation of intricate webpage layouts.</p><p>6. <strong>Component Registration</strong></p><p>JSON2React library offers components, but there is always a need for a custom touch to every application according to a designer or a developer, therefore considering the needs of everyone, the library allows you to register your components and use them on the go.<br>Below is the example to register your component &amp; use it:</p><pre>import { Page, registry } from &quot;json2react/dist&quot;;<br>import Counter from &quot;./Counter&quot;;<br><br><br>registry.register(&quot;counter&quot;, Counter)<br><br>function App() {<br>  const [values, setValues] = useState({});<br>  const onChange = (formValues) =&gt; {<br>    setValues({<br>      ...formValues,<br>    });<br>  };<br><br>  return (<br>    &lt;div className=&quot;App&quot;&gt;<br>        &lt;Page<br>          schema={{<br>            type: &quot;counter&quot;,<br>            name: &quot;counter&quot;<br>          }}<br>          values={values}<br>          onChange={onChange}<br>        /&gt;<br>    &lt;/div&gt;<br>  );<br>}<br><br>export default App;</pre><p><strong>Advantages of JSON2React in Dynamic Frontend Development</strong></p><ol><li><strong>Rapid Iteration:</strong> JSON2React allows for rapid iteration and experimentation. Developers can make adjustments in real time without the need for traditional deployment cycles, enabling faster development by storing JSON in databases.</li><li><strong>Reduced Deployment Overhead:</strong> Small updates and tweaks can be implemented seamlessly by modifying JSON configurations. This eliminates the need for extensive code changes, recompilation, and deployment, reducing deployment overhead.</li><li><strong>Enhanced Collaboration:</strong> JSON configurations provide a clear, human-readable representation of the webpage structure. This makes collaboration between developers, designers, and other stakeholders more straightforward, as changes can be communicated through JSON data.</li><li><strong>Improved Development Experience:</strong> By streamlining the process of making small changes, JSON2React contributes to an improved development experience. Developers can focus on refining and enhancing the user interface without being bogged down by deployment complexities.</li></ol><p><strong>Example application with JSON2React</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r9plj64bGtaJStEq1ZYMPg.gif" /></figure><p><strong>Conclusion</strong></p><ol><li>Library not only saved our time for the development/changes for existing pages in React but also saved us from multiple deployments regarding small changes.</li><li>Approximately, the build time for us can go up to 15–20 mins, first from installing dependencies to generating a build. Therefore using JSON2React library for small changes saved us from building &amp; deploying, saving us at least 15 hours of time in a month.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f579a2bfb877" width="1" height="1" alt=""><hr><p><a href="https://medium.com/naukri-engineering/saving-react-development-effort-by-using-in-house-library-json2react-f579a2bfb877">Saving React Development Effort by using In-House library -JSON2React</a> was originally published in <a href="https://medium.com/naukri-engineering">Naukri Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>