<?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: Mandlenkosi </title>
    <description>The latest articles on DEV Community by Mandlenkosi  (@fanatii).</description>
    <link>https://dev.to/fanatii</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%2F1214023%2F83d3d145-c7aa-4233-a40c-a5fc80d21dd8.jpeg</url>
      <title>DEV Community: Mandlenkosi </title>
      <link>https://dev.to/fanatii</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/fanatii"/>
    <language>en</language>
    <item>
      <title>Elevate your Vue App: Vue-Concurrency 101</title>
      <dc:creator>Mandlenkosi </dc:creator>
      <pubDate>Wed, 22 Nov 2023 10:56:46 +0000</pubDate>
      <link>https://dev.to/fanatii/elevate-your-vue-app-vue-concurrency-101-5dfh</link>
      <guid>https://dev.to/fanatii/elevate-your-vue-app-vue-concurrency-101-5dfh</guid>
      <description>&lt;p&gt;Earlier this year the Vue.js team released a library called vue-concurrency. This powerful tool opened up new ways of simplifying fetch requests, ensuring great user experiences with the main goal being, optimizing concurrency in our applications. In this post we'll delve into why this library was created and the problems it solves. But firstly, in order to understand why's, we need to understand the term "concurrency".&lt;/p&gt;

&lt;h2&gt;
  
  
  What is concurrency?
&lt;/h2&gt;

&lt;p&gt;Concurrency is simply the ability to perform/handle multiple tasks at the same time. Think of a situation where you click a button(s) that allows you to make fetch requests to the server. Clicking this button multiple times sends multiple async requests that the server will need to handle all at the same time. That is concurrency. The server's ability to handle multiple requests/tasks at the same time.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;Client-side applications frequently need to handle asynchronous tasks. These tasks can include making requests to a server, carrying out background logic, and responding to user actions such as scrolling, interacting with forms and navigation. Another key goal is to create user interfaces that are more robust, so that we can withstand issues like network failures. This involves strategies like repeatedly attempting server requests in case of a failure, or providing users with the option to manually retry.&lt;/p&gt;

&lt;p&gt;To achieve this, we often employ techniques like debouncing and throttling. However, these methods sometimes require defensive programming, where we set flags like isSearching, isLoading, and isError to manage the application's state.Unfortunately, this manual approach is not only repetitive but also prone to mistakes and bugs.&lt;/p&gt;

&lt;p&gt;For example, forgetting to reset isLoading to false in certain situations can leave the UI stuck in a never ending loading state. Neglecting to stop background operations during a user's transition to a different page can lead to errors. It would be more efficient if these tasks could be handled more seamlessly and efficiently. This is where Vue-concurrency comes in.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Vue-concurrency?
&lt;/h2&gt;

&lt;p&gt;Vue-concurrency is a library designed to bundle all asynchronous operations, manage and oversee concurrency for both Vue and the Composition API. Vue Concurrency aims to provide a useful and simplified way of dealing with complex details related to asynchronous operations. &lt;/p&gt;

&lt;p&gt;Instead of getting into the nitty-gritty of handling asynchronous tasks, Vue Concurrency abstracts or simplifies these details to make it more convenient for developers to work with asynchronous operations in Vue applications. This results in decreased boilerplate code and introduces innovative throttling and polling techniques.&lt;/p&gt;

&lt;h2&gt;
  
  
  BASIC USAGE:
&lt;/h2&gt;

&lt;p&gt;Referencing the code below, useTask() function gives you a Task, which is like a wrapper for a generator function. Similar to how you can call an async function multiple times with different inputs and get different results, you can do the same with a Task. When a Task runs, it produces a TaskInstance. So, one Task can have several instances.&lt;/p&gt;

&lt;p&gt;What's unique is that unlike regular functions, a Task is reactive and knows about all its instances. If any instance of a Task is running, the Task itself is considered running. You can access information about the last instance and the last successful instance.&lt;/p&gt;

&lt;p&gt;For example, consider getUsersTask, a Task created using useTask. When you perform this task with getUsersTask.perform(), you get a TaskInstance. Performing a task and creating a new task instance happens via calling perform(). This method takes a function that uses the yield syntax to pause executation on promises and promise-like objects till they resolve. This workds similarly to async await with the added ability to cancel operations.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--j_t3b_6F--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zbb4mlbjy5pd78vi1sen.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--j_t3b_6F--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zbb4mlbjy5pd78vi1sen.png" alt="Image description" width="760" height="163"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Managing Concurrency
&lt;/h2&gt;

