<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: SHIBAM</title>
    <description>The latest articles on DEV Community by SHIBAM (@shib_itsme).</description>
    <link>https://dev.to/shib_itsme</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F478242%2F694309e9-83c2-4f6b-bcb1-08b8ac046abe.png</url>
      <title>DEV Community: SHIBAM</title>
      <link>https://dev.to/shib_itsme</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shib_itsme"/>
    <language>en</language>
    <item>
      <title>Running a Green CI Pipeline Isn't the Hard Part Anymore</title>
      <dc:creator>SHIBAM</dc:creator>
      <pubDate>Tue, 27 Oct 2026 06:17:00 +0000</pubDate>
      <link>https://dev.to/shib_itsme/running-a-green-ci-pipeline-isnt-the-hard-part-anymore-11ml</link>
      <guid>https://dev.to/shib_itsme/running-a-green-ci-pipeline-isnt-the-hard-part-anymore-11ml</guid>
      <description>&lt;p&gt;Six months ago, your team adopted an AI coding assistant. Pull requests doubled. Generated code started landing in branches faster than reviewers could read it. The CI pipeline kept up for about three weeks.&lt;/p&gt;

&lt;p&gt;Now the queue backs up by mid-morning. Builds take 38 minutes. 4,000 tests run on every commit when 60 are relevant. The pipeline was designed for developers writing code. It is now processing code that machines write, at machine speed, with human-era validation.&lt;/p&gt;

&lt;p&gt;This is for platform engineers and engineering leads dealing with what happens when AI-generated code meets a CI pipeline that was never built for that volume.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Green is the baseline. It is not the finish line.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  AI writes the code faster. CI still validates it the slow way.
&lt;/h2&gt;

&lt;p&gt;The bottleneck shifted. AI coding assistants removed the slowest part of the development cycle: writing code. What they did not touch is everything after the commit: dependency resolution, compilation, test execution, image builds. Those still run the same way they did when a developer pushed two PRs a day instead of ten.&lt;/p&gt;

&lt;p&gt;Look at what happens on a single-file change: full dependency downloads, full compilation, full test suite, full Docker layer rebuilds. Multiply that by the PR volume an AI assistant generates. &lt;a href="https://github.blog/news-insights/research/survey-reveals-ais-impact-on-the-developer-experience/" rel="noopener noreferrer"&gt;GitHub's 2023 developer experience survey&lt;/a&gt; found that developers already spend as much time waiting for builds as writing code. AI tools did not shrink that wait. They stacked more builds into it.&lt;/p&gt;

&lt;p&gt;Incredibuild's survey found &lt;a href="https://www.incredibuild.com/blog/what-held-up-devs-in-2021-long-build-times" rel="noopener noreferrer"&gt;98% of developers wasted time waiting for builds&lt;/a&gt;, with build times increasing nearly 16% year over year. That was measured before AI-generated commits were a factor.&lt;/p&gt;

&lt;p&gt;Then there is the trust problem. More commits means more pipeline runs, which means more exposure to flaky tests. &lt;a href="https://slack.engineering/handling-flaky-tests-at-scale-auto-detection-suppression/" rel="noopener noreferrer"&gt;Slack's mobile team&lt;/a&gt; watched flaky tests drive their main branch build pass rate to 20%. Each failure took 28 minutes to triage. At AI-assisted commit velocity, flaky tests do not just slow you down. They stop the entire merge queue.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://circleci.com/resources/2026-state-of-software-delivery/" rel="noopener noreferrer"&gt;CircleCI's 2026 report&lt;/a&gt;, analysing 28 million workflows, confirms the pattern: increased code volume is exposing validation as a delivery bottleneck. AI made the input faster. The pipeline is still the same.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two approaches to CI in the AI era: faster execution or less work
&lt;/h2&gt;

&lt;p&gt;Most teams start with the first: bigger runners, parallelised tests, cached dependencies, conditional pipeline logic. These help. But they optimise the wrong layer. Doubling CPU on 5,000 tests still runs 4,700 unnecessary tests, whether a human or an AI wrote the change.&lt;/p&gt;

&lt;p&gt;The more interesting approach: &lt;strong&gt;stop doing work that does not need to happen.&lt;/strong&gt; Detect which dependencies changed, which modules need recompilation, which tests are affected by the code change, and skip everything else. At AI-generated volume, the savings multiply with every PR that skips redundant work.&lt;/p&gt;

&lt;p&gt;That is the path this walkthrough follows with Harness CI.&lt;/p&gt;

&lt;p&gt;Here is where each type of waste maps to a Harness CI feature. Every row in this table gets worse as AI-generated commit volume increases:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Waste&lt;/th&gt;
&lt;th&gt;What happens&lt;/th&gt;
&lt;th&gt;Harness feature&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Dependency re-downloads&lt;/td&gt;
&lt;td&gt;Every run fetches the same packages&lt;/td&gt;
&lt;td&gt;Cache Intelligence&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Unnecessary recompilation&lt;/td&gt;
&lt;td&gt;Unchanged modules rebuilt from scratch&lt;/td&gt;
&lt;td&gt;Build Intelligence&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Full test suite on small changes&lt;/td&gt;
&lt;td&gt;4,000 tests when 60 are relevant&lt;/td&gt;
&lt;td&gt;Test Intelligence&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Docker layer rebuilds&lt;/td&gt;
&lt;td&gt;Base layers rebuilt despite no Dockerfile change&lt;/td&gt;
&lt;td&gt;Docker Layer Caching&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Serial test execution&lt;/td&gt;
&lt;td&gt;Tests run single-threaded on one runner&lt;/td&gt;
&lt;td&gt;Test splitting and parallelism&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Flaky test noise&lt;/td&gt;
&lt;td&gt;Intermittent failures block unrelated PRs&lt;/td&gt;
&lt;td&gt;Flaky test detection and quarantine&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Enabling Cache Intelligence, Test Intelligence, and Build Intelligence
&lt;/h2&gt;

&lt;p&gt;The Harness CI intelligence features work at the stage level. You do not install plugins or write custom caching scripts. You enable them in your pipeline configuration.&lt;/p&gt;

&lt;p&gt;Here is a Java Maven pipeline with Cache Intelligence and Test Intelligence active, running on Harness Cloud:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;pipeline&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ci green not enough - SD&lt;/span&gt;
  &lt;span class="na"&gt;inputs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;branch&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;string&lt;/span&gt;
      &lt;span class="na"&gt;required&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
      &lt;span class="na"&gt;default&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;main&lt;/span&gt;
  &lt;span class="na"&gt;clone&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;enabled&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
    &lt;span class="na"&gt;connector&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;shibam_github&lt;/span&gt;
    &lt;span class="na"&gt;repo&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;shibam17/ci-intelligence-lab&lt;/span&gt;
    &lt;span class="na"&gt;ref&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ inputs.branch }}&lt;/span&gt;
  &lt;span class="na"&gt;stages&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;build&lt;/span&gt;
      &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Build&lt;/span&gt;
      &lt;span class="na"&gt;runtime&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;cloud&lt;/span&gt;
      &lt;span class="na"&gt;platform&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;os&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;linux&lt;/span&gt;
        &lt;span class="na"&gt;arch&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;amd64&lt;/span&gt;
      &lt;span class="na"&gt;cache&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;enabled&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
      &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;run_tests&lt;/span&gt;
          &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Run Tests&lt;/span&gt;
          &lt;span class="na"&gt;run-test&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;container&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
              &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;maven:3.9-eclipse-temurin-17&lt;/span&gt;
            &lt;span class="na"&gt;script&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;mvn clean test&lt;/span&gt;
            &lt;span class="na"&gt;intelligence&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
              &lt;span class="na"&gt;disabled&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
            &lt;span class="na"&gt;report&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
              &lt;span class="na"&gt;paths&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;**/*.xml"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two things are happening in this pipeline that do not happen in a standard CI setup:&lt;/p&gt;

&lt;h3&gt;
  
  
  Cache Intelligence (stage level)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;cache&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;enabled&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is it. Harness detects the build tooling (Maven in this case, also supports Gradle, Yarn, Go, .NET, Bazel) and automatically preserves and restores the dependency cache between runs. The cache key is derived from files like &lt;code&gt;pom.xml&lt;/code&gt; or &lt;code&gt;build.gradle&lt;/code&gt;. No manual cache key configuration, no &lt;code&gt;hashFiles()&lt;/code&gt; expressions, no cache invalidation scripts.&lt;/p&gt;

&lt;p&gt;On the first run, the cache step shows "file not found" because nothing has been saved yet. On every subsequent run, it restores the full &lt;code&gt;.m2/repository&lt;/code&gt; in seconds. In our test pipeline, the cache save uploaded 13 MB of Maven dependencies, and the second run restored them in 9 seconds instead of re-downloading.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Run #7: Cache Intelligence saving 13 MB of Maven dependencies (compressed to 12 MB), cached in 745ms&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fc85511rd4qkzaroopl9c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fc85511rd4qkzaroopl9c.png" alt="Run #7 console showing cache save" width="800" height="432"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Test Intelligence (run-test step)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;run-test&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;script&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;mvn clean test&lt;/span&gt;
  &lt;span class="na"&gt;intelligence&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;disabled&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Setting &lt;code&gt;intelligence.disabled: false&lt;/code&gt; activates Test Intelligence. Harness uses code-change information and a call graph to identify which unit tests are affected by the changed code. It selects those tests, plus any new or modified tests. Everything else is skipped.&lt;/p&gt;

&lt;p&gt;Test Intelligence supports Java, Python, Ruby, C#, Kotlin, and Scala. The call graph is built per language.&lt;/p&gt;

&lt;p&gt;On our first run, TI built a call graph with 82 nodes and 39 test relations across all 42 tests. On the second run, after changing a single file (&lt;code&gt;InputValidator.java&lt;/code&gt;), TI selected only 12 tests and skipped the remaining 30. The test run time dropped from 58ms to 16ms.&lt;/p&gt;

&lt;p&gt;On broad-impact changes (like modifying &lt;code&gt;pom.xml&lt;/code&gt;), the system runs the full suite automatically. It does not blindly skip.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Run #7: Test Intelligence selected 12 tests and skipped 30 after a single-file change to InputValidator.java&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F40874pg0h1dcwxe3aah9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F40874pg0h1dcwxe3aah9.png" alt="Run #7 Tests tab showing 12 passed, 30 skipped by TI" width="800" height="471"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Build Intelligence (stage level)
&lt;/h3&gt;

&lt;p&gt;For pipelines that compile code, Build Intelligence adds another layer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;build-intelligence&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;enabled&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Build Intelligence operates on compiled outputs. If the inputs for a module have not changed, Harness retrieves the previously generated build output instead of recompiling. Gradle, Bazel, and Maven 3.9+ are supported.&lt;/p&gt;

&lt;p&gt;This layer stacks on top of Cache Intelligence: caching avoids re-downloading dependencies, Build Intelligence avoids re-compiling code that has not changed.&lt;/p&gt;

&lt;p&gt;Two more layers worth knowing about: &lt;strong&gt;Docker Layer Caching&lt;/strong&gt; stores previously built image layers so that only changed layers rebuild, which matters most for pipelines that build container images on every commit. &lt;strong&gt;Test splitting and parallelism&lt;/strong&gt; distributes your test suite across multiple runners based on timing data, so a 20-minute serial test run can drop to 5 minutes across four parallel stages. Both stack with the intelligence features above.&lt;/p&gt;

&lt;h3&gt;
  
  
  Flaky test detection (automatic)
&lt;/h3&gt;

&lt;p&gt;Harness tracks test results over a 14-day observation window. A test that has both passed and failed against the same commit within that window gets a FLAKY indicator. Quarantine mode keeps the test running and visible but prevents its failure from blocking the pipeline. The test exits quarantine after five consecutive successful runs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Before and after
&lt;/h2&gt;

&lt;p&gt;We ran this pipeline against a Java Maven project with 42 unit tests across 5 service modules (order, inventory, pricing, notification, validation). Here is what changed between the first run (no cache, no call graph) and the second run (single file changed):&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Metric&lt;/th&gt;
&lt;th&gt;Run #6 (baseline)&lt;/th&gt;
&lt;th&gt;Run #7 (with intelligence)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Cache restore&lt;/td&gt;
&lt;td&gt;Miss (no prior cache)&lt;/td&gt;
&lt;td&gt;Hit (13 MB restored in 9s)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tests executed&lt;/td&gt;
&lt;td&gt;42 (full suite)&lt;/td&gt;
&lt;td&gt;12 (selected by TI)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tests skipped by TI&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;30&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Test run time&lt;/td&gt;
&lt;td&gt;58ms&lt;/td&gt;
&lt;td&gt;16ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Call graph&lt;/td&gt;
&lt;td&gt;Built (82 nodes, 39 relations)&lt;/td&gt;
&lt;td&gt;Reused for selection&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Failure rate&lt;/td&gt;
&lt;td&gt;2.38% (1 test bug)&lt;/td&gt;
&lt;td&gt;0%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;Before (Run #6): 42 tests, all executed, 1 failed, 0 skipped by TI&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fczai7lf4jw5sheua4dre.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fczai7lf4jw5sheua4dre.png" alt="Run #6 Tests tab showing 42 tests" width="800" height="476"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;After (Run #7): 42 tests, 12 executed, 30 skipped by TI, 0 failures&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmhbqpgoqr7erm3or9fkl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmhbqpgoqr7erm3or9fkl.png" alt="Run #7 Tests tab showing 12 passed, 30 skipped by TI" width="800" height="471"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The pipeline is still green. It is just doing 71% less test work to get there. On a larger codebase with thousands of tests, that ratio translates to minutes saved per commit.&lt;/p&gt;

&lt;h2&gt;
  
  
  What connects beyond CI
&lt;/h2&gt;

&lt;p&gt;Faster CI is one layer. The bottlenecks on either side are different problems.&lt;/p&gt;

&lt;p&gt;Code that passes CI and sits in staging for three weeks is a deployment problem. &lt;a href="https://www.harness.io/products/continuous-delivery" rel="noopener noreferrer"&gt;Continuous Delivery&lt;/a&gt; with progressive rollout and built-in verification closes that gap: code moves to production when it is ready, not when someone remembers to deploy it.&lt;/p&gt;

&lt;p&gt;Security alerts from four different scanners creating duplicate noise is a triage problem. &lt;a href="https://www.harness.io/products/security-testing-orchestration" rel="noopener noreferrer"&gt;Security Testing Orchestration&lt;/a&gt; deduplicates findings and gives developers one prioritised list instead of four noisy dashboards.&lt;/p&gt;

&lt;p&gt;CI costs spiralling across dozens of feature branches is a visibility problem. &lt;a href="https://www.harness.io/products/cloud-cost" rel="noopener noreferrer"&gt;Cloud Cost Management&lt;/a&gt; shows what each pipeline actually costs, per branch, per team.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it against your pipeline
&lt;/h2&gt;

&lt;p&gt;The fastest way to see the difference: take an existing pipeline, add &lt;code&gt;cache: enabled: true&lt;/code&gt; at the stage level, and swap your &lt;code&gt;run&lt;/code&gt; test step for a &lt;code&gt;run-test&lt;/code&gt; step with &lt;code&gt;intelligence: disabled: false&lt;/code&gt;. Run it twice. Compare the second run's test count against your baseline.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="c1"&gt;# The minimum change to enable intelligence on an existing pipeline:&lt;/span&gt;
&lt;span class="na"&gt;stages&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;build&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Build&lt;/span&gt;
    &lt;span class="na"&gt;runtime&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;cloud&lt;/span&gt;
    &lt;span class="na"&gt;cache&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;enabled&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;tests&lt;/span&gt;
        &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Tests&lt;/span&gt;
        &lt;span class="na"&gt;run-test&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;container&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;maven:3.9-eclipse-temurin-17&lt;/span&gt;
          &lt;span class="na"&gt;script&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;mvn clean test&lt;/span&gt;
          &lt;span class="na"&gt;intelligence&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;disabled&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
          &lt;span class="na"&gt;report&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;paths&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
              &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;**/*.xml"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Start with &lt;a href="https://developer.harness.io/docs/continuous-integration/get-started/overview" rel="noopener noreferrer"&gt;Harness CI documentation&lt;/a&gt; for the full configuration reference per language and build tool.&lt;/p&gt;




