<?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: Gbengacode</title>
    <description>The latest articles on DEV Community by Gbengacode (@gbengacode).</description>
    <link>https://dev.to/gbengacode</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F628728%2F1a839896-718a-4b70-a0af-762552b62d9b.jpg</url>
      <title>DEV Community: Gbengacode</title>
      <link>https://dev.to/gbengacode</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gbengacode"/>
    <language>en</language>
    <item>
      <title>5 Reasons Why Some Junior Developers Never Become Seniors</title>
      <dc:creator>Gbengacode</dc:creator>
      <pubDate>Fri, 09 May 2025 20:19:48 +0000</pubDate>
      <link>https://dev.to/gbengacode/5-reasons-why-some-junior-developers-never-become-seniors-a4k</link>
      <guid>https://dev.to/gbengacode/5-reasons-why-some-junior-developers-never-become-seniors-a4k</guid>
      <description>&lt;p&gt;Becoming a senior developer isn’t just about years of experience—it's about how you grow, think, and adapt. Unfortunately, not every junior developer makes it to the senior level. In this post, I’ll break down five common reasons why that growth sometimes stalls.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Lack of Continuous Learning
&lt;/h3&gt;

&lt;p&gt;You risk becoming outdated if you’re not actively learning new frameworks, languages, or patterns. Reading documentation, experimenting with side projects, and staying curious are essential habits. Seniors don’t stop learning—they learn faster and more strategically.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tip: Allocate a few hours each week to explore something new, even if it's outside your current stack.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Weak Problem-Solving Skills
&lt;/h3&gt;

&lt;p&gt;It’s one thing to write code that works—it’s another to understand why it works and how it can be improved.&lt;/p&gt;

&lt;p&gt;Junior developers who always reach for Stack Overflow before thinking through a problem or who shy away from complex bugs may struggle to grow. Senior developers are expected to break down problems, propose solutions, and think critically under pressure.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tip: Practice solving problems on platforms like LeetCode, CodeWars, or by contributing to open source.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. No Ownership Mentality
&lt;/h3&gt;

&lt;p&gt;Are you just completing tasks, or are you owning features?&lt;/p&gt;

&lt;p&gt;Taking ownership means being responsible for the design, development, testing, and success of what you build. Juniors who always wait to be told what to do—or deflect responsibility when things go wrong—miss out on opportunities to lead.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tip: Start by volunteering to take charge of small features or improvements end-to-end.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. Poor Communication &amp;amp; Collaboration
&lt;/h3&gt;

&lt;p&gt;You could be the best coder on the team, but if you can’t communicate your ideas or work well with others, you’re not going to grow.&lt;/p&gt;

&lt;p&gt;Senior developers are often bridges between teams. They write documentation, review pull requests, and mentor juniors. If you’re not building those soft skills, it will be hard to take the next step.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tip: Practice explaining technical concepts in plain English. Write blog posts. Lead a sprint demo. Pair program.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  5.  Fear of Failure or Avoiding Challenges
&lt;/h3&gt;

&lt;p&gt;Growth comes from discomfort. The sooner you’re okay with being wrong or struggling with tough problems, the sooner you’ll grow.&lt;/p&gt;

&lt;p&gt;Some juniors avoid challenging work because they’re afraid to fail. But every senior developer has a graveyard of bugs and broken deployments behind them—it’s part of the journey.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tip: Say “yes” to things that scare you. Take on that refactor. Dive into legacy code. You’ll learn faster than you think.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;Not every junior developer becomes a senior, but every senior started as a junior. It’s not just about coding more, it’s about thinking differently, owning your growth, and embracing the challenges ahead.&lt;/p&gt;

&lt;p&gt;Are you working on leveling up right now? What’s been your biggest obstacle or breakthrough?&lt;/p&gt;

&lt;p&gt;Let me know in the comments. See you in my next post.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Lynx vs. React Native: Is TikTok’s New Framework a Game Changer?</title>
      <dc:creator>Gbengacode</dc:creator>
      <pubDate>Tue, 11 Mar 2025 08:49:07 +0000</pubDate>
      <link>https://dev.to/gbengacode/lynx-vs-react-native-is-tiktoks-new-framework-a-game-changer-3ej2</link>
      <guid>https://dev.to/gbengacode/lynx-vs-react-native-is-tiktoks-new-framework-a-game-changer-3ej2</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Lynx, developed by ByteDance, and React Native, created by Facebook, are both frameworks designed to facilitate cross-platform mobile application development. Here's a comparison highlighting their key differences and similarities:&lt;/p&gt;