&lt;p&gt;You can decide how a task handles running multiple instances simultaneously. By default, a task can run an unlimited number of instances at the same time.&lt;/p&gt;

&lt;p&gt;To set rules for this, you use methods like &lt;code&gt;.drop()&lt;/code&gt;, &lt;code&gt;.enqueue()&lt;/code&gt;, &lt;code&gt;.restartable()&lt;/code&gt;, or &lt;code&gt;.keepLatest()&lt;/code&gt; on an existing task, typically right after creating the task.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://vue-concurrency.netlify.app/managing-concurrency/"&gt;You can find all examples here:&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Drop:&lt;/strong&gt; Setting a task as &lt;code&gt;.drop()&lt;/code&gt; means that if there's an instance currently running, any attempts to run additional instances will fail. The running instance will be dropped.
Use case: Useful for tasks like form submissions to prevent duplicate requests.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Use case: Useful for tasks like form submissions to prevent duplicate requests.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--RBZt4SUY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3w0tu3zaq1a30c5ixv8q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RBZt4SUY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3w0tu3zaq1a30c5ixv8q.png" alt="Image description" width="545" height="113"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Restartable:&lt;/strong&gt; Setting a task as &lt;code&gt;.restartable()&lt;/code&gt; means that if there’s an instance running, starting the task again will immediately stop the existing instance and run the new one.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Use case: Handy for tasks like polling or debouncing, often used in combination with a timeout.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mmyJNfxm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vzae9fqkdc1udhofj30q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mmyJNfxm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vzae9fqkdc1udhofj30q.png" alt="Image description" width="471" height="101"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Enqueue:&lt;/strong&gt; Setting a task as &lt;code&gt;.enqueue()&lt;/code&gt; means that if there’s an instance running, starting the task again will add the new instance to a queue, scheduling it to run later.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Use case: Beneficial for scheduling tasks for performance or other reasons.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--B0LtreHg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b8vudwhprpzvo2jcd0ts.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--B0LtreHg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b8vudwhprpzvo2jcd0ts.png" alt="Image description" width="527" height="109"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In essence, Vue-concurrency pretty much aligns with the Vue.js philosophy of simplicity and sets the stage for more efficient, responsive, and user-friendly frontend applications. As we embrace the future of front-end development, Vue-concurrency stands out as a valuable tool for developers seeking to streamline their workflows and create exceptional user experiences.&lt;/p&gt;

&lt;p&gt;Liked the article? Then I can bet that you would also loved my own personal blog that focuses on gaming, coding and the latest tech products found here&lt;/p&gt;

&lt;p&gt;You can also find me on &lt;a href="https://www.instagram.com/fanatii_dev"&gt;Instagram&lt;/a&gt;, &lt;a href="https://github.com/fanatII1"&gt;Github&lt;/a&gt;, &lt;a href="https://www.linkedin.com/in/mandlenkosi-marwanqana-b08357218/"&gt;LinkedIn&lt;/a&gt;, &lt;a href="https://twitter.com/fanatii_dev"&gt;Twitter&lt;/a&gt;. And here’s My &lt;a href="https://fanatii1.github.io/Portfolio/"&gt;https://fanatii1.github.io/Portfolio/&lt;/a&gt; and in &lt;a href="https://3d-mandlenkosi.vercel.app/"&gt;3D&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>programming</category>
      <category>vue</category>
    </item>
    <item>
      <title>Choosing The Right Headless CMS</title>
      <dc:creator>Mandlenkosi </dc:creator>
      <pubDate>Mon, 20 Nov 2023 12:47:50 +0000</pubDate>
      <link>https://dev.to/fanatii/choosing-the-right-headless-cms-18k8</link>
      <guid>https://dev.to/fanatii/choosing-the-right-headless-cms-18k8</guid>
      <description>&lt;p&gt;In the ever-evolving landscape of content management systems (CMS), selecting the right headless CMS is crucial for developers, content creators, and businesses aiming to build flexible, scalable, and content-rich applications. In this blog post, we’ll delve into some factors you should consider when choosing a headless CMS, whether you’re using React, Vue, Svelte or your favorite frontend framework.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is a headless CMS?
&lt;/h2&gt;

&lt;p&gt;Imagine a headless CMS like a magical recipe book. In this book, chefs (content creators) write down amazing recipes (content) for delicious dishes, but they don’t decide how the food should look on the plate.&lt;/p&gt;