&lt;h2&gt;
  
  
  Frequently asked questions
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;How do I know if my CI pipeline is doing unnecessary work?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Look at what runs on a single-file change. If the pipeline downloads all dependencies, rebuilds all modules, and runs the full test suite, those are layers of repeated work. Cache hit rates, test selection ratios, and build output reuse are the metrics that matter.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is the difference between Cache Intelligence and Build Intelligence?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Cache Intelligence preserves downloaded dependencies between runs so you do not fetch the same packages again. Build Intelligence preserves compiled build outputs so you do not recompile modules whose inputs have not changed. One avoids re-downloading. The other avoids re-building.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Does Test Intelligence skip tests randomly?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;No. It uses code-change information and a call graph to determine which tests are associated with the changed code. It selects those tests plus any new or modified tests. It runs the full suite on broad-impact changes like &lt;code&gt;pom.xml&lt;/code&gt; modifications.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can these work with my existing pipeline?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Yes. Cache Intelligence and Test Intelligence work with Harness Cloud and self-hosted runners. You do not need to rewrite your pipeline. Enable caching at the stage level and swap your test step to &lt;code&gt;run-test&lt;/code&gt; with &lt;code&gt;intelligence: disabled: false&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What languages does Test Intelligence support?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Java, Python, Ruby, C#, Kotlin, and Scala.&lt;/p&gt;




</description>
      <category>ai</category>
      <category>ci</category>
      <category>devrel</category>
    </item>
    <item>
      <title>From Git Repo to Docker Image: Building Your First CI Pipeline in Harness</title>
      <dc:creator>SHIBAM</dc:creator>
      <pubDate>Tue, 20 Oct 2026 08:26:55 +0000</pubDate>
      <link>https://dev.to/shib_itsme/from-git-repo-to-docker-image-building-your-first-ci-pipeline-in-harness-5e5m</link>
      <guid>https://dev.to/shib_itsme/from-git-repo-to-docker-image-building-your-first-ci-pipeline-in-harness-5e5m</guid>
      <description>&lt;p&gt;Connected a GitHub repo, built it, tested it, and pushed a tagged image to DockerHub, in about ten minutes, without writing a line of YAML.&lt;/p&gt;

&lt;p&gt;Creating your first CI pipeline usually sounds simple until you actually start doing it.&lt;/p&gt;

&lt;p&gt;You connect your repository, figure out what stages you need, configure the build steps, set up the runtime, add caching, testing, credentials, and then hope the first run actually works. With AI coding assistants now generating pull requests faster than most teams can review them, the pressure on CI pipelines is only growing. The &lt;a href="https://survey.stackoverflow.co/2025/" rel="noopener noreferrer"&gt;2025 Stack Overflow Developer Survey&lt;/a&gt; found that 84% of developers now use AI tools in their workflow, with 51% using them daily. Every AI-generated commit still needs a pipeline to validate it.&lt;/p&gt;

&lt;p&gt;I had a Java Maven project that needed a CI pipeline, so I set one up in Harness.&lt;/p&gt;

&lt;p&gt;This walkthrough is for developers or platform engineers setting up their first Harness CI pipeline. You need a &lt;a href="https://app.harness.io/auth/#/signup" rel="noopener noreferrer"&gt;Harness account&lt;/a&gt; (free tier works), a GitHub repository with buildable code, a Dockerfile in that repository (the Docker push step builds from it), and a DockerHub account if you want to follow the push step. I used my &lt;a href="https://github.com/shibam17/ci-intelligence-lab" rel="noopener noreferrer"&gt;ci-intelligence-lab&lt;/a&gt; repo, a Java Maven project with 42 unit tests and a working Dockerfile already in the root.&lt;/p&gt;

&lt;p&gt;So I started with one simple goal:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Connect my repository, create a working CI pipeline, and then take it one step further by building and pushing the image to DockerHub.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;And honestly, most of the work ended up happening for me.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;End result: the pipeline itself ran in just over 3 minutes, build, test, and push to DockerHub, without writing a line of pipeline YAML.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Two ways to do this
&lt;/h2&gt;

&lt;p&gt;You can write the pipeline YAML from scratch: pick your container images, define your build and test commands, configure caching, add the Docker push step, wire up connectors. If you already know Harness CI well, that works.&lt;/p&gt;

&lt;p&gt;The other option is to let Harness scan the repository and generate the pipeline for you. You review what it creates, run it, and then modify from there.&lt;/p&gt;

&lt;p&gt;I went with the second option. I wanted a working pipeline first, not a perfect one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Starting with a build pipeline
&lt;/h2&gt;

&lt;p&gt;The first screen keeps things straightforward.&lt;/p&gt;

&lt;p&gt;Harness asks what you want to do:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a build pipeline&lt;/li&gt;
&lt;li&gt;Create a deployment pipeline&lt;/li&gt;
&lt;li&gt;Get going on your own&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Since I was trying out CI, I selected &lt;strong&gt;Create a build pipeline&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqc8zh3qi3vllpeopzr2m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqc8zh3qi3vllpeopzr2m.png" alt="Let's get you set up screen" width="799" height="340"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The next screen explains what is about to happen.&lt;/p&gt;

&lt;p&gt;Harness will scan the repository, determine the stages and steps it needs, generate the pipeline, and store the YAML inside the &lt;code&gt;.harness&lt;/code&gt; directory of the repository.&lt;/p&gt;

&lt;p&gt;There is also an option to build everything manually.&lt;/p&gt;

&lt;p&gt;I just clicked &lt;strong&gt;Let's go&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Connecting the repository
&lt;/h2&gt;

&lt;p&gt;The first real step is selecting where the source code lives.&lt;/p&gt;

&lt;p&gt;Harness gives you multiple options here, including Harness Code, GitHub, GitLab, and Bitbucket.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjlwrqisvyxbwnlxiq44v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjlwrqisvyxbwnlxiq44v.png" alt="Select version control" width="800" height="453"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I use GitHub, so I selected GitHub.&lt;/p&gt;

&lt;p&gt;From there, Harness gave me another simple choice.&lt;/p&gt;

&lt;p&gt;I could either use an existing connector or create a new one. I created a new one.&lt;/p&gt;

&lt;p&gt;For GitHub Cloud, OAuth was already available as the authentication option. I clicked &lt;strong&gt;Connect&lt;/strong&gt;, authorised Harness through GitHub, and that was basically it.&lt;/p&gt;

&lt;p&gt;No copying tokens around. No manually setting up a bunch of authentication fields.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fkumpewv9ee0s6cj5miw4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fkumpewv9ee0s6cj5miw4.png" alt="GitHub connector creation with OAuth" width="800" height="458"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once the connector was ready, Harness could access my repositories.&lt;/p&gt;

&lt;p&gt;I selected the repository I wanted to build from and moved on. If you have dozens of repositories you may need to scroll to find yours.&lt;/p&gt;

&lt;h2&gt;
  
  
  This is where Harness started doing the work
&lt;/h2&gt;

&lt;p&gt;After selecting the repository, there was not much left for me to configure.&lt;/p&gt;

&lt;p&gt;Harness started checking connectivity, cloning the default branch, indexing the files, detecting the languages, and analysing the repository.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmuyv3dyyauva2alqckpa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmuyv3dyyauva2alqckpa.png" alt="Code analysis in progress" width="800" height="461"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then it started generating the pipeline YAML. This is where the AI part actually started making sense to me. It was not just an AI button sitting somewhere in the product. Harness was actually looking at my codebase and using that information to put together the pipeline. I was not manually deciding which build image to use, what build command I needed, how the test step should look, or how the basic CI stage should be structured. Harness was putting that together for me.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffec1vvfqqpp12pwx345u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffec1vvfqqpp12pwx345u.png" alt="Generating pipeline YAML via Harness AI" width="799" height="459"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Within a short while, the pipeline was created. Harness asked whether I wanted to start my first build. Of course I clicked &lt;strong&gt;Let's go&lt;/strong&gt;. You generated the pipeline for me, now let's see if it actually works.&lt;/p&gt;

&lt;h2&gt;
  
  
  The first run actually passed
&lt;/h2&gt;

&lt;p&gt;The pipeline started running immediately.&lt;/p&gt;

&lt;p&gt;I could see Harness going through the generated steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Initialize&lt;/li&gt;
&lt;li&gt;Clone the codebase&lt;/li&gt;
&lt;li&gt;Set up Build Intelligence&lt;/li&gt;
&lt;li&gt;Restore the cache&lt;/li&gt;
&lt;li&gt;Build&lt;/li&gt;
&lt;li&gt;Test&lt;/li&gt;
&lt;li&gt;Save the cache&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And then everything turned green.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9t5w5lbso51r8w6lcp8q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9t5w5lbso51r8w6lcp8q.png" alt="First run success, cache save" width="800" height="683"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The full run took 2 minutes and 34 seconds. 42 tests passed.&lt;/p&gt;

&lt;p&gt;That was probably the point where the whole onboarding flow clicked for me.&lt;/p&gt;

&lt;p&gt;I had essentially given Harness access to the repository, selected the codebase, let it analyse what was inside, and then ran the pipeline it created.&lt;/p&gt;

&lt;p&gt;And the first run passed.&lt;/p&gt;

&lt;p&gt;No manual pipeline assembly before getting to that point.&lt;/p&gt;

&lt;p&gt;That is a solid starting point, but I wanted to make the pipeline more real.&lt;/p&gt;

&lt;p&gt;Building and testing is useful, but I also wanted the image to actually go somewhere.&lt;/p&gt;

&lt;p&gt;So next, I decided to build and push it to DockerHub.&lt;/p&gt;

&lt;h2&gt;
  
  
  Adding Build and Push to Docker
&lt;/h2&gt;

&lt;p&gt;Inside the pipeline editor, I clicked the &lt;strong&gt;+&lt;/strong&gt; button to add another step.&lt;/p&gt;

&lt;p&gt;I searched for Docker.&lt;/p&gt;

&lt;p&gt;Harness immediately showed several Docker-related options, including &lt;strong&gt;Build and Push Docker&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5icrhyequn86vq5766m3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5icrhyequn86vq5766m3.png" alt="Add step, searching for Docker" width="799" height="461"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I selected it and, once again, Harness gave me the option to use an existing connector or create a new one.&lt;/p&gt;

&lt;p&gt;I created a new Docker connector.&lt;/p&gt;

&lt;p&gt;For DockerHub, the connector setup was straightforward: select DockerHub as the provider, enter the credentials, done.&lt;/p&gt;

&lt;p&gt;Once the connector was available, I selected it in the Build and Push Docker step.&lt;/p&gt;

&lt;p&gt;Then I configured the repository I wanted to push to.&lt;/p&gt;

&lt;p&gt;For the image tags, I used the pipeline sequence ID and also added &lt;code&gt;latest&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;I also kept Docker layer caching enabled.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8886sjq03fvarnjukcsp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8886sjq03fvarnjukcsp.png" alt="Build and Push Docker configuration" width="800" height="694"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Build, test, push
&lt;/h2&gt;

&lt;p&gt;I ran the pipeline again. This time it went through the original CI steps and then continued into the Docker push step.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Clone → Build → Test → Build and Push Docker → Save Cache&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fq88bjnpibufcvwkky9xa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fq88bjnpibufcvwkky9xa.png" alt="Full pipeline with Docker push step" width="800" height="457"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The pipeline passed, but I wanted to confirm outside of Harness. I opened DockerHub and the newly pushed image was there, including the &lt;code&gt;latest&lt;/code&gt; tag and the tag from the pipeline run.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzl30hqygiheotcdm50mw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzl30hqygiheotcdm50mw.png" alt="DockerHub repository showing pushed tags" width="800" height="294"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This time the full pipeline, including the Docker push, finished in 3 minutes and 6 seconds. The Docker step itself took 47 seconds.&lt;/p&gt;

&lt;p&gt;So the end state: code in GitHub, a CI pipeline that builds and tests it, and the resulting image pushed to DockerHub. One extra step on top of what Harness generated.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I configured vs what Harness handled
&lt;/h2&gt;