&lt;h3&gt;
  
  
  Architecture and Performance
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Lynx: Utilizes a multi-threaded interactivity model that separates UI rendering from business logic, aiming to enhance performance and responsiveness. This design ensures smoother UI experiences, especially in resource-intensive applications. &lt;/li&gt;
&lt;li&gt;React Native: Employs a JavaScript bridge to communicate between JavaScript code and native modules, which can introduce performance bottlenecks in complex applications. However, React Native's new architecture, Fabric &amp;amp; JSI, aims to reduce dependency on the JS bridge, allowing direct interaction with native code.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Development Approach
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Lynx: Designed to be framework-agnostic but currently offers robust support for React. Developers can write markup and CSS similarly to web development, making it accessible for those familiar with web technologies. However, Lynx is primarily intended for integrating shared views into existing native applications rather than building entire apps from scratch. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;React Native: Allows developers to build entire applications using JavaScript and React, with components rendering as native widgets. It provides a comprehensive solution for developing full-fledged mobile applications across platforms.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Community and Ecosystem
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Lynx: Recently open-sourced, Lynx's public ecosystem is still developing. While it has been used internally by ByteDance for years, it currently lacks the broader community support and third-party libraries that more established frameworks offer. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;React Native: Boasts a mature ecosystem with extensive community support, numerous plugins, and third-party libraries, facilitating faster development and troubleshooting.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Use Cases
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Lynx: Suitable for integrating high-performance, native-like views into existing applications. It's particularly beneficial for apps requiring complex UI components and smooth animations&lt;/li&gt;
&lt;li&gt;React Native: Ideal for building entire cross-platform applications from scratch, especially when leveraging React's component-based architecture and existing JavaScript knowledge.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In summary, while both Lynx and React Native aim to simplify cross-platform mobile development, they differ in architecture, performance optimization, development approach, and ecosystem maturity. React Native offers a more established environment for building complete applications, whereas Lynx provides a modern approach to integrating high-performance components into existing apps, with the potential to evolve into a comprehensive framework as its ecosystem grows.&lt;/p&gt;

&lt;p&gt;Kindly like, share, and follow see you in my next post.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>javascript</category>
      <category>mobile</category>
    </item>
    <item>
      <title>React Reconciliation</title>
      <dc:creator>Gbengacode</dc:creator>
      <pubDate>Sat, 04 May 2024 20:57:44 +0000</pubDate>
      <link>https://dev.to/gbengacode/react-reconciliation-59am</link>
      <guid>https://dev.to/gbengacode/react-reconciliation-59am</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;React, a popular JavaScript library for building user interfaces employs a sophisticated process called reconciliation to efficiently update the UI in response to changes in data or state. Reconciliation lies at the heart of React's performance optimization strategy, ensuring that UI updates are fast and seamless. In this article, we'll delve into the intricacies of React reconciliation, exploring its key concepts and how it optimizes the rendering process.&lt;/p&gt;

&lt;h2&gt;
  
  
  The concept of the Virtual Dom in React
&lt;/h2&gt;

&lt;p&gt;At the core of React's reconciliation process is the Virtual DOM, a lightweight, in-memory representation of the actual DOM. When a component's state changes, React constructs a new Virtual DOM tree, which mirrors the structure of the UI. This Virtual DOM serves as a blueprint for what the UI should look like based on the updated state.&lt;/p&gt;

&lt;h2&gt;
  
  
  Diffing Algorithm the algorithm for React Reconciliation
&lt;/h2&gt;

&lt;p&gt;React's reconciliation algorithm employs a technique known as tree diffing to compare the previous Virtual DOM with the new one. This process involves traversing both trees and identifying the differences between them. By comparing the two trees, React can determine precisely which parts of the UI have changed, need to be added, or should be removed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Component Lifecycle Methods for Aiding React Reconciliation
&lt;/h2&gt;

&lt;p&gt;React provides developers with a set of lifecycle methods that allow them to fine-tune the reconciliation process. Two key methods, shouldComponentUpdate and componentDidUpdate, play a crucial role in optimizing component rendering.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;shouldComponentUpdate: This method allows developers to control whether a component should re-render based on changes in state or props. By implementing custom logic within shouldComponentUpdate, developers can prevent unnecessary re-renders, thus improving performance.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;componentDidUpdate: After a component has been updated and re-rendered, the componentDidUpdate method is called. This lifecycle hook is useful for performing side effects or additional updates based on the new state.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Keyed Reconciliation: Optimizing List Rendering
&lt;/h2&gt;

&lt;p&gt;Rendering lists of elements efficiently is a common challenge in web development. React addresses this challenge through keyed reconciliation, where each element in a list is assigned a unique identifier (key). By using keys, React can track individual elements and optimize updates accordingly.&lt;br&gt;
For example&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;ul&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;items&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;li&lt;/span&gt; &lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&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="nx"&gt;item&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/li&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="p"&gt;))}&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/ul&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, each &lt;code&gt;&amp;lt;li&amp;gt;&lt;/code&gt;element is assigned a unique key based on the item.id. React leverages these keys to identify which elements have changed, moved, or been added/removed within the list.&lt;/p&gt;

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

&lt;p&gt;React reconciliation is a critical aspect of React's performance optimization strategy. By leveraging the Virtual DOM, a sophisticated diffing algorithm, and lifecycle methods, React ensures that UI updates are fast, efficient, and seamless. Understanding the principles of reconciliation empowers developers to build high-performance React applications that deliver exceptional user experiences.&lt;/p&gt;

&lt;p&gt;Kindly like, share, and follow see you in my next post.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>The Concept of API Versioning in API Design</title>
      <dc:creator>Gbengacode</dc:creator>
      <pubDate>Fri, 03 May 2024 16:50:05 +0000</pubDate>
      <link>https://dev.to/gbengacode/the-concept-of-api-versioning-in-api-design-2911</link>
      <guid>https://dev.to/gbengacode/the-concept-of-api-versioning-in-api-design-2911</guid>
      <description>&lt;h2&gt;
  
  
  What is API Versioning?
&lt;/h2&gt;