&lt;p&gt;Now, think of developers as chefs who use this magical recipe book. The book doesn’t tell them exactly how to arrange the food on the plate or what the plate should look like. It’s like giving chefs the freedom to create their own special dishes and present them in a way that makes people happy.&lt;/p&gt;

&lt;p&gt;So, in the context of a developer, imagine the headless CMS (the recipe book) like a database that stores all your content (images, videos, blog post content etc.). The database is just their to store your content. The manner in which you display the content is all up to you. Meaning, the frontend framework you choose to present the content is all up to you.&lt;/p&gt;

&lt;h2&gt;
  
  
  Traditional CMS or Headless CMS?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--O6kKyHFp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nk8wcwt2cv0dlxjz3jkc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--O6kKyHFp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nk8wcwt2cv0dlxjz3jkc.png" alt="Image description" width="800" height="314"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To comprehend the difference between the traditional and headless CMS’s, we’ll continue with the recipe book analogy.&lt;/p&gt;

&lt;p&gt;Imagine a traditional CMS(e.g Wordpress) like a magical cookbook where the recipes not only include instructions for making delicious dishes but also specify exactly how each dish should look on the plate. It’s like a cookbook that not only gives you the recipe but also tells you where to put each ingredient, how to arrange them, and even provides a specific plate to use.&lt;/p&gt;

&lt;p&gt;The one advantage of this might be that, users can quickly set up a website without delving into the intricacies of design and structure. The predefined themes and templates streamline the process, allowing users to focus more on content creation.&lt;/p&gt;

&lt;p&gt;Although that might sound great, this limits your creativity a bit, in a sense that maybe the template designs offered may not be what you want. Maybe you want a more creative looking site with custom designs, and this is where headless CMS comes in.&lt;/p&gt;

&lt;p&gt;With a Headless CMS, you can focus more on your own design and functionality of the site using your favorite frontend framework while having control on the content that you want to present. This gives you a little bit more flexibility as a developer&lt;/p&gt;

&lt;h2&gt;
  
  
  Best Headless CMS’s in 2023
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1.Sanity
&lt;/h3&gt;

&lt;p&gt;Sanity is an open source headless CMS that provides developers with an unparalleled level of customization not readily available elsewhere. By treating content as data, Sanity facilitates in-depth data analytics, content creation, and various distribution options. Sanity’s user-friendly software promotes real-time collaboration among team members, allowing marketers to handle content management and developers to tailor and publish content precisely where needed. The system’s wide range of integrations ensures seamless transfer into any preferred application. Pricing: Has a free tier, which can scale from a Basic plan($99) to Pro plan($499)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.sanity.io/"&gt;View Sanity here&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;Strapi, which is the most used headless CMS in the world, stands out as a top-tier headless CMS platform, showcasing a straightforward interface and comprehensive customizability. Operating entirely on JavaScript, this platform empowers the creation of content-rich experiences that seamlessly move from the presentation layer to the ultimate channels where the content will be showcased. This is the perfect CMS for you if you want to have full control over the CMS’s data and its structure. Strapi is also useful to those who want to self host their own backend with their CMS. Pricing: Has a free tier, which can scale from a Basic plan($99) to Pro plan($499)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://strapi.io/"&gt;View Strapi here&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  3.Contentful
&lt;/h3&gt;

&lt;p&gt;Contentful operates as a cloud-based headless CMS, offering a fully managed service that alleviates the need for users to host it independently. Its cloud-based architecture ensures accessibility and convenience. Additionally, Contentful excels in scalability, designed to effortlessly manage substantial volumes of content and accommodate high levels of traffic. For developers, Contentful delivers a favorable experience, providing well-documented APIs and an extensive selection of Software Development Kits (SDKs) compatible with various programming languages. Notably, the platform stands out for its rich content modeling capabilities, granting users the flexibility to easily define and structure content according to their specific needs. This feature enhances the adaptability and customization potential of the platform for diverse projects and applications. Pricing: Has a free plan, with a Basic plan starting from at $300&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.contentful.com/"&gt;View Contentful here&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  4.Kontent.ai
&lt;/h3&gt;

&lt;p&gt;Kontent.ai excels with features like omnichannel content delivery, catering to static site generators and multiple websites. The Web Spotlight feature provides authors insights into audience consumption across diverse channels. Offering a rare balance of user-friendliness for small businesses and scalability for large enterprises, Kontent.ai stands out with its efficient microservice architecture. However, it’s important to note some limitations, such as the potential for more development time for certain customizations and English-only support on the backend, which may pose challenges for international businesses.&lt;/p&gt;

