<?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: Christian Smith Mantas</title>
    <description>The latest articles on DEV Community by Christian Smith Mantas (@casm101).</description>
    <link>https://dev.to/casm101</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%2F772792%2Fecbd4b56-e956-4873-9ff4-e632aa42890c.png</url>
      <title>DEV Community: Christian Smith Mantas</title>
      <link>https://dev.to/casm101</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/casm101"/>
    <language>en</language>
    <item>
      <title>React-stories for Mere Mortals</title>
      <dc:creator>Christian Smith Mantas</dc:creator>
      <pubDate>Tue, 30 Jan 2024 22:02:06 +0000</pubDate>
      <link>https://dev.to/casm101/react-stories-for-mere-mortals-38ck</link>
      <guid>https://dev.to/casm101/react-stories-for-mere-mortals-38ck</guid>
      <description>&lt;h2&gt;
  
  
  React Stories for Mere Mortals
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Once upon a codebase, in the mystical land of React, there emerged a hero... or rather, a heroic component: &lt;code&gt;react-stories&lt;/code&gt;.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsvpmcuih11ji4m4qg07b.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%2Fsvpmcuih11ji4m4qg07b.png" alt="Screen capture of react-stories" width="800" height="438"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the realm of web development, where the epic sagas of user interfaces unfold, &lt;code&gt;react-stories&lt;/code&gt; has carved its niche. It's not just another React component; it's a beacon of storytelling in an ocean of static content.&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%2F0wcc4l2dha7abh8ktl41.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%2F0wcc4l2dha7abh8ktl41.png" alt="Component hero" width="800" height="457"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What's This Heroic Component About?
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;React-stories&lt;/code&gt; is the Gandalf of React components, guiding developers through the enchanted forest of creating story formats similar to what you'd see on Instagram or Facebook. You know, those little circles that your friends click on, and voila! A montage of their day in bite-sized pieces.&lt;/p&gt;

&lt;p&gt;But &lt;em&gt;why&lt;/em&gt;, you ask? Because stories are not just for social media giants anymore. They've become a staple in engaging users, showcasing products, and sharing content in an interactive, fleeting fashion. &lt;code&gt;React-stories&lt;/code&gt; brings this power to your React applications, allowing you to wield the might of stories with the ease of a few lines of code.&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%2Fphmyygkgrf434bcdn7s0.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%2Fphmyygkgrf434bcdn7s0.png" alt="Magical tech stack" width="800" height="457"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The Magical Tech Stack
&lt;/h2&gt;

&lt;p&gt;Crafted in the forges of modern technology, react-stories is built with a stack as mighty as the component itself:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;React:&lt;/strong&gt; The backbone, because, well, it's a &lt;em&gt;React&lt;/em&gt; component.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;TypeScript:&lt;/strong&gt; For the spell of strong typing, keeping bugs at bay.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Storybook:&lt;/strong&gt; The mystical tome where components are visualised in isolation.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Jest &amp;amp; React Testing Library:&lt;/strong&gt; The guardians ensuring the component's robustness through trials and tests.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This ensemble doesn't just make &lt;code&gt;react-stories&lt;/code&gt; a piece of code; it turns it into a reliable, scalable, and maintainable ally for developers.&lt;/p&gt;

&lt;h2&gt;
  
  
  How It Was Forged
&lt;/h2&gt;

&lt;p&gt;Creating &lt;code&gt;react-stories&lt;/code&gt; wasn't like a stroll in the Shire. It involved thoughtful design and meticulous crafting. The process went something like this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Identify the Quest:&lt;/strong&gt; Recognising the need for an easy-to-use story component in React.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Gather the Tools:&lt;/strong&gt; Choosing TypeScript for type-safety, Storybook for component documentation, and Jest for testing.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;The Forging:&lt;/strong&gt; Writing the code, with each line tempered like a blacksmith crafting a sword.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Trials by Fire:&lt;/strong&gt; Testing, because what good is a sword if it breaks at the first orc?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Enchantment:&lt;/strong&gt; Adding features like customisable styles and controls, making it not just functional but also delightful to use.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  In the Developer's Arsenal
&lt;/h2&gt;

&lt;p&gt;So, how do mere mortals (aka developers) use this celestial gift? Simple:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Install the Component:&lt;/strong&gt; With a chant (or command) as simple as &lt;code&gt;npm install @casm101/react-stories&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Implement the Stories:&lt;/strong&gt; Add the &lt;code&gt;&amp;lt;ReactStories/&amp;gt;&lt;/code&gt;component in your app, feed it a list of stories, and behold the magic.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Customise Your Tales:&lt;/strong&gt; Style it, control it, make it your own. React-stories is flexible enough to match your application's theme and design.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here is a simple example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="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="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;StoryViewer&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;@casm101/react-stories&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;stories&lt;/span&gt; &lt;span class="o"&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;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;path/to/image.jpg&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;image&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;duration&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;5000&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;path/to/video.mp4&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;video&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="c1"&gt;// ...more stories&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;MyComponent&lt;/span&gt; &lt;span class="o"&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;ReactStory&lt;/span&gt; &lt;span class="nx"&gt;stories&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;stories&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="sr"&gt;/&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="nx"&gt;MyComponent&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  A Storyteller's Conclusion
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;React-stories&lt;/code&gt; is more than just a component; it's a storyteller's tool in the digital age. Whether you're a seasoned wizard in web development or a hobbit taking your first steps, &lt;code&gt;react-stories&lt;/code&gt;offers an enchanting way to engage your audience.&lt;/p&gt;