&lt;p&gt;API Versioning is the practice of managing different releases or iterations of an API. It involves assigning unique identifiers (usually in the form of version numbers or labels) to distinct sets of functionalities and endpoints within an API. This allows developers to introduce changes, enhancements, or fixes to an API while maintaining backward compatibility with existing client applications.&lt;/p&gt;

&lt;h3&gt;
  
  
  Approaches to API Versioning
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;URI Versioning&lt;/strong&gt;: In this approach, the API version is specified directly in the URI (Uniform Resource Identifier) of each endpoint.
For example:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;https&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="c1"&gt;//api.example.com/v1/users&lt;/span&gt;
&lt;span class="nx"&gt;https&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="c1"&gt;//api.example.com/v2/users &lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Query Parameter Versioning&lt;/strong&gt;: The API version is included as a query parameter in API requests. For example:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;https&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="c1"&gt;//api.example.com/users?version=1&lt;/span&gt;
&lt;span class="nx"&gt;https&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="c1"&gt;//api.example.com/users?version=2&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Header Versioning&lt;/strong&gt;: Header versioning refers to the practice of including the API version information as a standard HTTP header in API requests. This typically involves using existing HTTP header fields, such as Accept or Content-Type.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Media Type Versioning&lt;/strong&gt;: The API version is indicated in the media type (MIME type) of the request or response. For example:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;Accept&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;application&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;vnd&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;example&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;v1&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="nx"&gt;json&lt;/span&gt;
&lt;span class="nx"&gt;Content&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;Type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;application&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;vnd&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;example&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;v2&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="nx"&gt;json&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Custom header versioning&lt;/strong&gt;: Custmo header versioning is a specific subset of header versioning where a custom header is created solely for the purpose of conveying the API version. Unlike standard HTTP headers like Accept or Content-Type, custom headers are specifically defined by API providers to carry version information.
For example
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;GET&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;users&lt;/span&gt; &lt;span class="nx"&gt;HTTP&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mf"&gt;1.1&lt;/span&gt;
&lt;span class="nx"&gt;Host&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;api&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;example&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;com&lt;/span&gt;
&lt;span class="nx"&gt;X&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;API&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;Version&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; 

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Semantic Versioning&lt;/strong&gt;: This approach assigns version numbers according to the Semantic Versioning (SemVer) scheme, which consists of three parts: MAJOR.MINOR.PATCH. This scheme is typically used for libraries or SDKs but can also be applied to APIs.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Advantages of API versioning
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Maintaining Compatibility&lt;/strong&gt;: As your API evolves over time, you may need to introduce changes that could potentially break existing client implementations. Versioning allows you to make these changes without disrupting existing users who may rely on specific behaviors or data formats. Each version can be maintained independently, allowing clients to continue using older versions while new ones are developed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Enabling Evolution&lt;/strong&gt;: APIs need to evolve to accommodate new features, bug fixes, and improvements. Versioning provides a structured approach to introducing these changes while ensuring backward compatibility with existing clients. Without versioning, changes could lead to unexpected behavior or even failure in client applications.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Managing Deprecation&lt;/strong&gt;: As APIs evolve, certain functionalities or endpoints may become deprecated. Versioning allows you to communicate these changes clearly to clients, providing them with ample time to migrate to newer versions that offer equivalent or improved functionality. Deprecation policies should be documented and communicated to API consumers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Supporting Multiple Clients&lt;/strong&gt;: APIs are often consumed by multiple clients, such as web applications, mobile apps, and third-party services. Versioning enables you to cater to the diverse needs of these clients without forcing them to adopt changes that may not be relevant to their use cases. Clients can choose to upgrade to newer versions at their own pace.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Facilitating Testing and Debugging&lt;/strong&gt;: With versioned APIs, developers can test their applications against specific versions to ensure compatibility and reliability. This simplifies the testing process and reduces the risk of introducing bugs or regressions in production environments.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Enhancing Security&lt;/strong&gt;: Security vulnerabilities may be discovered in older versions of APIs. Versioning allows you to address these vulnerabilities by releasing patches or updates to affected versions while maintaining support for newer versions. This helps protect both your API and its consumers from potential security threats.&lt;/p&gt;

&lt;p&gt;Let me know your thoughts about API versioning and how you have used them. See you in my next post.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>React 19 Is Here!</title>
      <dc:creator>Gbengacode</dc:creator>
      <pubDate>Sat, 24 Feb 2024 06:41:07 +0000</pubDate>
      <link>https://dev.to/gbengacode/react-19-is-here-oha</link>
      <guid>https://dev.to/gbengacode/react-19-is-here-oha</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;React 19 emerges as a game-changer in front-end development, introducing many innovative features. From refined concurrent rendering to novel state-handling mechanisms, React 19 enhances both performance and developer experience. In this article, we explore these cutting-edge additions, providing insights into how they reshape the landscape of dynamic user interface development. Whether you're a seasoned React developer or new to the framework, understanding React 19's advancements is crucial for staying ahead in modern web development. Join us on a journey to unravel the transformative features that make React 19 a milestone release, setting the stage for the future of front-end innovation.&lt;/p&gt;

&lt;h2&gt;
  
  
  New features
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. React Compiler
&lt;/h3&gt;