&lt;p&gt;Pricing: Has a free plan, with a custom sales Enterprise plan&lt;/p&gt;

&lt;p&gt;&lt;a href="https://kontent.ai/"&gt;View Konent.ai here&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  5. ContentStack
&lt;/h3&gt;

&lt;p&gt;Tailored specifically for enterprise use, Contentstack serves as a robust headless CMS platform unafraid of complexity. Its agility is a key asset, providing organizations with efficient content management and the flexibility required for seamless integration across major digital platforms.&lt;/p&gt;

&lt;p&gt;Contentstack’s notable features include advanced content scheduling and repository capabilities, facilitating comprehensive content management. The platform boasts an extensive array of RESTful APIs, simplifying content output across various graphic user interfaces. With a robust search function, Contentstack adeptly manages content and code in increasingly intricate digital environments. Its “blank slate” approach empowers advanced development teams with full customizability in building their headless CMS.&lt;/p&gt;

&lt;p&gt;However, Contentstack does have limitations. The absence of templates makes the “blank slate” approach challenging for smaller teams. Additionally, while the platform supports versioning, it is not fully complete, occasionally posing challenges for real-time collaboration.&lt;/p&gt;

&lt;p&gt;Pricing: All plans require sales contact&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.contentstack.com/"&gt;View ContentStack here&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Factors to consider when choosing a Headless CMS:
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Content Modeling:&lt;/strong&gt; The CMS should allow you to define content models that match your specific needs. Look for a system that provides flexibility in structuring and modeling content.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;API Support:&lt;/strong&gt; Determine whether the CMS offers a RESTful API, GraphQL, or both. Sanity mostly supports GraphQL&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Developer Experience:&lt;/strong&gt; Ensure that the CMS has comprehensive and well-maintained documentation. This is crucial for developers to understand how to integrate and use the CMS effectively.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost and Licensing:&lt;/strong&gt; Understand the CMS’s pricing model. Some are open source, while others are subscription-based. Consider your budget and the long-term cost implications.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ease of Use:&lt;/strong&gt; Evaluate the user interface of the CMS itself. A clean and intuitive interface can simplify content management tasks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scalability:&lt;/strong&gt; Assess the CMS’s ability to scale horizontally to handle increased traffic and content. Ensure it can accommodate the growth of your application.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cloud based vs Self hosted:&lt;/strong&gt; Determine whether you want to intergrate your cms with your backend and self host the everything or whether you want a cloud based solution, meaning the CMS is a fully managed service that you don’t have to host yourself, providing ease of access&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In conclusion, navigating the dynamic landscape of content management systems (CMS) requires a thoughtful consideration of various factors, especially when selecting a headless CMS for React, Vue, Svelte, or other preferred frontend frameworks. As illustrated through the analogy of a magical recipe book, the distinction between traditional and headless CMSs underscores the importance of flexibility and creativity in content presentation. The blog post provides valuable insights into some of the best headless CMS options in 2023, such as Sanity, Strapi, Contentful, Kontent.ai, and ContentStack, each offering unique features and pricing structures. The factors to consider when choosing a headless CMS, including content modeling, API support, developer experience, cost, ease of use, scalability, and the choice between cloud-based and self-hosted solutions, provide a comprehensive guide for developers, content creators, and businesses seeking to build versatile and scalable applications.&lt;/p&gt;

&lt;p&gt;Liked the article? Then I can bet that you would also loved my own personal blog that focuses on gaming, coding and the latest tech products found here&lt;/p&gt;

&lt;p&gt;You can also find me on &lt;a href="https://www.instagram.com/fanatii_dev"&gt;Instagram&lt;/a&gt;, &lt;a href="https://github.com/fanatII1"&gt;Github&lt;/a&gt;, &lt;a href="https://www.linkedin.com/in/mandlenkosi-marwanqana-b08357218/"&gt;LinkedIn&lt;/a&gt;, &lt;a href="https://twitter.com/fanatii_dev"&gt;Twitter&lt;/a&gt;. And here’s My &lt;a href="https://fanatii1.github.io/Portfolio/"&gt;https://fanatii1.github.io/Portfolio/&lt;/a&gt; and in &lt;a href="https://3d-mandlenkosi.vercel.app/"&gt;3D&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>react</category>
      <category>nextjs</category>
    </item>
  </channel>
</rss>