&lt;p&gt;Here is the split:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;I did&lt;/th&gt;
&lt;th&gt;Harness did&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Connected my GitHub account (OAuth)&lt;/td&gt;
&lt;td&gt;Detected Java + Maven from the repo&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Selected the repository&lt;/td&gt;
&lt;td&gt;Chose the container image (&lt;code&gt;maven:3.9-eclipse-temurin-17&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Clicked "Let's go"&lt;/td&gt;
&lt;td&gt;Generated the build and test steps&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Added the Docker push step&lt;/td&gt;
&lt;td&gt;Configured Cache Intelligence and Build Intelligence&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Created the DockerHub connector&lt;/td&gt;
&lt;td&gt;Set up test reporting with JUnit XML paths&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Set the image tags&lt;/td&gt;
&lt;td&gt;Structured the stage, clone, and runtime config&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Six decisions on my side. Six things I did not have to figure out.&lt;/p&gt;

&lt;p&gt;If I had written this pipeline from scratch, I would have needed to know which Maven image version to use, how Harness structures its YAML stages, where to put the cache config, and how to format the test report paths. Instead, I started with a working baseline and added the Docker push step on top.&lt;/p&gt;

&lt;p&gt;That difference matters. Starting with a blank pipeline means you have to understand the product before you can get value from it. Here, the order was reversed: get something running, then customise.&lt;/p&gt;

&lt;p&gt;And if your team is using AI coding assistants, every one of those AI-generated PRs still needs to pass through a pipeline like this before it ships. The faster you can stand one up, the less it bottlenecks the rest of the delivery chain.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.harness.io/blog/test-intelligence" rel="noopener noreferrer"&gt;Test Intelligence&lt;/a&gt; can skip tests that are not affected by your code change, and &lt;a href="https://www.harness.io/blog/cache-intelligence" rel="noopener noreferrer"&gt;Cache Intelligence&lt;/a&gt; handles dependency caching automatically (yours is already enabled in the generated pipeline). If you want to see how those features perform at scale, &lt;a href="https://www.harness.io/blog/fastest-ci-tool" rel="noopener noreferrer"&gt;Harness CI benchmarks&lt;/a&gt; show up to 4x faster builds with both enabled. I will walk through both of those in a follow-up post. The &lt;a href="https://developer.harness.io/docs/continuous-integration/use-ci/build-and-upload-artifacts/build-and-push/build-and-push-to-docker-registry" rel="noopener noreferrer"&gt;Harness CI documentation&lt;/a&gt; covers advanced Docker push options including multi-architecture builds and custom Dockerfile paths.&lt;/p&gt;




&lt;p&gt;Here is the pipeline YAML that Harness generated and that I extended with the Docker push step:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;pipeline&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;pipeline_shibam17_ci_intelligence_lab_build_cf9f&lt;/span&gt;
  &lt;span class="na"&gt;clone&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;enabled&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
  &lt;span class="na"&gt;stages&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;build_and_test&lt;/span&gt;
      &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;build-and-test&lt;/span&gt;
      &lt;span class="na"&gt;runtime&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;cloud&lt;/span&gt;
      &lt;span class="na"&gt;clone&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;enabled&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
      &lt;span class="na"&gt;cache&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;enabled&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
      &lt;span class="na"&gt;build-intelligence&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;enabled&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
      &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;build&lt;/span&gt;
          &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Build&lt;/span&gt;
          &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;container&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
              &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;maven:3.9-eclipse-temurin-17&lt;/span&gt;
            &lt;span class="na"&gt;shell&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;bash&lt;/span&gt;
            &lt;span class="na"&gt;script&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;mvn -B -Dmaven.repo.local=/harness/.m2/repository -DskipTests clean compile&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;test&lt;/span&gt;
          &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Test&lt;/span&gt;
          &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;container&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
              &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;maven:3.9-eclipse-temurin-17&lt;/span&gt;
            &lt;span class="na"&gt;shell&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;bash&lt;/span&gt;
            &lt;span class="na"&gt;script&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;mvn -B -Dmaven.repo.local=/harness/.m2/repository test&lt;/span&gt;
            &lt;span class="na"&gt;report&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
              &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;junit&lt;/span&gt;
              &lt;span class="na"&gt;paths&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;target/surefire-reports/*.xml&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;docker-push-sdrepo&lt;/span&gt;
          &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;docker_push_sdrepo&lt;/span&gt;
          &lt;span class="na"&gt;build&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;buildAndPushToDocker&lt;/span&gt;
            &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
              &lt;span class="na"&gt;connector&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;shibam_dockerhub&lt;/span&gt;
              &lt;span class="na"&gt;repo&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;shibam17/sd-devrel-easybuggy&lt;/span&gt;
              &lt;span class="na"&gt;tags&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;${{ pipeline.sequenceId }}&lt;/span&gt;
                &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;latest&lt;/span&gt;
              &lt;span class="na"&gt;caching&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Fork the &lt;a href="https://github.com/shibam17/ci-intelligence-lab" rel="noopener noreferrer"&gt;ci-intelligence-lab&lt;/a&gt; repository and try the onboarding flow against it, or point Harness at your own repo and see what it generates. Budget about ten minutes for the full setup: creating connectors, letting Harness generate the pipeline, and running your first build. The &lt;a href="https://developer.harness.io/docs/continuous-integration/get-started/onboarding-guide/" rel="noopener noreferrer"&gt;Harness CI getting started guide&lt;/a&gt; covers the full configuration reference.&lt;/p&gt;




&lt;h2&gt;
  
  
  Frequently asked questions
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;How does Harness know what build steps to generate?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Harness clones your repository, indexes the files, and detects the languages and build tools present. It uses that information to select the right container image, build commands, and test reporting configuration. For a Java Maven project, it picked &lt;code&gt;maven:3.9-eclipse-temurin-17&lt;/code&gt; and configured &lt;code&gt;mvn&lt;/code&gt; commands automatically.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Do I need a Dockerfile in my repository for the Docker push step?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Yes. The Build and Push Docker step builds the image from the Dockerfile in your repository root (or a path you specify). If your project does not have a Dockerfile yet, add one before enabling the push step.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can I use a registry other than DockerHub?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Yes. Harness supports Docker Hub, AWS ECR, Google GAR, Azure ACR, and Harness Artifact Registry. The connector setup is the same: create a connector for your provider and reference it in the Build and Push step.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What does Build Intelligence do in the generated pipeline?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Build Intelligence caches compiled build outputs. If the inputs for a module have not changed since the last run, Harness retrieves the previously compiled output instead of recompiling. This stacks on top of Cache Intelligence, which handles dependency downloads.&lt;/p&gt;




</description>
      <category>automation</category>
      <category>cicd</category>
      <category>devops</category>
      <category>docker</category>
    </item>
    <item>
      <title>Intent-Driven Assertions are Redefining How We Test Software</title>
      <dc:creator>SHIBAM</dc:creator>
      <pubDate>Thu, 06 Nov 2025 14:00:00 +0000</pubDate>
      <link>https://dev.to/shib_itsme/intent-driven-assertions-are-redefining-how-we-test-software-5400</link>
      <guid>https://dev.to/shib_itsme/intent-driven-assertions-are-redefining-how-we-test-software-5400</guid>
      <description>&lt;p&gt;Picture this: your QA team just rolled out a comprehensive new test suite; polished, precise, and built to catch every bug. Yet soon after, half the tests fail. Not because the code is broken, but because the design team shifted a button slightly. And even when the tests pass, users still find issues in production. A familiar story?&lt;/p&gt;

&lt;p&gt;End-to-end testing was meant to bridge that gap. This is how teams verify that complete user workflows actually work the way users expect them to. It's testing from the user's perspective; can they log in, complete a transaction, see their data?​&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Real Problem Isn't Maintenance. It's Misplaced Focus.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Maintaining traditional UI tests often feels endless. Hard-coded selectors break with every UI tweak, which happens nearly every sprint. A clean, well-structured test suite quickly turns into a maintenance marathon. Then come the flaky tests:  scripts that fail because a button isn’t visible yet or an overlay momentarily blocks it. The application might work perfectly, yet the test still fails, creating unpredictable false alarms and eroding trust in test results.&lt;/p&gt;

&lt;p&gt;The real issue lies in what’s being validated. Conventional assertions often focus on technical details- like whether a &lt;code&gt;div.class-name-xy&lt;/code&gt; exists or a CSS selector returns a value, rather than confirming that the user experience actually works.&lt;/p&gt;

&lt;p&gt;The problem with this approach is that it tests &lt;strong&gt;&lt;em&gt;how&lt;/em&gt;&lt;/strong&gt; something is implemented, not &lt;em&gt;&lt;strong&gt;whether&lt;/strong&gt;&lt;/em&gt; it works for the user. As a result, a test might pass even when the actual experience is broken, giving teams a false sense of confidence and wasting valuable debugging time.&lt;/p&gt;

&lt;p&gt;Some common solutions attempt to bridge that gap. Teams experiment with smarter locators, dynamic waits, self-healing scripts, or visual validation tools to reduce flakiness. Others lean on behavior-driven frameworks such as &lt;em&gt;Cucumber&lt;/em&gt;, &lt;em&gt;SpecFlow&lt;/em&gt;, or &lt;em&gt;Gauge&lt;/em&gt; to describe tests in plain, human-readable language. These approaches make progress, but they still rely on predefined selectors and rigid code structures that don’t always adapt when the UI or business logic changes.&lt;/p&gt;

&lt;p&gt;What’s really needed is a shift in perspective : one that focuses on &lt;em&gt;&lt;strong&gt;intent&lt;/strong&gt;&lt;/em&gt; rather than &lt;strong&gt;&lt;em&gt;implementation&lt;/em&gt;&lt;/strong&gt;. Testing should understand what you’re trying to validate, not just how the test is written.&lt;/p&gt;

&lt;p&gt;That’s exactly where Harness builds on these foundations. By combining AI understanding with intent-driven, natural language assertions, it goes beyond behavior-driven testing, actually turning human intent directly into executable validation.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Are Intent-Driven Natural Language Assertions?
&lt;/h2&gt;

&lt;p&gt;‍&lt;/p&gt;

&lt;p&gt;Harness AI Test Automation reimagines testing from the ground up. Instead of writing brittle scripts tied to UI selectors, it allows testers to describe what they actually want to verify, in plain, human language.&lt;/p&gt;

&lt;p&gt;Think of it as moving from technical validation to intent validation. Rather than writing code to confirm whether a button exists, you can simply ask:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;“Did the login succeed?”&lt;/em&gt;&lt;/strong&gt; or &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;“Is the latest transaction a deposit?”&lt;/em&gt;&lt;/strong&gt;. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Behind the scenes, Harness AI interprets these statements dynamically, understanding both the context and the intent of the test. It evaluates the live state of the application to ensure assertions reflect real business logic, not just surface-level UI details.&lt;/p&gt;

&lt;p&gt;This shift is more than a technical improvement; it’s a cultural one. It &lt;strong&gt;&lt;em&gt;democratizes testing&lt;/em&gt;&lt;/strong&gt;, empowering anyone on the team, from developers to product managers, to contribute meaningful and resilient checks. The result is faster test creation, easier maintenance, and validations that truly align with what users care about: a working, seamless experience.&lt;/p&gt;

&lt;p&gt;Harness describes this as "Intent-based Testing", where tests express what matters rather than how to check it, enabling developers and QA teams to focus on outcomes, not implementation details.&lt;/p&gt;

&lt;h2&gt;
  
  
  Harness AI Test Automation Solving Traditional Testing Issues
&lt;/h2&gt;

&lt;p&gt;‍&lt;/p&gt;

&lt;p&gt;Traditional automation for end-to-end testing/UI testing often breaks when UIs change, leading to &lt;strong&gt;high maintenance overhead&lt;/strong&gt; and flaky results. Playwright, Selenium, or Cypress scripts frequently fail because they depend on exact element paths or hardcoded data, which makes CI/CD pipelines brittle.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Industry statistics reveal that 70-80% of organizations still rely heavily on manual testing methods, creating significant bottlenecks in otherwise automated DevOps toolchains. &lt;a href="https://itbrief.in/story/harness-launches-ai-test-automation-for-faster-devops-testing" rel="noopener noreferrer"&gt;Source&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Harness AI Test Automation addresses these issues by leveraging &lt;strong&gt;AI-powered assertions&lt;/strong&gt; that dynamically adapt to the live page or API context. Benefits include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reduced flakiness: Tests automatically handle UI changes without manual intervention&lt;/li&gt;
&lt;li&gt;Lower maintenance costs: AI-generated selectors eliminate constant rewriting of selectors or brittle logic&lt;/li&gt;
&lt;li&gt;Focus on business logic: Teams concentrate on verifying user-centric outcomes rather than technical details&lt;/li&gt;
&lt;li&gt;Faster and No-Code test creation: Organizations report 10x faster test creation and the ability to cut test creation time by up to 90%&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Organizations using AI Test Automation see up to 70% less maintenance effort and significant improvements in release velocity.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  How Harness AI Test Understands and Validates Your Intent
&lt;/h2&gt;

&lt;p&gt;‍&lt;/p&gt;

&lt;p&gt;Harness uses large language models (LLMs) optimized for testing contexts. The AI:&lt;/p&gt;

&lt;p&gt;‍&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Understands Your Intent:&lt;/strong&gt; The AI parses your natural language assertion to grasp what you're trying to verify, for example, “Did the login succeed?" or “Is the button visible after submission?"&lt;/li&gt;
&lt;li&gt;**Analyzes Real Application Context:  **It evaluates the live state of your application by analyzing the HTML DOM and the rendered viewport. This provides the AI with a comprehensive understanding of the app's current behavior, structure, and visual presentation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Maintains Context History:&lt;/strong&gt; It keeps a record of previous steps and results, so the AI can use historical context when validating new assertions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Learns from Past Runs:&lt;/strong&gt; Outputs from prior test executions are stored and referenced, allowing future assertions to become more accurate and context-aware over time.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Provides Detailed Reasoning:&lt;/strong&gt; Instead of just marking a test as “pass” or “fail,” the AI explains why, offering insights backed by both visual and structural evidence.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Together, these layers of intelligence make Harness AI Assertions not just smarter but contextually aware, giving you a more human-like and reliable testing experience every time you run your pipeline.&lt;/p&gt;

&lt;p&gt;This context-aware approach identifies subtle bugs that are often missed by traditional tests and reduces the risks associated with AI “hallucinations.” Hybrid verification techniques cross-check outputs against real-time data, ensuring reliability.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;For example, when testing a dynamic transaction table, an assertion like &lt;strong&gt;“Verify the latest transaction is a deposit over $500”&lt;/strong&gt; will succeed even if the table order changes or new rows are added. Harness adapts automatically without requiring code changes&lt;br&gt;
‍&lt;a href="https://www.harness.io/blog/genai-to-test-genai?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;Harness Blog on AI Test Automation&lt;/a&gt;.&lt;br&gt;
‍&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Crucially, we are not asking the AI to generate code (although for some math questions it might) and then never consult it again; we actually ask the AI this question with the context of the webpage every time you run the test.&lt;/p&gt;

&lt;p&gt;‍&lt;/p&gt;

&lt;p&gt;Successful or not, the assertion will also give you back reasoning as to why it is true:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fshtxpz2tgvk9duvu0taz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fshtxpz2tgvk9duvu0taz.png" alt=" " width="800" height="226"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fan71so9t59mev9dm4jcl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fan71so9t59mev9dm4jcl.png" alt=" " width="800" height="409"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  How Teams Use Harness AI Assertions
&lt;/h3&gt;

&lt;p&gt;‍&lt;br&gt;
Organizations across fintech, SaaS, and e-commerce are using Harness AI to simplify complex testing scenarios:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Financial services:&lt;/strong&gt; Validating transaction tables and workflows with natural language assertions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SaaS platforms:&lt;/strong&gt; Checking onboarding flows and dynamic permission rules.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;E-commerce:&lt;/strong&gt; Confirming discount logic and inventory updates dynamically.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Healthcare:&lt;/strong&gt; Transforming test creation from days to minutes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Even less-technical users can author and maintain robust tests. Auto-suggested assertions and natural language prompts &lt;strong&gt;accelerate collaboration across QA, developers, and product teams&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqncjcvgjvez877h1vr5q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqncjcvgjvez877h1vr5q.png" alt=" " width="800" height="151"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff4tp51hnxb3xkuhfwejr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff4tp51hnxb3xkuhfwejr.png" alt=" " width="800" height="419"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can also perform assertions based on parameters.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk8sgl8flwrbig4f6fm6u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk8sgl8flwrbig4f6fm6u.png" alt=" " width="800" height="428"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;An early adopter reported that after integrating Harness AI Assertions, &lt;strong&gt;release verification time dropped by more than 50%&lt;/strong&gt;, freeing QA teams to focus on higher-value work. &lt;a href="https://www.devopsdigest.com/harness-ai-test-automation-released" rel="noopener noreferrer"&gt;DevOpsDigest coverage&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Transforming QA with Harness AI: Faster, Smarter, Reliable
&lt;/h2&gt;

&lt;p&gt;‍&lt;/p&gt;

&lt;p&gt;Harness AI Test Automation empowers teams to move faster with confidence. Key benefits include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Faster test creation:&lt;/strong&gt; Write robust assertions in minutes rather than hours.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reduced test maintenance:&lt;/strong&gt; Fewer broken scripts and less manual debugging.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Improved collaboration:&lt;/strong&gt; Align developers, testers, and product managers around shared intent.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Future-ready QA:&lt;/strong&gt; Supports modern DevOps practices and continuous delivery pipelines.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Harness AI Test Automation turns traditional QA challenges into &lt;strong&gt;&lt;em&gt;opportunities for smarter, more reliable automation,&lt;/em&gt;&lt;/strong&gt; enabling organizations to release software faster while maintaining high quality.&lt;/p&gt;

&lt;p&gt;Harness AI is to test what intelligent assistants are to coding: it allows humans to focus on strategy, intent, and value, while the AI handles repetitive validation (&lt;a href="https://www.harness.io/products/ai-test-automation?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;Harness AI Test Automation&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;‍&lt;/p&gt;

&lt;p&gt;Harness AI Test Automation represents &lt;strong&gt;a paradigm shift&lt;/strong&gt; in testing. By combining &lt;strong&gt;intent-driven natural language assertions, AI-powered context awareness, and self-adapting validation&lt;/strong&gt;, it empowers teams to deliver reliable software faster and with less friction.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>testing</category>
      <category>nlp</category>
      <category>harness</category>
    </item>
    <item>
      <title>Introduction to Alibaba Cloud RDS (Relational Database Service) Management</title>
      <dc:creator>SHIBAM</dc:creator>
      <pubDate>Sun, 10 Aug 2025 06:51:31 +0000</pubDate>
      <link>https://dev.to/shib_itsme/introduction-to-alibaba-cloud-rds-relational-database-service-management-29g4</link>
      <guid>https://dev.to/shib_itsme/introduction-to-alibaba-cloud-rds-relational-database-service-management-29g4</guid>
      <description>&lt;p&gt;&lt;strong&gt;Introduction to Alibaba Cloud RDS (Relational Database Service) Management&lt;/strong&gt;&lt;br&gt;
In today’s fast-paced digital landscape, efficient database management is vital for businesses and developers alike. Alibaba Cloud’s Relational Database Service (RDS) offers a robust solution for hosting, managing, and scaling databases without the burden of infrastructure maintenance. Whether you're a seasoned developer or a business professional exploring cloud computing for the first time, this guide breaks down Alibaba Cloud RDS in detail, helping you navigate its capabilities and unlock its full potential.&lt;/p&gt;

&lt;p&gt;What is Alibaba Cloud RDS?&lt;br&gt;
Alibaba Cloud RDS is a fully managed database service that supports multiple database engines, including MySQL, PostgreSQL, SQL Server, MariaDB, and more. It simplifies database management by automating routine tasks such as backups, scaling, and maintenance, allowing businesses and developers to focus on their core applications rather than the complexities of database infrastructure.&lt;br&gt;
Key Advantages of RDS:&lt;br&gt;
Ease of Use: Setting up and managing a database is straightforward through the intuitive Alibaba Cloud console.&lt;br&gt;
Scalability: RDS allows you to scale database resources up or down depending on workload demands.&lt;br&gt;
Reliability: Features like automated backups, disaster recovery, and multi-zone deployments ensure your database is always available.&lt;br&gt;
Security: RDS includes built-in security features like network isolation, access control, and data encryption to safeguard your information.&lt;br&gt;
Example: Consider a growing e-commerce business during a festive sale. Traffic surges can overwhelm on-premise database setups, leading to slow loading times or crashes. With Alibaba Cloud RDS, the database automatically scales to handle the increased load, ensuring a smooth shopping experience for customers.&lt;/p&gt;

&lt;p&gt;Setting Up an RDS Instance: Step-by-Step&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Creating a Database Instance
To get started with RDS:
Log in to the Alibaba Cloud console.
Navigate to the RDS Dashboard and click "Create Instance."
Select a database engine such as MySQL or PostgreSQL.
Configure instance type, storage size, and region based on your requirements.
Set up network and security options, including Virtual Private Cloud (VPC) and security groups.
Once configured, click Create to provision your database instance.
Tip for Non-Devs: Think of this process as ordering a customized coffee. You choose the size (storage), flavor (database engine), and toppings (security settings) before hitting "order."&lt;/li&gt;
&lt;li&gt;Connecting to Your Database
After the instance is ready:
Obtain the connection string from the RDS console.
Use tools like DBeaver, phpMyAdmin, or your application’s database library to connect.
For developers, connection strings can be integrated into application configuration files, while non-technical users can use graphical clients for data management.&lt;/li&gt;
&lt;li&gt;Managing and Monitoring
RDS simplifies ongoing database management:
Backups: Automated daily backups are enabled by default, with the ability to configure custom backup schedules.
Performance Monitoring: Access real-time and historical performance metrics such as query latency, CPU utilization, and memory usage.
Scaling Resources: Easily increase storage or switch to a higher instance type during peak traffic periods.
Real-World Example: A blogging platform might observe increased traffic when a post goes viral. With RDS, you can add more resources instantly to handle the demand, ensuring fast page loads for readers.
Key Features of Alibaba Cloud RDS&lt;/li&gt;
&lt;li&gt;High Availability
RDS supports multi-zone deployment, ensuring data remains accessible even during outages in a specific data center. For critical applications, features like read replicas and failover capabilities guarantee minimal downtime.&lt;/li&gt;
&lt;li&gt;Scalability
RDS makes scaling effortless:
Vertical Scaling: Increase instance size (CPU, RAM) for better performance.
Horizontal Scaling: Add read replicas to distribute the workload.&lt;/li&gt;
&lt;li&gt;Enhanced Security
RDS provides comprehensive security features:
Data Encryption: Secure sensitive data both at rest and in transit.
Access Control: Implement granular permissions using built-in access management tools.
Network Isolation: Use VPCs to restrict external access.
Best Practices for Using Alibaba Cloud RDS
Optimize Database Performance
Efficient query design is crucial for minimizing resource usage and improving response times. Use indexing, caching, and optimized SQL statements to enhance performance.
Developer Quote: "Database optimization is like organizing a library. With a proper index, finding a book is quick and effortless."
Backup and Disaster Recovery
Ensure your data is always recoverable:
Schedule regular backups through the RDS console.
Test restoration processes periodically to verify backup integrity.
Monitor and Adjust
Use Alibaba Cloud’s CloudMonitor to track resource utilization and set alarms for key metrics such as CPU load and query execution time.
Who Can Benefit from RDS?
Developers: Simplify database management with automation and focus on application development.
Small Businesses: Enjoy enterprise-grade database solutions without needing a dedicated IT team.
Enterprises: Leverage RDS’s scalability and reliability to handle mission-critical workloads.
Success Stories: How Businesses Use RDS
Example 1: Startups Scaling Quickly
A SaaS startup utilized RDS to manage customer data as they onboarded thousands of users. By enabling auto-scaling, they maintained high performance during rapid user growth.
Example 2: E-Commerce Websites
An online retail platform handled Black Friday traffic by deploying read replicas to balance the load across multiple servers, ensuring smooth operations.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Conclusion: Why Choose Alibaba Cloud RDS?&lt;br&gt;
Alibaba Cloud RDS stands out as a reliable, scalable, and secure solution for database management. Its automated features reduce the overhead of routine tasks, enabling you to focus on innovation and growth.&lt;br&gt;
Whether you’re running a small blog, a growing startup, or a global enterprise, RDS empowers you with the tools needed to handle complex database needs effortlessly.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Scaling Web Applications with Alibaba Cloud Auto Scaling</title>
      <dc:creator>SHIBAM</dc:creator>
      <pubDate>Sun, 10 Aug 2025 06:50:37 +0000</pubDate>
      <link>https://dev.to/shib_itsme/scaling-web-applications-with-alibaba-cloud-auto-scaling-3ibd</link>
      <guid>https://dev.to/shib_itsme/scaling-web-applications-with-alibaba-cloud-auto-scaling-3ibd</guid>
      <description>&lt;p&gt;&lt;strong&gt;Scaling Web Applications with Alibaba Cloud Auto Scaling&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In today’s fast-paced digital world, web applications need to be reliable, responsive, and scalable. A sudden spike in website traffic—a viral post, a sales event, or even a new product launch—can overwhelm your resources if you're not prepared. This is where Alibaba Cloud Auto Scaling comes in, offering an automated, intelligent way to manage your infrastructure. Whether you’re a developer delving into the intricacies of application performance or a non-technical professional exploring efficient solutions, this comprehensive guide breaks it all down.&lt;/p&gt;

&lt;p&gt;What is Auto Scaling, and Why Does It Matter?&lt;br&gt;
Imagine you own a coffee shop. During the morning rush, you need more baristas to serve the crowd, while in the afternoon lull, you may need just one. Running your web application follows a similar principle. Auto Scaling dynamically adjusts your cloud resources—like virtual machines, databases, and load balancers—based on the traffic load, ensuring your application performs consistently.&lt;br&gt;
Real-World Perspective&lt;br&gt;
As one Alibaba Cloud user shared on their forum:&lt;br&gt;
 "Before implementing Auto Scaling, we often struggled with downtime during high-traffic periods, particularly during seasonal campaigns. With Auto Scaling, our website stayed fast, responsive, and most importantly, available."&lt;br&gt;
For both developers and non-developers, Auto Scaling removes the headache of manual scaling and optimizes both performance and cost.&lt;/p&gt;

&lt;p&gt;The Basics: How Alibaba Cloud Auto Scaling Works&lt;br&gt;
Alibaba Cloud Auto Scaling monitors specific metrics to determine whether your resources need adjustment. These include CPU utilization, memory usage, and custom metrics like application-specific KPIs. Depending on these metrics, Auto Scaling either:&lt;br&gt;
Scales Up: Adds more resources to accommodate increased traffic.&lt;br&gt;
Scales Down: Removes excess resources during low traffic to save money.&lt;br&gt;
For Developers:&lt;br&gt;
You can define complex scaling policies using predefined thresholds. For instance:&lt;br&gt;
Scale up by adding one ECS instance if CPU utilization exceeds 75% for 5 minutes.&lt;br&gt;
Scale down by removing an instance if traffic drops below 10 requests per second.&lt;br&gt;
For Non-Developers:&lt;br&gt;
Think of it as having a thermostat for your website. It automatically adjusts the heat (resources) based on the room’s temperature (traffic levels), so everything stays comfortable without manual tweaks.&lt;br&gt;
A Day in the Life of Auto Scaling: Practical Scenarios&lt;br&gt;
Let’s look at how Auto Scaling works in real-world scenarios:&lt;br&gt;
Scenario 1: E-commerce Store&lt;br&gt;
During a Black Friday sale, an online store experiences a tenfold increase in visitors within minutes. Without Auto Scaling, servers crash, leading to lost sales and frustrated customers. With Alibaba Cloud Auto Scaling, the system detects the surge and spins up additional ECS instances within seconds. Once the sale ends, the resources are scaled down to avoid unnecessary costs.&lt;br&gt;
Scenario 2: Educational Platform&lt;br&gt;
A learning platform hosts live online classes. During live sessions, user activity peaks, requiring more resources for video streaming. Auto Scaling ensures a smooth experience by allocating extra capacity during classes and scaling back afterward.&lt;br&gt;
Scenario 3: Startup Website&lt;br&gt;
A new startup launches its product. On launch day, they see a sudden increase in traffic driven by social media buzz. Auto Scaling ensures their website doesn’t buckle under the unexpected load, providing a seamless experience to visitors.&lt;br&gt;
Beyond Scaling: The Benefits of Auto Scaling&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Enhanced User Experience
"Users don’t care about the backend; they care about speed," says Ali Akbar, a cloud computing enthusiast. Auto Scaling ensures minimal latency and a consistent experience, even during heavy traffic.&lt;/li&gt;
&lt;li&gt;Cost Optimization
Alibaba Cloud Auto Scaling uses a pay-as-you-go model, meaning you pay only for what you use. During low-traffic periods, you’re not paying for idle resources, which can significantly cut costs for startups and enterprises alike.&lt;/li&gt;
&lt;li&gt;Improved Reliability
Downtime can tarnish a brand's reputation. Auto Scaling ensures that applications remain available, even when traffic spikes unexpectedly. Alibaba Cloud’s robust monitoring tools provide insights into scaling decisions, helping you identify and prevent potential bottlenecks.&lt;/li&gt;
&lt;li&gt;Time Savings
Scaling manually is not only tedious but error-prone. Auto Scaling automates resource management, freeing up time for developers to focus on innovation rather than infrastructure.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Getting Started: Configuring Auto Scaling on Alibaba Cloud&lt;br&gt;
Setting up Auto Scaling involves a few straightforward steps:&lt;br&gt;
Define an Auto Scaling Group&lt;br&gt;
 An Auto Scaling group is a collection of ECS instances with similar configurations. This acts as the foundation for scaling operations.&lt;/p&gt;

&lt;p&gt;Set Scaling Policies&lt;br&gt;
 Decide when and how to scale your resources. You can use:&lt;/p&gt;

&lt;p&gt;Dynamic Scaling Policies: Triggered by real-time metrics (e.g., CPU utilization).&lt;br&gt;
Scheduled Scaling Policies: Ideal for predictable traffic patterns (e.g., daily peak hours).&lt;br&gt;
Monitor Metrics&lt;br&gt;
 Alibaba Cloud offers a powerful monitoring service that integrates seamlessly with Auto Scaling. It tracks metrics and sends alerts to ensure your scaling policies are effective.&lt;/p&gt;

&lt;p&gt;Test and Optimize&lt;br&gt;
 Run stress tests to validate your configurations. Adjust thresholds and policies based on performance data.&lt;/p&gt;

&lt;p&gt;Advanced Features of Alibaba Cloud Auto Scaling&lt;br&gt;
Predictive Scaling&lt;br&gt;
Alibaba Cloud uses AI-powered predictive scaling to anticipate future traffic based on historical data. For instance, if your traffic spikes every Friday evening, the system preemptively scales up resources before the surge begins.&lt;br&gt;
Integration with Other Services&lt;br&gt;
Auto Scaling works hand-in-hand with other Alibaba Cloud services like:&lt;br&gt;
Elastic Load Balancer (ELB): Distributes traffic across multiple instances for optimal performance.&lt;br&gt;
Object Storage Service (OSS): Ensures your static content (images, videos) loads quickly.&lt;br&gt;
Function Compute: Supports serverless operations by scaling functions on demand.&lt;br&gt;
Overcoming Challenges with Auto Scaling&lt;br&gt;
While Auto Scaling is incredibly effective, it’s not without challenges:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Configuration Complexity
Setting thresholds that balance performance and cost can be tricky. A misconfigured policy could lead to over-scaling or under-scaling.
Solution: Alibaba Cloud’s monitoring tools provide insights to fine-tune your configurations.&lt;/li&gt;
&lt;li&gt;Cold Start Issues
When scaling up, newly added instances take time to initialize, which may temporarily affect performance.
Solution: Use Alibaba Cloud’s Warm-up Mode, which ensures new instances are ready before being added to the load balancer.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The Bigger Picture: Why Auto Scaling is Essential&lt;br&gt;
The digital world is unpredictable. Today, a viral tweet can bring thousands of visitors to your site within minutes. Without a robust scaling strategy, your application risks poor performance or complete downtime. Alibaba Cloud Auto Scaling provides an intelligent, automated way to stay ahead of these challenges.&lt;br&gt;
As cloud computing expert Jeff Barr aptly put it:&lt;br&gt;
 "Scaling isn’t just about adding resources; it’s about delivering consistent, high-quality user experiences at scale."&lt;br&gt;
Conclusion&lt;br&gt;
Alibaba Cloud Auto Scaling isn’t just a tool—it’s a strategic asset for anyone running web applications. For developers, it’s about fine-tuning performance and optimizing resources. For non-developers, it’s a reliable way to ensure your site performs well without the need for constant manual adjustments.&lt;br&gt;
Key Takeaways:&lt;br&gt;
Auto Scaling ensures your application remains responsive and cost-effective.&lt;br&gt;
It adapts to traffic spikes in real-time, providing a seamless user experience.&lt;br&gt;
Advanced features like predictive scaling and integration with other Alibaba Cloud services enhance functionality.&lt;br&gt;
Ready to Scale?&lt;br&gt;
Start your journey with Alibaba Cloud Auto Scaling today. With a free trial and intuitive setup, there’s no better time to ensure your application is prepared for whatever the digital world throws at it.&lt;br&gt;
Visit the Alibaba Cloud Auto Scaling page for more details.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Skip the Pixel Pushing: Build Stunning UIs in DronaHQ with Figma + AI</title>
      <dc:creator>SHIBAM</dc:creator>
      <pubDate>Wed, 07 May 2025 07:00:00 +0000</pubDate>
      <link>https://dev.to/shib_itsme/skip-the-pixel-pushing-build-stunning-uis-in-dronahq-with-figma-ai-1a21</link>
      <guid>https://dev.to/shib_itsme/skip-the-pixel-pushing-build-stunning-uis-in-dronahq-with-figma-ai-1a21</guid>
      <description>&lt;p&gt;In today's fast-paced digital landscape, &lt;strong&gt;beautiful design&lt;/strong&gt; isn’t a luxury — it’s an expectation.  &lt;/p&gt;

&lt;p&gt;Customers expect seamless, visually striking apps that work flawlessly across devices.&lt;/p&gt;

&lt;p&gt;That's why we are incredibly excited to unveil a game-changing upgrade for the DronaHQ community:&lt;br&gt;&lt;br&gt;
Introducing the &lt;strong&gt;Figma Design Kit  —&lt;/strong&gt; a comprehensive, fully customizable design system designed to streamline the design-to-development process. Whether you're a UI/UX designer or a developer, this kit offers everything you need to build stunning, consistent, and high-quality user interfaces directly in Figma, ensuring that your designs are easily translated into DronaHQ applications.&lt;/p&gt;

&lt;p&gt;With this kit, you can maintain brand consistency, speed up your design workflow, and hand off your assets seamlessly to developers, all while focusing on creating beautiful and functional app interfaces.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxpv9agkd092sc6tzobm3.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxpv9agkd092sc6tzobm3.jpeg" alt="Figma Design System" width="800" height="393"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🚀 &lt;strong&gt;No more struggling with design translations. No more brand mismatches. No more waiting for assets.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This guide will take you through the complete workflow, best practices, and powerful advanced options to bring your creativity into the real world.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;What’s Inside the DronaHQ Figma Design Kit?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;👉 &lt;a href="https://www.figma.com/community/file/1493571947316588027" rel="noopener noreferrer"&gt;&lt;strong&gt;Access the Figma Kit Here&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The DronaHQ Figma Design Kit is a fully customizable design system.&lt;br&gt;&lt;br&gt;
 You can adjust it as per your project needs or brand requirements. Let’s see what you get:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fill26oa2ox0d5octg7st.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fill26oa2ox0d5octg7st.png" alt="com" width="799" height="396"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🔹Component Library&lt;/p&gt;

&lt;p&gt;In the Component Library section of the DronaHQ Figma Design Kit, you’ll find various categories like Featured, Basic, Selection, Native, and more.&lt;/p&gt;

&lt;p&gt;This structure closely mirrors the component categories available inside the DronaHQ app builder, making it easy for developers and designers to work in a familiar environment when moving designs into live apps.&lt;/p&gt;

&lt;p&gt;🔹 Icon Pack&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Dozens of App-Ready Icons&lt;/strong&gt;, neatly categorized based on their hue like feather, dark,  green ,and also social icons.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why This is a Big Deal for Designers and Developers
&lt;/h2&gt;

&lt;p&gt;Historically, designers and developers have operated in separate silos. Designers build polished UI screens in Figma, and developers are left to manually interpret those designs inside app builders — often leading to time-consuming back-and-forth, mismatched layouts, and brand inconsistencies.&lt;/p&gt;

&lt;p&gt;The new DronaHQ Figma Design Kit changes that. Paired with the AI Upload flow, it brings clarity, speed, and precision to the design-to-development process. What used to take hours of component recreation can now be done in minutes, and with far greater accuracy.&lt;/p&gt;

&lt;p&gt;With this system in place, teams benefit from seamless handoffs. Developers don’t need to guess the spacing, colors, or component behavior. Everything is well-defined, customizable, and aligned with the components inside DronaHQ.&lt;/p&gt;

&lt;p&gt;It’s a huge step forward — not just for improving efficiency, but for enabling a more collaborative product development process where designers and developers speak the same visual language.&lt;/p&gt;

&lt;p&gt;But now?&lt;br&gt;&lt;br&gt;
 DronaHQ is &lt;strong&gt;breaking down the barriers&lt;/strong&gt; between world-class design and rapid app development.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Benefits:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Spend less time fiddling with colors and spacing.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Control every pixel right from Figma.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Give developers stunning UI templates out of the box.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Launch apps faster with fewer design bottlenecks.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It’s about creating a &lt;strong&gt;smoother, smarter&lt;/strong&gt;, and &lt;strong&gt;more exciting journey&lt;/strong&gt; — from idea to launch.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Developer-Specific Gains&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;By using a shared design system, developers experience less friction. Instead of fixing inconsistencies or revalidating layouts, they can plug in approved components and focus on the logic, data handling, and performance of the app.&lt;/p&gt;

&lt;p&gt;Developers can pull components once and reuse them across multiple apps or modules without revalidating layout behavior every time.&lt;/p&gt;

&lt;p&gt;And as apps grow, it’s easier to scale — because the system grows with you.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;The Hidden Cost of Not Using a Design System&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Without a structured design kit, teams often pay the price later. Inconsistent designs, inaccessible components, and duplicated effort create long-term maintenance burdens.&lt;/p&gt;

&lt;p&gt;Data shows that mature design systems can speed up UI delivery by 47%, reduce design debt by half, and save up to 30% of implementation time on each project.&lt;/p&gt;

&lt;p&gt;For developers, the impact is clear: fewer revisions, faster launches, and a more scalable UI architecture.&lt;/p&gt;




&lt;h2&gt;
  
  
  How It Works: Figma to DronaHQ
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnajnj7hl0p7ax2ot9glh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnajnj7hl0p7ax2ot9glh.png" alt="figma To  DronaHQ  Flow" width="800" height="354"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Upload designs into DronaHQ apps
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0mjsiji7ihi9kpz9naru.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0mjsiji7ihi9kpz9naru.gif" alt="walkthrough" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The process is refreshingly straightforward:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Customize the Figma Kit :&lt;/strong&gt; Access the official DronaHQ Design System here: &lt;a href="https://www.figma.com/community/file/1493571947316588027" rel="noopener noreferrer"&gt;Download Kit.&lt;/a&gt;   Modify components — adjust branding, sizing, colors, fonts.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Export Screens or Components&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Once your design is ready, export your frames or individual components directly from Figma in any image file format.  &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Upload via DronaHQ AI Chatbot&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Upload your exported files to the DronaHQ AI Chatbot. These files are instantly converted into assets that you can use directly inside your app builder.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  HTML/CSS Export to Control Designer
&lt;/h3&gt;

&lt;p&gt;While image uploads are fast and simple, for highly interactive UI needs (hover states, animations, dynamic forms), DronaHQ offers a powerful "Control Designer" feature.&lt;/p&gt;

&lt;p&gt;Using plugins like &lt;strong&gt;Anima&lt;/strong&gt; in Figma:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Export clean HTML/CSS code from your designs.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Import into DronaHQ Control Designer.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Build truly dynamic, responsive controls.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Refer to this blog for full instructions: &lt;a href="https://shibam-dhar.medium.com/import-your-figma-designs-directly-into-dronahq-d03b0c0706ba" rel="noopener noreferrer"&gt;How to Export Figma Designs to HTML Using Anima&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Choosing Between PNG Uploads and HTML/CSS Exports
&lt;/h2&gt;

&lt;p&gt;When bringing your Figma designs into DronaHQ, you can either upload &lt;strong&gt;PNG images&lt;/strong&gt; or export as &lt;strong&gt;HTML/CSS code&lt;/strong&gt;. Each method serves different use cases depending on your design goals, skill level, and maintenance needs. Here's a breakdown to help you decide:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftjv7nlg5249kmneb2hhr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftjv7nlg5249kmneb2hhr.png" alt="compare table" width="800" height="756"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Quick Tip:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
 If you're a designer or PM looking to get something live quickly with visual fidelity, PNGs will do the job. But if you're a developer or working closely with one, HTML/CSS offers the flexibility and control needed for richer interactions and responsiveness.&lt;/p&gt;

&lt;h2&gt;
  
  
  Using DronaHQ’s Figma Kit Right
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Before diving into high-fidelity screens, familiarize yourself with the foundational elements like typography, color styles, spacing guidelines, and grid layouts provided in the kit. This helps maintain consistency and saves time down the line.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Stick to using the pre-built components (buttons, inputs, tables, etc.) from the kit instead of creating new ones from scratch. These components are optimized for DronaHQ’s frontend and reduce friction during handoff and implementation.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Take advantage of component variants (like primary/secondary buttons, filled/outlined inputs) and configurable properties. This keeps your designs modular and reduces duplication in your Figma file.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Regular check-ins with your dev team ensure designs remain feasible and aligned with DronaHQ’s capabilities. It also helps in identifying when to customize versus when to reuse existing components.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;While it’s tempting to push design boundaries, remember the goal is to build efficiently using low-code principles. Keep customizations minimal and purposeful to reduce development complexity.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Resources and Quick Links
&lt;/h2&gt;

&lt;p&gt;✅ &lt;a href="https://www.figma.com/community/file/1493571947316588027" rel="noopener noreferrer"&gt;DronaHQ Figma Design System Kit&lt;/a&gt;&lt;br&gt;&lt;br&gt;
 ✅ &lt;a href="https://www.dronahq.com/" rel="noopener noreferrer"&gt;DronaHQ Platform - Sign Up&lt;/a&gt;&lt;br&gt;&lt;br&gt;
 ✅ &lt;a href="https://docs.dronahq.com/building-with-ai/" rel="noopener noreferrer"&gt;DronaHQ Documentation - Working with AI Chatbot&lt;/a&gt;&lt;br&gt;&lt;br&gt;
 ✅ &lt;a href="https://shibam-dhar.medium.com/import-your-figma-designs-directly-into-dronahq-d03b0c0706ba" rel="noopener noreferrer"&gt;Anima Plugin - Export Figma to HTML&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Thank you for reading this far. If you find this article useful, please like and share this article. Someone could find it useful too.💖&lt;/p&gt;

&lt;p&gt;Connect with me on 👉  &lt;a href="https://www.linkedin.com/in/shibamdhar/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; and &lt;a href="https://medium.com/@shibam-dhar" rel="noopener noreferrer"&gt;Medium&lt;/a&gt;!&lt;/p&gt;

</description>
      <category>ux</category>
      <category>ui</category>
      <category>ai</category>
      <category>lowcode</category>
    </item>
    <item>
      <title>DevOps Reimagined: From Jenkins to AIOps and the Rise of Intelligent Automation – Part II</title>
      <dc:creator>SHIBAM</dc:creator>
      <pubDate>Sat, 26 Apr 2025 05:30:00 +0000</pubDate>
      <link>https://dev.to/shib_itsme/devops-reimagined-from-jenkins-to-aiops-and-the-rise-of-intelligent-automation-part-ii-3fj0</link>
      <guid>https://dev.to/shib_itsme/devops-reimagined-from-jenkins-to-aiops-and-the-rise-of-intelligent-automation-part-ii-3fj0</guid>
      <description>&lt;p&gt;In Part I, we explored how traditional DevOps practices are transforming with the rise of AIOps and intelligent automation. But that’s only part of the story. The DevOps ecosystem is also being redefined by emerging priorities—&lt;strong&gt;security, developer experience, and human-first culture&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In this second installment, we dive into these trends reshaping the DevOps narrative.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔒 DevSecOps: Where Security is Built-In, Not Bolted On
&lt;/h2&gt;

&lt;p&gt;Security is no longer something you "add on later." In the &lt;strong&gt;DevSecOps&lt;/strong&gt; era, it’s baked in from commit to production.&lt;/p&gt;

&lt;p&gt;Teams are adopting &lt;strong&gt;SBOMs (Software Bill of Materials)&lt;/strong&gt; to gain visibility into all app dependencies. This transparency accelerates response time when vulnerabilities like &lt;em&gt;Log4j&lt;/em&gt; arise.&lt;/p&gt;

&lt;p&gt;Security testing is now deeply embedded in the pipeline:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;SAST&lt;/strong&gt; (Static Application Security Testing) checks code quality at build time.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DAST&lt;/strong&gt; (Dynamic Application Security Testing) scans running applications for real-world exploits.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Tools like &lt;strong&gt;Snyk&lt;/strong&gt; and &lt;strong&gt;OWASP ZAP&lt;/strong&gt; help detect and fix issues before and after runtime.&lt;/p&gt;

&lt;p&gt;CI/CD platforms are getting smarter too. With &lt;strong&gt;secret scanners&lt;/strong&gt; and &lt;strong&gt;compliance gates&lt;/strong&gt;, you can block hardcoded credentials and policy violations before they go live.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;✅ Example: &lt;strong&gt;GitHub Advanced Security&lt;/strong&gt; scans for secrets, vulnerabilities, and misconfigurations on every push—right inside your repo.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  🤖 Rise of Internal Developer Platforms (IDPs)
&lt;/h2&gt;

&lt;p&gt;Developer experience (DevEx) is no longer a “nice to have”—it’s essential.&lt;/p&gt;

&lt;p&gt;That’s where &lt;strong&gt;Internal Developer Platforms (IDPs)&lt;/strong&gt; come in. These platforms enable developers to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Spin up environments without waiting for ops&lt;/li&gt;
&lt;li&gt;Deploy services with pre-approved templates&lt;/li&gt;
&lt;li&gt;Operate through golden paths aligned to best practices&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;IDPs unify tooling under a single dashboard—bringing metrics, logs, docs, and statuses into one place.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;🚀 Platforms like &lt;strong&gt;Backstage&lt;/strong&gt;, &lt;strong&gt;Port&lt;/strong&gt;, and &lt;strong&gt;Humanitec&lt;/strong&gt; are leading this space—turning platform engineering into a core DevOps function.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  ⟳ Continuous &lt;em&gt;Everything&lt;/em&gt;
&lt;/h2&gt;

&lt;p&gt;"Continuous delivery" was just the start. Now, “continuous” spans the entire software lifecycle:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Continuous Planning&lt;/strong&gt;: Real-time roadmaps synced with dev activity.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Continuous Feedback&lt;/strong&gt;: Product telemetry and user data flow directly into dev cycles.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Feature Flags&lt;/strong&gt;: Tools like &lt;strong&gt;LaunchDarkly&lt;/strong&gt;, &lt;strong&gt;Flagsmith&lt;/strong&gt;, and &lt;strong&gt;Flipt&lt;/strong&gt; allow gradual rollouts, instant rollbacks, and real-time toggles.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;📊 &lt;strong&gt;83% of high-performing teams use feature flags in production&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
— &lt;em&gt;LaunchDarkly 2025 Report&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  👨‍💻 DevEx: The New North Star for DevOps
&lt;/h2&gt;

&lt;p&gt;In modern DevOps, &lt;strong&gt;Developer Experience (DevEx)&lt;/strong&gt; is the performance multiplier.&lt;/p&gt;

&lt;p&gt;What does good DevEx look like?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🔄 Fewer context switches through integrated tools&lt;/li&gt;
&lt;li&gt;⚡ Fast, intuitive UX for all developer-facing systems&lt;/li&gt;
&lt;li&gt;📘 Great documentation and onboarding flows&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;💬 “DevEx is not a luxury. It’s the foundation of modern software delivery.”&lt;br&gt;&lt;br&gt;
— &lt;em&gt;Charity Majors, CTO at Honeycomb&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Investing in DevEx means faster delivery, happier teams, and better outcomes.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧠 Culture Still Matters: The Human Side of DevOps
&lt;/h2&gt;

&lt;p&gt;Even with AI and automation, &lt;strong&gt;DevOps is still about people&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🤝 Blameless postmortems promote learning over blame&lt;/li&gt;
&lt;li&gt;🧠 Psychological safety encourages innovation&lt;/li&gt;
&lt;li&gt;🌍 Async communication tools like Slack, Discord bots, and Teams workflows support distributed teams&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;📝 GitLab’s &lt;a href="https://about.gitlab.com/company/culture/all-remote/manifesto/" rel="noopener noreferrer"&gt;Remote Manifesto&lt;/a&gt; is a great example of cultural values baked into DevOps practice.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;DevOps culture is evolving—but its core remains deeply human.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔮 What’s Next in DevOps?
&lt;/h2&gt;

&lt;p&gt;The future is already here. Expect to see more of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;⚙️ &lt;strong&gt;AI-powered pipelines&lt;/strong&gt; that detect and self-correct anomalies&lt;/li&gt;
&lt;li&gt;🧩 &lt;strong&gt;Composable DevOps stacks&lt;/strong&gt; built for niche and domain-specific workflows&lt;/li&gt;
&lt;li&gt;☁️ &lt;strong&gt;Developer-first cloud platforms&lt;/strong&gt; tailored to languages and use cases&lt;/li&gt;
&lt;li&gt;🙌 &lt;strong&gt;Zero-touch infrastructure&lt;/strong&gt; that configures and scales itself&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🖊️ Final Thoughts
&lt;/h2&gt;

&lt;p&gt;DevOps has come a long way from just automating builds and deployments. It’s now an interconnected system of tools, teams, and philosophies—focused on &lt;strong&gt;automation, security, platform engineering, and human experience&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;To thrive in this landscape, you need to be:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🧠 Curious&lt;/li&gt;
&lt;li&gt;🧰 Tool-savvy&lt;/li&gt;
&lt;li&gt;🤝 Collaborative&lt;/li&gt;
&lt;li&gt;🔁 Always learning&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  📚 Resources to Follow
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.devopsweekly.com/" rel="noopener noreferrer"&gt;DevOps Weekly&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://newsletter.pragmaticengineer.com/" rel="noopener noreferrer"&gt;The Pragmatic Engineer&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/c/cloudnativefdn" rel="noopener noreferrer"&gt;CNCF YouTube Channel&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Thank you for reading this far. If you find this article useful, please like and share this article. Someone could find it useful too.💖&lt;/p&gt;

&lt;p&gt;Connect with me on 👉  &lt;a href="https://www.linkedin.com/in/shibamdhar/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; and &lt;a href="https://medium.com/@shibam-dhar" rel="noopener noreferrer"&gt;Medium&lt;/a&gt;!&lt;/p&gt;

</description>
      <category>devops</category>
      <category>devex</category>
      <category>ai</category>
      <category>security</category>
    </item>
    <item>
      <title>🔥DevOps Reimagined: From Jenkins to AIOps and the Rise of Intelligent Automation – Part I</title>
      <dc:creator>SHIBAM</dc:creator>
      <pubDate>Fri, 25 Apr 2025 12:26:00 +0000</pubDate>
      <link>https://dev.to/shib_itsme/devops-reimagined-from-jenkins-to-aiops-and-the-rise-of-intelligent-automation-part-i-3h9m</link>
      <guid>https://dev.to/shib_itsme/devops-reimagined-from-jenkins-to-aiops-and-the-rise-of-intelligent-automation-part-i-3h9m</guid>
      <description>&lt;h2&gt;
  
  
  🚀 Introduction: The DevOps Revolution — Then and Now
&lt;/h2&gt;

&lt;p&gt;DevOps started as a cultural movement to break down the silos between development and operations teams. In its early days, it promised faster deployments, fewer bugs, and tighter feedback loops. Today, it’s evolved into a full-fledged engineering philosophy touching every aspect of the software delivery lifecycle.&lt;/p&gt;

&lt;p&gt;According to the &lt;a href="https://puppet.com/resources/report/2024-state-of-devops-report/" rel="noopener noreferrer"&gt;2024 State of DevOps Report by Puppet&lt;/a&gt;, high-performing DevOps teams deploy 973x more frequently than their low-performing counterparts, with 6570x faster lead times. That’s not just impressive — it’s transformative.&lt;/p&gt;

&lt;p&gt;In this article, we dive deep into how DevOps is evolving in 2025, what new trends and tools are shaping it, and what developers need to know to stay ahead.&lt;/p&gt;




&lt;h2&gt;
  
  
  🌐 The Core Principles of DevOps: Modern Take
&lt;/h2&gt;

&lt;p&gt;Traditionally, DevOps was rooted in three key pillars:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;CI/CD pipelines&lt;/strong&gt; for faster delivery&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Automation&lt;/strong&gt; to eliminate manual toil&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Collaboration and communication&lt;/strong&gt; between devs and ops&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But in today’s world of fast-paced delivery and complex infrastructure, these pillars have matured and taken new forms:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Developer Experience (DevEx)&lt;/strong&gt; is now central. Developers want more than just working pipelines — they need intuitive tooling, faster feedback loops, and fewer blockers. If you’ve ever been stuck waiting on a deployment you don’t own or figuring out where the logs are, you know the pain.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Platform engineering&lt;/strong&gt; helps streamline workflows with internal tools and self-service infrastructure. Think of it like building guardrails so developers can move quickly without falling off the cliff.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security and observability&lt;/strong&gt; are no longer optional. They’re baked in from the first line of code to the final deployment.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🧪 &lt;em&gt;Relatable?&lt;/em&gt; If you’ve ever juggled three different dashboards just to troubleshoot a bug, or hunted through Slack to find the person who owns a failing pipeline, then this shift is happening around you.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt; Shopify’s engineering teams use &lt;a href="https://backstage.io/" rel="noopener noreferrer"&gt;Backstage&lt;/a&gt; to bring together their microservices, documentation, deployment logs, and team ownership in one place — creating a single pane of glass that boosts DevEx and cuts down cognitive overload.&lt;/p&gt;




&lt;h2&gt;
  
  
  🚗 The Modern DevOps Stack: What's In and What's Out
&lt;/h2&gt;

&lt;h3&gt;
  
  
  What’s fading:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Jenkins (legacy for many orgs, often slow to scale and hard to maintain)&lt;/li&gt;
&lt;li&gt;Manual config management (replaced by Infrastructure as Code — IaC — tools that offer consistency and automation)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  What’s hot:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GitHub Actions&lt;/strong&gt; for CI/CD — native, flexible, and deeply integrated into the GitHub ecosystem. As of 2025, over 90% of open-source projects hosted on GitHub rely on GitHub Actions for automation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ArgoCD&lt;/strong&gt; for GitOps — declarative and Kubernetes-native, empowering teams to adopt continuous delivery with confidence. &lt;a href="https://argo-cd.readthedocs.io/en/stable/" rel="noopener noreferrer"&gt;Intuit&lt;/a&gt; reports a 2x reduction in production deployment failures since adopting ArgoCD.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Terraform &amp;amp; Pulumi&lt;/strong&gt; for IaC — enabling reproducible and versioned infrastructure. HashiCorp’s 2024 usage report noted Terraform is used by 70% of Fortune 500 companies.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Crossplane&lt;/strong&gt; for cloud-native control planes — bringing Kubernetes-style APIs to manage infrastructure across AWS, GCP, and Azure. It allows platform teams to compose infrastructure abstractions that developers can easily consume.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These modern tools are gaining ground not just because they're trendy — they solve real pain points: reducing manual intervention, enabling self-service, improving auditability, and aligning infrastructure with code.&lt;/p&gt;




&lt;h2&gt;
  
  
  ⚙️ Automation Beyond Pipelines
&lt;/h2&gt;

&lt;p&gt;Modern automation goes beyond just build and deploy — it's about creating intelligent, responsive systems that can adapt to change and reduce operational overhead.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Event-driven workflows&lt;/strong&gt; powered by &lt;a href="https://temporal.io/" rel="noopener noreferrer"&gt;Temporal&lt;/a&gt;: Instead of relying on static pipelines, Temporal enables dynamic, long-running workflows that react to real-world events — from payment processing to data ingestion. It's especially powerful in microservices architectures, where orchestration and coordination are key. &lt;a href="https://temporal.io/case-studies/coinbase" rel="noopener noreferrer"&gt;Coinbase&lt;/a&gt; used Temporal to handle billions of dollars in transactions more reliably.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Policy-as-Code&lt;/strong&gt; using &lt;a href="https://www.openpolicyagent.org/" rel="noopener noreferrer"&gt;Open Policy Agent (OPA)&lt;/a&gt;: This brings governance and compliance into your pipelines and runtime decisions. With OPA, teams can write and enforce policies — like who can deploy what, where, and when — all as code. Netflix uses OPA to manage access policies and service configurations at scale.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Infrastructure automation&lt;/strong&gt; with &lt;a href="https://dagger.io/" rel="noopener noreferrer"&gt;Dagger&lt;/a&gt;: A modern approach to CI pipelines and environment provisioning, Dagger lets developers write pipelines in their own language (like Python or Go) and run them anywhere. It's gaining popularity for being portable and developer-friendly.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  ☁️ Cloud-Native &amp;amp; Kubernetes: Now Just the Foundation
&lt;/h2&gt;

&lt;p&gt;While Kubernetes once symbolized cutting-edge infrastructure, today it’s just the beginning — the new normal. Every serious product team now runs on Kubernetes or a similar container orchestration platform. But as workloads grow and complexity increases, new challenges have emerged: managing service-to-service communication, optimizing across cloud vendors, and building developer-friendly environments.&lt;/p&gt;

&lt;p&gt;That’s where new layers are coming in:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Service Meshes&lt;/strong&gt; (like Istio and Linkerd) enable fine-grained traffic control, secure service-to-service communication, and observability baked into the infrastructure.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hybrid/Multi-cloud orchestration&lt;/strong&gt; is becoming vital for businesses with compliance or latency needs. Platforms like Google Anthos and HashiCorp Consul are rising in popularity for their ability to span cloud boundaries.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Developer platforms abstracting K8s&lt;/strong&gt; are now in demand because developers shouldn’t need to know Kubernetes YAML to deploy code. Tools like &lt;a href="https://vercel.com/" rel="noopener noreferrer"&gt;Vercel&lt;/a&gt;, &lt;a href="https://render.com/" rel="noopener noreferrer"&gt;Render&lt;/a&gt;, and &lt;a href="https://www.qovery.com/" rel="noopener noreferrer"&gt;Qovery&lt;/a&gt; provide an experience where devs can focus on app logic, not infrastructure setup.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;📊 &lt;strong&gt;Stat:&lt;/strong&gt; CNCF's 2025 report shows that 84% of organizations are using Kubernetes in production, but 61% say they are actively exploring ways to abstract it from developers to reduce onboarding friction and cognitive load.&lt;/p&gt;




&lt;h2&gt;
  
  
  📊 DevOps Meets Observability
&lt;/h2&gt;

&lt;p&gt;Observability is no longer just an ops concern — it’s now central to how developers ship and maintain software. In an era where applications are distributed, containerized, and constantly evolving, the ability to &lt;em&gt;understand what's happening inside your systems in real time&lt;/em&gt; is essential.&lt;/p&gt;

&lt;p&gt;Today’s developer is expected to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Instrument applications using &lt;a href="https://opentelemetry.io/" rel="noopener noreferrer"&gt;OpenTelemetry&lt;/a&gt;, the emerging standard for observability data&lt;/li&gt;
&lt;li&gt;Use &lt;a href="https://grafana.com/" rel="noopener noreferrer"&gt;Grafana&lt;/a&gt; and &lt;a href="https://prometheus.io/" rel="noopener noreferrer"&gt;Prometheus&lt;/a&gt; for real-time metrics, dashboards, and alerting&lt;/li&gt;
&lt;li&gt;Implement distributed tracing to connect logs, metrics, and traces for root cause analysis&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🔍 &lt;strong&gt;Stat:&lt;/strong&gt; Teams with full observability resolve incidents 65% faster and spend 2x less time in war rooms compared to those with limited visibility (New Relic, 2024).&lt;/p&gt;




&lt;h2&gt;
  
  
  🧠 AIOps: The AI Layer Over DevOps
&lt;/h2&gt;

&lt;p&gt;AIOps — Artificial Intelligence for IT Operations — is rapidly reshaping how DevOps teams manage infrastructure, detect issues, and streamline processes. In 2025, it's more than just a buzzword; it's a vital tool for handling the scale and complexity of modern systems.&lt;/p&gt;

&lt;p&gt;Here’s how AIOps is making an impact:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Anomaly detection and root cause analysis&lt;/strong&gt;: AI models analyze logs, metrics, and traces to detect outliers and diagnose problems much faster than traditional monitoring tools.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AI-generated runbooks&lt;/strong&gt;: When an issue arises, AIOps tools can automatically suggest (or even execute) remediation steps based on previous incident patterns.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Smarter alerting&lt;/strong&gt;: Instead of waking up the on-call engineer for every minor blip, tools like &lt;a href="https://www.pagerduty.com/products/ai-ops/" rel="noopener noreferrer"&gt;PagerDuty AI&lt;/a&gt; correlate alerts and prioritize only the ones that actually matter.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🎯 &lt;em&gt;Why it matters:&lt;/em&gt; As systems become increasingly distributed and data-heavy, it's humanly impossible to monitor and respond to every signal in real time. AIOps helps reduce alert fatigue, improve uptime, and speed up resolution.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt; &lt;a href="https://harness.io/" rel="noopener noreferrer"&gt;Harness.io&lt;/a&gt; leverages AIOps to optimize cloud spend and refine deployment strategies using real-time usage data. It detects inefficient workloads, automates rollback strategies, and continuously tunes pipelines to reduce costs without sacrificing performance.&lt;/p&gt;

&lt;p&gt;This is just scratching the surface. In Part 2, we’ll explore the next wave of DevOps innovation — from DevSecOps and Internal Developer Platforms to the cultural practices that make it all work.&lt;/p&gt;

&lt;p&gt;Stay tuned.&lt;/p&gt;




&lt;p&gt;Thank you for reading this far. If you find this article useful, please like and share this article. Someone could find it useful too.💖&lt;/p&gt;

&lt;p&gt;Connect with me on 👉  &lt;a href="https://www.linkedin.com/in/shibamdhar/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; and &lt;a href="https://medium.com/@shibam-dhar" rel="noopener noreferrer"&gt;Medium&lt;/a&gt;!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>ai</category>
      <category>devops</category>
    </item>
    <item>
      <title>🔥 Mastering HTTP Requests in JavaScript (2025 Guide)</title>
      <dc:creator>SHIBAM</dc:creator>
      <pubDate>Mon, 14 Apr 2025 05:19:10 +0000</pubDate>
      <link>https://dev.to/shib_itsme/mastering-http-requests-in-javascript-2025-guide-52ja</link>
      <guid>https://dev.to/shib_itsme/mastering-http-requests-in-javascript-2025-guide-52ja</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;🧠 &lt;strong&gt;Did you know?&lt;/strong&gt; Over &lt;strong&gt;94% of websites&lt;/strong&gt; use JavaScript for client-side scripting, and &lt;strong&gt;HTTP requests&lt;/strong&gt; power most modern app interactions! Whether you're calling an API, submitting a form, or fetching a product list, you’re using HTTP requests.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In this guide, you’ll master all the ways to make and handle HTTP requests in &lt;strong&gt;JavaScript&lt;/strong&gt; — from old-school &lt;code&gt;XMLHttpRequest&lt;/code&gt; to the modern &lt;code&gt;fetch()&lt;/code&gt; and power-packed Axios.&lt;/p&gt;




&lt;h2&gt;
  
  
  🚀 What Are HTTP Requests?
&lt;/h2&gt;

&lt;p&gt;HTTP requests let your app &lt;strong&gt;communicate with a server&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🔍 Fetch user or product data&lt;/li&gt;
&lt;li&gt;📝 Submit forms or files&lt;/li&gt;
&lt;li&gt;🔐 Authenticate and authorize users&lt;/li&gt;
&lt;li&gt;📦 Upload files and images&lt;/li&gt;
&lt;li&gt;🔁 Sync data with databases or APIs&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  ⚡ The Native Hero: &lt;code&gt;fetch()&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Introduced in &lt;strong&gt;ES6&lt;/strong&gt;, &lt;code&gt;fetch()&lt;/code&gt; is modern, promise-based, and built into all modern browsers.&lt;/p&gt;

&lt;h3&gt;
  
  
  ✅ Basic GET Request:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://api.publicapis.org/entries&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;catch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Fetch error:&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  ✅ POST Request with Headers:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://api.example.com/user&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;POST&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Content-Type&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;application/json&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Shibam&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;email&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;shibam@example.com&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
  &lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  🔧 &lt;code&gt;fetch()&lt;/code&gt; Options:
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Option&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;method&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;HTTP method like &lt;code&gt;GET&lt;/code&gt;, &lt;code&gt;POST&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;headers&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Custom headers&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;body&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Data to be sent (for POST)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;mode&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;CORS handling&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;credentials&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Send cookies (auth tokens)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  💎 Axios: The Developer Favorite
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://axios-http.com/" rel="noopener noreferrer"&gt;Axios&lt;/a&gt; is a &lt;strong&gt;popular HTTP client&lt;/strong&gt; used by over &lt;strong&gt;27.5 million projects monthly (NPM Trends, 2024)&lt;/strong&gt;. It simplifies requests with cleaner syntax, automatic JSON parsing, and powerful features like interceptors.&lt;/p&gt;

&lt;h3&gt;
  
  
  ✅ Install:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;axios
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  ✅ Basic GET:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;axios&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;axios&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nx"&gt;axios&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://api.publicapis.org/entries&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;catch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  ✅ POST with Config:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;axios&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://api.example.com/data&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Axios Post!&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;user&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;shibam&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Authorization&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Bearer TOKEN&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  🔥 Features:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;✅ &lt;strong&gt;Interceptors&lt;/strong&gt; for headers, tokens, logging&lt;/li&gt;
&lt;li&gt;✅ &lt;strong&gt;Automatic JSON parsing&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;✅ &lt;strong&gt;Error handling with response codes&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;✅ &lt;strong&gt;Node.js + Browser support&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🧪 Old-School: &lt;code&gt;XMLHttpRequest&lt;/code&gt; (XHR)
&lt;/h2&gt;

&lt;p&gt;📉 Once the only option for AJAX calls, now mostly replaced by &lt;code&gt;fetch&lt;/code&gt; and Axios.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;xhr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;XMLHttpRequest&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nx"&gt;xhr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;GET&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://api.example.com/data&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;xhr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;onload&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;function &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;xhr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;status&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;xhr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;responseText&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="nx"&gt;xhr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;🧟 Use only for &lt;strong&gt;legacy browser support&lt;/strong&gt; (IE11 or older).&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  🔁 Modern Pattern: Async/Await
&lt;/h2&gt;

&lt;p&gt;Syntactic sugar over promises for cleaner code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;getData&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://api.example.com/info&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Error:&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ Works with both &lt;code&gt;fetch()&lt;/code&gt; and &lt;code&gt;axios&lt;/code&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  🌐 Adding Query Params
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Manual (Fetch):
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://api.example.com/items?category=books&amp;amp;page=2&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Axios-friendly:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;axios&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/items&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;params&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;category&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;books&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;page&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  📦 Handling FormData (File Uploads)
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;formData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;FormData&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nx"&gt;formData&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;profile&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;fileInput&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;files&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;

&lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/api/upload&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;POST&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;formData&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  🚨 Error Handling Like a Pro
&lt;/h2&gt;

&lt;h3&gt;
  
  
  With &lt;code&gt;fetch()&lt;/code&gt;:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/api/data&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ok&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Request failed&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="p"&gt;})&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;catch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  With Axios:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;axios&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/api/bad-endpoint&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;catch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Server responded with:&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;status&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;request&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;No response received&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Error:&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  🔁 Multiple Requests at Once
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;all&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
  &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/api/user&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
  &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/api/settings&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;])&lt;/span&gt;
&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="nx"&gt;res1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res2&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;res1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;settings&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;res2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;settings&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With Axios:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;settings&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;all&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
  &lt;span class="nx"&gt;axios&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/user&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
  &lt;span class="nx"&gt;axios&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/settings&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  📊 Fun Dev Stats (2025 Edition)
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Metric&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Websites using JavaScript&lt;/td&gt;
&lt;td&gt;94.7%+ (W3Techs, Jan 2025)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Monthly Axios downloads (NPM)&lt;/td&gt;
&lt;td&gt;27.5 million+ (NPM Trends 2024)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Developers preferring &lt;code&gt;fetch&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;65% (StackOverflow Survey 2024)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Average API response time (US APIs)&lt;/td&gt;
&lt;td&gt;~120ms (Postman State of APIs)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Most used HTTP method&lt;/td&gt;
&lt;td&gt;GET (78%)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  ✅ Summary
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Method&lt;/th&gt;
&lt;th&gt;Async&lt;/th&gt;
&lt;th&gt;Lightweight&lt;/th&gt;
&lt;th&gt;Legacy Support&lt;/th&gt;
&lt;th&gt;Features&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;fetch()&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;Native + Promises&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Axios&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;❌ (needs install)&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;Interceptors, Timeout, Nodes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;XMLHttpRequest&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;Callback-based, verbose&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  🔚 Final Thoughts
&lt;/h2&gt;

&lt;p&gt;🧭 As we move further into &lt;strong&gt;2025&lt;/strong&gt;, your safest bets for making HTTP requests in JavaScript are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use &lt;strong&gt;&lt;code&gt;fetch()&lt;/code&gt;&lt;/strong&gt; for modern, simple use-cases&lt;/li&gt;
&lt;li&gt;Use &lt;strong&gt;Axios&lt;/strong&gt; for complex apps needing interceptors, tokens, and better error handling&lt;/li&gt;
&lt;li&gt;Avoid &lt;code&gt;XMLHttpRequest&lt;/code&gt; unless maintaining legacy systems&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;👋 &lt;a href="https://www.linkedin.com/in/shibamdhar/" rel="noopener noreferrer"&gt;Follow me on LinkedIn&lt;/a&gt; for more content around &lt;strong&gt;JavaScript&lt;/strong&gt;, &lt;strong&gt;DevRel&lt;/strong&gt;, and &lt;strong&gt;AI&lt;/strong&gt; — let's connect and build together!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>axios</category>
      <category>fetch</category>
    </item>
    <item>
      <title>🤖 Getting Started with AI in JavaScript: A Beginner's Guide to the Future of Web Development : Part -II</title>
      <dc:creator>SHIBAM</dc:creator>
      <pubDate>Tue, 08 Apr 2025 03:24:00 +0000</pubDate>
      <link>https://dev.to/shib_itsme/getting-started-with-ai-in-javascript-a-beginners-guide-to-the-future-of-web-development-part-1p46</link>
      <guid>https://dev.to/shib_itsme/getting-started-with-ai-in-javascript-a-beginners-guide-to-the-future-of-web-development-part-1p46</guid>
      <description>&lt;h2&gt;
  
  
  🧠 Trendy: Using Transformers.js for LLMs in the Browser
&lt;/h2&gt;

&lt;p&gt;Welcome to the future of AI — where &lt;strong&gt;Large Language Models (LLMs)&lt;/strong&gt; like GPT and BERT can now run &lt;strong&gt;locally in the browser&lt;/strong&gt;, thanks to &lt;a href="https://xenova.github.io/transformers.js/" rel="noopener noreferrer"&gt;&lt;code&gt;transformers.js&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Running AI models in the browser eliminates latency and enhances privacy.” – &lt;em&gt;HuggingFace Blog&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  🚀 What is Transformers.js?
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://github.com/xenova/transformers.js" rel="noopener noreferrer"&gt;Transformers.js&lt;/a&gt; is a &lt;strong&gt;pure JavaScript library&lt;/strong&gt; that lets you run HuggingFace transformer models in the browser. No Python. No servers. Just JS.&lt;/p&gt;

&lt;p&gt;🌟 Features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🤖 Supports text generation, classification, translation, summarization&lt;/li&gt;
&lt;li&gt;🧠 Uses ONNX + WebAssembly (WASM) under the hood&lt;/li&gt;
&lt;li&gt;🧪 100% runs in-browser – private, fast, and serverless&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🔨 Build: AI Text Generator in the Browser
&lt;/h2&gt;

&lt;p&gt;Here’s how to build a GenAI chatbot using Transformers.js.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;🧠 &lt;strong&gt;Goal:&lt;/strong&gt; Use a GPT-style model to generate text completions in-browser&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  1. Add the Script
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"module"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;pipeline&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://cdn.jsdelivr.net/npm/@xenova/transformers@2.5.0&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Generate Text
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;💬 AI Chatbot in Browser&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;textarea&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"input"&lt;/span&gt; &lt;span class="na"&gt;rows=&lt;/span&gt;&lt;span class="s"&gt;"4"&lt;/span&gt; &lt;span class="na"&gt;cols=&lt;/span&gt;&lt;span class="s"&gt;"50"&lt;/span&gt; &lt;span class="na"&gt;placeholder=&lt;/span&gt;&lt;span class="s"&gt;"Type your prompt..."&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/textarea&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;onclick=&lt;/span&gt;&lt;span class="s"&gt;"generateText()"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Ask AI&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;pre&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"output"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;🧠 Waiting for input...&lt;span class="nt"&gt;&amp;lt;/pre&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"module"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;pipeline&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://cdn.jsdelivr.net/npm/@xenova/transformers@2.5.0&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;generator&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;pipeline&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;text-generation&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Xenova/distilgpt2&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;generateText&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;prompt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;input&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;generator&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;max_new_tokens&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;40&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
      &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;output&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;textContent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;generated_text&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;};&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🔥 This uses the &lt;code&gt;distilgpt2&lt;/code&gt; model and generates responses based on your input.&lt;/p&gt;

&lt;h3&gt;
  
  
  ✅ Output Example:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Prompt: The future of AI is
Response: The future of AI is not a dream anymore — it's happening right now in real time.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  🧠 Use Case 2: Smart UI Assistant with Brain.js
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/BrainJS/brain.js" rel="noopener noreferrer"&gt;Brain.js&lt;/a&gt; is a &lt;strong&gt;lightweight neural net library&lt;/strong&gt; for JS developers.&lt;/p&gt;

&lt;p&gt;Imagine making your site smarter by training it to understand patterns — like recognizing user behavior or product popularity.&lt;/p&gt;

&lt;h3&gt;
  
  
  🧪 Code: AI-Based Sentiment Predictor
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;brain&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;brain.js&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;net&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;brain&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;NeuralNetwork&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="nx"&gt;net&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;train&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;input&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;awesome&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="na"&gt;output&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;positive&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;input&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;terrible&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="na"&gt;output&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;negative&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;]);&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;output&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;net&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;awesome&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt; &lt;span class="c1"&gt;// { positive: 0.98 }&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;output&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🧠 This is basic sentiment prediction — but it lays the groundwork for things like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🔍 Product review analysis&lt;/li&gt;
&lt;li&gt;💬 Live feedback loops&lt;/li&gt;
&lt;li&gt;🎯 UI personalization&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🌎 Real-World AI x JavaScript Use Cases
&lt;/h2&gt;

&lt;p&gt;Let’s take a look at some &lt;strong&gt;real companies&lt;/strong&gt; and open-source tools using AI + JavaScript.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Platform&lt;/th&gt;
&lt;th&gt;Use Case&lt;/th&gt;
&lt;th&gt;Tech Stack&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://runwayml.com/" rel="noopener noreferrer"&gt;Runway&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;In-browser video editing w/ GenAI&lt;/td&gt;
&lt;td&gt;JavaScript, WebAssembly&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://huggingface.co/spaces" rel="noopener noreferrer"&gt;HuggingFace Spaces&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Browser-based AI demos&lt;/td&gt;
&lt;td&gt;Transformers.js, React, Vite&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://teachablemachine.withgoogle.com/" rel="noopener noreferrer"&gt;Google Teachable Machine&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Train your own model visually&lt;/td&gt;
&lt;td&gt;TensorFlow.js&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://replicate.com" rel="noopener noreferrer"&gt;Replicate UI&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;UI for running AI models via API&lt;/td&gt;
&lt;td&gt;React + REST&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://you.com" rel="noopener noreferrer"&gt;You.com&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Search engine with in-browser GenAI&lt;/td&gt;
&lt;td&gt;TypeScript, Web Workers, LLM APIs&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  🔍 Use Case: AI as a Browser Extension (New &amp;amp; Cool!)
&lt;/h2&gt;

&lt;p&gt;With AI getting smaller and faster, devs are building AI-powered browser extensions like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;📜 &lt;strong&gt;TLDR This&lt;/strong&gt; – Summarizes articles&lt;/li&gt;
&lt;li&gt;✍️ &lt;strong&gt;Compose AI&lt;/strong&gt; – Autocompletes emails and messages&lt;/li&gt;
&lt;li&gt;🧠 &lt;strong&gt;Monica&lt;/strong&gt; – Local memory extension that learns what you browse&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can build your own using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="err"&gt;//&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;manifest.json&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Smart Summary"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"permissions"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"activeTab"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"storage"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"content_scripts"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"summary.js"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"manifest_version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And then use &lt;code&gt;Transformers.js&lt;/code&gt; or &lt;code&gt;fetch()&lt;/code&gt; to call AI models directly from the extension.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧠 Bonus: Using OpenAI API from JavaScript
&lt;/h2&gt;

&lt;p&gt;Want to work with ChatGPT/GPT-4 via JavaScript? Use the OpenAI API:&lt;/p&gt;

&lt;h3&gt;
  
  
  📜 Setup
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;openai
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;OpenAI&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;openai&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;openai&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;OpenAI&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;apiKey&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;YOUR_API_KEY&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;dangerouslyAllowBrowser&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;chatCompletion&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;openai&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;completions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;model&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;gpt-3.5-turbo&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt; &lt;span class="na"&gt;role&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;user&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Write a haiku about JavaScript&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;}],&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;chatCompletion&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;choices&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;content&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;⚠️ &lt;strong&gt;Note&lt;/strong&gt;: This sends data to OpenAI’s servers. If you need privacy, go for &lt;code&gt;Transformers.js&lt;/code&gt;.&lt;/p&gt;




&lt;p&gt;✅ That’s it for &lt;strong&gt;Part 2&lt;/strong&gt;!&lt;/p&gt;

&lt;p&gt;🙌 Let me know when you're ready for &lt;strong&gt;Part 3&lt;/strong&gt;!&lt;/p&gt;




&lt;p&gt;Thank you for reading this far. If you find this article useful, please like and share this article. Someone could find it useful too.💖&lt;/p&gt;

&lt;p&gt;Connect with me on 👉  &lt;a href="https://www.linkedin.com/in/shibamdhar/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; and [Medium]&lt;/p&gt;

</description>
      <category>ai</category>
      <category>javascript</category>
      <category>beginners</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>🤖 Getting Started with AI in JavaScript: A Beginner's Guide to the Future of Web Development : Part -I</title>
      <dc:creator>SHIBAM</dc:creator>
      <pubDate>Mon, 07 Apr 2025 12:00:00 +0000</pubDate>
      <link>https://dev.to/shib_itsme/getting-started-with-ai-in-javascript-a-beginners-guide-to-the-future-of-web-development-part-mig</link>
      <guid>https://dev.to/shib_itsme/getting-started-with-ai-in-javascript-a-beginners-guide-to-the-future-of-web-development-part-mig</guid>
      <description>&lt;h2&gt;
  
  
  🤖 Getting Started with AI in JavaScript: A Beginner's Guide to the Future of Web Development
&lt;/h2&gt;

&lt;p&gt;Artificial Intelligence (AI) is everywhere — from recommending your next Netflix show 🎬 to helping self-driving cars 🚗 navigate roads. But what if I told you that you, a JavaScript developer, can build intelligent apps &lt;strong&gt;right in the browser&lt;/strong&gt;?&lt;/p&gt;

&lt;p&gt;Welcome to the &lt;strong&gt;beginner-friendly guide&lt;/strong&gt; on how JavaScript is powering the next generation of AI on the web. 🌐✨&lt;/p&gt;




&lt;h2&gt;
  
  
  🧠 What You'll Learn
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;What is AI and how it connects to JavaScript&lt;/li&gt;
&lt;li&gt;JavaScript libraries that bring AI to the browser&lt;/li&gt;
&lt;li&gt;Hands-on mini project using &lt;code&gt;TensorFlow.js&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;New and trendy use cases like &lt;strong&gt;GenAI&lt;/strong&gt;, &lt;strong&gt;LLMs&lt;/strong&gt;, and &lt;strong&gt;AI Web Assistants&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Quotes, stats, and real-world references&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  📌 Why Should JavaScript Developers Care About AI?
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;"Artificial intelligence is the new electricity." — &lt;strong&gt;Andrew Ng&lt;/strong&gt;, AI pioneer&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Just like electricity revolutionized industries in the past, AI is now transforming &lt;strong&gt;every tech field&lt;/strong&gt;. And while Python has dominated the AI scene for years, JavaScript is quickly becoming a &lt;strong&gt;front-runner&lt;/strong&gt; in bringing AI to life &lt;strong&gt;in the browser&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  📊 The Stats Say It All
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;JavaScript is the &lt;strong&gt;#1 most used programming language&lt;/strong&gt; (&lt;a href="https://survey.stackoverflow.co/2023/#technology-most-popular-technologies" rel="noopener noreferrer"&gt;Stack Overflow 2023 Developer Survey&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;TensorFlow.js&lt;/code&gt;, &lt;code&gt;Brain.js&lt;/code&gt;, and &lt;code&gt;onnxruntime-web&lt;/code&gt; make AI browser-compatible&lt;/li&gt;
&lt;li&gt;More than &lt;strong&gt;70% of AI demos on the web&lt;/strong&gt; now use some form of JS, WebGL, or WebAssembly (&lt;a href="https://towardsdatascience.com/ai-in-the-browser-the-rise-of-javascript-ml-libraries-55fc03fc1843" rel="noopener noreferrer"&gt;source&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🔍 What is AI, Really?
&lt;/h2&gt;

&lt;p&gt;At its core, &lt;strong&gt;Artificial Intelligence (AI)&lt;/strong&gt; is the simulation of human intelligence by machines. It can include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🧮 &lt;strong&gt;Machine Learning&lt;/strong&gt; (ML): systems that learn from data
&lt;/li&gt;
&lt;li&gt;🖼️ &lt;strong&gt;Computer Vision&lt;/strong&gt;: recognizing images or videos
&lt;/li&gt;
&lt;li&gt;🗣️ &lt;strong&gt;Natural Language Processing&lt;/strong&gt; (NLP): understanding and generating human language
&lt;/li&gt;
&lt;li&gt;🎮 &lt;strong&gt;Reinforcement Learning&lt;/strong&gt;: teaching bots to play games or perform tasks&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In JavaScript, AI most often means using pre-trained models or building lightweight models that can &lt;strong&gt;run in the browser&lt;/strong&gt; using libraries like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.tensorflow.org/js" rel="noopener noreferrer"&gt;TensorFlow.js&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/BrainJS/brain.js" rel="noopener noreferrer"&gt;Brain.js&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://onnxruntime.ai/" rel="noopener noreferrer"&gt;ONNX Runtime Web&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://xenova.github.io/transformers.js/" rel="noopener noreferrer"&gt;Transformers.js&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  💡 Use Case Spotlight: AI-Powered Text Summarizer ✍️
&lt;/h2&gt;

&lt;p&gt;Let’s say you’re building a news site and want to summarize articles for readers. With JavaScript, you can run a lightweight LLM in the browser that:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Reads the content&lt;/li&gt;
&lt;li&gt;Sends a prompt to a &lt;strong&gt;local&lt;/strong&gt; or &lt;strong&gt;cloud-hosted&lt;/strong&gt; LLM&lt;/li&gt;
&lt;li&gt;Returns a short summary in real-time&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Sound too futuristic? Stick around — we’ll build a version of it in this blog using &lt;code&gt;Transformers.js&lt;/code&gt;. 👇&lt;/p&gt;




&lt;h2&gt;
  
  
  🔧 Setting Up Your JavaScript AI Environment
&lt;/h2&gt;

&lt;p&gt;Before you dive into coding, here’s how to set up a basic AI-friendly dev environment.&lt;/p&gt;

&lt;h3&gt;
  
  
  📁 Tools You’ll Need
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tool&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;VS Code&lt;/td&gt;
&lt;td&gt;Code editor&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Node.js&lt;/td&gt;
&lt;td&gt;JavaScript runtime&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;npm / yarn&lt;/td&gt;
&lt;td&gt;Package manager&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Git&lt;/td&gt;
&lt;td&gt;Version control&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Browser&lt;/td&gt;
&lt;td&gt;Where your AI app runs! 🧠🌍&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h3&gt;
  
  
  🛠️ Install TensorFlow.js
&lt;/h3&gt;

&lt;p&gt;Let’s get started with installing one of the most popular JS AI libraries:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; @tensorflow/tfjs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  🧪 Test Your First AI Script
&lt;/h2&gt;

&lt;p&gt;Let’s make sure everything works by running a simple neural net in the browser.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://cdn.jsdelivr.net/npm/@tensorflow/tfjs"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;🧠 AI Says: Add Two Numbers&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;pre&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"output"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/pre&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
      &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;runModel&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;model&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;tf&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sequential&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
        &lt;span class="nx"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;tf&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;layers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dense&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;units&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;inputShape&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}));&lt;/span&gt;
        &lt;span class="nx"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;compile&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;loss&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;meanSquaredError&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;optimizer&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;sgd&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;

        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;xs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;tf&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;tensor2d&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ys&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;tf&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;tensor2d&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;

        &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;ys&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;epochs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;250&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;

        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;output&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;predict&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;tf&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;tensor2d&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]));&lt;/span&gt;
        &lt;span class="nx"&gt;output&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

        &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;output&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;textContent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;AI says: 5 + ? ≈ &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;output&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dataSync&lt;/span&gt;&lt;span class="p"&gt;()[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;

      &lt;span class="nf"&gt;runModel&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🎉 Output: The AI model "learns" that the pattern is x2, and will say something like “5 + ? ≈ 10”.&lt;/p&gt;




&lt;p&gt;Thank you for reading this far. If you find this article useful, please like and share this article. Someone could find it useful too.💖&lt;/p&gt;

&lt;p&gt;Connect with me on 👉  &lt;a href="https://www.linkedin.com/in/shibamdhar/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; and &lt;a href="https://medium.com/@shibam-dhar" rel="noopener noreferrer"&gt;Medium&lt;/a&gt;!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>ai</category>
      <category>beginners</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>State Management for Large Internal Tools: Redux, Context API, or Alternatives?</title>
      <dc:creator>SHIBAM</dc:creator>
      <pubDate>Wed, 26 Mar 2025 14:00:00 +0000</pubDate>
      <link>https://dev.to/shib_itsme/state-management-for-large-internal-tools-redux-context-api-or-alternatives-51op</link>
      <guid>https://dev.to/shib_itsme/state-management-for-large-internal-tools-redux-context-api-or-alternatives-51op</guid>
      <description>&lt;h2&gt;
  
  
  State Management for Large Internal Tools: Redux, Context API, or Alternatives?
&lt;/h2&gt;

&lt;p&gt;Among the biggest challenges developers face while building large internal tool applications is state management. With the plethora of libraries/frameworks available, this can be quite daunting. In this blog we will dissect the three most widely-used state management strategies, Redux vs Context API vs Other solutions, and help you pick the best strategy for your application. This guide’s purpose is also to demystify state management whether you’re a developer or it’s less familiar territory for you.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;What Is State Management?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;State management is about how an app keeps track of its data and updates it when things change. Think of it as the app's memory, helping it remember what it needs to show or do at any given time.&lt;/p&gt;

&lt;p&gt;In web apps, "state" is like a snapshot of the app’s current data that helps display the right information on the screen. For instance, in a tool for managing customer orders, the state might include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Who’s logged in (current user session).
&lt;/li&gt;
&lt;li&gt;A list of all customer orders.
&lt;/li&gt;
&lt;li&gt;Results from a search filter (e.g., only showing "pending orders").&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you don’t have a clear way to manage this state, keeping everything updated and consistent across different parts of the app can become a mess—especially when the app gets bigger or more complex. That’s why using a good state management system is crucial.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Core Considerations for Choosing a State Management Tool&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Before selecting a state management tool, evaluate these technical considerations:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;State Complexity:&lt;/strong&gt; Assess whether your app’s state has simple structures or involves intricate relationships and interdependencies between components.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Update Frequency:&lt;/strong&gt; Determine how often state updates occur and whether real-time or high-frequency updates are required.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Team Expertise:&lt;/strong&gt; Consider the team's proficiency with existing tools and libraries, such as Redux, Context API, or others, to minimize learning curves.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scalability:&lt;/strong&gt; Ensure the chosen solution can accommodate potential growth in application size, data volume, and feature set.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Performance Impact:&lt;/strong&gt; Evaluate the importance of optimizing renders to avoid unnecessary re-renders and maintain high application performance.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These criteria help align the state management choice with the application's technical requirements and future scalability.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Context API&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The Context API is a native feature of React and is often the first choice for smaller-scale applications. It allows you to share data across components without prop drilling (manually passing props through each level of the component tree).&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Use:&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Simple state sharing, such as theme toggles or user authentication.
&lt;/li&gt;
&lt;li&gt;Apps where state does not change frequently or is limited in scope.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Advantages&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Native to React: No need to install additional libraries.
&lt;/li&gt;
&lt;li&gt;Lightweight and easy to implement.
&lt;/li&gt;
&lt;li&gt;Perfect for small to medium-sized apps.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Disadvantages&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Not designed for high-frequency updates.
&lt;/li&gt;
&lt;li&gt;Performance issues arise when multiple components depend on the same context.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Example Code&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;createContext&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;useContext&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Create a context  &lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;UserContext&lt;/span&gt; &lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;createContext&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;App&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;  
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setUser&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;John Doe&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;role&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Admin&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;  
    &lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;UserContext&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Provider&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{{&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setUser&lt;/span&gt; &lt;span class="p"&gt;}}&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;  
      &lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Dashboard&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;  
    &lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/UserContext.Provider&lt;/span&gt;&lt;span class="se"&gt;\&amp;gt;&lt;/span&gt;&lt;span class="sr"&gt; &lt;/span&gt;&lt;span class="err"&gt; 
&lt;/span&gt;  &lt;span class="p"&gt;);&lt;/span&gt;  
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;Dashboard&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;  
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useContext&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;UserContext&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;  
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h1&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Welcome&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h1&lt;/span&gt;&lt;span class="se"&gt;\&amp;gt;&lt;/span&gt;&lt;span class="sr"&gt;; &lt;/span&gt;&lt;span class="err"&gt; 
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  &lt;strong&gt;Explanation:&lt;/strong&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;createContext&lt;/code&gt;&lt;/strong&gt;: This creates a Context object, &lt;code&gt;UserContext&lt;/code&gt;, which allows you to pass data through the component tree without explicitly passing props to each level.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;App&lt;/code&gt; component&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;useState&lt;/code&gt;&lt;/strong&gt; is used to manage the &lt;code&gt;user&lt;/code&gt; state (&lt;code&gt;name&lt;/code&gt; and &lt;code&gt;role&lt;/code&gt;).
&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;UserContext.Provider&lt;/code&gt; component wraps the child component &lt;code&gt;Dashboard&lt;/code&gt; and provides &lt;code&gt;user&lt;/code&gt; and &lt;code&gt;setUser&lt;/code&gt; as the &lt;code&gt;value&lt;/code&gt;. This means any child component inside &lt;code&gt;Provider&lt;/code&gt; can access this data.
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;Dashboard&lt;/code&gt; component&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;useContext(UserContext)&lt;/code&gt;&lt;/strong&gt; is used to access the &lt;code&gt;user&lt;/code&gt; data from the &lt;code&gt;UserContext&lt;/code&gt; and display the user's name.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This setup allows you to share the &lt;code&gt;user&lt;/code&gt; state across different components in the app without prop drilling, especially useful when the app grows.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Redux&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Redux is a powerful state management library commonly used in larger, more complex applications. It uses a centralized store to manage state across the entire app.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Use&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Large-scale apps with complex state interdependencies.
&lt;/li&gt;
&lt;li&gt;High-frequency state updates, such as real-time data syncing.
&lt;/li&gt;
&lt;li&gt;Applications requiring a predictable state container.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Advantages&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Centralized state management.
&lt;/li&gt;
&lt;li&gt;Strong debugging tools via Redux DevTools.
&lt;/li&gt;
&lt;li&gt;Predictable state updates due to strict rules.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Disadvantages&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Boilerplate-heavy: Redux can be verbose, especially for newcomers.
&lt;/li&gt;
&lt;li&gt;Overkill for simple applications.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Example Code&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Install Redux dependencies: npm install @reduxjs/toolkit react-redux  &lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;configureStore&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;createSlice&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@reduxjs/toolkit&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Provider&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;useSelector&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;useDispatch&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-redux&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Create a slice  &lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;userSlice&lt;/span&gt; &lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;createSlice&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;  
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;user&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  
  &lt;span class="na"&gt;initialState&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;John Doe&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;role&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Admin&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;  
  &lt;span class="na"&gt;reducers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;  
    &lt;span class="na"&gt;setUser&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;action&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;  
      &lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;action&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  
      &lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;role&lt;/span&gt; &lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;action&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;role&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  
    &lt;span class="p"&gt;},&lt;/span&gt;  
  &lt;span class="p"&gt;},&lt;/span&gt;  
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;store&lt;/span&gt; &lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;configureStore&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;reducer&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;user&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;userSlice&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;reducer&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;  
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;setUser&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;userSlice&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;actions&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;App&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;  
  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;  
    &lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Provider&lt;/span&gt; &lt;span class="nx"&gt;store&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;store&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;  
      &lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Dashboard&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;  
    &lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Provider&lt;/span&gt;&lt;span class="se"&gt;\&amp;gt;&lt;/span&gt;&lt;span class="sr"&gt; &lt;/span&gt;&lt;span class="err"&gt; 
&lt;/span&gt;  &lt;span class="p"&gt;);&lt;/span&gt;  
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;Dashboard&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;  
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useSelector&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;  
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;dispatch&lt;/span&gt; &lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useDispatch&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;  
    &lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;  
      &lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h1&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Welcome&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h1&lt;/span&gt;&lt;span class="se"&gt;\&amp;gt;&lt;/span&gt;&lt;span class="sr"&gt; &lt;/span&gt;&lt;span class="err"&gt; 
&lt;/span&gt;      &lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;button&lt;/span&gt; &lt;span class="nx"&gt;onClick&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{()&lt;/span&gt; &lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;dispatch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;setUser&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Jane Doe&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;role&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;User&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;}))}&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;  
        &lt;span class="nx"&gt;Change&lt;/span&gt; &lt;span class="nx"&gt;User&lt;/span&gt;  
      &lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/button&lt;/span&gt;&lt;span class="se"&gt;\&amp;gt;&lt;/span&gt;&lt;span class="sr"&gt; &lt;/span&gt;&lt;span class="err"&gt; 
&lt;/span&gt;    &lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="se"&gt;\&amp;gt;&lt;/span&gt;&lt;span class="sr"&gt; &lt;/span&gt;&lt;span class="err"&gt; 
&lt;/span&gt;  &lt;span class="p"&gt;);&lt;/span&gt;  
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  &lt;strong&gt;Explanation:&lt;/strong&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;createSlice&lt;/code&gt;&lt;/strong&gt;: This function from Redux Toolkit creates a "slice" of the state. In this case, the slice is named &lt;code&gt;user&lt;/code&gt; and contains the initial state with a &lt;code&gt;name&lt;/code&gt; and &lt;code&gt;role&lt;/code&gt;, as well as a &lt;code&gt;setUser&lt;/code&gt; action to modify that state.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;configureStore&lt;/code&gt;&lt;/strong&gt;: This sets up the Redux store, and the &lt;code&gt;user&lt;/code&gt; slice reducer is added to the store.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;Provider&lt;/code&gt;&lt;/strong&gt;: The &lt;code&gt;Provider&lt;/code&gt; component is used to pass the Redux store to the rest of the app. This makes the store available to all components that are wrapped in the &lt;code&gt;Provider&lt;/code&gt;.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;useSelector&lt;/code&gt;&lt;/strong&gt;: This hook is used to access the current &lt;code&gt;user&lt;/code&gt; state from the Redux store. It listens to the store and re-renders the component whenever the state changes.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;useDispatch&lt;/code&gt;&lt;/strong&gt;: This hook is used to dispatch actions to modify the Redux state. In this example, when the button is clicked, it dispatches the &lt;code&gt;setUser&lt;/code&gt; action to update the user's name and role.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In this setup, Redux manages global state and provides a way to dispatch actions that change state, which is particularly useful for larger applications with more complex state logic.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Alternatives&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Beyond Context API and Redux, several other state management libraries and patterns are worth considering:&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Zustand&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Zustand is a lightweight state management library with a simpler API compared to Redux. It’s well-suited for both small and medium-scale apps.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Example Code&lt;/strong&gt;
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;create&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;zustand&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;useStore&lt;/span&gt; &lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="kd"&gt;set&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt;  
  &lt;span class="na"&gt;user&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;John Doe&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;role&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Admin&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;  
  &lt;span class="na"&gt;setUser&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="p"&gt;}),&lt;/span&gt;  
&lt;span class="p"&gt;}));&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;App&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;  
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setUser&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useStore&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;  
  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;  
    &lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;  
      &lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h1&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Welcome&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h1&lt;/span&gt;&lt;span class="se"&gt;\&amp;gt;&lt;/span&gt;&lt;span class="sr"&gt; &lt;/span&gt;&lt;span class="err"&gt; 
&lt;/span&gt;      &lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;button&lt;/span&gt; &lt;span class="nx"&gt;onClick&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{()&lt;/span&gt; &lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;setUser&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Jane Doe&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;role&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;User&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;})}&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;  
        &lt;span class="nx"&gt;Change&lt;/span&gt; &lt;span class="nx"&gt;User&lt;/span&gt;  
      &lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/button&lt;/span&gt;&lt;span class="se"&gt;\&amp;gt;&lt;/span&gt;&lt;span class="sr"&gt; &lt;/span&gt;&lt;span class="err"&gt; 
&lt;/span&gt;    &lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="se"&gt;\&amp;gt;&lt;/span&gt;&lt;span class="sr"&gt; &lt;/span&gt;&lt;span class="err"&gt; 
&lt;/span&gt;  &lt;span class="p"&gt;);&lt;/span&gt;  
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;MobX&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;MobX simplifies state management by leveraging observable objects. It’s great for apps with complex UIs that need automatic updates.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Recoil&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Recoil provides fine-grained state management and is designed for React. It allows you to manage independent pieces of state (atoms) and derive computed state (selectors).&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;Choosing the Right Tool&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Here’s a quick summary to guide your decision:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;Context API&lt;/th&gt;
&lt;th&gt;Redux&lt;/th&gt;
&lt;th&gt;Alternatives (Zustand, MobX, etc.)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Best For&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Simple apps&lt;/td&gt;
&lt;td&gt;Large, complex apps&lt;/td&gt;
&lt;td&gt;Small-to-medium apps&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Setup Complexity&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Low&lt;/td&gt;
&lt;td&gt;High&lt;/td&gt;
&lt;td&gt;Low to Medium&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Performance for High Updates&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Moderate&lt;/td&gt;
&lt;td&gt;Excellent&lt;/td&gt;
&lt;td&gt;Excellent&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Boilerplate&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Minimal&lt;/td&gt;
&lt;td&gt;High&lt;/td&gt;
&lt;td&gt;Minimal to Medium&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Building scalable internal tools requires state management, which is a major challenge. Context API is recommended for small apps where as Redux is used for large apps with too many states and its need to be communicated with each other. Solutions like Zustand or MobX offer a middle-ground solution, targeting flexibility with a short learning curve.&lt;/p&gt;

&lt;p&gt;We can have confidence in the decision we made on state management strategy for our application when — we understand how our application manages states and the strengths of each of the tools.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>redux</category>
      <category>devrel</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