&lt;p&gt;React Compiler, no longer a research project, is now powering Instagram.com in production, representing a significant advancement in React's capabilities. It addresses the issue of excessive re-renders on state changes by introducing an optimizing compiler. Unlike manual memoization, this compiler automatically re-renders specific UI parts when the state changes, eliminating code clutter. Operating within the rules of both JavaScript and React, it ensures safety and performance. Developers can validate their code with tools like Strict Mode and React's ESLint plugin. The compiler is already active on Instagram.com and is set for further integration across Meta surfaces, with plans for an open-source release.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Actions
&lt;/h3&gt;

&lt;p&gt;Actions allow you to pass a function to DOM elements such as &lt;/p&gt;
&lt;br&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;form&lt;/span&gt; &lt;span class="nx"&gt;action&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;search&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;query&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;/&amp;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;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;submit&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Search&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="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/form&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The action function has the flexibility to operate synchronously or asynchronously. It can be defined on the client side using standard JavaScript or on the server using the 'use server' directive. React takes charge of managing the data submission life cycle when an action is employed, offering hooks like useFormStatus and useFormState for accessing the current form action's state and response.&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;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useFormStatus&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="s2"&gt;react-dom&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="nx"&gt;action&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;./actions&lt;/span&gt;&lt;span class="dl"&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;Submit&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;status&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useFormStatus&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="k"&gt;return&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;disabled&lt;/span&gt;&lt;span class="o"&gt;=&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="nx"&gt;pending&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Submit&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="err"&gt;&amp;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="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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;form&lt;/span&gt; &lt;span class="nx"&gt;action&lt;/span&gt;&lt;span class="o"&gt;=&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="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Submit&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/form&lt;/span&gt;&lt;span class="err"&gt;&amp;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;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="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useFormState&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="s2"&gt;react-dom&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&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;increment&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;previousState&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="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;previousState&lt;/span&gt; &lt;span class="o"&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="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;StatefulForm&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;state&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;formAction&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useFormState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;increment&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="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;form&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;button&lt;/span&gt; &lt;span class="nx"&gt;formAction&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;formAction&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Increment&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="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/form&lt;/span&gt;&lt;span class="err"&gt;&amp;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;By default, Actions are submitted within a transition, maintaining the interactivity of the current page during processing. With support for async functions, the introduction of async/await in transitions enables the display of pending UI, utilizing the isPending state to signal ongoing processing during asynchronous requests like fetching data.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. React Canary
&lt;/h3&gt;

&lt;p&gt;Canaries mark a shift in our React development approach. Unlike the previous method where features were researched and developed privately within Meta, Canaries involved building in public with community collaboration to refine features showcased in the React Labs blog series. This approach ensures that users are informed about upcoming features earlier in the development process. It allows them to witness the finalization stages rather than only encountering the polished product upon Stable release.&lt;/p&gt;

&lt;p&gt;Some of the features in the react canary are &lt;br&gt;
React Server Components, Asset Loading, Document Metadata, and Actions &lt;/p&gt;
&lt;h4&gt;
  
  
  1. Directives
&lt;/h4&gt;

&lt;p&gt;"use client" and "use server" are bundler features designed for full-stack React frameworks. They mark the “split points” between the two environments: "use client" instructs the bundler to generate a &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; tag (like Astro Islands), while "use server" tells the bundler to generate a POST endpoint (like tRPC Mutations). Together, they let you write reusable components that compose client-side interactivity with the related server-side logic.&lt;/p&gt;
&lt;h4&gt;
  
  
  2. Document Metadata:
&lt;/h4&gt;

&lt;p&gt;Support for rendering &lt;code&gt;&amp;lt;title&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;meta&amp;gt;&lt;/code&gt;, and metadata &lt;code&gt;&amp;lt;link&amp;gt;&lt;/code&gt; tags anywhere in your component tree has been added. These work the same way in all environments, including fully client-side code, SSR, and RSC. This provides built-in support for features pioneered by libraries like React Helmet.&lt;/p&gt;
&lt;h4&gt;
  
  
  3. Actions
&lt;/h4&gt;

&lt;p&gt;Actions are to manage sending data from the client to the server. You can add action to elements like &lt;code&gt;&amp;lt;form/&amp;gt;&lt;/code&gt;, access the status with useFormStatus, handle the result with useFormState, and optimistically update the UI with useOptimistic.&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;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useOptimistic&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="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;AppContainer&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;optimisticState&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;addOptimistic&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useOptimistic&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="c1"&gt;// updateFn&lt;/span&gt;
    &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;currentState&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;optimisticValue&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="c1"&gt;// merge and return new state&lt;/span&gt;
      &lt;span class="c1"&gt;// with optimistic value&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;To get started with the React canary&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="c1"&gt;//for npm &lt;/span&gt;
&lt;span class="nx"&gt;npm&lt;/span&gt; &lt;span class="nx"&gt;install&lt;/span&gt; &lt;span class="nx"&gt;react&lt;/span&gt;&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;canary&lt;/span&gt; &lt;span class="nx"&gt;react&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;dom&lt;/span&gt;&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;canary&lt;/span&gt;
&lt;span class="c1"&gt;//for yarn&lt;/span&gt;
&lt;span class="nx"&gt;yarn&lt;/span&gt; &lt;span class="nx"&gt;add&lt;/span&gt; &lt;span class="nx"&gt;react&lt;/span&gt;&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;canary&lt;/span&gt; &lt;span class="nx"&gt;react&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;dom&lt;/span&gt;&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;canary&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Creating a dedicated testing environment is preferable to modifying your current production dependencies. This approach enables you to offer feedback without causing disruptions to your live applications.&lt;/p&gt;

