<?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 Jasmin Bhesaniya on Medium]]></title>
        <description><![CDATA[Stories by Jasmin Bhesaniya on Medium]]></description>
        <link>https://medium.com/@jasminbhesaniya?source=rss-6e8655246df8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*f1UCrQYcOWyLzGbS7SOnIw.jpeg</url>
            <title>Stories by Jasmin Bhesaniya on Medium</title>
            <link>https://medium.com/@jasminbhesaniya?source=rss-6e8655246df8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 22:42:18 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jasminbhesaniya/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[HTTP Finally Gets a Missing Piece: Understanding the New QUERY Method]]></title>
            <link>https://medium.com/@jasminbhesaniya/http-finally-gets-a-missing-piece-understanding-the-new-query-method-cc7dd5642def?source=rss-6e8655246df8------2</link>
            <guid isPermaLink="false">https://medium.com/p/cc7dd5642def</guid>
            <category><![CDATA[http-get-request]]></category>
            <category><![CDATA[http-request]]></category>
            <category><![CDATA[http-api]]></category>
            <category><![CDATA[http-query]]></category>
            <category><![CDATA[http-new-query-method]]></category>
            <dc:creator><![CDATA[Jasmin Bhesaniya]]></dc:creator>
            <pubDate>Sat, 04 Jul 2026 06:49:52 GMT</pubDate>
            <atom:updated>2026-07-04T06:59:05.248Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f8MM5Xh4E-3_VGm3--YfBg.png" /></figure><p>For nearly three decades, HTTP has powered everything from simple websites to massive distributed systems.</p><p>Despite countless improvements to APIs, one problem has remained surprisingly unsolved:</p><p><strong>How do you send a large, complex, read-only request without abusing </strong><strong>POST?</strong></p><p>In June 2026, the IETF officially answered that question by publishing <strong>RFC 10008</strong>, introducing a brand-new HTTP method:</p><pre>QUERY</pre><p>It’s the first standardized HTTP method since PATCH became an RFC in 2010.</p><p>Let’s explore why this matters and what it means for modern API development.</p><h3>The Problem We’ve Been Living With</h3><p>Imagine you’re building an e-commerce platform.</p><p>Your users can search products using:</p><ul><li>Categories</li><li>Brands</li><li>Price ranges</li><li>Availability</li><li>Ratings</li><li>Multiple sorting options</li><li>Nested filters</li><li>Custom attributes</li></ul><p>Your request quickly becomes something like:</p><pre>GET /products?category=laptop&amp;brand=apple&amp;priceMin=1000&amp;priceMax=5000&amp;rating=4&amp;sort=price&amp;...</pre><p>Now imagine dozens more filters.</p><p>Soon you’ll encounter several issues.</p><h3>1. URLs Become Huge</h3><p>Different browsers, reverse proxies, gateways, and servers all impose practical URL length limits.</p><p>Even if your backend supports long URLs, another component in the request path might reject them.</p><h3>2. Complex Data Doesn’t Fit Well</h3><p>Representing JSON-like structures inside a query string becomes difficult.</p><p>For example:</p><pre>filters[0][field]=price<br>filters[0][operator]=gte<br>filters[0][value]=1000</pre><p>This quickly becomes unreadable.</p><h3>3. Sensitive Filters Appear in Logs</h3><p>Query parameters often appear in:</p><ul><li>Browser history</li><li>Reverse proxy logs</li><li>CDN logs</li><li>Monitoring systems</li></ul><p>Even when HTTPS protects data in transit, URLs frequently remain visible throughout infrastructure.</p><h3>The Traditional Workaround</h3><p>Most developers eventually switch to:</p><pre>POST /products/search</pre><p>with a JSON body.</p><pre>{<br>  &quot;brand&quot;: &quot;Apple&quot;,<br>  &quot;price&quot;: {<br>    &quot;min&quot;: 1000,<br>    &quot;max&quot;: 5000<br>  },<br>  &quot;rating&quot;: 4<br>}</pre><p>Problem solved?</p><p>Not exactly.</p><p>Using POST for searching introduces semantic problems.</p><p>HTTP assumes POST may modify server state.</p><p>That means:</p><ul><li>No guaranteed idempotency</li><li>Limited automatic caching</li><li>Retries become risky</li><li>Intermediaries cannot safely optimize requests</li></ul><p>Developers have been using “POST for search” for years because there wasn’t a better standard.</p><p>Until now.</p><h3>Meet HTTP QUERY</h3><p>The new method combines the strengths of both GET and POST.</p><pre>QUERY /products<br>Content-Type: application/json</pre><pre>{<br>  &quot;brand&quot;:&quot;Apple&quot;,<br>  &quot;price&quot;:{<br>      &quot;min&quot;:1000,<br>      &quot;max&quot;:5000<br>  }<br>}</pre><p>Think of it as:</p><blockquote><strong><em>GET semantics + POST request body</em></strong></blockquote><p>That’s exactly the gap HTTP has been missing.</p><h3>What Makes QUERY Different?</h3><h3>Safe</h3><p>Like GET, it should never modify server data.</p><p>Running the same request should only retrieve information.</p><h3>Idempotent</h3><p>Executing the same request multiple times produces the same effect.</p><p>This allows clients and intermediaries to retry failed requests safely.</p><h3>Supports Request Bodies</h3><p>Unlike GET, QUERY officially supports large structured payloads.</p><p>You can send:</p><ul><li>JSON</li><li>XML</li><li>SQL-like query languages</li><li>GraphQL-style filters</li><li>Nested objects</li><li>Arrays</li></ul><p>without squeezing everything into the URL.</p><h3>Cacheable</h3><p>Since QUERY is defined as a safe method, caches and CDNs can eventually optimize these requests similarly to GET, provided implementations support it.</p><p>This is one of the biggest long-term advantages.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/653/1*gQeQuFuMfp6sSI-_xG9gDg.png" /></figure><h3>Real-World Example</h3><p>Instead of creating multiple endpoints:</p><pre>GET /users/active<br>GET /users/premium<br>GET /users/admin<br>GET /users/search</pre><p>You can expose a single endpoint:</p><pre>QUERY /users</pre><p>with a flexible request body:</p><pre>{<br>  &quot;status&quot;:&quot;active&quot;,<br>  &quot;role&quot;:&quot;admin&quot;,<br>  &quot;country&quot;:&quot;India&quot;,<br>  &quot;joinedAfter&quot;:&quot;2025-01-01&quot;<br>}</pre><p>The API remains clean while allowing virtually unlimited filtering.</p><h3>Will Frameworks Support It?</h3><p>Not immediately.</p><p>Although the HTTP specification is now standardized, adoption will take time.</p><p>Frameworks, API gateways, browsers, SDKs, reverse proxies, cloud providers, and developer tools all need to add support.</p><p>History tells us that protocol changes typically take years before becoming commonplace.</p><p>For the near future, most production APIs will continue using POST for complex searches.</p><h3>Should You Start Using QUERY Today?</h3><p>If you’re building production APIs today:</p><p><strong>Probably not yet.</strong></p><p>Support across the ecosystem is still limited.</p><p>However, you should absolutely understand it because future frameworks and API platforms will likely adopt it over the coming years.</p><p>Knowing QUERY today prepares you for the next evolution of REST API design.</p><h3>Why This Matters</h3><p>The introduction of QUERY isn’t just another HTTP method.</p><p>It fixes a long-standing mismatch between protocol semantics and real-world API design.</p><p>For years we’ve been forced to choose between:</p><ul><li>Correct HTTP semantics (GET)</li><li>Practical implementation (POST)</li></ul><p>QUERY finally lets us have both.</p><p>That’s why many developers consider it one of the most meaningful additions to HTTP in over a decade.</p><h3>Final Thoughts</h3><p>Most HTTP innovations are incremental.</p><p>The QUERY method is different.</p><p>It solves a real problem that backend engineers, frontend developers, API designers, and cloud platforms have been working around for years.</p><p>Will it replace POST overnight?</p><p>No.</p><p>Will it gradually become the preferred way to perform complex read-only operations?</p><p>Very likely.</p><p>As framework support matures, don’t be surprised if QUERY becomes as familiar as GET, POST, and PATCH.</p><p>The web just gained a new tool — and this one has been a long time coming.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cc7dd5642def" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Claude Code Plugins Explained: Skills, Agents, MCP Servers & More]]></title>
            <link>https://medium.com/@jasminbhesaniya/claude-code-plugins-explained-skills-agents-mcp-servers-more-5adff4b62f05?source=rss-6e8655246df8------2</link>
            <guid isPermaLink="false">https://medium.com/p/5adff4b62f05</guid>
            <category><![CDATA[agents]]></category>
            <category><![CDATA[skills]]></category>
            <category><![CDATA[claude-code-plugins]]></category>
            <category><![CDATA[mcps]]></category>
            <category><![CDATA[claude-code]]></category>
            <dc:creator><![CDATA[Jasmin Bhesaniya]]></dc:creator>
            <pubDate>Sun, 29 Mar 2026 09:59:30 GMT</pubDate>
            <atom:updated>2026-03-29T09:59:30.372Z</atom:updated>
            <content:encoded><![CDATA[<p>Many developers using Claude Code don’t realize it already has a <strong>powerful plugin system</strong> built in.</p><p>And once you start using it, your development workflow can change completely.</p><p>So what exactly are Claude Code plugins?</p><p>A <strong>plugin</strong> is a self-contained directory that extends Claude Code with custom functionality. These plugins allow developers to add new capabilities without modifying the core system.</p><p>Plugins can include components like <strong>skills, agents, hooks, MCP servers, and LSP servers.</strong></p><p>💡 <strong>Why this matters</strong></p><p>Instead of manually wiring tools, running linters, or checking errors, plugins let Claude handle many of these tasks automatically.</p><p>You essentially turn Claude Code into a <strong>smarter development environment.</strong></p><h3>🔧 What Plugins Add to Claude Code</h3><p><strong>1️⃣ Skills</strong><br>Model-invoked capabilities that Claude can use automatically when needed.</p><p><strong>2️⃣ Agents</strong><br>Specialized sub-agents designed for tasks like:<br>• PR reviews<br>• Security checks<br>• Automated testing</p><p><strong>3️⃣ MCP Servers</strong><br>One-click integrations with tools developers already use:<br>GitHub • Jira • Figma • Slack • Supabase • Vercel</p><p><strong>4️⃣ Hooks</strong><br>Automatically run actions like <strong>linting or formatting</strong> after every file edit.</p><p><strong>5️⃣ LSP Servers</strong><br>Provide real-time developer intelligence such as:<br>• Type errors<br>• Missing imports<br>• Syntax issues<br>• Code navigation for 11+ languages</p><p>⚡ <strong>The real game-changer: Code Intelligence</strong></p><p>After every edit Claude makes, the language server immediately reports:</p><p>• Type errors<br>• Missing imports<br>• Syntax issues</p><p>Claude can then <strong>fix them in the same turn.</strong></p><p>No compiler runs.<br>No manual linting.<br>Just instant feedback.</p><h3>📦 Installing Plugins</h3><p>You can install plugins directly from the official marketplace:</p><pre>/plugin install github@claude-plugins-official<br>/plugin install pyright-lsp@claude-plugins-official<br>/plugin install pr-review-toolkit@claude-plugins-official</pre><p>Reload plugins without restarting Claude Code:</p><pre>/reload-plugins</pre><h3>🛠️ Want to Build Your Own Plugin?</h3><p>All you need is:</p><p>• A plugin folder<br>• A plugin.json manifest<br>• Your skills or agents</p><p>Test locally using:</p><pre>claude --plugin-dir ./my-plugin</pre><h3>👥 Team-Level Plugin Control</h3><p>Teams can enforce plugins across an entire repository using:</p><pre>.claude/settings.json</pre><p>This ensures <strong>every developer uses the same tools and standards automatically.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5adff4b62f05" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ How to Use AI Effectively as a Software Engineer]]></title>
            <link>https://medium.com/@jasminbhesaniya/smart-prompting-for-software-engineers-124f308ee5e6?source=rss-6e8655246df8------2</link>
            <guid isPermaLink="false">https://medium.com/p/124f308ee5e6</guid>
            <category><![CDATA[writing-prompts]]></category>
            <category><![CDATA[smart-prompting]]></category>
            <category><![CDATA[prompt-engineering]]></category>
            <category><![CDATA[ai-tools]]></category>
            <dc:creator><![CDATA[Jasmin Bhesaniya]]></dc:creator>
            <pubDate>Sat, 14 Feb 2026 11:35:32 GMT</pubDate>
            <atom:updated>2026-02-14T12:12:58.769Z</atom:updated>
            <content:encoded><![CDATA[<p>Nowadays, almost every developer is using AI tools to build applications faster 🚀. AI helps us write boilerplate code, generate logic, and even build complete features in minutes. However, <strong>AI should be used as an assistant, not blindly trusted.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZGOmRC53KIPOud5P6kURnw.png" /></figure><h4>⚠️ Why Code Review is Still Mandatory</h4><p>AI-generated code may:</p><ul><li>Use libraries that don’t fully meet our requirements</li><li>Suggest outdated or less-maintained packages</li><li>Generate unnecessarily long or complex code</li><li>Follow an architecture that is hard to scale or reuse</li><li>Include security vulnerabilities or performance bottlenecks</li><li>Miss edge cases specific to your business logic</li></ul><p><strong>That’s why reviewing and refactoring AI-generated code is a must.</strong></p><h4>🔥 The Secret Weapon: Skills Files</h4><p><strong>The most important technique in this entire blog post is using Skills files!</strong></p><p>A Skills file (SKILL.md) is a documentation file that teaches AI about your project <strong>before</strong> it writes any code. It contains:</p><ul><li>Your exact tech stack and versions</li><li>Architecture patterns you follow</li><li>Libraries you prefer (and what to avoid)</li><li>Coding standards and conventions</li></ul><p><strong>Result</strong>: AI generates code that matches your project’s standards on the first try, saving hours of back-and-forth!</p><p>We’ll cover this in detail in the dedicated section below.</p><h4>🔍 First Step: Do Proper R&amp;D (Very Important)</h4><p>Before writing any prompt, we should first do R&amp;D:</p><p><strong>Research these key areas:</strong></p><ol><li><strong>Which library is best for the current use case</strong></li></ol><ul><li>Check GitHub stars, npm downloads, and community activity</li><li>Look at the issue tracker — are bugs being fixed actively?</li><li>Review the documentation quality</li></ul><p><strong>2. Which package is actively maintained and widely adopted</strong></p><ul><li>Check the last commit date</li><li>Look at the number of contributors</li><li>Check if it’s production-ready or still in beta</li></ul><p><strong>3. Which architecture suits our project for clean, reusable, and scalable code</strong></p><ul><li>Consider your team’s existing patterns</li><li>Think about future maintainability</li><li>Evaluate how it fits into your testing strategy</li></ul><p><strong>AI works best after we already have clarity.</strong></p><h4>✍️ Prompt Quality Decides Code Quality</h4><p>The output of AI depends heavily on how specific our prompt is.</p><h4>❌ Generic Prompt (Poor Results)</h4><pre>&quot;Create form validation in React&quot;</pre><p><strong>Problems with this prompt:</strong></p><ul><li>No library specified</li><li>No architecture mentioned</li><li>No context about the project</li><li>AI will make assumptions that may not align with your needs</li></ul><h4>✅ Specific Prompt (Better Results)</h4><pre>&quot;I want to implement form validation in a React app using react-hook-form <br>with Zod schema validation, following a reusable and scalable architecture. <br>The form should:<br>- Handle nested objects<br>- Support async validation<br>- Display error messages below each field<br>- Use TypeScript for type safety<br>- Follow our existing design system with Tailwind CSS<br>- Include proper accessibility attributes&quot;</pre><p><strong>Why this works:</strong></p><ul><li>Specifies exact libraries (react-hook-form, Zod)</li><li>Mentions the architecture approach</li><li>Lists specific requirements</li><li>Includes constraints (TypeScript, Tailwind)</li><li>Considers accessibility</li></ul><h4>💡 The Anatomy of a Smart Prompt</h4><h4>1. Context First</h4><p>Always start with context about your project:</p><pre>&quot;I&#39;m building an e-commerce checkout flow in a Next.js 14 app <br>using the App Router. We use TypeScript, Tailwind CSS, and <br>follow a feature-based folder structure.&quot;</pre><h4>2. Specify Technologies</h4><p>Be explicit about the tech stack:</p><pre>&quot;Use:<br>- React 19 with TypeScript<br>- React Hook Form v7<br>- Zod for schema validation<br>- Tailwind CSS for styling<br>- No external UI libraries&quot;</pre><h4>3. Define Architecture Patterns</h4><p>Tell AI how you want code organized:</p><pre>&quot;Follow these patterns:<br>- Custom hooks for form logic<br>- Separate validation schemas in a schemas/ folder<br>- Reusable form components<br>- Error boundary for form errors<br>- Server actions for form submission&quot;</pre><h4>4. Include Constraints and Requirements</h4><p>Specify what you DO and DON’T want:</p><pre>&quot;Requirements:<br>✓ Must be mobile-responsive<br>✓ Include loading states<br>✓ Handle network errors gracefully<br>✓ Support dark mode<br>✗ Don&#39;t use any deprecated APIs<br>✗ Avoid inline styles<br>✗ No class components&quot;</pre><h4>5. Ask for Best Practices</h4><p>Explicitly request quality code:</p><pre>&quot;Follow best practices:<br>- Add TypeScript types for all props<br>- Include JSDoc comments<br>- Write unit tests with Jest<br>- Ensure accessibility (WCAG 2.1 AA)<br>- Add error handling&quot;</pre><h4>🎯 Real-World Prompting Examples</h4><h4>Example: State Management</h4><p><strong>❌ Weak Prompt:</strong></p><pre>&quot;Add state management to my app&quot;</pre><p><strong>✅ Strong Prompt:</strong></p><pre>&quot;Implement state management for a shopping cart in a Next.js 14 app.</pre><pre>Current Setup:<br>- Next.js 14 with App Router<br>- TypeScript<br>- Server Components where possible</pre><pre>Requirements:<br>- Use React Context API (no Redux/Zustand)<br>- Persist cart to localStorage<br>- Sync across browser tabs<br>- Type-safe with TypeScript<br>- Support these operations:<br>  * Add item<br>  * Remove item<br>  * Update quantity<br>  * Clear cart<br>  * Calculate total</pre><pre>Architecture:<br>- Create a CartProvider component<br>- Use useReducer for state logic<br>- Separate actions into a types file<br>- Create custom hooks for cart operations (useCart, useCartActions)<br>- Include optimistic update</pre><h4>The Evolution: From Prompt Engineering to Context Engineering</h4><p>In 2026, prompt engineering has evolved beyond writing good prompts — it’s now about <strong>“context engineering”</strong>: structuring information so AI models can work autonomously as agents. Skills files are at the heart of this evolution, acting as portable instruction sets that transform generalist AI models into specialized experts for your specific tasks.</p><h4>What Are Skills Files?</h4><p><strong>This is the game-changer that most developers don’t know about!</strong></p><p>A Skills file (SKILL.md) is a Markdown file that instructs an AI agent on how to perform a specific, specialized task. Think of it as a &quot;instruction manual&quot; that teaches AI about:</p><ul><li>Your project’s specific architecture</li><li>Which libraries and versions you use</li><li>Your team’s coding standards</li><li>Best practices for your tech stack</li><li>Common patterns and anti-patterns in your codebase</li></ul><p><strong>The magic</strong>: Instead of explaining your project context in every single prompt, you create the Skills file once, and AI reads it automatically before generating code.</p><h4>Why Skills Files Are Critical</h4><p><strong>Without a Skills file:</strong></p><pre>You: &quot;Create a form component&quot;<br>AI: *Generates generic code with random library choices*<br>You: &quot;No, we use react-hook-form, not Formik&quot;<br>AI: *Regenerates*<br>You: &quot;No, we have a custom wrapper for forms&quot;<br>AI: *Regenerates again*<br>[Wastes 10+ minutes going back and forth]</pre><p><strong>With a Skills file:</strong></p><pre>You: &quot;Create a form component&quot;<br>AI: *Reads your SKILL.md file first*<br>AI: *Generates code using react-hook-form with your custom wrapper*<br>AI: *Follows your team&#39;s exact patterns*<br>[Gets it right the first time!]</pre><h4>The Four Pillars of Skills Files</h4><p><strong>1. Context Optimization</strong> AI agents have limited context windows. Instead of loading every rule into every prompt, Skills files enable <strong>progressive disclosure</strong> — loading specialized instructions only when necessary. This prevents “context rot” where the model gets overwhelmed by too much information.</p><p><strong>2. Tribal Knowledge Embedding</strong> Skills files allow you to document specific company, team, or project preferences that AI wouldn’t know otherwise:</p><ul><li>“Always use Tailwind CSS, never inline styles”</li><li>“Use these specific SQL naming conventions”</li><li>“Follow our authentication pattern with JWT”</li><li>“Never use class components, only functional”</li></ul><p><strong>3. Reduced Hallucinations</strong> By providing clear guidelines, constraints, and examples in a Skills file, you significantly reduce the likelihood of plausible but incorrect output. The AI has concrete examples to follow instead of guessing.</p><p><strong>4. Portability Across Tools</strong> Skills files follow an open standard adopted by 30+ AI agents and tools. Write once, use everywhere — Claude, Cursor, Windsurf, Gemini CLI, and more.</p><h4>Creating a Skills File for Your Project</h4><p>Create a SKILL.md file in your project root or in a /docsfolder:</p><pre># Project Skills Documentation</pre><pre>## Description<br>This skill helps generate React components following our team&#39;s architecture and coding standards. Use this when creating any new component, form, or UI element in the project.</pre><pre>## Tech Stack<br>- React 18.2.0 with TypeScript 5.0<br>- Next.js 14 (App Router)<br>- Tailwind CSS 3.3<br>- React Hook Form 7.45 (NEVER use Formik)<br>- Zod for validation<br>- TanStack Query v5 for data fetching<br>- Zustand for global state</pre><pre>## Architecture Patterns</pre><pre>### Component Structure<br>All components follow this structure:</pre><p>/components/ /feature-name/ FeatureName.tsx # Main component FeatureName.types.ts # TypeScript types FeatureName.styles.ts # Tailwind classes (if complex) FeatureName.test.tsx # Unit tests index.ts # Public exports</p><pre>### Form Components<br>ALWAYS use our custom form wrapper:<br>```typescript<br>import { Form, FormField } from &#39;@/components/ui/form&#39;;<br>import { useForm } from &#39;@/hooks/useForm&#39;;</pre><pre>// Use this pattern for all forms<br>const MyForm = () =&gt; {<br>  const form = useForm({ schema: mySchema });<br>  // ...<br>}</pre><h4>API Calls</h4><p>ALWAYS use our API client wrapper:</p><pre>import { apiClient } from &#39;@/lib/api-client&#39;;</pre><pre>// Never use fetch directly<br>const data = await apiClient.get(&#39;/endpoint&#39;);</pre><h4>State Management Rules</h4><ul><li>Local state: useState</li><li>Form state: react-hook-form</li><li>Server state: TanStack Query</li><li>Global UI state: Zustand</li><li>NEVER use Redux or Context for data fetching</li></ul><h4>Coding Standards</h4><h4>File Naming</h4><ul><li>Components: PascalCase (UserProfile.tsx)</li><li>Hooks: camelCase with ‘use’ prefix (useAuth.ts)</li><li>Utils: camelCase (formatDate.ts)</li><li>Types: PascalCase with .types.ts suffix</li></ul><h4>Import Order</h4><ol><li>React imports</li><li>Third-party libraries</li><li>Internal components</li><li>Internal hooks</li><li>Internal utils</li><li>Types</li><li>Styles/CSS</li></ol><h4>TypeScript Requirements</h4><ul><li>ALWAYS use explicit return types for functions</li><li>NEVER use ‘any’ (use ‘unknown’ if needed)</li><li>Export types separately from components</li><li>Use type instead of interface for simple types</li></ul><h4>Anti-Patterns (NEVER Do This)</h4><p>❌ Don’t use class components ❌ Don’t use deprecated React lifecycle methods ❌ Don’t fetch data in useEffect (use TanStack Query) ❌ Don’t use inline styles (use Tailwind) ❌ Don’t create new Date() in components (not timezone-safe) ❌ Don’t use nested ternary operators ❌ Don’t create functions inside JSX</p><h4>Common Patterns</h4><h4>Loading States</h4><pre>if (isLoading) return &lt;Skeleton /&gt;;<br>if (error) return &lt;ErrorMessage error={error} /&gt;;<br>return &lt;ActualContent data={data} /&gt;;</pre><h4>Error Handling</h4><pre>try {<br>  await apiClient.post(&#39;/endpoint&#39;, data);<br>  toast.success(&#39;Success message&#39;);<br>} catch (error) {<br>  if (error instanceof ApiError) {<br>    toast.error(error.message);<br>  } else {<br>    toast.error(&#39;An unexpected error occurred&#39;);<br>  }<br>}</pre><h4>Form Validation</h4><p>Always use Zod schemas in separate file:</p><pre>// forms/user.schema.ts<br>export const userSchema = z.object({<br>  email: z.string().email(),<br>  name: z.string().min(2),<br>});</pre><h4>Testing Requirements</h4><ul><li>Unit tests for all utilities</li><li>Integration tests for API calls</li><li>Component tests for user interactions</li><li>Use React Testing Library (not Enzyme)</li><li>Aim for 80% coverage minimum</li></ul><h4>Accessibility Requirements</h4><ul><li>All interactive elements must be keyboard accessible</li><li>Include ARIA labels for screen readers</li><li>Color contrast must meet WCAG 2.1 AA</li><li>Test with keyboard navigation</li><li>Test with screen reader</li></ul><h4>Performance Guidelines</h4><ul><li>Use React.memo for expensive components</li><li>Lazy load routes with React.lazy</li><li>Optimize images with next/image</li><li>Keep bundle size under 200KB per route</li></ul><h3>Examples</h3><h4><strong>Claude</strong></h4><pre>## 🔧 Skills Files Across Different AI Tools</pre><pre>**Important**: Different AI tools handle Skills files differently. You may need to adapt your Skills file depending on which tool you&#39;re using.</pre><pre>### Overview: Do You Need Different Skills Files?</pre><pre>**Short answer**: Yes, but maintain a base file and adapt it.</pre><pre>**Why**: Each AI tool has:<br>- Different ways of loading Skills files<br>- Different strengths (reasoning vs. coding)<br>- Different context window sizes<br>- Different integration patterns</pre><pre>### Tool-Specific Implementations</pre><pre>#### 1. Claude (Claude.ai &amp; Claude Code)</pre><pre>**How it works:**<br>- Anthropic&#39;s &quot;Agent Skills&quot; load `SKILL.md` files on-demand<br>- Claude uses the **description field** in YAML frontmatter to determine when to use the skill<br>- Skills are loaded progressively based on context</pre><pre>**File location:**</pre><p>/your-project/ /skills/ SKILL.md SKILL-frontend.md SKILL-testing.md</p><pre>**YAML frontmatter format:**<br>```yaml<br>---<br>name: react-components<br>description: &quot;Use this skill when creating React components, forms, or UI elements. Triggers: component creation, form building, UI implementation.&quot;<br>---</pre><p><strong>Best practices for Claude:</strong></p><ul><li>Write <strong>concise, keyword-rich descriptions</strong></li><li>Include trigger words in description (what tasks activate this skill)</li><li>Claude excels at abstract reasoning, so you can be less prescriptive</li><li>Focus on “what” and “why” rather than exact syntax</li></ul><p><strong>Example prompt:</strong></p><pre>&quot;Create a user profile form component&quot;<br>[Claude automatically reads SKILL.md based on description match]</pre><h4>Cursor AI</h4><p><strong>How it works:</strong></p><ul><li>Uses .cursorrules file (or SKILL.md) in project root</li><li>Loads context automatically for all coding tasks</li><li>Best for project-wide coding standards</li></ul><p><strong>File location:</strong></p><pre>/your-project/<br>  .cursorrules</pre><p><strong>Format:</strong></p><pre># Cursor Rules for This Project</pre><pre>You are an expert in React, TypeScript, and Next.js.</pre><pre>## Tech Stack<br>- React 18.2 with TypeScript<br>- Next.js 14 App Router<br>- Tailwind CSS</pre><pre>## Code Style<br>- Use functional components only<br>- Prefer composition over inheritance<br>- Always use TypeScript strict mode</pre><pre>## File Structure<br>[Your structure here]</pre><p><strong>Best practices for Cursor:</strong></p><ul><li>More detailed syntax examples (Cursor is optimized for code generation)</li><li>Include specific code patterns and templates</li><li>Focus on file structure and naming conventions</li><li>Add more code examples than Claude needs</li></ul><p><strong>Example usage:</strong></p><pre>Just start coding - Cursor reads .cursorrules automatically</pre><h4>Gemini CLI</h4><p><strong>How it works:</strong></p><ul><li>Uses .googlegemini/ or .aiskills/ directories</li><li>Supports project-scoped and user-scoped skills</li><li>Skills are loaded based on context</li></ul><p><strong>File location:</strong></p><pre>/your-project/<br>  /.googlegemini/<br>    skills/<br>      SKILL.md</pre><p><strong>Best practices for Gemini:</strong></p><ul><li>Clear step-by-step instructions (Gemini follows procedural guidance well)</li><li>Include more examples than Claude</li><li>Structured formats (numbered lists, checklists)</li></ul><h4>GitHub Copilot</h4><p><strong>How it works:</strong></p><ul><li>Reads from .github/copilot-instructions.md</li><li>Or inline comments in code</li><li>Context is limited to current file + nearby files</li></ul><p><strong>File location:</strong></p><pre>/your-project/<br>  /.github/<br>    copilot-instructions.md</pre><p><strong>Best practices for Copilot:</strong></p><ul><li>Very concise (smaller context window)</li><li>Focus on coding patterns and snippets</li><li>Include inline code examples</li><li>Use comments in code for specific guidance</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/745/1*gHL7EEuv-PdesGB9jUhRfg.png" /></figure><h4>Strategy: One Base File, Multiple Adaptations</h4><p><strong>Recommended approach:</strong></p><ol><li><strong>Create a master </strong><strong>SKILL.md</strong> with all your project knowledge</li><li><strong>Adapt it for each tool</strong> based on their strengths:</li></ol><pre>/your-project/<br>  /docs/<br>    SKILL-master.md          # Complete documentation<br>  /skills/<br>    SKILL.md                 # For Claude (abstract, description-based)<br>  .cursorrules              # For Cursor (concrete, example-heavy)<br>  /.github/<br>    copilot-instructions.md  # For Copilot (concise)</pre><p><strong>What to adapt:</strong></p><p>Aspect Claude Cursor Copilot <strong>Length</strong> Medium Long Short <strong>Abstraction</strong> High Medium Low <strong>Examples</strong> Few Many Inline only <strong>Format</strong> Prose + examples Templates + code Snippets <strong>Description</strong> Required (YAML) Not needed Not needed</p><h4>Example: Same Skill, Different Tools</h4><p><strong>For Claude (</strong><strong>SKILL.md):</strong></p><pre>---<br>name: react-forms<br>description: &quot;Create React form components using react-hook-form and Zod validation&quot;<br>---</pre><pre>## Form Architecture<br>We use react-hook-form for all forms. Forms should be composable, <br>with separate validation schemas and reusable field components.</pre><pre>## Pattern<br>[Less code, more explanation]</pre><p><strong>For Cursor (</strong><strong>.cursorrules):</strong></p><pre># React Forms</pre><pre>## Exact Pattern<br>```typescript<br>// ALWAYS use this exact structure<br>import { useForm } from &#39;react-hook-form&#39;;<br>import { zodResolver } from &#39;@hookform/resolvers/zod&#39;;<br>import { mySchema } from &#39;./schema&#39;;</pre><pre>export const MyForm = () =&gt; {<br>  const form = useForm({<br>    resolver: zodResolver(mySchema)<br>  });<br>  // ...<br>};</pre><p>[More complete code examples]</p><pre>**For Copilot (`.github/copilot-instructions.md`):**<br>```markdown<br># Forms<br>- Use react-hook-form + Zod<br>- Pattern: `useForm({ resolver: zodResolver(schema) })`<br>- See `/components/forms/` for examples</pre><h4>💼 Real-World Skills File Usage Examples</h4><h4>Example 1: Multi-Tool Setup for a React Project</h4><p><strong>Your project structure:</strong></p><pre>/my-react-app/<br>  /docs/<br>    SKILL-master.md          # Master documentation (all info)<br>  /skills/<br>    SKILL.md                 # For Claude (abstract)<br>  .cursorrules              # For Cursor (detailed)<br>  /.github/<br>    copilot-instructions.md  # For Copilot (concise)</pre><p><strong>Workflow:</strong></p><ol><li><strong>Morning planning with Claude</strong>: “Review SKILL.md and create a plan for implementing the user dashboard”</li><li><strong>Coding with Cursor</strong>: Uses .cursorrules automatically as you type</li><li><strong>Quick completions with Copilot</strong>: Uses inline instructions for small edits</li><li><strong>End of day with Windsurf</strong>: “Check code against SKILL.md and suggest improvements”</li></ol><h4>Example 2: Using Skills Files in Prompts</h4><p><strong>With Claude:</strong></p><pre>&quot;Based on the react-forms skill, create a multi-step registration form <br>with email validation, password strength checking, and terms acceptance.&quot;</pre><pre>[Claude reads SKILL.md automatically and generates code following your patterns]</pre><p><strong>With Cursor:</strong></p><pre>Just start typing in your editor:<br>// Create a form for user registration</pre><pre>[Cursor reads .cursorrules and suggests code that matches your standards]</pre><p><strong>With Gemini CLI:</strong></p><pre>gemini &quot;Create a form component&quot; --skill react-forms</pre><pre>[Gemini loads skills from .googlegemini/skills/ directory]</pre><h4>Template 3: Utility Function</h4><pre>Create a utility function called [functionName].</pre><h4>🚨 Common Prompting Mistakes to Avoid</h4><h4>Mistake 1: Being Too Vague</h4><p><strong>❌ Don’t:</strong></p><pre>&quot;Fix my code&quot;<br>&quot;Make it better&quot;<br>&quot;Optimize this&quot;</pre><p><strong>✅ Do:</strong></p><pre>&quot;This function is slow with large arrays. <br>Optimize it by using a Map for O(1) lookups <br>instead of array.find() which is O(n)&quot;</pre><h4>Mistake 2: Assuming AI Knows Your Context</h4><p><strong>❌ Don’t:</strong></p><pre>&quot;Add this feature&quot;<br>[paste code without explanation]</pre><p><strong>✅ Do:</strong></p><pre>&quot;This is a payment processing component in our e-commerce app.<br>We need to add support for Apple Pay.</pre><pre>Current payment methods: Stripe, PayPal<br>Payment flow: [explain]<br>[paste relevant code]</pre><pre>Add Apple Pay integration that:<br>- [requirements]&quot;</pre><h4>Mistake 3: Not Specifying Versions</h4><p><strong>❌ Don’t:</strong></p><pre>&quot;Use React Router&quot;</pre><p><strong>✅ Do:</strong></p><pre>&quot;Use React Router v6 (not v5) with the new data APIs&quot;</pre><h4>Mistake 4: Asking for Too Much at Once</h4><p><strong>❌ Don’t:</strong></p><pre>&quot;Build a complete authentication system with login, <br>register, forgot password, email verification, <br>OAuth, 2FA, session management, and role-based access control&quot;</pre><p><strong>✅ Do:</strong></p><pre>&quot;First, create the basic login form component with <br>email and password fields using react-hook-form&quot;<br>[Then iterate with follow-up prompts]</pre><h4>Mistake 5: Not Reviewing Output</h4><p><strong>❌ Don’t:</strong></p><pre>[Copy-paste AI code directly without reading]</pre><p><strong>✅ Do:</strong></p><pre>- Read every line<br>- Understand the approach<br>- Check for security issues<br>- Verify package versions<br>- Test edge cases<br>- Refactor if needed</pre><h4>📊 The Smart Prompting Workflow</h4><pre>0. CREATE SKILLS FILE (One Time Setup)<br>   ↓<br>   Document your project standards<br>   List libraries and versions<br>   Define architecture patterns<br>   Specify coding conventions<br>   ↓<br>1. RESEARCH<br>   ↓<br>   Understand the problem<br>   Research best solutions<br>   Choose the right tools<br>   ↓<br>2. PLAN<br>   ↓<br>   Define architecture<br>   Specify requirements<br>   Consider edge cases<br>   ↓<br>3. PROMPT WITH SKILLS<br>   ↓<br>   Reference your Skills file<br>   Provide context<br>   Specify technologies<br>   List requirements clearly<br>   Include constraints<br>   ↓<br>4. AI READS SKILLS FIRST<br>   ↓<br>   AI understands your project<br>   AI knows your standards<br>   AI uses your libraries<br>   AI follows your patterns<br>   ↓<br>5. REVIEW<br>   ↓<br>   Read generated code<br>   Check for issues<br>   Verify it meets requirements<br>   Test thoroughly<br>   ↓<br>6. REFACTOR<br>   ↓<br>   Improve code quality<br>   Optimize performance<br>   Add documentation<br>   Ensure maintainability<br>   ↓<br>7. UPDATE SKILLS FILE<br>   ↓<br>   Document new patterns<br>   Update library versions<br>   Add learnings<br>   ↓<br>8. ITERATE<br>   ↓<br>   Ask follow-up questions<br>   Refine implementation<br>   Handle edge cases</pre><h4>🚀 Conclusion</h4><p><strong>AI can speed up development</strong>, but <strong>developer judgment builds quality software</strong>.</p><p>The best developers in the AI era are those who:</p><ul><li><strong>Create comprehensive Skills files</strong> for their projects</li><li>Know what to ask for</li><li>Understand what they receive</li><li>Can evaluate and improve the output</li><li>Take full ownership of their code</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=124f308ee5e6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Generative AI vs AI Agents vs Agentic AI — What’s the Real Difference?]]></title>
            <link>https://medium.com/@jasminbhesaniya/generative-ai-vs-ai-agents-vs-agentic-ai-whats-the-real-difference-210f4c2e9119?source=rss-6e8655246df8------2</link>
            <guid isPermaLink="false">https://medium.com/p/210f4c2e9119</guid>
            <category><![CDATA[generative-ai-tools]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[large-language-models]]></category>
            <category><![CDATA[agentic-workflow]]></category>
            <dc:creator><![CDATA[Jasmin Bhesaniya]]></dc:creator>
            <pubDate>Sat, 03 Jan 2026 04:53:33 GMT</pubDate>
            <atom:updated>2026-01-04T11:08:21.353Z</atom:updated>
            <content:encoded><![CDATA[<h3>🤖 Generative AI vs AI Agents vs Agentic AI — What’s the Real Difference?</h3><p>AI is evolving very fast — from tools that only <em>create content</em> to systems that can <strong>think, plan, and act on their own</strong>.</p><h3>The Foundation: Large Language Models (LLMs)</h3><p>Before diving into the distinctions, it’s important to understand the technology that powers most modern AI systems: <strong>Large Language Models (LLMs)</strong>.</p><h4>What are LLMs?</h4><p>Large Language Models are massive neural networks trained on vast amounts of text data. They learn patterns, relationships, and structures in language, enabling them to understand context, generate coherent text, and even reason through problems.</p><p><strong>Popular LLMs include:</strong></p><ul><li>GPT-4 (OpenAI)</li><li>Claude (Anthropic)</li><li>Gemini (Google)</li><li>LLaMA (Meta)</li></ul><pre>        ┌─────────────────┐<br>        │      LLM        │<br>        │  (Core Engine)  │<br>        └────────┬────────┘<br>                 ↓<br>        ┌────────┴────────┐<br>        ↓        ↓        ↓<br>   Generative  Agent   Agentic<br>      AI      Systems    AI</pre><p>Think of an LLM as a powerful engine. Generative AI uses that engine to create content. AI Agents use it to reason and make decisions. Agentic AI uses it to autonomously pursue complex goals.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WuHFn6lCkvdlPrSSn1vEdA.png" /></figure><h3>What is Generative AI?</h3><p><strong>Generative AI</strong> refers to artificial intelligence systems that can create new content based on patterns learned from training data. These systems can generate text, images, music, code, and more.</p><h4>Key Characteristics:</h4><ul><li><strong>Creates new content</strong> from learned patterns</li><li><strong>Responds to prompts</strong> provided by users</li><li><strong>Stateless interaction</strong> — each interaction is independent</li><li><strong>No autonomous decision-making</strong> — waits for user input</li><li><strong>Single-turn or conversational</strong> format</li></ul><h4>Examples:</h4><ul><li>ChatGPT generating text, images, code responses</li></ul><h4>How Generative AI Works:</h4><pre>User Input (Prompt) → Generative AI Model → Generated Output<br>     ↓                       ↓                      ↓<br>&quot;Write a poem&quot;      Processes patterns      Creates poem</pre><p>The process is straightforward: you provide input, the model processes it using learned patterns, and it generates an output. The model doesn’t take actions beyond generating content, and it doesn’t make decisions about what to do next.</p><h3>What is an AI Agent?</h3><p>An <strong>AI Agent</strong> is a more advanced system that can perceive its environment, make decisions, and take actions to achieve specific goals. Unlike generative AI, agents have autonomy and can interact with external systems.</p><p>An <strong>AI Agent can perform tasks</strong> using tools and external systems.</p><h4>Key Characteristics:</h4><ul><li><strong>Goal-oriented</strong> — works toward specific objectives</li><li><strong>Autonomous decision-making</strong> — chooses actions without constant human input</li><li><strong>Can use tools</strong> — interacts with APIs, databases, and software</li><li><strong>Multi-step reasoning</strong> — breaks down complex tasks</li><li><strong>Memory and context</strong> — remembers previous interactions</li></ul><h4>Examples:</h4><ul><li>Customer service bots that can check order status, process refunds, and update accounts</li><li>Trading bots that analyze markets and execute trades</li><li>Personal assistants that schedule meetings and send emails</li></ul><h4>How AI Agents Work:</h4><p><strong>[Diagram: AI Agent Flow]</strong></p><pre>Goal: &quot;Book a flight to Paris&quot;<br>         ↓<br>    AI Agent<br>         ↓<br>    ┌────┴────┐<br>    ↓         ↓<br>Perceive  → Decide → Act<br>    ↓         ↓       ↓<br>Search    Compare  Book<br>flights   prices   ticket<br>    ↓         ↓       ↓<br>    └─────  Tools   ──┘<br>         (APIs, Databases)</pre><p>An AI agent operates in a continuous loop: it perceives information from its environment, decides on the best course of action, takes that action, and then evaluates the results to inform its next steps.</p><h3>What is Agentic AI?</h3><p><strong>Agentic AI</strong> is refers to advanced AI systems that can act autonomously to achieve goals, moving beyond simple command-response to proactively plan, reason, and execute complex tasks with minimal human intervention</p><p>Think of it this way: if AI Agents are the specific implementations, Agentic AI is the philosophy and set of principles behind them.</p><h4>Key Characteristics:</h4><ul><li><strong>Autonomy &amp; Initiative:</strong> Sets goals, creates plans, and takes action independently.</li><li><strong>Proactivity</strong> — initiates actions without prompting</li><li><strong>Reasoning &amp; Planning: </strong>Uses sophisticated logic to break down complex tasks and strategize solutions</li><li><strong>Learning &amp; Adaptation:</strong> Improves performance over time by learning from interactions and experiences.</li><li><strong>Tool Use:</strong> Can integrate with and utilize various digital tools and APIs to perform actions.</li><li><strong>Multi-Agent Collaboration:</strong> Different agents can work together to achieve a shared objective</li></ul><h4>Example of Agentic Behavior:</h4><p>You say:</p><blockquote><em>“Increase website sales.”</em></blockquote><p>Agentic AI will automatically:</p><ul><li>Analyze traffic</li><li>Detect weak pages</li><li>Suggest UI improvements</li><li>Run A/B tests</li><li>Change pricing strategies</li><li>Repeat daily</li></ul><h4>How They Work Together</h4><p>Here’s where it gets interesting: these concepts aren’t mutually exclusive. In fact, the most powerful AI systems combine all three.</p><h4>How Agentic AI Work:</h4><p><strong>[Diagram: Agentic AI Flow]</strong></p><pre>┌─────────────────────────────────────────┐<br>│         Agentic AI Framework            │<br>│  (Autonomy + Reasoning + Adaptability)  │<br>└──────────────┬──────────────────────────┘<br>               ↓<br>       ┌───────────────┐<br>       │   AI Agent    │<br>       │  (Execution)  │<br>       └───────┬───────┘<br>               ↓<br>    ┌──────────┴──────────┐<br>    ↓                     ↓<br>┌────────┐          ┌─────────┐<br>│  Tools │          │Generative│<br>│  APIs  │          │   AI     │<br>└────────┘          │ (Content)│<br>                    └─────────┘</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ui2GNIgL6SWWao4VFZ7EKA.jpeg" /></figure><h3>Real-World Example:</h3><p>Imagine an AI-powered research assistant:</p><ol><li><strong>Agentic AI principles</strong> guide its autonomous operation</li><li>The system functions as an <strong>AI Agent</strong> that can:</li></ol><ul><li>Search databases</li><li>Access research papers</li><li>Organize findings</li></ul><p>3. It uses <strong>Generative AI</strong> to:</p><ul><li>Summarize articles</li><li>Write research notes</li><li>Create reports</li></ul><h3>Practical Use Cases</h3><h4>Generative AI Use Case:</h4><p><strong>Content Marketing</strong></p><ul><li>Generate blog posts, social media content</li><li>Create product descriptions</li><li>Design marketing visuals</li></ul><h4>AI Agent Use Case:</h4><p><strong>Customer Support</strong></p><ul><li>Retrieve customer information</li><li>Process refunds and exchanges</li><li>Update account settings</li><li>Escalate to humans when needed</li></ul><h4>Agentic AI Use Case:</h4><p><strong>Personal Productivity</strong></p><ul><li>Monitors your work patterns</li><li>Automatically optimizes your schedule</li><li>Proactively suggests improvements</li><li>Learns your preferences over time</li><li>Adapts to changing priorities</li></ul><h3>Key Takeaways</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/714/1*NxnAyysXYr5R8xUpHFT5Dg.png" /></figure><p><strong>Generative AI</strong> is your creative assistant — it makes content when you ask.</p><p><strong>AI Agents</strong> are your task executors — they complete specific jobs using tools and reasoning.</p><p><strong>Agentic AI</strong> is advanced AI systems that can act autonomously to achieve goals, moving beyond simple command-response to proactively plan, reason, and execute complex tasks with minimal human intervention</p><ul><li>Decide what to do</li><li>Plan multiple steps</li><li>Learn from mistakes</li><li>Run continuously without prompts</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=210f4c2e9119" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[React’s New <Activity /> Component: Preserve UI State Without Unmounting]]></title>
            <link>https://medium.com/@jasminbhesaniya/reacts-new-activity-component-preserve-ui-state-without-unmounting-81f612222052?source=rss-6e8655246df8------2</link>
            <guid isPermaLink="false">https://medium.com/p/81f612222052</guid>
            <category><![CDATA[preserve-ui-state]]></category>
            <category><![CDATA[react-new-feature]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[react-activity-component]]></category>
            <category><![CDATA[react-optimization]]></category>
            <dc:creator><![CDATA[Jasmin Bhesaniya]]></dc:creator>
            <pubDate>Sun, 21 Dec 2025 09:19:55 GMT</pubDate>
            <atom:updated>2025-12-21T09:19:55.330Z</atom:updated>
            <content:encoded><![CDATA[<p>React continues to evolve to solve real-world UI problems, and one of the most exciting recent additions is the <strong>&lt;Activity /&gt; component</strong>.</p><p>If you’ve ever hidden a component only to lose its internal state — collapsed panels reopening, form inputs resetting, subscriptions restarting — then &lt;Activity /&gt; is built exactly for you.</p><h3>What is &lt;Activity /&gt;?</h3><p>&lt;Activity /&gt; is a new React component that allows you to <strong>hide and restore UI while preserving internal state</strong>.</p><pre>&lt;Activity mode={visibility}&gt;<br>  &lt;Sidebar /&gt;<br>&lt;/Activity&gt;</pre><p>Instead of unmounting components when they’re hidden, React keeps them “alive” in the background — without visual rendering or side effects.</p><p>Think of it as <strong>background rendering with state preservation</strong>.</p><h3>The Problem with Conditional Rendering</h3><p>In React, we often show or hide components like this:</p><pre>{isShowingSidebar &amp;&amp; &lt;Sidebar /&gt;}</pre><p>This works, but there’s a downside:</p><ul><li>When isShowingSidebar becomes false, the component <strong>unmounts</strong></li><li>All internal state is destroyed</li><li>Effects are cleaned up</li><li>When shown again, everything resets</li></ul><p>This behavior is not always desirable.</p><h3>Enter &lt;Activity /&gt;</h3><p>With &lt;Activity /&gt;, you can hide UI <strong>without losing state</strong>:</p><pre>&lt;Activity mode={isShowingSidebar ? &quot;visible&quot; : &quot;hidden&quot;}&gt;<br>  &lt;Sidebar /&gt;<br>&lt;/Activity&gt;</pre><h3>What happens internally?</h3><p>When mode=&quot;hidden&quot;:</p><ul><li>Children are visually hidden using display: none</li><li>Effects are destroyed (subscriptions, listeners, timers)</li><li>Components still re-render at a lower priority</li><li>Internal state is preserved</li></ul><p>When mode=&quot;visible&quot;:</p><ul><li>UI reappears</li><li>Previous state is restored</li><li>Effects are re-created</li></ul><p>This makes &lt;Activity /&gt; ideal for UI that is <strong>temporarily hidden but expected to return</strong>.</p><h4>Props</h4><ol><li><strong>children</strong>: The UI you want to show or hide</li><li><strong>mode</strong>: &quot;visible&quot; or &quot;hidden&quot; (defaults to &quot;visible&quot;)</li></ol><h3>Why &lt;Activity /&gt; Is Powerful</h3><ul><li>Preserves UI and internal state</li><li>Avoids unnecessary remounting</li><li>Prevents unwanted side effects</li><li>Improves UX for complex layouts</li><li>Ideal for dashboards, sidebars, tabs, modals, and panels</li></ul><h3>Final Thoughts</h3><p>&lt;Activity /&gt; changes how we think about hiding UI in React. Instead of choosing between <strong>visibility</strong> and <strong>state loss</strong>, we now get the best of both worlds.</p><p>It’s a small API with a big impact — especially for modern, interactive React applications.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=81f612222052" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Critical Security Alert: React Server Components & Next.js RCE Vulnerability (CVE-2025–55182)]]></title>
            <link>https://medium.com/@jasminbhesaniya/critical-security-alert-react-server-components-next-js-rce-vulnerability-cve-2025-55182-5c1cd93b7475?source=rss-6e8655246df8------2</link>
            <guid isPermaLink="false">https://medium.com/p/5c1cd93b7475</guid>
            <category><![CDATA[critical-security]]></category>
            <category><![CDATA[critical-alert-nextjs]]></category>
            <category><![CDATA[critical-security-react]]></category>
            <category><![CDATA[critical-nextjs-update]]></category>
            <category><![CDATA[react-security-update]]></category>
            <dc:creator><![CDATA[Jasmin Bhesaniya]]></dc:creator>
            <pubDate>Sun, 07 Dec 2025 07:19:42 GMT</pubDate>
            <atom:updated>2025-12-07T07:52:24.371Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Severity: CVSS 10.0 (Critical)</strong><br> <strong>CVE-2025–55182 (React) | CVE-2025–66478 (Next.js)</strong></p><h4>The Vulnerability</h4><p>A critical remote code execution vulnerability has been discovered in React Server Components. Attackers can execute malicious code on your server by sending specially crafted requests — no authentication required.</p><h4>⚠️ Are You Seeing This Error?</h4><p>If you’re encountering security warnings or vulnerability alerts like this in your npm audit or GitHub security alerts, <strong>you need to update immediately:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_3rCBQOyGnLQg05BizFgWg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AwK-EIaBmRAzV3FGTFZAgw.png" /></figure><h4><strong>Common signs you’re affected:</strong></h4><ul><li>Security scanner showing CVE-2025–55182 or CVE-2025–66478</li><li>npm audit reporting critical vulnerabilities in next, react-server-dom-* packages</li><li>GitHub Dependabot alerts for React Server Components</li><li>Severity rating: <strong>Critical (10.0/10)</strong></li><li>Attack complexity: <strong>Low</strong> | Privileges required: <strong>None</strong></li></ul><h4>The Vulnerability</h4><p>A critical</p><h4>Affected Versions</h4><p><strong>React Packages (versions 19.0.0, 19.1.0, 19.1.1, 19.2.0):</strong></p><ul><li>react-server-dom-webpack</li><li>react-server-dom-parcel</li><li>react-server-dom-turbopack</li></ul><p><strong>Frameworks &amp; Bundlers:</strong></p><ul><li>Next.js ≥14.3.0-canary.77, ≥15.x, ≥16.x</li><li>React Router, Waku, Redwood SDK, Expo</li><li>Vite, Parcel plugins with RSC support</li></ul><p><strong>Not affected:</strong> Apps without server-side rendering or React Server Components.</p><h4>Fix Instructions</h4><h4>Next.js</h4><p>Update to the patched version for your release line:</p><pre>npm install next@15.0.5   # for 15.0.x<br>npm install next@15.1.9   # for 15.1.x<br>npm install next@15.2.6   # for 15.2.x<br>npm install next@15.3.6   # for 15.3.x<br>npm install next@15.4.8   # for 15.4.x<br>npm install next@15.5.7   # for 15.5.x<br>npm install next@16.0.7   # for 16.0.x<br><br># Canary users (14.3.0-canary.77+)<br>npm install next@14</pre><p>React Router (with unstable RSC APIs)</p><pre>npm install react@latest react-dom@latest react-server-dom-parcel@latest react-server-dom-webpack@latest @vitejs/plugin-rsc@latest</pre><p>Direct React Server Packages</p><pre>npm install react@latest react-dom@latest<br>npm install react-server-dom-webpack@latest  # or parcel/turbopack</pre><h4>Verify &amp; Deploy</h4><p><strong>Check your versions:</strong></p><pre>npm list react react-dom next</pre><h4><strong>Patched versions:</strong></h4><ul><li>React: 19.0.1, 19.1.2, 19.2.1+</li><li>Next.js: See versions above</li></ul><p><strong>Deploy immediately</strong> after testing locally. This cannot wait.</p><h4>Timeline</h4><ul><li><strong>Nov 29:</strong> Vulnerability reported by Lachlan Davidson</li><li><strong>Dec 3:</strong> Patches released and publicly disclosed</li></ul><p><strong>Update now.</strong> This is a maximum-severity vulnerability requiring immediate action.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5c1cd93b7475" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Understanding React Suspense Component]]></title>
            <link>https://medium.com/@jasminbhesaniya/understanding-react-suspense-00ca317b1486?source=rss-6e8655246df8------2</link>
            <guid isPermaLink="false">https://medium.com/p/00ca317b1486</guid>
            <category><![CDATA[react-performance]]></category>
            <category><![CDATA[react-suspense]]></category>
            <category><![CDATA[user-experience]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[fallback]]></category>
            <dc:creator><![CDATA[Jasmin Bhesaniya]]></dc:creator>
            <pubDate>Sat, 29 Nov 2025 06:54:58 GMT</pubDate>
            <atom:updated>2025-11-29T07:18:20.683Z</atom:updated>
            <content:encoded><![CDATA[<p>React Suspense is a powerful feature that helps you <strong>handle asynchronous operations</strong> in a cleaner and more user-friendly way. Instead of manually managing loading states, Suspense lets React <em>wait</em> for something (like data or code) before rendering the UI — while showing a fallback (like a loader).</p><h4>⭐ What is Suspense in React?</h4><p><strong>Suspense</strong> is a React component that allows you to <strong>show a loading UI</strong> until a particular part of your application is ready.</p><p>It’s like saying:</p><blockquote>“Render this component, but if its data or code isn’t ready yet, show a fallback loader.”</blockquote><h4>⚙️ <strong>How Does Suspense Work?</strong></h4><p>Suspense works by wrapping components that need asynchronous resources.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*21B0Bs2UunJiIT0LvxoBAQ.png" /></figure><p>Example flow:</p><ol><li>Component needs data or lazy-loaded code</li><li>React sees it’s not ready</li><li>Suspense shows fallback UI (spinner/loading text)</li><li>Once ready → render the actual component</li></ol><p>It makes your UI smoother and avoids ugly conditional loading checks everywhere.</p><h4>🤔 <strong>Why Use Suspense?</strong></h4><p>You should use Suspense when you want:</p><ul><li>Cleaner async code</li><li>Better user experience</li><li>Centralized loading states</li><li>To avoid multiple isLoading checks</li><li>To improve performance with lazy loading</li></ul><p>It simplifies handling async tasks — especially when using frameworks like <strong>React.lazy</strong> or libraries like <strong>React Query</strong>, <strong>SWR</strong>, or <strong>Relay</strong>.</p><h4>🧩 <strong>Simple Example: Lazy Loading with Suspense</strong></h4><pre>import React, { Suspense, lazy } from &quot;react&quot;;<br><br>const Dashboard = lazy(() =&gt; import(&quot;./Dashboard&quot;));<br><br>export default function App() {<br>  return (<br>    &lt;div&gt;<br>      &lt;h2&gt;My App&lt;/h2&gt;<br><br>      &lt;Suspense fallback={&lt;p&gt;Loading dashboard...&lt;/p&gt;}&gt;<br>        &lt;Dashboard /&gt;<br>      &lt;/Suspense&gt;<br>    &lt;/div&gt;<br>  );<br>}</pre><h4>✔️ What’s happening here?</h4><ul><li>Dashboard component loads only when needed</li><li>Suspense shows &quot;Loading dashboard...&quot; until it&#39;s ready</li><li>Improves performance by reducing bundle size</li></ul><h4>🎯 Benefits of Using Suspense</h4><h4>1. Cleaner Loading Logic</h4><p>Avoids multiple repetitive isLoading states.</p><h4>2. Better Code Splitting</h4><p>Load components only when required with React.lazy.</p><h4>3. Enhanced User Experience</h4><p>Shows proper fallback loaders instead of blank screens.</p><h4>4. Works Great with Data Frameworks</h4><p>Modern libraries like SWR, Relay, React Query support Suspense mode.</p><h4>5. Improves App Performance</h4><p>Reduces initial bundle size and boosts page load speed.</p><h3>📝 Short Conclusion</h3><p>React Suspense makes asynchronous UI handling <strong>simple, elegant, and scalable</strong>.<br> If you want better performance, cleaner code, and smoother loading states — Suspense is the way to go.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=00ca317b1486" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ React Monorepo Architecture with pnpm Workspaces]]></title>
            <link>https://medium.com/@jasminbhesaniya/react-monorepo-architecture-with-pnpm-workspaces-fb5c4d3e89b4?source=rss-6e8655246df8------2</link>
            <guid isPermaLink="false">https://medium.com/p/fb5c4d3e89b4</guid>
            <category><![CDATA[react-architecture]]></category>
            <category><![CDATA[workspace]]></category>
            <category><![CDATA[react-project-structure]]></category>
            <category><![CDATA[pnpm]]></category>
            <category><![CDATA[monorepo]]></category>
            <dc:creator><![CDATA[Jasmin Bhesaniya]]></dc:creator>
            <pubDate>Sat, 22 Nov 2025 06:05:47 GMT</pubDate>
            <atom:updated>2025-11-22T06:09:07.809Z</atom:updated>
            <content:encoded><![CDATA[<p>Managing multiple applications — like web apps, admin dashboards, landing pages, and shared UI libraries — often leads to duplicated code, repeated logic, and inconsistent design. A <strong>monorepo</strong> solves these problems by keeping everything in a single, well-structured repository.</p><p>Among all package managers, <strong>pnpm</strong> has become the most efficient and reliable choice for monorepos. In this guide, we’ll walk through <em>why</em> pnpm is ideal and <em>how</em> to set up a complete React monorepo from scratch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XB9K0PzB1i5feKaxv6SDVg.png" /></figure><h4>🌟 Why Choose pnpm?</h4><p>pnpm is fast, lightweight, and extremely workspace-friendly. Compared to npm and yarn:</p><p>✅ Zero code duplication<br>✅ Faster installs<br>✅ Fewer version conflicts<br>✅ Perfect for monorepos</p><blockquote><strong>Real-world benefit:</strong><br> If your product has <strong>multiple apps</strong> (web app, admin panel, marketing site) and they all follow <strong>the same design system and shared logic</strong>, you don’t need to rewrite code.<br> A pnpm monorepo lets you build once, use everywhere, and save development time.</blockquote><h4>🏗️ What is a Monorepo?</h4><p>A monorepo stores multiple related projects in one repository — apps, shared packages, utils, type definitions, etc.</p><h3>🎁 Benefits</h3><ul><li><strong>Shared code:</strong> Common UI components, hooks, business logic</li><li><strong>Consistent design:</strong> One theme system across all apps</li><li><strong>Faster feature delivery:</strong> Update in one place → used across all apps</li><li><strong>Easier collaboration:</strong> Same config, same tooling</li><li><strong>Optimized builds:</strong> With Nx, Turborepo, or pnpm recursive scripts</li></ul><pre>.<br>├── apps/<br>│   ├── web-app/<br>│   ├── admin-panel/<br>│   └── mobile-app/ (optional)<br>├── packages/<br>│   ├── ui-components/<br>│   ├── utils/<br>│   ├── types/<br>│   └── graphql-api-client/<br>├── package.json<br>├── pnpm-workspace.yaml<br>└── README.md</pre><h4>🧩 Real Example</h4><ul><li><strong>apps/web-app</strong> → Your main React website</li><li><strong>apps/admin-panel</strong> → Admin dashboard</li><li><strong>packages/ui-components</strong> → Shared design system</li><li><strong>packages/utils</strong> → Common helper functions</li><li><strong>packages/types</strong> → Shared TypeScript models</li><li><strong>packages/graphql-api-client</strong> → API wrapper</li></ul><p>This keeps everything reusable, unified, and maintainable.</p><h4>⚙️ Setting Up the Monorepo with pnpm Workspaces</h4><h4><strong>Step 1 — Create Project Folder</strong></h4><pre>mkdir pnpm-monorepo<br>cd pnpm-monorepo</pre><h4>Step 2 — Initialize Root Package</h4><pre>pnpm init</pre><p>Creates a basic package.json for root configuration.</p><h4>Step 3 — Define Workspace</h4><p>Create <strong>pnpm-workspace.yaml</strong>:</p><p>packages:<br> — ‘apps/*’<br> — ‘packages/*’</p><h4>Step 4 — Root package.json with Scripts</h4><pre>{<br>  &quot;name&quot;: &quot;pnpm-monorepo&quot;,<br>  &quot;version&quot;: &quot;1.0.0&quot;,<br>  &quot;private&quot;: true,<br>  &quot;scripts&quot;: {<br>    &quot;dev&quot;: &quot;pnpm --parallel --filter \&quot;./apps/**\&quot; dev&quot;,<br>    &quot;build&quot;: &quot;pnpm --filter \&quot;./apps/**\&quot; build&quot;,<br>    &quot;lint&quot;: &quot;pnpm --recursive lint&quot;,<br>    &quot;clean&quot;: &quot;pnpm --recursive clean&quot;<br>  },<br>  &quot;devDependencies&quot;: {<br>    &quot;typescript&quot;: &quot;^5.0.0&quot;,<br>    &quot;prettier&quot;: &quot;^3.0.0&quot;,<br>    &quot;eslint&quot;: &quot;^8.0.0&quot;<br>  }<br>}</pre><h4>Step 5 — Create App &amp; Package Folders</h4><pre>mkdir -p apps/web-app/src<br>mkdir -p apps/admin-panel/src<br>mkdir -p packages/ui-components/src<br>mkdir -p packages/utils/src<br>mkdir -p packages/types/src<br>mkdir -p packages/graphql-api-client/src</pre><h4>Step 6 — Example: web-app package.json</h4><pre>{<br>  &quot;name&quot;: &quot;@monorepo/web-app&quot;,<br>  &quot;version&quot;: &quot;1.0.0&quot;,<br>  &quot;private&quot;: true,<br>  &quot;scripts&quot;: {<br>    &quot;dev&quot;: &quot;vite&quot;,<br>    &quot;build&quot;: &quot;vite build&quot;<br>  },<br>  &quot;dependencies&quot;: {<br>    &quot;react&quot;: &quot;^18.2.0&quot;,<br>    &quot;@monorepo/ui-components&quot;: &quot;workspace:*&quot;<br>  }<br>}</pre><h4>Step 7 — Shared UI Package Example</h4><pre>{<br>  &quot;name&quot;: &quot;@monorepo/ui-components&quot;,<br>  &quot;version&quot;: &quot;1.0.0&quot;,<br>  &quot;main&quot;: &quot;src/index.ts&quot;,<br>  &quot;peerDependencies&quot;: {<br>    &quot;react&quot;: &quot;^18.2.0&quot;<br>  }<br>}</pre><h4>Step 8 — Install All Dependencies</h4><pre>pnpm install</pre><h4>🔧 Managing Dependencies in Workspaces</h4><p>Install only in one workspace</p><pre>pnpm add axios --filter @monorepo/web-app</pre><p>Install everywhere</p><pre>pnpm add lodash --recursive</pre><p>Install root dev dependency</p><pre>pnpm add -D -w eslint</pre><p>Link internal workspace packages</p><pre>pnpm add @monorepo/ui-components --filter @monorepo/web-app --workspace</pre><p>🤖 Automation with Root Scripts</p><pre>{<br>  &quot;scripts&quot;: {<br>    &quot;dev&quot;: &quot;pnpm --parallel --filter \&quot;./apps/**\&quot; dev&quot;,<br>    &quot;build&quot;: &quot;pnpm --recursive build&quot;,<br>    &quot;lint&quot;: &quot;pnpm --recursive lint&quot;,<br>    &quot;clean&quot;: &quot;pnpm --recursive clean&quot;<br>  }<br>}</pre><h4>🎯 Final Thoughts</h4><p>A pnpm monorepo is a game-changer for teams building multiple applications with shared logic and UI. You get:</p><p>🚀 Faster development</p><p>💡 Zero duplication</p><p>🎨 Consistent UI/UX</p><p>🔐 Cleaner architecture</p><p>⚡ Better performance</p><p>If you’re working on a product with multiple platforms (landing page, customer app, admin dashboard), a pnpm monorepo ensures one source of truth and maximum efficiency.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fb5c4d3e89b4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Boost Your React Performance Using SWR with Axios]]></title>
            <link>https://medium.com/@jasminbhesaniya/boost-your-react-performance-using-swr-with-axios-748648cc2b05?source=rss-6e8655246df8------2</link>
            <guid isPermaLink="false">https://medium.com/p/748648cc2b05</guid>
            <category><![CDATA[react-hook]]></category>
            <category><![CDATA[swr]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[data-fetching]]></category>
            <category><![CDATA[axios]]></category>
            <dc:creator><![CDATA[Jasmin Bhesaniya]]></dc:creator>
            <pubDate>Sat, 01 Nov 2025 05:42:22 GMT</pubDate>
            <atom:updated>2025-11-01T05:42:22.581Z</atom:updated>
            <content:encoded><![CDATA[<p>Most React developers use Axios (or the native fetch) for API requests — and that works fine for small apps.</p><p>But as your application grows, managing loading states, caching, revalidation, and data freshness becomes a headache.</p><p>That’s where SWR comes in.<br>SWR isn’t just another data fetching tool, it’s a powerful React Hook that handles caching, re-fetching, and synchronization automatically.</p><h3>⚡ What Is SWR?</h3><p><strong>SWR</strong> stands for <strong>Stale-While-Revalidate</strong> — a strategy to return cached data (stale) first, then revalidate it by fetching the latest version in the background.</p><p>In simple words:</p><blockquote><em>“You get instant data from cache while SWR silently updates it behind the scenes.”</em></blockquote><p>So your app feels <strong>faster</strong>, stays <strong>fresh</strong>, and requires <strong>less code</strong>.</p><h3>🧠 Why Use SWR Instead of Only Axios?</h3><p>Axios is great for making HTTP requests — but it stops there.<br> You still have to manually handle things like caching, deduplication, or revalidation. SWR does all of that for you out of the box.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*zsiEQI9ZIOaAA3iem0E63w.png" /></figure><h3>🧩 Example: SWR with Axios</h3><p>You can easily use SWR <strong>together</strong> with Axios — Axios handles the HTTP request, SWR handles caching and revalidation.</p><pre>import useSWR from &quot;swr&quot;;<br>import axios from &quot;axios&quot;;<br><br>const fetcher = (url: string) =&gt; axios.get(url).then(res =&gt; res.data);<br><br>function UserProfile() {<br>  const { data, error, isLoading } = useSWR(&quot;/api/user&quot;, fetcher);<br><br>  if (isLoading) return &lt;p&gt;Loading...&lt;/p&gt;;<br>  if (error) return &lt;p&gt;Failed to load user.&lt;/p&gt;;<br><br>  return (<br>    &lt;div&gt;<br>      &lt;h2&gt;{data.name}&lt;/h2&gt;<br>      &lt;p&gt;Email: {data.email}&lt;/p&gt;<br>    &lt;/div&gt;<br>  );<br>}</pre><p>✅ <strong>What happens here:</strong></p><ul><li>SWR calls /api/user using Axios.</li><li>It caches the result.</li><li>When you visit the same page again, it shows cached data instantly.</li><li>Meanwhile, it fetches fresh data in the background.</li><li>The UI updates automatically once new data arrives.</li></ul><h4>Handling Mutations (POST / PUT) with SWR</h4><p>While useSWR is perfect for fetching data, SWR also provides a hook called <strong>useSWRMutation</strong> for performing <strong>POST</strong>, <strong>PUT</strong>, <strong>PATCH</strong>, or <strong>DELETE</strong> requests.</p><p>It allows you to <strong>mutate data</strong> (send updates) and <strong>instantly revalidate</strong> your cache — so your UI stays in sync without needing a full page refresh.</p><p>Here’s an example of how to add or update a user using SWR and Axios 👇</p><pre>import useSWRMutation from &quot;swr/mutation&quot;;<br>import axios from &quot;axios&quot;;<br><br>const postUser = async (url: string, { arg }: { arg: { name: string; email: string } }) =&gt; {<br>  const response = await axios.post(url, arg);<br>  return response.data;<br>};<br><br>function AddUser() {<br>  const { trigger, isMutating } = useSWRMutation(&quot;/api/users&quot;, postUser);<br><br>  const handleSubmit = async (e: React.FormEvent&lt;HTMLFormElement&gt;) =&gt; {<br>    e.preventDefault();<br>    const formData = new FormData(e.currentTarget);<br>    const user = {<br>      name: formData.get(&quot;name&quot;) as string,<br>      email: formData.get(&quot;email&quot;) as string,<br>    };<br><br>    await trigger(user);<br>    alert(&quot;User added successfully!&quot;);<br>  };<br><br>  return (<br>    &lt;form onSubmit={handleSubmit}&gt;<br>      &lt;input type=&quot;text&quot; name=&quot;name&quot; placeholder=&quot;Name&quot; required /&gt;<br>      &lt;input type=&quot;email&quot; name=&quot;email&quot; placeholder=&quot;Email&quot; required /&gt;<br>      &lt;button type=&quot;submit&quot; disabled={isMutating}&gt;<br>        {isMutating ? &quot;Saving...&quot; : &quot;Add User&quot;}<br>      &lt;/button&gt;<br>    &lt;/form&gt;<br>  );<br>}</pre><p>✅ <strong>How it works:</strong></p><ul><li>useSWRMutation runs only when you manually call trigger() — perfect for forms and user actions.</li><li>After a successful mutation, SWR can automatically <strong>revalidate</strong> your cached data (using the mutate function).</li></ul><p>You can also trigger <strong>manual cache updates</strong> after mutation like this:</p><pre>import { mutate } from &quot;swr&quot;;<br><br>// After adding a new user:<br>await trigger(user);<br>mutate(&quot;/api/users&quot;); // revalidate the users list</pre><h4>💡 Why It’s Powerful</h4><ul><li>No need to manually refetch after POST/PUT — SWR handles revalidation.</li><li>Keeps the UI instantly up-to-date.</li><li>No extra state management. No manual re-fetch logic.</li><li>Simplifies logic for forms, updates, and CRUD operations.</li></ul><h3>💡 Key Benefits of Using SWR</h3><h4>1. Performance Boost</h4><p>SWR returns cached data instantly, so your UI never waits. Users see results right away — even offline.</p><h4>2. Automatic Revalidation</h4><p>Whenever you refocus the browser tab or reconnect to the internet, SWR automatically refreshes your data.</p><h4>3. Simplified Code</h4><p>No need for useEffect, manual loading flags, or error state management. SWR gives you all of that in one line.</p><h4>4. Built-in Caching and Deduplication</h4><p>SWR prevents duplicate requests for the same resource — saving bandwidth and improving speed.</p><h4>5. Real-time and Reactive</h4><p>It keeps your UI synchronized with the backend automatically — ideal for dashboards, feeds, or live updates.</p><h4>6. Flexible</h4><p>You can still use <strong>Axios</strong>, <strong>Fetch</strong>, or even <strong>GraphQL clients</strong> as your fetcher function — SWR doesn’t lock you in.</p><h3>🧭 When to Use SWR</h3><p>Use SWR whenever you need:</p><ul><li>Client-side data fetching in React apps</li><li>Caching and auto-updates</li><li>Real-time data (dashboards, analytics, etc.)</li><li>Server data that changes frequently</li></ul><p>If your data is <strong>static</strong> (like config files or constants), plain Axios or fetch is enough.</p><h3>🔚 Conclusion</h3><p>If you’re still managing API states manually with Axios — it’s time to modernize your data fetching strategy.<br> Using <strong>SWR + Axios</strong> makes your React apps:</p><ul><li>Faster ⚡</li><li>Simpler 💡</li><li>Smarter 🔁</li></ul><p>It’s one of those small changes that instantly improve both <strong>performance</strong> and <strong>developer experience</strong>.</p><blockquote><em>Try it out here 👉</em><a href="https://swr.vercel.app/"><em> https://swr.vercel.app/</em></a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=748648cc2b05" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[JavaScript Package Managers: npm vs Yarn vs Bun vs pnpm — The Ultimate Developer Guide]]></title>
            <link>https://medium.com/@jasminbhesaniya/javascript-package-managers-npm-vs-yarn-vs-bun-vs-pnpm-the-ultimate-developer-guide-22a71c962f34?source=rss-6e8655246df8------2</link>
            <guid isPermaLink="false">https://medium.com/p/22a71c962f34</guid>
            <category><![CDATA[javascript-tips]]></category>
            <category><![CDATA[yarn]]></category>
            <category><![CDATA[npm]]></category>
            <category><![CDATA[pnpm]]></category>
            <category><![CDATA[package-manager]]></category>
            <dc:creator><![CDATA[Jasmin Bhesaniya]]></dc:creator>
            <pubDate>Sat, 20 Sep 2025 06:35:12 GMT</pubDate>
            <atom:updated>2025-09-20T06:35:12.341Z</atom:updated>
            <content:encoded><![CDATA[<h3>JavaScript Package Managers: npm vs Yarn vs Bun vs pnpm — The Ultimate Developer Guide</h3><p>As a JavaScript developer, choosing the right package manager can significantly impact your development workflow, project performance, and team collaboration. With multiple options available today, each offering unique advantages, it can be challenging to decide which one best suits your needs.</p><h3>Overview of Package Managers</h3><p>Package managers are essential tools that handle dependency management, version control, and script execution in JavaScript projects. They automate the process of installing, updating, and removing packages, while maintaining dependency trees and resolving version conflicts.</p><h3>npm (Node Package Manager)</h3><p><strong>The Original and Default Choice</strong></p><p>npm is the default package manager that comes bundled with Node.js. As the original solution in the JavaScript ecosystem, it has the largest registry and widespread adoption.</p><h4>Pros:</h4><ul><li><strong>Universal compatibility</strong>: Works with all Node.js projects out of the box</li><li><strong>Industry standard</strong>: Most documentation and tutorials assume npm usage</li><li><strong>Mature ecosystem</strong>: Extensive tooling and CI/CD integration</li><li><strong>Built-in security</strong>: Includes audit functionality for vulnerability scanning</li><li><strong>No additional installation</strong>: Comes pre-installed with Node.js</li></ul><h4>Cons:</h4><ul><li><strong>Slower installation</strong>: Generally, the slowest among modern alternatives</li><li><strong>Disk space usage</strong>: Creates nested node_modules which can be space-inefficient</li><li><strong>Security concerns</strong>: Historically had some security vulnerabilities</li><li><strong>Limited workspace support</strong>: Basic monorepo support compared to alternatives</li></ul><h3>Yarn</h3><p><strong>The Performance Pioneer</strong></p><p>Developed by Facebook (now Meta), Yarn was created to address npm’s early shortcomings, particularly around speed, security, and deterministic installs.</p><h4>Pros:</h4><ul><li><strong>Faster installations</strong>: Parallel downloads and caching improve speed</li><li><strong>Deterministic installs</strong>: yarn.lock ensures consistent installs across environments</li><li><strong>Excellent monorepo support</strong>: Built-in workspaces feature</li><li><strong>Offline capability</strong>: Can install packages from cache without internet</li><li><strong>Zero-installs</strong>: Yarn 2+ supports running projects without node_modules</li><li><strong>Plugin system</strong>: Extensible architecture for custom functionality</li></ul><h4>Cons:</h4><ul><li><strong>Learning curve</strong>: Different commands and concepts from npm</li><li><strong>Yarn 2+ compatibility</strong>: Major version changes broke some existing workflows</li><li><strong>Additional dependency</strong>: Requires separate installation</li><li><strong>Storage overhead</strong>: Cache can consume significant disk space</li></ul><h3>Bun</h3><p><strong>The Speed Demon</strong></p><p>Bun is the newest entrant, written in Zig and designed as a complete JavaScript runtime replacement, not just a package manager. It aims to be the fastest option available.</p><h4>Pros:</h4><ul><li><strong>Blazing fast</strong>: Significantly faster than alternatives due to optimized implementation</li><li><strong>All-in-one tool</strong>: Runtime, bundler, test runner, and package manager</li><li><strong>Modern architecture</strong>: Built from scratch with performance as priority</li><li><strong>Drop-in replacement</strong>: Compatible with existing npm/yarn projects</li><li><strong>Innovative caching</strong>: Advanced caching strategies for better performance</li><li><strong>Active development</strong>: Rapidly evolving with frequent updates</li></ul><h4>Cons:</h4><ul><li><strong>Relatively new</strong>: Less mature, potential stability issues</li><li><strong>Limited ecosystem</strong>: Fewer plugins and extensions compared to established options</li><li><strong>Platform support</strong>: Initially focused on macOS/Linux (Windows support improving)</li><li><strong>Breaking changes</strong>: Fast development pace may introduce compatibility issues</li><li><strong>Learning resources</strong>: Fewer tutorials and community resources available</li></ul><h3>pnpm</h3><p><strong>The Efficiency Expert</strong></p><p>pnpm (performant npm) focuses on disk space efficiency and speed through innovative dependency management using hard links and a global store.</p><h3>Pros:</h3><ul><li><strong>Disk space efficiency</strong>: Shares packages across projects via hard links</li><li><strong>Fast installations</strong>: Often faster than npm and competitive with Yarn</li><li><strong>Strict dependency resolution</strong>: Prevents phantom dependencies</li><li><strong>Great monorepo support</strong>: Excellent workspace implementation</li><li><strong>npm compatibility</strong>: Direct drop-in replacement for npm</li><li><strong>Security by design</strong>: Stricter dependency access prevents supply chain attacks</li></ul><h3>Cons:</h3><ul><li><strong>Hard link limitations</strong>: May not work properly on some file systems or deployment environments</li><li><strong>Newer adoption</strong>: Smaller community compared to npm/Yarn</li><li><strong>Complexity</strong>: The hard link system can be confusing to debug</li><li><strong>Platform inconsistencies</strong>: Behavior may vary across different operating systems</li></ul><h3>Our Recommendations</h3><h4>For New Projects:</h4><p><strong>Top Pick: pnpm</strong></p><ul><li>Best balance of performance, efficiency, and compatibility</li><li>Excellent for most modern development scenarios</li><li>Growing ecosystem support and adoption</li></ul><h3>By Project Type:</h3><p><strong>Small to Medium Projects:</strong></p><ul><li><strong>First choice:</strong> npm (simplicity and universal support)</li><li><strong>Alternative:</strong> pnpm (if disk space or speed matters)</li></ul><p><strong>Large Enterprise Applications:</strong></p><ul><li><strong>First choice:</strong> pnpm (efficiency and strict dependency management)</li><li><strong>Alternative:</strong> Yarn (mature monorepo support)</li></ul><p><strong>Monorepo Projects:</strong></p><ul><li><strong>First choice:</strong> pnpm (excellent workspace support + efficiency)</li><li><strong>Alternative:</strong> Yarn (proven monorepo tooling)</li></ul><p><strong>Performance-Critical Applications:</strong></p><ul><li><strong>First choice:</strong> Bun (unmatched speed)</li><li><strong>Fallback:</strong> pnpm (reliable performance with maturity)</li></ul><p><strong>Learning/Educational Projects:</strong></p><ul><li><strong>Recommended:</strong> npm (standard documentation and tutorials)</li></ul><h3>By Team Experience:</h3><p><strong>Beginner Teams:</strong> npm → Easy adoption, extensive learning resources <strong>Experienced Teams:</strong> pnpm → Advanced features without complexity overhead <strong>Performance-Focused Teams:</strong> Bun → Cutting-edge speed and unified tooling</p><h3>Quick Start Commands</h3><h4>npm</h4><pre>npm install<br>npm run build<br>npm publish</pre><h4>Yarn</h4><pre>yarn install<br>yarn build<br>yarn publish</pre><h4>Bun</h4><pre>bun install<br>bun run build<br>bun publish</pre><h4>pnpm</h4><pre>pnpm install<br>pnpm run build<br>pnpm publish</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=22a71c962f34" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>