&lt;p&gt;Remember, in the end, every application is a story, and react-stories helps you tell it in an interactive, captivating way. So, go forth and let your React applications tell their tales!&lt;/p&gt;

&lt;p&gt;Check out the &lt;code&gt;react-stories&lt;/code&gt; component &lt;a href="https://github.com/Casm101/react-stories" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Disclaimer!&lt;/strong&gt; &lt;em&gt;The images in the post are generated using AI technology (Dall·e 3) but the article is all mine!&lt;/em&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>react</category>
      <category>npm</category>
      <category>typescript</category>
    </item>
    <item>
      <title>HTTP Verbs for mere mortals</title>
      <dc:creator>Christian Smith Mantas</dc:creator>
      <pubDate>Wed, 03 Jan 2024 01:41:46 +0000</pubDate>
      <link>https://dev.to/casm101/http-verbs-for-mere-mortals-53n</link>
      <guid>https://dev.to/casm101/http-verbs-for-mere-mortals-53n</guid>
      <description>&lt;p&gt;Welcome, dear mortals, to the mystical and slightly quirky world of HTTP verbs! Yes, in the grand kingdom of web development, these aren't just any verbs. They are the superheroes of the internet, the silent sentinels standing guard over your web requests, making sure that what you ask for is what you get – quite literally!&lt;/p&gt;

&lt;p&gt;So, buckle up as we embark on an epic journey to decipher these enigmatic yet essential elements of the web. From the valiant GET, always ready to fetch and retrieve, to the diligent POST, tirelessly delivering data to its destined server. We'll explore each of these verbs with a sprinkle of humor, a dash of simplicity, and, fear not, absolutely no convoluted technical jargon that sounds like it's been concocted in a mad scientist's lab.&lt;/p&gt;

&lt;p&gt;Remember, while the world of HTTP might seem like an arcane script written in an alien language, it's really more like a secret club with a surprisingly straightforward handshake. So let's decode these handshakes, one step at a time!&lt;/p&gt;

&lt;h2&gt;
  
  
  Before we get started...
&lt;/h2&gt;