&lt;p&gt;That is all for now. See you in my next post. Kindly like, share, comment, and follow. &lt;/p&gt;

</description>
      <category>webdev</category>
      <category>react</category>
      <category>frontend</category>
      <category>beginners</category>
    </item>
    <item>
      <title>How to monitor your Next.js Application performance and track errors with Sentry</title>
      <dc:creator>Gbengacode</dc:creator>
      <pubDate>Fri, 23 Feb 2024 10:01:16 +0000</pubDate>
      <link>https://dev.to/gbengacode/how-to-monitor-nextjs-application-performance-and-track-errors-with-sentry-36l2</link>
      <guid>https://dev.to/gbengacode/how-to-monitor-nextjs-application-performance-and-track-errors-with-sentry-36l2</guid>
      <description>&lt;h2&gt;
  
  
  What is Sentry
&lt;/h2&gt;

&lt;p&gt;Sentry is an open-source platform for tracking and monitoring errors, empowering developers to detect, prioritize, and address issues in real-time promptly. This tool delivers comprehensive error reports, stack traces, and deep insights into the underlying causes of errors, facilitating swift diagnosis and resolution. It extends its support across various platforms and languages such as JavaScript, Node.js, Python, and Java. By leveraging Sentry's robust features, development teams can effectively maintain the stability and dependability of their applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to setup Sentry in your Next.js Application
&lt;/h2&gt;

&lt;p&gt;The easiest way to setup is to through the use of SDK&lt;br&gt;
Sentry captures data by using an SDK within your application’s runtime.&lt;/p&gt;
&lt;h3&gt;
  
  
  Procedures
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Sign in to &lt;a href="https://sentry.io/auth/login/" rel="noopener noreferrer"&gt;Sentry&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Bootstrap a Next.js Application by running&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;npx&lt;/span&gt; &lt;span class="nx"&gt;create&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;next&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;latest&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;




&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Install the SDK through the installation wizard&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;npx&lt;/span&gt; &lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;sentry&lt;/span&gt;&lt;span class="sr"&gt;/wizard@latest -i nextj&lt;/span&gt;&lt;span class="err"&gt;s
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;




&lt;/li&gt;

&lt;/ol&gt;

&lt;p&gt;The wizard will prompt you to log in to Sentry. It will then automatically do the following steps for you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;create config files with the default Sentry.init() calls for each runtime (node, browser, edge)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;create or update your Next.js config with the default Sentry configuration&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;create .sentryclirc with an auth token to upload source maps (this file is automatically added to .gitignore)&lt;br&gt;
add an example page to your app to verify your Sentry setup&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We can pass extra configuration the through the option in the Sentry.init() calls.&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="nx"&gt;Sentry&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;init&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;dsn&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://69cb89218edf8713f71b66a00c5c9f66@o4506789727305728.ingest.sentry.io/4506789728419840&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;maxBreadcrumbs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;debug&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The list of the common options are dsn, debug, release, environment etc. You can check the doc for more option exploration &lt;a href="https://docs.sentry.io/platforms/javascript/guides/nextjs/configuration/options/" rel="noopener noreferrer"&gt;https://docs.sentry.io/platforms/javascript/guides/nextjs/configuration/options/&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Let's make a sample Next.js API call and test Sentry error reporting
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;use client&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;Sentry&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@sentry/nextjs&lt;/span&gt;&lt;span class="dl"&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="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;Home&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;failedApiCall&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="k"&gt;try&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="s2"&gt;this is an error&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="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;Sentry&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;captureException&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;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;main&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;flex min-h-screen flex-col items-center justify-between p-24&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;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;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;p-3 border border-blue-500&lt;/span&gt;&lt;span class="dl"&gt;"&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="nx"&gt;failedApiCall&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Throw&lt;/span&gt; &lt;span class="nx"&gt;an&lt;/span&gt; &lt;span class="nb"&gt;Error&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="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/main&lt;/span&gt;&lt;span class="err"&gt;&amp;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;
  
  
  Sentry Performance Monitoring and Error Reporting
&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%2Frj36ff2prtb69hy2cl20.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%2Frj36ff2prtb69hy2cl20.png" alt="Sentry performance monitor and Error reporting" width="800" height="367"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From the report, we can get useful insight into the error where the application that leads to the error the source URL the browser, and the system which the user uses to access the application and other useful sights. &lt;br&gt;
That is it for now. For more posts like this kindly follow, like, and comment. See you in my next post&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>nextjs</category>
      <category>sentry</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Exploring the New Features in Node.js Version 20 for Implementing Them in a Project</title>
      <dc:creator>Gbengacode</dc:creator>
      <pubDate>Sat, 09 Sep 2023 08:44:31 +0000</pubDate>
      <link>https://dev.to/gbengacode/examining-nodejs-v20-features-in-real-world-scenarios-5blg</link>
      <guid>https://dev.to/gbengacode/examining-nodejs-v20-features-in-real-world-scenarios-5blg</guid>
      <description>&lt;h2&gt;
  
  
  Node.js v20+
&lt;/h2&gt;

&lt;p&gt;Node.js v20, launched on April 18, 2023, introduces a range of exciting enhancements. In this release, Node.js focuses on bolstering its security by minimizing external dependencies and introducing a reliable built-in test runner. Moreover, Node.js v20 empowers developers to build self-contained executable applications that can run seamlessly on Windows, macOS, and Linux without the need for Node.js installation on users' systems.&lt;br&gt;
In this post, we will be looking at some of the features of this improved version of Node.js and how to integrate them into your projects.&lt;/p&gt;
&lt;h2&gt;
  
  
  Features in the Node.js v20
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Built-in .env file support&lt;/li&gt;
&lt;li&gt;Experimental Permission Model&lt;/li&gt;
&lt;li&gt;Custom ESM loader hooks on a dedicated thread&lt;/li&gt;
&lt;li&gt;Synchronous import.meta.resolve()&lt;/li&gt;
&lt;li&gt;url.parse() warns URLs with ports that are not numbers&lt;/li&gt;
&lt;li&gt;Stable test runner&lt;/li&gt;
&lt;li&gt;V8 JavaScript engine updated to V8 11.3&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Getting Started
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Download and Installation Node.js if it is not installed on your machine. &lt;/li&gt;
&lt;li&gt;Use Node version Manager to upgrade your Node.js version if it is not v20.
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;nvm&lt;/span&gt; &lt;span class="nx"&gt;install&lt;/span&gt; &lt;span class="nx"&gt;v20&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mf"&gt;6.1&lt;/span&gt;
&lt;span class="nx"&gt;nvm&lt;/span&gt; &lt;span class="nx"&gt;use&lt;/span&gt; &lt;span class="nx"&gt;v20&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mf"&gt;6.1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Initialize your node application with
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;npm&lt;/span&gt; &lt;span class="nx"&gt;init&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  Built-in .env file support
&lt;/h2&gt;
&lt;h2&gt;
  
  
  What is an environment variable
&lt;/h2&gt;

&lt;p&gt;Environment variables provide insights into a process's operational context, encompassing aspects like production, development, and the build pipeline. In Node.js, they serve as a secure repository for sensitive information, such as passwords and API credentials, that should not be hard-coded in the codebase. Utilizing environment variables is essential for configuring variables or settings that may vary across different environments.&lt;/p&gt;

&lt;p&gt;Node.js inherently supports environment variables, rendering them a superior choice compared to alternative configuration methods like config.js or config.json files. Leveraging environment variables, especially in tandem with automation tools like build pipelines, enables you to steer clear of cumbersome tasks like scripting configuration files.&lt;br&gt;
One of the most popular package use in configuration of environment variable in node is the dotenv package but with the introduction of Node.js v20. Starting from Node.js v20.6.0, Node.js supports .env files for configuring environment variables.&lt;/p&gt;

&lt;p&gt;Your configuration file should follow the INI file format, with each line containing a key-value pair for an environment variable.&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="nx"&gt;URL&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;http://test.com&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2Fjmqx8t9pvpec4smz3riy.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%2Fjmqx8t9pvpec4smz3riy.png" alt="Image description" width="800" height="176"&gt;&lt;/a&gt;&lt;br&gt;
To initialize your Node.js application with predefined configurations, use the following CLI command:&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="nx"&gt;node&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;file&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt; &lt;span class="nx"&gt;filename&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;js&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;. We can specific the folder in which the .env file is in&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="nx"&gt;node&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;file&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;foldername&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt; &lt;span class="nx"&gt;filename&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;js&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can go ahead and configure the package.json file to with above CLI command &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%2F1hvi3igwvknlqj5n8lpl.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%2F1hvi3igwvknlqj5n8lpl.png" alt="Node 20 test" width="800" height="410"&gt;&lt;/a&gt;&lt;br&gt;
We notice that this using nodemon package to turn our server.js file, this is useful for development purpose since it's watch for changes and restart the server if need be.&lt;/p&gt;
&lt;h2&gt;
  
  
  Stable test runner
&lt;/h2&gt;

&lt;p&gt;A test runner is a software tool or framework that automates the execution of tests for software applications. Its primary purpose is to locate, run, and report on the results of tests, making it an essential component of the software testing process. Test runners are particularly valuable in the context of automated testing and continuous integration (CI) pipelines. Here are some key aspects and functions of a test runner:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Test Discovery: Test runners typically have the capability to discover and locate test cases within a codebase automatically. They can identify test files, classes, functions, or methods that are intended for testing.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Execution: Test runners execute the identified tests, running them one by one or in parallel, depending on the configuration. They simulate the interaction with the application to verify that it behaves as expected.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Reporting: Test runners collect and report the results of test execution. They provide information on which tests passed, which failed, and any errors or exceptions encountered during testing. This reporting helps developers identify and address issues in their code.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Configuration: Test runners often allow configuration options to control how tests are executed. This includes specifying test environments, controlling parallelism, and filtering tests based on criteria like tags or categories.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Integration: Test runners can be integrated into continuous integration (CI) and continuous delivery (CD) pipelines, enabling automated testing as part of the software development and deployment process. They can also integrate with other development tools and services.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Support for Multiple Testing Frameworks: Many test runners are designed to work with various testing frameworks, such as JUnit, NUnit, Mocha, Jasmine, pytest, and more. This flexibility allows developers to choose the testing framework that best suits their project.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For Node.js we mostly used test runner like Jest or Mocha. With Node.js v20 we can now run tests without using external test runners. &lt;/p&gt;
&lt;h2&gt;
  
  
  Get started with Node Native Test