&lt;p&gt;You need to know a couple of things before we embark on our quest, these calls into battle are known in tow fashions, they can be both &lt;em&gt;safe&lt;/em&gt; and &lt;em&gt;idempotent&lt;/em&gt; (don't get that last one wrong, it can still "get it up").&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Safe&lt;/em&gt; calls are read-only, meaning you need not worry about destroying data when making your requests.&lt;/p&gt;

&lt;p&gt;As for &lt;em&gt;Idempotent&lt;/em&gt;, these calls "into action" mean you can make multiple requests of the same type, but do not expect to GET &lt;em&gt;&lt;em&gt;wink wink&lt;/em&gt;&lt;/em&gt; the same response.&lt;/p&gt;

&lt;h2&gt;
  
  
  What are HTTP verbs anyway?!
&lt;/h2&gt;

&lt;p&gt;Put in mere mortal terms, GTTP verbs are our way in communicating with a server, giving it instructions on how to handle the information sent along with the URL, so let's get started.&lt;/p&gt;

&lt;h2&gt;
  
  
  The basics
&lt;/h2&gt;

&lt;p&gt;Our basic calls compose an acronym of sorts (even though they don't line-up) called CRUD, which stands for: Create, Read, Update and Delete.&lt;/p&gt;

&lt;h3&gt;
  
  
  POST
&lt;/h3&gt;

&lt;p&gt;POST is the bustling postman of the HTTP world. It doesn't just knock on doors to deliver mail, it pushes through the data you send and makes sure it gets to where it needs to be. Think of POST as your own personal digital courier, braving the wilds of the internet to get your precious packages (a.k.a data) safely to their destination. Just don't expect it to bring your morning tea (coffee is for chumps).&lt;/p&gt;

&lt;h3&gt;
  
  
  Get
&lt;/h3&gt;

&lt;p&gt;GET is the grand old duke of HTTP verbs. It’s like your reliable old friend who goes to fetch your groceries. You ask, and GET delivers, no questions asked. Need some data? GET's on it. Want to retrieve that lost cat picture? GET's got your back. It's like a well-trained retriever, but for data - loyal, dependable, and always returning with what you throw, or request for that matter.&lt;/p&gt;

&lt;h3&gt;
  
  
  PATCH and PUT
&lt;/h3&gt;

&lt;p&gt;In the realm of HTTP verbs, we encounter the curious case of PATCH and PUT – almost like twins separated at birth. They both seem to do the same trick – updating data – but with their own little quirks. It's like having two chefs in a kitchen, both capable of making a sandwich, but each with a distinct style.&lt;/p&gt;

&lt;p&gt;Imagine PUT as the chef who insists on making your sandwich from scratch every time. Want to change the cheese in your sandwich? PUT says, “Sure, but let me rebuild that sandwich from the ground up!” It’s thorough but a bit overzealous. PUT ensures everything is exactly as you specify, but it’ll replace your whole sandwich to change a single ingredient.&lt;/p&gt;

&lt;p&gt;Enter PATCH, the more laid-back sibling. It's like the chef who says, “Oh, just want to swap the cheese? No problem, I’ll just open up that sandwich and replace that one part.” PATCH is your go-to for a quick fix, a little tweak here and there. It's the efficient editor, updating only what needs to be changed without bothering the rest of the data sandwich.&lt;/p&gt;

&lt;p&gt;In the end, whether you choose PATCH or PUT, depends on whether you need a complete makeover or just a quick touch-up. Just remember, in the world of HTTP verbs, it's always good to have options – even if it feels like choosing between two flavours of the same ice cream!&lt;/p&gt;

&lt;h3&gt;
  
  
  Delete
&lt;/h3&gt;

&lt;p&gt;DELETE, the solemn executioner of the HTTP verbs, wields its power with a quiet dignity. When it's time to say goodbye to that piece of data, DELETE steps in, gives a respectful nod, and makes it vanish into the digital void. It's not cruel, just necessary. Like a gardener pruning dead branches, DELETE keeps your digital garden flourishing by removing what no longer serves a purpose.&lt;/p&gt;

&lt;h2&gt;
  
  
  Diving deeper into the &lt;em&gt;occult&lt;/em&gt; verbs
&lt;/h2&gt;

&lt;p&gt;Absolutely, here's a brief introduction for the lesser-known HTTP verbs:&lt;/p&gt;

&lt;p&gt;Diving Into the Hidden Gems: HEAD, CONNECT, OPTIONS, and TRACE&lt;/p&gt;

&lt;p&gt;Welcome to the less-trodden paths of the HTTP verb forest, where the lesser-known yet equally intriguing verbs like HEAD, CONNECT, OPTIONS, and TRACE reside. These are the unsung heroes of the HTTP world, often overshadowed by their more famous counterparts but holding their unique charm and utility.&lt;/p&gt;

&lt;h3&gt;
  
  
  Head
&lt;/h3&gt;

&lt;p&gt;HEAD is the stealthy ninja of HTTP verbs. It sneaks up to a server, takes a quick peek at what’s there, and reports back without actually grabbing anything. It’s like checking if the milk in the fridge is fresh without taking the carton out. HEAD asks the question, "What's there?" but stops short of saying, "I’ll take it." It’s perfect for those who love window shopping on the web.&lt;/p&gt;

&lt;h3&gt;
  
  
  Connect
&lt;/h3&gt;

&lt;p&gt;CONNECT is the great unifier, the builder of bridges in the HTTP world. Imagine it as the social butterfly at a party, introducing guests to each other. In technical terms, it establishes a tunnel between the client and the server, making sure that everyone can chat securely through a proxy. CONNECT is your go-to when you need to whisper secrets over the web.&lt;/p&gt;

&lt;h3&gt;
  
  
  Trace
&lt;/h3&gt;

&lt;p&gt;TRACE plays the role of the web detective. It’s like sending out a digital echo into the abyss and listening for the echoes. TRACE retraces the steps of a web request to its origin, helping you understand the path it took. It’s the verb you use when you want to shout into the canyon and hear your own voice come back, revealing the twists and turns of the internet’s pathways.&lt;/p&gt;

&lt;h3&gt;
  
  
  Options
&lt;/h3&gt;

&lt;p&gt;And last but not least my personal favourite, OPTIONS is the informative tour guide of HTTP verbs. It’s like walking up to an information kiosk and asking, "What can I do here?" OPTIONS gladly tells you all the actions you can perform at a particular URL, handing you a menu of web methods. It's essential for those moments when you're pondering, "What are my options?".&lt;/p&gt;

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

&lt;p&gt;And there you have it – a whirlwind tour through the vibrant landscape of HTTP verbs, from the famous to the unsung heroes. We've laughed with GET, hustled with POST, touched up with PUT, and even remixed with PATCH. Not to forget our brief yet insightful encounters with the likes of HEAD, CONNECT, OPTIONS, and TRACE.&lt;/p&gt;

&lt;p&gt;As we conclude this journey, it's clear that each HTTP verb, whether a headliner or a hidden gem, plays a crucial role in the intricate ballet of web communication. They're more than just commands; they're the gears that keep the vast engine of the internet running smoothly.&lt;/p&gt;

</description>
      <category>api</category>
      <category>restapi</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