&lt;/h2&gt;
&lt;h3&gt;
  
  
  The Node Test Module
&lt;/h3&gt;

&lt;p&gt;The node:test module facilitates the creation of JavaScript tests. To access it:&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;import&lt;/span&gt; &lt;span class="nx"&gt;test&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;node:test&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;p&gt;Tests created via the test module consist of a single function that is processed in one of three ways:&lt;/p&gt;

&lt;p&gt;A synchronous function that is considered failing if it throws an exception, and is considered passing otherwise.&lt;br&gt;
A function that returns a Promise that is considered failing if the Promise rejects, and is considered passing if the Promise resolves.&lt;br&gt;
A function that receives a callback function. If the callback receives any truthy value as its first argument, the test is considered failing. If a falsy value is passed as the first argument to the callback, the test is considered passing. If the test function receives a callback function and also returns a Promise, the test will fail.&lt;/p&gt;

&lt;p&gt;The Node.js v20 also exposes the assert module&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;import&lt;/span&gt; &lt;span class="nx"&gt;assert&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;node:assert&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Running tests can also be done using describe to declare a suite and it to declare a test. A suite is used to organize and group related tests together. it is a shorthand for test().&lt;/p&gt;

&lt;h2&gt;
  
  
  Sample Test
&lt;/h2&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="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;describe&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;it&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;node:test&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;assert&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;node:assert&lt;/span&gt;&lt;span class="dl"&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;add&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;multiply&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;subtract&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;../calc.js&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="nf"&gt;describe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;test&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="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;should do some addition operation&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="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;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;add&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="nx"&gt;assert&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;equal&lt;/span&gt;&lt;span class="p"&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;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;})&lt;/span&gt;

  &lt;span class="nf"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;should do some subtraction operation&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="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;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;subtract&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="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nx"&gt;assert&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;equal&lt;/span&gt;&lt;span class="p"&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;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;})&lt;/span&gt;

  &lt;span class="nf"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;should do some subtraction operation&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;skip&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="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;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;multiply&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="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nx"&gt;assert&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;equal&lt;/span&gt;&lt;span class="p"&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;15&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;
  
  
  The result of the test
&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%2F0f97opeigt5xqf4irblu.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%2F0f97opeigt5xqf4irblu.png" alt="Image description" width="800" height="346"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We also have extra options for our test like&lt;br&gt;
&lt;strong&gt;Skipping tests&lt;/strong&gt;&lt;br&gt;
Individual tests can be skipped by passing the skip option to the test, or by calling the test context's skip() method&lt;br&gt;
&lt;strong&gt;Only tests&lt;/strong&gt;&lt;br&gt;
If Node.js is started with the --test-only command-line option, it is possible to skip all top level tests except for a selected subset by passing the only option to the tests that should be run.&lt;br&gt;
&lt;strong&gt;Filtering tests by name&lt;/strong&gt;&lt;br&gt;
The --test-name-pattern command-line option can be used to only run tests whose name matches the provided pattern. Test name patterns are interpreted as JavaScript regular expressions.&lt;br&gt;
That is it for now. See you in my next post&lt;/p&gt;

</description>
      <category>node</category>
      <category>programming</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>How to Speed up and Improve Performance of Your Node JS Application</title>
      <dc:creator>Gbengacode</dc:creator>
      <pubDate>Mon, 28 Aug 2023 11:29:21 +0000</pubDate>
      <link>https://dev.to/gbengacode/speed-up-your-node-js-application-with-compression-package-1n48</link>
      <guid>https://dev.to/gbengacode/speed-up-your-node-js-application-with-compression-package-1n48</guid>
      <description>&lt;p&gt;When building Node.js applications, especially in the case of larger projects, it becomes paramount to maintain minimal data transfer during client interactions. This practice is instrumental in achieving peak performance on the client side. Consequently, there is a demand for reducing the payload of the responses being sent to users, all the while preserving the integrity of the response content.&lt;/p&gt;

&lt;p&gt;A Node.js compression middleware known as &lt;a href="https://www.npmjs.com/package/compression" rel="noopener noreferrer"&gt; Compression&lt;/a&gt; the-shelf solution for effectively compressing responses sent from the application to clients. This tool seamlessly addresses the aforementioned need, ensuring that data transmission remains efficient and optimized.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to implement compression package in to your node application
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;install the compression package 
&lt;code&gt;npm install compression&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;use the compression middleware in your application &lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Sample code with an Express Application
&lt;/h2&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;express&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;express&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="nx"&gt;compression&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;compression&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;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;express&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;PORT&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;7000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Change this to the port you want to listen on&lt;/span&gt;

&lt;span class="c1"&gt;// Apply compression middleware with custom configuration&lt;/span&gt;
&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nf"&gt;compression&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;level&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="c1"&gt;//&lt;/span&gt;
    &lt;span class="na"&gt;threshold&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="na"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&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="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;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;x-no-compression&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;return&lt;/span&gt; &lt;span class="nx"&gt;compression&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&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="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Don't apply compression if 'x-no-compression' header is present&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;app&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;/&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;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&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;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;This is a post about how to use the compression package&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;repeat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10000&lt;/span&gt;&lt;span class="p"&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;send&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="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;listen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;PORT&lt;/span&gt;&lt;span class="p"&gt;,&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="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="s2"&gt;`Listening on port &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;PORT&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&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;
  
  
  Custom configuration of compression
&lt;/h2&gt;

&lt;h3&gt;
  
  
  level
&lt;/h3&gt;

&lt;p&gt;The level of zlib compression to apply to responses. A higher level will result in better compression, but will take longer to complete. A lower level will result in less compression, but will be much faster.&lt;/p&gt;

&lt;h3&gt;
  
  
  Threshold
&lt;/h3&gt;

&lt;p&gt;The byte threshold for the response body size before compression is considered for the response, defaults to 1kb. This is a number of bytes or any string accepted by the bytes module.&lt;/p&gt;

&lt;h3&gt;
  
  
  filter
&lt;/h3&gt;

&lt;p&gt;A function to decide if the response should be considered for compression. This function is called as filter(req, res) and is expected to return true to consider the response for compression, or false to not compress the response.&lt;br&gt;
The default filter function uses the compressible module to determine if res.getHeader('Content-Type') is compressible.&lt;/p&gt;

&lt;h3&gt;
  
  
  Before Compression
&lt;/h3&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%2Fd98mdx7an1ik9ad3uqs8.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%2Fd98mdx7an1ik9ad3uqs8.png" alt="Node JS compression" width="800" height="176"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  After Compression
&lt;/h3&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%2Fxkbnt5fmdwbgbavomc66.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%2Fxkbnt5fmdwbgbavomc66.png" alt="Node JS compression" width="800" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The size of payload before was 550kb before and after is 181b&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>tutorial</category>
      <category>node</category>
    </item>
    <item>
      <title>ChatGPT "The New Magic Response System"</title>
      <dc:creator>Gbengacode</dc:creator>
      <pubDate>Sat, 17 Dec 2022 12:18:26 +0000</pubDate>
      <link>https://dev.to/gbengacode/chatgpt-the-new-magic-response-system-bno</link>
      <guid>https://dev.to/gbengacode/chatgpt-the-new-magic-response-system-bno</guid>
      <description>&lt;p&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;br&gt;
The ChatGPTt is the most intelligent and impressive artificial intelligent chatbot created by Open AI. It was released on November 20, 2022. ChatGPT is a natural language processing  that can answer questions, follow up on the question, admit flaws, challenge incorrect premises, and reject inappropriate requests.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What are the uses of the ChatGPT&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Answering user questions.&lt;/li&gt;
&lt;li&gt;Writing text compositions.&lt;/li&gt;
&lt;li&gt;Solving math equations&lt;/li&gt;
&lt;li&gt;Writing text&lt;/li&gt;
&lt;li&gt;Debugging and fixing code&lt;/li&gt;
&lt;li&gt;Translating between lanaguage creating text summaries recommendaton&lt;/li&gt;
&lt;li&gt;Classifying things&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;How does it work&lt;/strong&gt;&lt;br&gt;
ChatGPT has been trained using a large database of information obtained from the internet. According to Open AI, ChatGPT employs the use of  Reinforcement Learning from Human Feedback (RLHF). It has an easy-to-use interface that allows it to respond to follow-up questions, reject certain requests, and detect when it has malfunctioned. It is also relatively simple to use.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to use ChatGPT&lt;/strong&gt;&lt;br&gt;
Go to &lt;a href="https://chat.openai.com" rel="noopener noreferrer"&gt;https://chat.openai.com&lt;/a&gt; on your computer or phone, login to your account or create a new account&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%2Fq0s3m8vduhxe5b18044y.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%2Fq0s3m8vduhxe5b18044y.png" alt="Image description" width="800" height="356"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ChatGPT In Action&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Asking ChatGPT to explain version control system&lt;/li&gt;
&lt;/ul&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%2Fe3dcr0wlbb7q6wt31mk6.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%2Fe3dcr0wlbb7q6wt31mk6.png" alt="Image description" width="800" height="460"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Asking ChatGPT to solve leetcode question&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Given an input string s and a pattern p, implement regular expression matching with support for '.' and '*' where:&lt;/p&gt;

&lt;p&gt;'.' Matches any single character.​​​​&lt;br&gt;
'*' Matches zero or more of the preceding element.&lt;br&gt;
The matching should cover the entire input string (not partial).&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%2Fi08ccu2th1m5lf4vf89x.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%2Fi08ccu2th1m5lf4vf89x.png" alt="Image description" width="800" height="393"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ChatGPT VS Search engine&lt;/strong&gt;&lt;br&gt;
ChatGPT is a conservational base model that uses information from training data and general responses while Search engines help to get information by indexing web pages on the internet.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Limitation of ChatGPT&lt;/strong&gt;&lt;br&gt;
The inability to provide contextual answers that are required in a specific way. The quality of the response is the main issue with chatGPT. According the openAi some of the limitations of ChatGPT are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;May occasionally generate incorrect information&lt;/li&gt;
&lt;li&gt;May occasionally produce harmful instructions or biased content&lt;/li&gt;
&lt;li&gt;Limited knowledge of the world and events after 2021&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
  </channel>
</rss>
