<?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: James 'Dante' Midzi</title>
    <description>The latest articles on DEV Community by James 'Dante' Midzi (@psypher1).</description>
    <link>https://dev.to/psypher1</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F778297%2F104e4184-3c67-4836-bf91-cc3c1b5d679a.jpeg</url>
      <title>DEV Community: James 'Dante' Midzi</title>
      <link>https://dev.to/psypher1</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/psypher1"/>
    <language>en</language>
    <item>
      <title>The 'AI' Problem Noone Is Talking About</title>
      <dc:creator>James 'Dante' Midzi</dc:creator>
      <pubDate>Tue, 25 Aug 2026 08:35:11 +0000</pubDate>
      <link>https://dev.to/psypher1/the-ai-problem-noone-is-talking-about-3aj7</link>
      <guid>https://dev.to/psypher1/the-ai-problem-noone-is-talking-about-3aj7</guid>
      <description>&lt;p&gt;We are very deeply into 'AI' and the environment it has created. Over the course of these several years there have been a number of discussions, debates on ethics and the proliferation of these technologies. It started with speak of them taking jobs - people getting fired, companies replacing humans with them. And more importantly the creativity side and generative 'AI'.&lt;/p&gt;

&lt;p&gt;To add to that, the legal debates on rights and who own what is created by these generative systems.&lt;/p&gt;

&lt;p&gt;More recently, the effect this technology has had on the open-source world.&lt;/p&gt;

&lt;p&gt;However, throughout all of this what I've never seen being talked about most is the core that powers these LLMs, what enables them to be functional and to exist, and that is the data.&lt;/p&gt;

&lt;p&gt;For your ChatGPT, your Claude, your Gemini; for your Deepseek. For all of them to function and give you answer as 'quickly' as you assume, it requires data - large swathes of data. But there is only so much data one can feed into an LLM to train it. As of a certain point these companies had scrapped most if not all of the internet to train their model - some of it legally and some illegally. It had gotten to a point where the 'AI' was being trained on data from the 'Ai' creating a recursive loop.&lt;/p&gt;

&lt;p&gt;So where does a multi-million dollar company turn to in order to satisfy the endless hunger of the beasts they created? Well, to books of course. Physical books.&lt;/p&gt;

&lt;p&gt;A good number of you would not know about this because books, in the current climate, are not something that makes headlines. Also, a lot of you don't care about books anymore. And this is why I have written this - the books.&lt;/p&gt;




&lt;h2&gt;
  
  
  How Are Books Relevant?
&lt;/h2&gt;

&lt;p&gt;Remember I mentioned legal battles over 'AI'? That's where books come in. If these companies were truly altruistic, the would have gone the legal route, gotten the rights, paid whichever party had ownership of the material they wanted to use. Buuut, as has been evidence - and the reason for the legal battles - they have been scanning and &lt;em&gt;stealing&lt;/em&gt; content they have not licensed.&lt;/p&gt;

&lt;p&gt;For the books they have now turned to, they would also have to pay royalties and licensing fees...&lt;/p&gt;

&lt;p&gt;In the backdrop of legal battles over ownership and who owns what is created by 'AI', books were being destroyed.&lt;/p&gt;

&lt;p&gt;I doubt any of you would be aware of this as unless you explore, the only 'AI' you know is ChatGPT. But let me bring your attention to Anthropic and what its been doing...&lt;/p&gt;

&lt;h3&gt;
  
  
  Anthropic's Destruction of Books
&lt;/h3&gt;

&lt;p&gt;So as to not pay the fees and interact with the authors, Anthropic went about procuring old books, scanning them in a destructive meaner. In an effort to improve its LLM, in an initialve they called "Project Panama”&lt;/p&gt;

&lt;p&gt;And I quote:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Project Panama is our effort to destructively scan all the books in the world.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Why do this you may ask? I have already mentioned why, but let me elaborate further.&lt;/p&gt;

&lt;p&gt;Anthropic could have secured copyright permission to use existing e-books. This would have required going through the proper channels and engaging with the authors - something the co-founder described as 'tedious'. They had already pirated some sources already which resulted in a large settlement. So, when going about it legally became 'complicated', they turned to destructively scanning books.&lt;/p&gt;

&lt;p&gt;You can read more about the whole issue &lt;a href="https://www.theguardian.com/commentisfree/2026/aug/05/anthropic-ai-destroying-books" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Of course they would rather destroy printed copies than work with their authors&lt;/p&gt;

&lt;h3&gt;
  
  
  The Loss Of Historical Data
&lt;/h3&gt;

&lt;p&gt;A lot of the books being scanned and destroyed are one of a kind, can't be replicated. Once they are gone, they are gone. The only remaining record would be locked in Anthropic's servers. They have no obligation share what they have scanned, and most likely won't. That will make it even more difficult to find and get actual sources from the original authors of said information. All that would be left is whatever output the LLM has produced from its training&lt;/p&gt;




&lt;h2&gt;
  
  
  What Happens When There Are No More Books?
&lt;/h2&gt;

&lt;p&gt;We have already seen examples of what that looks like. Every single piece of physical media that was made digital exists at the whims of the company that made it so, and when that licensing runs out. In particular, the &lt;a href="https://www.syracuse.com/entertainment/2026/06/digital-platform-deleting-500-movies-purchased-by-customers-i-smell-a-lawsuit.html" rel="noopener noreferrer"&gt;PlayStation situation&lt;/a&gt; - where hundreds of movies 'purchased' on the platform are slated for deletion.&lt;/p&gt;

&lt;p&gt;Well a lot of you might not care now. You will later on when you can't get actual sources. When all you have to look for is an LLM run by a company that can revoke your access at their whim, at their own discretion. You can't say anything about it because they're in control .&lt;/p&gt;

&lt;p&gt;In a world where all the physical books are gone and one company or another controls your access to those digital copies, nothing stops them from modifying the books, taking the books from your control, or just denying you access.&lt;/p&gt;

&lt;p&gt;That is not a concern if you have physical copy of the book.&lt;/p&gt;




&lt;h2&gt;
  
  
  Wrapping Up
&lt;/h2&gt;

&lt;p&gt;Do I have a solution? I don't. I am not in a position to solve these things, not in a high enough position of power. All I can do is do what I've always been doing: try to bring awareness to what's happening while you are asking ChatGPT what the square root of a triangle is.&lt;/p&gt;

&lt;p&gt;All of this conveniently ties into the current push for digital ID that has been ramping up as of late. Once that goes online and the media is also online, the ID could be used to stop you from reading what they don't want you to. I say this in full knowledge that a good number of you don't read anyway, but for the ones that still do...&lt;/p&gt;

&lt;p&gt;The domino effect concerns me a great deal...&lt;/p&gt;




&lt;h3&gt;
  
  
  Thank you for reading, let's connect!
&lt;/h3&gt;

&lt;p&gt;Thank you for visiting this little corner of mine. My email and DMs are always open; if you want to chat or collaborate on something, &lt;a href="mailto:jamesmidzi@gmail.com"&gt;shoot me a email&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Where you can get hold of me:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://twitter.com/Psypher1" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://discord.com/users/Pharaoh#5441/" rel="noopener noreferrer"&gt;Discord&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.linkedin.com/in/jamesmidzi/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://zyvop.com/the-ai-problem-noone-is-talking-about-4cbhn" rel="noopener noreferrer"&gt;ZyVOP&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;💡 For more articles like this, &lt;a href="https://zyvop.com/newsletter" rel="noopener noreferrer"&gt;subscribe to the ZyVOP newsletter&lt;/a&gt;!&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>books</category>
      <category>rights</category>
    </item>
    <item>
      <title>Are You Crippled By Your Preferences</title>
      <dc:creator>James 'Dante' Midzi</dc:creator>
      <pubDate>Mon, 17 Aug 2026 08:03:25 +0000</pubDate>
      <link>https://dev.to/psypher1/are-you-crippled-by-your-preferences-8l5</link>
      <guid>https://dev.to/psypher1/are-you-crippled-by-your-preferences-8l5</guid>
      <description>&lt;p&gt;This article directly follows after the one I wrote &lt;a href="https://dantedecodes.vercel.app/articles/strict-types-wont-fix-your-lack-of-understanding" rel="noopener noreferrer"&gt;about types&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I caught a replay of a live stream the other day. During the live stream the developer was testing out Svelte, specifically the Svelte version of &lt;a href="https://ui.shadcn.com/" rel="noopener noreferrer"&gt;shadcn&lt;/a&gt;; svelte-shadcn. &lt;/p&gt;

&lt;p&gt;And throughout the video all he was doing was comparing the official shadcn website to the svelte-shadcn one. To me this was kind of strange because these are two different projects. Yes, one might take inspiration from one from the other but they are not the same things.&lt;/p&gt;

&lt;p&gt;Then he went on to say the reason why he never used Svelte is because he wants to use shadcn libraries. They're not supported by Svelte, and that got me very worried. You refuse to explore another technology because this one styling thing is not there?  🤔&lt;/p&gt;

&lt;p&gt;I believe as a developer you should be fluid. &lt;/p&gt;

&lt;p&gt;You shouldn't be crippled or locked in by one thing or the other. To me from the video and what he was doing, he's so obsessed with shadcn to the point that anything that doesn't support shadcn he can't use, i.e. Svelte.&lt;/p&gt;

&lt;p&gt;From what I understand when you were setting up the project with shadcn, there is a command on the website where you can just click a command and paste it and then it sets up the project and installs shadcn. &lt;/p&gt;

&lt;p&gt;He tried to do same on the svelte-shadcn website; it didn't work.  He then said, "This could be an easy thing to do." &lt;/p&gt;

&lt;p&gt;I'm then thinking, "But it's not the same thing. You can't be expecting this one developer who ported some shadcn to svelte to be able to keep on track with every single thing shadcn is doing." It doesn't make sense particularly with the climate we're in right now.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;As of writing this &lt;a href="https://www.shadcn-svelte.com/" rel="noopener noreferrer"&gt;svelte-shadcn&lt;/a&gt; has implemented that new project create flow&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Preferences As A Crutch
&lt;/h2&gt;

&lt;p&gt;This got me to wonder specifically about myself: is there anything that I'm too locked into that exploring something different is not possible?&lt;/p&gt;

&lt;p&gt;If you've been following my articles for any point in time, you know that I useTYPO3, I've explored Eleventy, I've used Astro, I've used React, I've used just about everything.  Not because I'm undecided, but because I want to be knowledgeable about the things people are using. To do that, I get out of my own way and  learn, broaden my horizons, to not be locked into one thing, to not be crippled by my preferences. &lt;/p&gt;

&lt;p&gt;Yes of course I've got things I prefer but that doesn't stop me from using other things, which is in direct contraste to that Youtuber I was watching. He's crippled by his preferences. If something doesn't have shadcn in, he can't use it because it takes too much time and it uses his tokens, as he says - this bring back a things I mentioned in the previous post. This dependence on LLMs&lt;/p&gt;

&lt;p&gt;It's one of those lessons that I learnt early on that you're not going to have one-to-one replication from one technology to the other. &lt;/p&gt;

&lt;p&gt;You're going to have to mould, not even mould yourself, but be fluid enough to change and understand what the technology wants and do what it wants, not what we're forcing it to be whatever you're used to. &lt;/p&gt;




&lt;h2&gt;
  
  
  Wrapping Up
&lt;/h2&gt;

&lt;p&gt;Well initially I didn't think this was a problem but this has brought up several questions. Now I'm opening it up to you. &lt;/p&gt;

&lt;p&gt;Do you not use a technology because it doesn't support the things you used to? Do you? &lt;/p&gt;

&lt;p&gt;Are you that close-minded that you can't adapt? &lt;/p&gt;

&lt;p&gt;If you are I don't think you can call yourself a developer. &lt;/p&gt;

&lt;p&gt;In my head as a developer, you're supposed to be able to learn anything you're driven to. Your driving tenet should be to learn. If you don't understand something you take the time to learn what it wants not what you want. &lt;/p&gt;

&lt;p&gt;Let me end this by saying:&lt;br&gt;
&lt;strong&gt;Styling Has Existed Before Shadcn, It Will Exist Long After.&lt;/strong&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Thank you for reading, let's connect!
&lt;/h3&gt;

&lt;p&gt;Thank you for visiting this little corner of mine. My email and DMs are always open; if you want to chat or collaborate on something, &lt;a href="mailto:jamesmidzi@gmail.com"&gt;shoot me a email&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Where you can get hold of me:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://twitter.com/Psypher1" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://discord.com/users/Pharaoh#5441/" rel="noopener noreferrer"&gt;Discord&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.linkedin.com/in/jamesmidzi/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>development</category>
      <category>discuss</category>
      <category>adaptability</category>
    </item>
    <item>
      <title>Strict Types Won't Fix Your Lack of Understanding</title>
      <dc:creator>James 'Dante' Midzi</dc:creator>
      <pubDate>Wed, 01 Jul 2026 17:24:18 +0000</pubDate>
      <link>https://dev.to/psypher1/strict-types-wont-fix-your-lack-of-understanding-533h</link>
      <guid>https://dev.to/psypher1/strict-types-wont-fix-your-lack-of-understanding-533h</guid>
      <description>&lt;p&gt;In development circle I am what would be considered a mid/senior developer. I have been in the trenches, seen the rise and fall of technologies. Seen the prophecies of doom and gloom with new things that showed up. Been a part of the ebb and flow of it all. My training, my initial training came in C, C++ and Java. So I would like to think I know what I am talking about when I am sceptical about things.&lt;/p&gt;

&lt;p&gt;An interesting thing I have come across over the years, is this need to enforce types on languages that are dynamic and pride themselves on that. While this wasn't an issue prior, it has become an increasingly worrying trend with current day developers. You come from a strictly typed language to a dynamic one and upon encountering something you don't understand, you assume adding types would fix the problems &lt;strong&gt;you&lt;/strong&gt; have.&lt;/p&gt;




&lt;h2&gt;
  
  
  Learn The Language
&lt;/h2&gt;

&lt;p&gt;As a developer it should be within you to want to learn, to strive for it. The need for improvement should be on of your core tenets - to want to be better. You wanting a language to have strict typing because that is what you are used to is a failure on your part.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Offenders
&lt;/h3&gt;

&lt;h4&gt;
  
  
  JavaScript/Typescript
&lt;/h4&gt;

&lt;p&gt;Arguably the worst of the offenders. This has been going on for as long as I can remember.&lt;/p&gt;

&lt;p&gt;I recall somewhere saying, "The war is over, typescript won". And I laughed, audibly, out loud. How does a super-set of another language win anything. It also wasn't a win, more a pushing hard for it to the point that the people against simply stopped arguing and moved on to building in.&lt;/p&gt;

&lt;p&gt;Honeestly, you can't tell me this is better:&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="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;BaseRecord&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;DataProvider&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;GetListParams&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;GetListResponse&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;@refine/core&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;BaseRecord&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt; &lt;span class="nx"&gt;DataProvider&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt; &lt;span class="nx"&gt;GetListParams&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt; &lt;span class="nx"&gt;GetListResponsel&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;arefinedev/core&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;dataProvider&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;DataProvider&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;getList&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;TData&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nx"&gt;BaseRecord&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;BaseRecord&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;f&lt;/span&gt; &lt;span class="nx"&gt;resource&lt;/span&gt; &lt;span class="p"&gt;):&lt;/span&gt;
     &lt;span class="nx"&gt;GetListParams&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;GetListResponse&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;TData&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;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="nx"&gt;resource&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;subjects&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt; &lt;span class="na"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;TData&lt;/span&gt;&lt;span class="p"&gt;[],&lt;/span&gt; &lt;span class="na"&gt;total&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="na"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[],&lt;/span&gt;
            &lt;span class="na"&gt;total&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Python
&lt;/h4&gt;

&lt;p&gt;In all my years of development, I never thought Python would join this conversation. But here we are. For all intents and purposes, type hints in Python were meant to be optional. But it seems to me these &lt;em&gt;hints&lt;/em&gt; are now becoming mandated.&lt;/p&gt;

&lt;p&gt;Python is smart enough to infer the type of your variable and return type of your functions. What are we doing here people?&lt;/p&gt;

&lt;h3&gt;
  
  
  The AI Argument
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;"I don't need to understand the language, the AI will do it for me"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Sure, that might be true, but what happens when something breaks and you have no clue why? What happens to your AI generated strongly typed code that you can't parse? You'll feed it to another AI as well?&lt;/p&gt;

&lt;p&gt;Also, I am sure you have noticed that these companies have jacked up their prices. This is going to continue, and because you have offloaded your thinking to some model you are going to pay.&lt;/p&gt;




&lt;h2&gt;
  
  
  My Stance
&lt;/h2&gt;

&lt;p&gt;Now, I am not saying no to types, far from it. What I am saying is learn the language and its nuances. Learn what makes it special, before you instantly decide this isn't working and types are needed. What I constantly here is "types will help". Help what? - When you don't understand the underlying language?&lt;/p&gt;

&lt;p&gt;There is a time and place for types, and that time and place is when you have learned and understood the language. Only then will what you are enforcing types on matter and make sense.&lt;/p&gt;

&lt;p&gt;I understand the necessity of types and I also understand when they are being used a crutch.&lt;/p&gt;

&lt;h3&gt;
  
  
  A Small Shout out
&lt;/h3&gt;

&lt;p&gt;In my fatigue of all the frameworks and all the gospel of types, I was fortunate to come across  &lt;a href="https://github.com/angelajholden" rel="noopener noreferrer"&gt;Angela Holden&lt;/a&gt;, who built a site for her 30 days of &lt;strong&gt;Vanilla JavaScript&lt;/strong&gt; series - a commitment she undertook to improve her JavaScript, a stream everyday for 30 days. She has been a developer for over 13 years and she has chosen to work on the language, to practice, to get better at it. To understand its nuances.&lt;/p&gt;

&lt;p&gt;Here is &lt;a href="https://angelajholden.github.io/30daysofvanillajavascript/" rel="noopener noreferrer"&gt;the site&lt;/a&gt; she was working on during the 30 days. Quite impressive if I do say so myself.&lt;/p&gt;




&lt;h2&gt;
  
  
  Wrapping Up
&lt;/h2&gt;

&lt;p&gt;I am concerned, not for myself but for the ones that come after. The ones that will not have that sense of curiosity and wanting to understand because they have been spoon-fed everything.&lt;/p&gt;

&lt;p&gt;I haven't been writing as much as I have been navigating this new landscape we find ourselves in, as well as other pressing mattters in my private life. I can't say when next I'll publish something, but be assured I am watching and paying attention to it all.&lt;/p&gt;

&lt;p&gt;A lot of you now think fundamentals don't matter anymore, I would argue they are more important than ever.&lt;/p&gt;




&lt;h3&gt;
  
  
  Thank you for reading, let's connect!
&lt;/h3&gt;

&lt;p&gt;Thank you for visiting this little corner of mine. My email and DMs are always open; if you want to chat or collaborate on something, &lt;a href="mailto:jamesmidzi@gmail.com"&gt;shoot me a email&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Where you can also get hold of me:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://twitter.com/Psypher1" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://discord.com/users/Pharaoh#5441/" rel="noopener noreferrer"&gt;Discord&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.linkedin.com/in/jamesmidzi/" rel="noopener noreferrer"&gt;Linkedin&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>programming</category>
      <category>fundamentals</category>
      <category>ai</category>
      <category>types</category>
    </item>
    <item>
      <title>Crypto Forge - Embracing Nuxt</title>
      <dc:creator>James 'Dante' Midzi</dc:creator>
      <pubDate>Tue, 06 Jan 2026 15:58:39 +0000</pubDate>
      <link>https://dev.to/psypher1/crypto-forge-embracing-nuxt-5ahh</link>
      <guid>https://dev.to/psypher1/crypto-forge-embracing-nuxt-5ahh</guid>
      <description>&lt;p&gt;I was out of commission for several months. During my time away I got time to refocus, recentre and work on my writing.&lt;/p&gt;

&lt;p&gt;When I was finally cleared one of the things I did was refresh my memory in several technology I had settled on. One of them was Nuxt, as I outlined in &lt;a href="https://dantedecodes.vercel.app/articles/how-svelte-5-made-me-understand-nuxt-2joj" rel="noopener noreferrer"&gt;this article&lt;/a&gt; .&lt;/p&gt;

&lt;p&gt;I am here to present to you &lt;strong&gt;&lt;a href="https://cryptoforge-nuxt.vercel.app/" rel="noopener noreferrer"&gt;Crypto Forge&lt;/a&gt;&lt;/strong&gt;- an app that lists cryptocurrencies and allows you to sort them in different ways.&lt;/p&gt;

&lt;p&gt;In essence it is a migration of Brad Traversy's project, &lt;a href="https://crypto-dash-two.vercel.app/" rel="noopener noreferrer"&gt;&lt;strong&gt;Crypto Dash&lt;/strong&gt;&lt;/a&gt; that was in React.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Recreate Instead of Building Something New?
&lt;/h2&gt;

&lt;p&gt;As I mention, I needed a refresher on a lot of the tools I had chosen. Rather than come up with a whole new ides, to dip my toes back in, I thought migrating something that is already working would be simpler than starting something completely from scratch. I do have ideas.&lt;/p&gt;




&lt;h2&gt;
  
  
  What I Learnt
&lt;/h2&gt;

&lt;p&gt;This exploration offered several learning opportunities, and entailed understanding what React was doing and translating that to Vue/Nuxt.&lt;/p&gt;

&lt;h3&gt;
  
  
  API Routes For Data Fetching
&lt;/h3&gt;

&lt;p&gt;Initially when I stated, I tried to fetch the data directly in the page. Upon further reading, and advice from the discord I learnt that it was recommended to use the &lt;code&gt;server&lt;/code&gt; folder and API routes to handle fetching of data.&lt;/p&gt;

&lt;p&gt;This helps in better managing server only parts of a Nuxt application. Using the server folder also helps in scalability and structuring of endpoints. &lt;/p&gt;

&lt;p&gt;While in this project I only made use of GET requests, in another one I am working I made full use of all the HTTP methods - it's a bit more complex.&lt;/p&gt;

&lt;p&gt;My usage looks like this:&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;//server/api/coin.get.js&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nf"&gt;defineEventHandler&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&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;query&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;getQuery&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;$fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://api.coingecko.com/api/v3/coins/markets&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;params&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;vs_currency&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;usd&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;order&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;query&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;order&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;market_cap_desc&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;per_page&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;query&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;per_page&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;page&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;query&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;page&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="na"&gt;sparkline&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="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

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

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;NOTE:&lt;br&gt;
Ideally the URL would be in an environment variable&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Composables To Avoid Logic Duplication
&lt;/h3&gt;

&lt;p&gt;A composable is a reusable function that performs some kind of logic. Say you needed to fetch user data for each page they visit on your app, rather that making that call every time, you would create a composable that does that.&lt;/p&gt;

&lt;p&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="c1"&gt;//src/composables/useUser.js&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;useUser&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="c1"&gt;// Shared, SSR-safe state&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;any&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;user&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;


  &lt;span class="nx"&gt;aaync&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;fetchUser&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;data&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;useFetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/api/user&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;credentials&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;include&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// important for auth cookies&lt;/span&gt;
      &lt;span class="p"&gt;})&lt;/span&gt;

      &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;fetchUser&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;I made use of a composable to fetch the coin data. That piece of code is too long too share, you can view it in &lt;a href="https://github.com/Psypher1/crypto-forge" rel="noopener noreferrer"&gt;the repository&lt;/a&gt; though.&lt;/p&gt;




&lt;h2&gt;
  
  
  What's Next?
&lt;/h2&gt;

&lt;p&gt;I have already started work on my next project using Nuxt. I am still contemplating whether to make it public or not. Broadly, I need to get a authentication and connecting to the database fully functional. So in the next coming weeks, I just might release it to the wild.&lt;/p&gt;

&lt;p&gt;I am still fixing issues with my policies and &lt;a href="https://dantedecodes.vercel.app/articles/fortify-your-database-supabases-row-level-security-3fh8" rel="noopener noreferrer"&gt;row level security&lt;/a&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Wrapping Up
&lt;/h2&gt;

&lt;p&gt;This was a fun exploration to get me back into the swing of things. I got to learn new ways of doing things; which I would argue are better than the other technologies I have explored.&lt;/p&gt;




&lt;h3&gt;
  
  
  Thank you for reading, let's connect!
&lt;/h3&gt;

&lt;p&gt;Thank you for visiting this little corner of mine. Let's connect on &lt;a href="https://twitter.com/Psypher1" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt;, &lt;a href="https://discord.com/users/Pharaoh#5441/" rel="noopener noreferrer"&gt;Discord&lt;/a&gt; and &lt;a href="https://www.linkedin.com/in/jamesmidzi/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;&lt;/p&gt;

</description>
      <category>nuxt</category>
      <category>vue</category>
      <category>api</category>
    </item>
    <item>
      <title>Laravel is How Development Should Be</title>
      <dc:creator>James 'Dante' Midzi</dc:creator>
      <pubDate>Mon, 31 Mar 2025 07:11:42 +0000</pubDate>
      <link>https://dev.to/psypher1/laravel-is-how-development-should-be-9ob</link>
      <guid>https://dev.to/psypher1/laravel-is-how-development-should-be-9ob</guid>
      <description>&lt;p&gt;I have not been doing that much writing. Not because I've nothing to write about, no. It's because I have been head down, silent and learning.&lt;/p&gt;

&lt;p&gt;I have been learning &lt;a href="https://laravel.com/" rel="noopener noreferrer"&gt;Laravel&lt;/a&gt;. If you read &lt;a href="https://dantedecodes.vercel.app/articles/why-sveltekit-will-be-my-goto-moving-forward-4abe" rel="noopener noreferrer"&gt;this article&lt;/a&gt; of mine you will recall I said I wouldn't reach for Laravel because I already use TYPO3. I had to walk back that statement when I realised while I have TYPO3, it is better suited to more involved projects.&lt;/p&gt;

&lt;p&gt;What changed? Well, I have a biggish project I am working on and I landed in a situation where SvelteKit wasn't sufficient and TYPO3 was too much. I needed a midpoint - and I was not going to go back to Nextjs.&lt;/p&gt;




&lt;h2&gt;
  
  
  Laravel
&lt;/h2&gt;

&lt;p&gt;Instead of trying to rattle my head with something new, I chose to leverage the PHP that I already know. On another journey I went, and what a wondrous one it turned out to be.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why Laravel Works?
&lt;/h3&gt;

&lt;p&gt;It just does.  In encounters that I have had with it, it shows a lot of thought went into creation of the framework. I don't know how to explain it, but it just does. Most things you may want to do, Laravel most likely has an in-built solution. Batteries included, I hear people say.&lt;/p&gt;

&lt;h4&gt;
  
  
  Authentication and Authorisation
&lt;/h4&gt;

&lt;p&gt;A thing that we all have to handle as developers is auth. In previous times I have always left this until the end because a number of the options were a headache to deal with.&lt;/p&gt;

&lt;p&gt;This is not the case with Laravel. You could choose to setup up the authentication flow on your own with code that sort of looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;store&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;//validate&lt;/span&gt;
        &lt;span class="nv"&gt;$validatedAttributes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;request&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;validate&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
            &lt;span class="s1"&gt;'first_name'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'required'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
            &lt;span class="s1"&gt;'last_name'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'required'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
            &lt;span class="s1"&gt;'email'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'required'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'email'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
            &lt;span class="s1"&gt;'password'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'required'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Password&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nb"&gt;min&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="s1"&gt;'confirmed'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
        &lt;span class="p"&gt;]);&lt;/span&gt;

        &lt;span class="c1"&gt;// create user&lt;/span&gt;
        &lt;span class="nv"&gt;$user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;User&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$validatedAttributes&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="c1"&gt;// log in&lt;/span&gt;
        &lt;span class="nc"&gt;Auth&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;login&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$user&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="c1"&gt;//redirect&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;redirect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/dashboard'&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;Or you could pick on of the starters that handle this for you. Some of them adding a few features to the process.&lt;/p&gt;

&lt;p&gt;The same goes for authorisation. Based on how you want the access to things to be be you can specify the authorisation rules on the specific routes, app-wide or on individual controllers.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="c1"&gt;// auth on a route&lt;/span&gt;
&lt;span class="nc"&gt;Route&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/jobs/{job}/edit'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;JobController&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;class&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'edit'&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;middleware&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'auth'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;can&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'edit'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'job'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// the policy that manages it&lt;/span&gt;
 &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;edit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;User&lt;/span&gt; &lt;span class="nv"&gt;$user&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;Job&lt;/span&gt; &lt;span class="nv"&gt;$job&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="kt"&gt;bool&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;$job&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;employer&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;is&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$user&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;h4&gt;
  
  
  Database Relations
&lt;/h4&gt;

&lt;p&gt;A thing that has given me trouble when building is database relations. I recall a time on one of the projects I was working on I got stuck trying to define database relations with Prisma. Some of it was because of how new I was at it. But even after I understood what was required the particular process manged to confuse me more.&lt;/p&gt;

&lt;p&gt;Laravel on the other hand is intuitive about relations. Yes, you have a couple of places you have to ensure you have handled. But that, I have found makes you consider things more deeply and pay close attention.&lt;/p&gt;

&lt;p&gt;Take for example; you have an Employers table and a Jobs table. Each Employer can have many Jobs. For that you would:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add the relation in the migration file&lt;/li&gt;
&lt;li&gt;Define the relations in the respective model files&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%2Fnk3kx46nsmuaqivewb1d.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%2Fnk3kx46nsmuaqivewb1d.png" alt=" " width="800" height="287"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;blockquote&gt;
&lt;p&gt;Code snippets in this article are taken from my Learn Laravel in 30 days repository as well as the final project from that.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Appreciation
&lt;/h2&gt;

&lt;p&gt;I would also like to thank &lt;strong&gt;&lt;a href="https://x.com/jeffrey_way" rel="noopener noreferrer"&gt;Jeffrey Way&lt;/a&gt;&lt;/strong&gt; for making my journey into Laravel an enjoyable experience. I highly recommend the &lt;a href="https://www.youtube.com/watch?v=1NjOWtQ7S2o&amp;amp;list=PL3VM-unCzF8hy47mt9-chowaHNjfkuEVz" rel="noopener noreferrer"&gt;30 days to learn Laravel&lt;/a&gt; playlist.&lt;/p&gt;




&lt;h2&gt;
  
  
  What About SvelteKit?
&lt;/h2&gt;

&lt;p&gt;It's a very unfortunate thing really. I find myself in the position of having to walk back on things I said.&lt;/p&gt;

&lt;p&gt;A little while after I adopted Svelte, several changes were made that go against the simplicity I have been aiming for. As such, if I am to use SvelteKit now, it would be in the state that I found it in when I started and now. As for the time being, me and Sveltekit are taking a break.&lt;/p&gt;




&lt;h2&gt;
  
  
  Wrapping Up
&lt;/h2&gt;

&lt;p&gt;I never paid that much attention to Laravel and I regret that. However, at least I have seen the light.&lt;/p&gt;

&lt;p&gt;Although, I am not a fan of how the Laravel team are trying to streamline the project creation process. I don't like starters I didn't make is all.&lt;/p&gt;

&lt;p&gt;I have been doing a lot of walking back my statements recently, huh?&lt;/p&gt;




&lt;h3&gt;
  
  
  Thank you for reading, let's connect!
&lt;/h3&gt;

&lt;p&gt;Thank you for visiting this little corner of mine. Let's connect on &lt;a href="https://twitter.com/Psypher1" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt;, &lt;a href="https://discord.com/users/Pharaoh#5441/" rel="noopener noreferrer"&gt;Discord&lt;/a&gt; and &lt;a href="https://www.linkedin.com/in/jamesmidzi/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;&lt;/p&gt;

</description>
      <category>php</category>
      <category>laravel</category>
      <category>programming</category>
    </item>
    <item>
      <title>How Svelte 5 Made Me Understand Nuxt</title>
      <dc:creator>James 'Dante' Midzi</dc:creator>
      <pubDate>Thu, 27 Feb 2025 10:38:37 +0000</pubDate>
      <link>https://dev.to/psypher1/how-svelte-5-made-me-understand-nuxt-2joj</link>
      <guid>https://dev.to/psypher1/how-svelte-5-made-me-understand-nuxt-2joj</guid>
      <description>&lt;p&gt;I have gone on a journey. A long winding journey. A journey I could not have foreseen. As it would have it; I am back, once again, announcing  my change in methodologies and workflows. &lt;/p&gt;

&lt;p&gt;A lot has happened in the world of development and tech; from React and Next.js, to Lucia, to Laravel, to Astro. So much to talk about...&lt;/p&gt;

&lt;p&gt;One of those 'changes' has made go back to the drawing board yet again. Something I did not think I would have had to to do for about 3 to 5 years. Yet, here we are; me eating my words. Rather than having to answer question later down the line, I figured it would be simpler for me to talk about and explain my decisions.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Changes
&lt;/h2&gt;

&lt;p&gt;It all boils down to one thing really. One thing that has been made core and I cannot get with it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Runes - My Friction Point
&lt;/h3&gt;

&lt;p&gt;I have read through the documentation, I watched the release videos. I have explored the &lt;em&gt;new&lt;/em&gt; way. After all that, I will never accept the runes syntax. My brain will not find synergy.&lt;/p&gt;

&lt;p&gt;This - whatever this way is - is in opposition of all the reasons I gravitated towards Svelte and Sveltekit.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;count&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;$state&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="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;double&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;$derived&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="nf"&gt;$effect&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;setInterval&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;elapsed&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="nx"&gt;interval&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;I understand all of it, I get what they were trying to accomplish. I just don't like it. It is too indicative of React; and I left React ages ago.&lt;/p&gt;

&lt;p&gt;I left the &lt;code&gt;useState&lt;/code&gt; and &lt;code&gt;useEffect&lt;/code&gt; of React because they wound up complicating what should have been simple. The runes syntax of Svelte feels a little to similar to React and I have no intention of writing that kind of code again. Regardless of how 'better' it may be.&lt;/p&gt;

&lt;p&gt;For me there was something elegant about Svelte's &lt;code&gt;$:&lt;/code&gt; syntax. It was simple, straightforward and easy enough to understand. It wasn't perfect, but it worked.&lt;/p&gt;

&lt;h4&gt;
  
  
  Then Snippets...
&lt;/h4&gt;

&lt;p&gt;To be able to have and reuse chunks of code. Sounds cool on paper, but looking at the code and the implementation, it feels too much like a React way of doing things. There are &lt;strong&gt;waaaaay&lt;/strong&gt; to many symbols for my liking. This is horrible to look at:&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;script&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;message&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`it's great to see you!`&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;$props&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;/script&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="nx"&gt;snippet&lt;/span&gt; &lt;span class="nf"&gt;hello&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="nx"&gt;p&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;hello&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;!&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;!&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/p&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sr"&gt;/snippet&lt;/span&gt;&lt;span class="err"&gt;}
&lt;/span&gt;
&lt;span class="p"&gt;{@&lt;/span&gt;&lt;span class="nd"&gt;render&lt;/span&gt; &lt;span class="nf"&gt;hello&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;alice&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="nd"&gt;render&lt;/span&gt; &lt;span class="nf"&gt;hello&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;bob&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Nuxt
&lt;/h3&gt;

&lt;p&gt;In &lt;a href="https://dantedecodes.vercel.app/articles/why-sveltekit-will-be-my-goto-moving-forward-4abe" rel="noopener noreferrer"&gt;an article&lt;/a&gt;, where I sang the praises of SvelteKit, I said that I didn't like Nuxt and how it did templating.&lt;/p&gt;

&lt;p&gt;With the looming arrival of Svelte 5, I revisited decisions I had made earlier. I realised that a lot of what I was complaining about had to do with my misunderstanding. I got over those misconceptions and learnt, built and migrated some projects. &lt;/p&gt;

&lt;p&gt;A few things that finally won me over were:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;File-Based Routing&lt;/strong&gt;: Nuxt implements file based routing, not directory based - I have &lt;a href="https://dantedecodes.vercel.app/articles/file-based-vs-directory-based-routing-understanding-the-difference-30mp" rel="noopener noreferrer"&gt;an article&lt;/a&gt; on this. I have always been partial to file-based routing. I only tolerated SvelteKit's directory approach because everything else is simple.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Auto Imports&lt;/strong&gt;: In most frameworks if you wish to import something into a file, you usually have an import statement at the top. This is not the case with Nuxt&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Separation of Concerns&lt;/strong&gt;: I mentioned this in that same article; how I was not a fan of Next.js placing everything in a single directory. Nuxt doesn't have that problem - everything has its specified place

&lt;ul&gt;
&lt;li&gt;Pages&lt;/li&gt;
&lt;li&gt;Layouts&lt;/li&gt;
&lt;li&gt;Middleware&lt;/li&gt;
&lt;li&gt;Server&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Modules&lt;/strong&gt;: So the Nuxt people have modules, modules upon modules to things you may want to add to your project; icons, SEO, sitemaps, fonts. Nuxt probably has a module for that. Reminds me of Astro integrations - I love those.&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;I was wrong about Nuxt, I admit that.&lt;/p&gt;




&lt;h2&gt;
  
  
  Wrapping Up
&lt;/h2&gt;

&lt;p&gt;I guess that's the beauty of being a developer and an adult; the ability to choose what I use and what I don't. If I am not happy in what I am doing and what I am doing it with, I will rarely ever invest that much commitment into it - this is where I have arrived with Svelte - I am not happy, I feel I am moving backwards.&lt;/p&gt;




&lt;h3&gt;
  
  
  Thank you for reading, let's connect!
&lt;/h3&gt;

&lt;p&gt;Thank you for visiting this little corner of mine. Let's connect on &lt;a href="https://twitter.com/Psypher1" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt;, &lt;a href="https://discord.com/users/Pharaoh#5441/" rel="noopener noreferrer"&gt;Discord&lt;/a&gt; and &lt;a href="https://www.linkedin.com/in/jamesmidzi/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;&lt;/p&gt;

</description>
      <category>vue</category>
      <category>nuxt</category>
      <category>svelte</category>
      <category>sveltekit</category>
    </item>
    <item>
      <title>You Don't Need The Flex</title>
      <dc:creator>James 'Dante' Midzi</dc:creator>
      <pubDate>Mon, 27 Jan 2025 12:04:52 +0000</pubDate>
      <link>https://dev.to/psypher1/you-dont-need-the-flex-42km</link>
      <guid>https://dev.to/psypher1/you-dont-need-the-flex-42km</guid>
      <description>&lt;p&gt;I find it very amusing that this is going to be my first post of the year. But it has bothered me enough that I must speak about it. &lt;/p&gt;

&lt;p&gt;No one can deny the godsend that tailwind has been. We are able to prototype faster and get things done quickly.&lt;/p&gt;

&lt;p&gt;I have noticed in the upsurge of Tailwind, has come with a forgetting and overlooking of some properties inherent in CSS and HTML.&lt;/p&gt;




&lt;h2&gt;
  
  
  Block and Inline Elements
&lt;/h2&gt;

&lt;p&gt;Yes, I am afraid we have to go there...&lt;/p&gt;

&lt;h3&gt;
  
  
  Block-Level Element
&lt;/h3&gt;

&lt;p&gt;I actually fail to understand how people forgot about the block element aspect of HTML. I see someone doing this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"flex flex-col"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;One&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Two&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Three&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And all they wanted to do was have elements one after each other - stack them. They already do that! That is what HTML inherently does. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Block-level elements always start a new line.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Yes, of course I understand there are certain instances where you want your element to only take up as little space as possible - what &lt;code&gt;flex&lt;/code&gt; does - but paying attention to what they have done, that is &lt;strong&gt;rarely&lt;/strong&gt; the case.&lt;/p&gt;

&lt;p&gt;Have a gander a some block elements&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;    &lt;span class="nt"&gt;&amp;lt;main&amp;gt;&lt;/span&gt;    &lt;span class="nt"&gt;&amp;lt;section&amp;gt;&lt;/span&gt;    &lt;span class="nt"&gt;&amp;lt;header&amp;gt;&lt;/span&gt;    &lt;span class="nt"&gt;&amp;lt;nav&amp;gt;&lt;/span&gt;    &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;-&lt;span class="nt"&gt;&amp;lt;h6&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To quote something Kevin Powell said (I am paraphrasing):&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Don't undo the styling and then end up redoing it again. Use the HTML to your advantage"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Inline-Level Element
&lt;/h3&gt;

&lt;p&gt;For posterity, it is only right I talk about inline elements as well. In HTML, there are certain elements that are not block. These elements only take up as much width as necessary. As such you can place them side by side - they do not naturally stack.&lt;/p&gt;

&lt;p&gt;Some inline elements you are familiar with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;a&amp;gt;&lt;/span&gt;    &lt;span class="nt"&gt;&amp;lt;img&amp;gt;&lt;/span&gt;    &lt;span class="nt"&gt;&amp;lt;input&amp;gt;&lt;/span&gt;    &lt;span class="nt"&gt;&amp;lt;span&amp;gt;&lt;/span&gt;    &lt;span class="nt"&gt;&amp;lt;button&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Wrapping Up
&lt;/h2&gt;

&lt;p&gt;So next time you are trying to stack elements, don't just rush to add &lt;code&gt;flex&lt;/code&gt;. Put your elements on the page and see if they stack as you want. Unhand the flex and think about what you want your resulting outcome to be.&lt;/p&gt;

&lt;p&gt;And if what I said, doesn't make sense, here is a link to &lt;a href="https://www.w3schools.com/html/html_blocks.asp" rel="noopener noreferrer"&gt;w3schools&lt;/a&gt; with examples you can play around with.&lt;/p&gt;




&lt;h3&gt;
  
  
  Thank you for reading, let's connect!
&lt;/h3&gt;

&lt;p&gt;Thank you for visiting this little corner of mine. Let's connect on &lt;a href="https://twitter.com/Psypher1" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt;, &lt;a href="https://discord.com/users/Pharaoh#5441/" rel="noopener noreferrer"&gt;Discord&lt;/a&gt; and &lt;a href="https://www.linkedin.com/in/jamesmidzi/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;&lt;/p&gt;

</description>
      <category>html</category>
      <category>webdev</category>
      <category>css</category>
      <category>tailwindcss</category>
    </item>
    <item>
      <title>Your Constant Quest For Productivity May Be Hurting You</title>
      <dc:creator>James 'Dante' Midzi</dc:creator>
      <pubDate>Wed, 17 Jul 2024 12:26:44 +0000</pubDate>
      <link>https://dev.to/psypher1/your-constant-quest-for-productivity-may-be-hurting-you-631</link>
      <guid>https://dev.to/psypher1/your-constant-quest-for-productivity-may-be-hurting-you-631</guid>
      <description>&lt;p&gt;I have been head down working on several things. During the time I found myself accomplishing a lot of what I had set out to. Accomplishing a lot more than I would previously. What changed?&lt;/p&gt;

&lt;p&gt;Let me take you on a journey...&lt;/p&gt;

&lt;p&gt;A number of the decisions I took towards the end of the previous year began to pay dividend. These included my stepping away from React and that ecosystem. Changing how I go about accomplishing the things I set out to. Elimination of things from my life and avoidance of others.&lt;/p&gt;

&lt;p&gt;Anyway, I digress...&lt;/p&gt;

&lt;p&gt;Let's talk productivity...&lt;/p&gt;




&lt;h2&gt;
  
  
  Productivity
&lt;/h2&gt;

&lt;p&gt;You will be hard pressed to not encounter someone talking about productivity this or productivity that. Be it an app, a book or some system that has 'increased their productivity'. Everyone and their grandma is on some tool, some book, some extension or some keyboard shortcuts to increase productivity - and it never ends. There is always going to be something, there is always something and there will always be something.&lt;/p&gt;

&lt;p&gt;One of the things I did, or rather didn't do, was stop hunting down tools and methods to 'achieve ultimate productivity'. A realisation hit me; I asked myself; with all this focus on creating the most productive work environment, is anything actually getting done?&lt;/p&gt;

&lt;p&gt;Why that question specifically? It boils down to an insight I had while I was reading and taking in the words in my own time. In it, our guide said something that made me stop and think. It was something to effect of:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The only thing you have the power to control is you. And as long as you are controlled by external forces, you will not be free.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Which in turn got me thinking; all this 'productivity' everyone is stuck in endless loops in search of, who is it for? Does anyone really want to be productive, or do they want to look like they're being productive? I have to admit, at a point I was guilty of the latter.&lt;/p&gt;

&lt;p&gt;That choice, that simple decision of asking myself; this that I am doing, is it helping me in any way? Is it aiding me getting to my keystones in any way? When I answered those questions honestly, a shift in my mindset occurred. I did away with all the hype and zeroed in on what was important to me.&lt;/p&gt;




&lt;h2&gt;
  
  
  The More You Look for Productivity, the Less You Accomplish
&lt;/h2&gt;

&lt;p&gt;That was the observation, the conclusion I came to. Every minute, every second spent on trying to and looking for ways to be 'productive' was a minute spent on not getting anything done. Simple as that. There is no hidden tool, special book or supposed system that will get you to be more 'productive'. &lt;/p&gt;

&lt;p&gt;The change that needs to happen is you, within you. Once your mind is set right and your focuses are correctly aligned, things will begin to work smoothly and you will attain that 'productivity' that you've been feverishly hunting. &lt;/p&gt;

&lt;p&gt;Contrary to what you might have been lead to believe, there is such a thing as too much 'productivity'.&lt;/p&gt;




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

&lt;p&gt;Forget the productivity tools, forget the books, forget the systems. Do the work, accomplish the task. Quiet the noise. Productivity is not some magic pill you can stumble upon, it is a shift in mindset. Wrap your head around that, and stop hunting for magic geese.&lt;/p&gt;




&lt;h3&gt;
  
  
  Thank you for reading, let's connect!
&lt;/h3&gt;

&lt;p&gt;Thank you for visiting this little corner of mine. Let's connect on &lt;a href="https://twitter.com/Psypher1" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt;, &lt;a href="https://discord.com/users/Pharaoh#5441/" rel="noopener noreferrer"&gt;Discord&lt;/a&gt; and &lt;a href="https://www.linkedin.com/in/jamesmidzi/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>focus</category>
      <category>mindset</category>
    </item>
    <item>
      <title>Say Hello To shrinkat - A Tiny URL Shortener</title>
      <dc:creator>James 'Dante' Midzi</dc:creator>
      <pubDate>Mon, 15 Apr 2024 14:48:38 +0000</pubDate>
      <link>https://dev.to/psypher1/say-hello-to-shrinkat-a-tiny-url-shortener-310k</link>
      <guid>https://dev.to/psypher1/say-hello-to-shrinkat-a-tiny-url-shortener-310k</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;TLDR&lt;br&gt;
I made a link shortener. The goal was to learn the Pocketbase API and see if it could be viable for some smaller projects I build in the future.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;There is really not much to say here. I wanted to implement an entirely localised solution to building something&lt;/p&gt;




&lt;h2&gt;
  
  
  Technologies I Used
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;SvelteKit (of course)&lt;/li&gt;
&lt;li&gt;Pocketbase &lt;sup id="fnref1"&gt;1&lt;/sup&gt;
&lt;/li&gt;
&lt;li&gt;TailwindCss&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What I Learnt
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;How authentication works with Pocketbase: It's quite different from how something like Supabase handles it.&lt;/li&gt;
&lt;li&gt;Data modelling: Being sqlite, the way I had to think about data needed a slight shift in mindset.&lt;/li&gt;
&lt;li&gt;Working with the Pocktebase sqlite database: Working with a barebones database was actually really fun.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Here Are Some Screenshots
&lt;/h2&gt;

&lt;p&gt;Here is the homepage:&lt;br&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%2F30hr71ggkairt2ody7yi.jpg" 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%2F30hr71ggkairt2ody7yi.jpg" alt="home page unauthed" width="700" height="347"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here is what a logged in user sees:&lt;br&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%2F4yeibll398akcpg2yzzz.jpg" 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%2F4yeibll398akcpg2yzzz.jpg" alt="logged in user" width="700" height="350"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Wrapping Up
&lt;/h2&gt;

&lt;p&gt;This was a fun little thing to build. I learnt quite a bit. There is definitely a place for Pocketbase in my  off the cuff build.&lt;/p&gt;

&lt;p&gt;My one gripe is deploying this database is not simple, not in the slightest.  And no, Docker does not count - I do not use those dark arts.&lt;/p&gt;

&lt;h3&gt;
  
  
  The code
&lt;/h3&gt;

&lt;p&gt;The code for shrinkat is available on GitHub. Fork it, make it your own, create pull requests...&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://github.com/meerkat-collective/shrinkat" rel="noopener noreferrer"&gt;https://github.com/meerkat-collective/shrinkat&lt;/a&gt;
&lt;/h2&gt;




&lt;h3&gt;
  
  
  Thank you for reading, let's connect!
&lt;/h3&gt;

&lt;p&gt;Thank you for visiting this little corner of mine. Let's connect on &lt;a href="https://twitter.com/Psypher1" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt;, &lt;a href="https://discord.com/users/Pharaoh#5441/" rel="noopener noreferrer"&gt;Discord&lt;/a&gt; and &lt;a href="https://www.linkedin.com/in/jamesmidzi/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;&lt;/p&gt;




&lt;ol&gt;

&lt;li id="fn1"&gt;
&lt;p&gt;Testing &amp;nbsp;↩&lt;/p&gt;
&lt;/li&gt;

&lt;/ol&gt;

</description>
      <category>svelte</category>
      <category>sveltekit</category>
      <category>pocketbase</category>
      <category>url</category>
    </item>
    <item>
      <title>Rendering External Markdown in Astro</title>
      <dc:creator>James 'Dante' Midzi</dc:creator>
      <pubDate>Wed, 07 Feb 2024 14:30:34 +0000</pubDate>
      <link>https://dev.to/psypher1/rendering-external-markdown-in-astro-46oj</link>
      <guid>https://dev.to/psypher1/rendering-external-markdown-in-astro-46oj</guid>
      <description>&lt;p&gt;It seems like I'm always writing the same article... 😂&lt;/p&gt;

&lt;p&gt;I enjoy Astro, it's a good framework, but there is one thing about it or rather the docs that irks me.&lt;/p&gt;

&lt;p&gt;Astro is pitched as a content first framework with native markdown support. That's what they say. However, this isn't &lt;em&gt;completely&lt;/em&gt; the case.&lt;/p&gt;

&lt;p&gt;When it comes to markdown that is local to your project, Astro does absolute wonders with the rendering and parsing. Your problems arise when you have your markdown from an external source i.e. a CMS. The docs have been structured in such a way that they want you to use local markdown and Content Collections.&lt;/p&gt;

&lt;p&gt;But sometimes, your markdown is somewhere else. What is one to do then?&lt;/p&gt;

&lt;p&gt;Let's go on a journey shall we? ...&lt;/p&gt;

&lt;h2&gt;
  
  
  The Scenario
&lt;/h2&gt;

&lt;p&gt;You use Hygraph as your CMS for your articles. You write your articles in markdown, and you can fetch them and all their data. What you want to do is have your articles rendered on your newly created Astro site.&lt;/p&gt;

&lt;p&gt;The requirements for this task are as follows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It needs to be &lt;strong&gt;one&lt;/strong&gt; thing - a package or whatever - that you import and use.&lt;/li&gt;
&lt;li&gt;You don't want to have to configure any additional things.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Before I give you the solutions that I think are best, I challenge you to find the solution within the Astro docs. I'll wait...&lt;/p&gt;




&lt;h2&gt;
  
  
  The Solution(s)
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Markdown Component (deprecated)
&lt;/h3&gt;

&lt;p&gt;I fought with this a while back when Astro was still in v1, and in those times, there was a package called &lt;code&gt;@astrojs/markdown-components&lt;/code&gt;. That package has long since been deprecated, as such you won't be able to install it.   &lt;/p&gt;

&lt;p&gt;For reference, this is how that would look (those who read my &lt;a href="https://dantedecodes.vercel.app/articles/how-to-display-devto-posts-on-an-astro-site-3icm" rel="noopener noreferrer"&gt;Displaying Dev.to Post on Your Astro Site&lt;/a&gt;  article will be familiar with this code.)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- /articles/[slug].astro --&amp;gt;&lt;/span&gt;
---
import Markdown from "@astrojs/markdown-component";

export async function getStaticPaths() {
  const articles = await fetchArticles();

  return articles.map((article) =&amp;gt; {
    return {
      params: { slug: article.slug },
      props: { article },
    };
  });
}

const {article} = Astro.props;
const {body_markdown}  = article;
---

&lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;Markdown&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;{body_markdown}&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;A wise man once said, "If it ain't broke, don't fix it." &lt;/p&gt;

&lt;p&gt;My site has been working well with this package, and because of that, I will not upgrade it to a higher version as I am not in the mood to do the dance again.&lt;/p&gt;

&lt;blockquote&gt;
&lt;h5&gt;
  
  
  Now, let's head on to the stuff that works with newer versions of Astro.
&lt;/h5&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  Astro Pub
&lt;/h3&gt;

&lt;p&gt;Repository: &lt;a href="https://github.com/astro-community/md" rel="noopener noreferrer"&gt;https://github.com/astro-community/md&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Installation &amp;amp; Usage
&lt;/h4&gt;



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

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- /articles/[slug].astro --&amp;gt;&lt;/span&gt;
---
import Markdown from "@astrojs/markdown-component";

export async function getStaticPaths() {
    ...
}

const {article} = Astro.props;
const {body_markdown}  = article;
---

&lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;Markdown&lt;/span&gt; &lt;span class="na"&gt;of=&lt;/span&gt;&lt;span class="s"&gt;{body_markdown}&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;: Currently as of writing this, AstroPub requires  &lt;code&gt;astro@^3.0.0&lt;/code&gt; to work smoothly.  &lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  Thoughts
&lt;/h4&gt;

&lt;p&gt;If I had no choice, but to fight this battle again, this is the method I would choose.&lt;/p&gt;




&lt;h3&gt;
  
  
  Markdown-it
&lt;/h3&gt;

&lt;p&gt;Repository: &lt;a href="https://github.com/markdown-it/markdown-it" rel="noopener noreferrer"&gt;https://github.com/markdown-it/markdown-it&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Installation &amp;amp; Usage
&lt;/h4&gt;



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

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- /articles/[slug].astro --&amp;gt;&lt;/span&gt;
---
import markdownit from "markdown-it";
const md = markdownit();

export async function getStaticPaths() {
 ...
}

const {content_markdown} = Astro.props
---

&lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;Fragment&lt;/span&gt; &lt;span class="na"&gt;set:html=&lt;/span&gt;&lt;span class="s"&gt;{md.render(content_markdown)}&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

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

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;: Markdown-it also requires &lt;code&gt;astro ^3.0.0&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  Thoughts
&lt;/h4&gt;

&lt;p&gt;I don't like this method. I don't like it because:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I have to declare a variable to store markdown-it.&lt;/li&gt;
&lt;li&gt;I have to use the &lt;code&gt;set:html&lt;/code&gt; to render the content.&lt;/li&gt;
&lt;li&gt;I have to additionally call the render function and then pass my content to it.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Astro Remote
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Update: 29 February 2024&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
After submitting an issue, Nate added the install command.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Repository: &lt;a href="https://github.com/natemoo-re/astro-remote" rel="noopener noreferrer"&gt;https://github.com/natemoo-re/astro-remote&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Installation &amp;amp; Usage
&lt;/h4&gt;



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

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- /articles/[slug].astro --&amp;gt;&lt;/span&gt;
---
import {Markdown} from "astro-remote";

export async function getStaticPaths() {
 ...
}

const {content_markdown} = Astro.props
---

&lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;Markdown&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;{body_markdown}&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

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

&lt;/div&gt;



&lt;h4&gt;
  
  
  Thoughts
&lt;/h4&gt;

&lt;p&gt;Astro Remote works very similarly to Astro Pub, and I like that about it.&lt;/p&gt;




&lt;h3&gt;
  
  
  The Thing About Marked
&lt;/h3&gt;

&lt;p&gt;If you did accept my challenge and looked in the docs, you might have found this section:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.astro.build/en/guides/markdown-content/#fetching-remote-markdown" rel="noopener noreferrer"&gt;Fetching Remote Markdown&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The Astro docs recommend &lt;strong&gt;marked&lt;/strong&gt;, but there's some things you have to be aware of with marked. &lt;/p&gt;

&lt;p&gt;Marked Site: &lt;a href="https://marked.js.org/" rel="noopener noreferrer"&gt;https://marked.js.org/&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Thoughts
&lt;/h4&gt;

&lt;p&gt;Marked informs you on their site that it does not sanitise your markup. Do with that information what you will.&lt;/p&gt;




&lt;h2&gt;
  
  
  Wrapping Up
&lt;/h2&gt;

&lt;p&gt;Astro -  a brilliant little thing. A bit more care with regard to this part of their framework/documentation would be cool. At least as much care as is given to other parts of the docs.&lt;/p&gt;

&lt;p&gt;On a steam, &lt;a href="https://twitter.com/whitep4nth3r" rel="noopener noreferrer"&gt;whitep4nth3r&lt;/a&gt; went on a journey of trying to find this information on stream, her goal was to use things the 'Astro way. In the end, she went with the markdown-it approach.&lt;/p&gt;

&lt;p&gt;The stream if you are curious. It's at 3hrs 57 minutes: &lt;a href="https://www.twitch.tv/videos/1998429304?filter=archives&amp;amp;sort=time" rel="noopener noreferrer"&gt;https://www.twitch.tv/videos/1998429304?filter=archives&amp;amp;sort=time&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Thank you for reading, let's connect!
&lt;/h3&gt;

&lt;p&gt;Thank you for visiting this little corner of mine. Let's connect on &lt;a href="https://twitter.com/Psypher1" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt;, &lt;a href="https://discord.com/users/Pharaoh#5441/" rel="noopener noreferrer"&gt;Discord&lt;/a&gt; and &lt;a href="https://www.linkedin.com/in/jamesmidzi/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;&lt;/p&gt;

</description>
      <category>astro</category>
      <category>markdown</category>
      <category>external</category>
    </item>
    <item>
      <title>Why SvelteKit Will Be My Goto Moving Forward</title>
      <dc:creator>James 'Dante' Midzi</dc:creator>
      <pubDate>Mon, 04 Dec 2023 13:00:00 +0000</pubDate>
      <link>https://dev.to/psypher1/why-sveltekit-will-be-my-goto-moving-forward-4abe</link>
      <guid>https://dev.to/psypher1/why-sveltekit-will-be-my-goto-moving-forward-4abe</guid>
      <description>&lt;p&gt;Allow me to tell you a tale, take you on a journey of how I switched how I work completely and I am probably not going back...&lt;/p&gt;

&lt;h2&gt;
  
  
  History
&lt;/h2&gt;

&lt;p&gt;Anyone who knows me and has been following my journey is aware that my development focuses consist of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Python&lt;/li&gt;
&lt;li&gt;PHP (TYPO#3)&lt;/li&gt;
&lt;li&gt;React/Next.js&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What this has allowed me to do is be more efficient at picking the correct tool for the things I'll be trying to accomplish.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Then
&lt;/h2&gt;

&lt;p&gt;It's no secret that I have been an advocate of Next.js for some time. I even have a short series I did investigating how to integrate it with different Headless CMS. I have done explorations on the features I believed people should know in regards to Next. As such me and Next have been on very good terms for a while.&lt;/p&gt;

&lt;h3&gt;
  
  
  Breaking Up With Next
&lt;/h3&gt;

&lt;p&gt;Put simply two words - &lt;strong&gt;&lt;em&gt;App Router&lt;/em&gt;&lt;/strong&gt;. I am not sure what the team at Vercel was in a hurry to get to, but they rushed this like I've never seen before. With me, if anything is pushed on me that hard, I form a natural aversion towards it; see one of my &lt;a href="https://dantedecodes.vercel.app/articles/typesafe-an-overused-term-that-needs-a-reality-check-5ho0" rel="noopener noreferrer"&gt;previous articles&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Lie of &lt;code&gt;Stable&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;While they may have made it stable now, when a lot of the &lt;em&gt;features&lt;/em&gt; of the router were introduced they weren't ready; despite what they liked you to believe.&lt;/p&gt;

&lt;p&gt;I could go on and on about the things that were reportedly stable, but that's not the point of the article. What I will do is tell you my main pain points.&lt;/p&gt;

&lt;p&gt;Clear boundaries or lack thereof:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One of the things I liked about Next.js was that there were clear boundaries; your &lt;strong&gt;pages&lt;/strong&gt; go here, your &lt;strong&gt;assets&lt;/strong&gt; go here, API routes go here. That is all but gone, with the brunt of the things happening in the app folder.
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Having to add pieces of text to change how your file/component works:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;This sort of relates to my first point; the adding of &lt;code&gt;'use client'&lt;/code&gt; or &lt;code&gt;'use server'&lt;/code&gt; within a file does not sit well with me. There is something elegant about &lt;code&gt;getStaticProps&lt;/code&gt; and &lt;code&gt;getServerSideProps&lt;/code&gt;; you knew exactly where your data was coming from and how it would be rendered.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I will not even get started on the actions, sorry server actions.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Yes, I know I can still use Next.js the way I prefer, but the mob makes so much noise I would just rather maintain the project I have the way they are and just not deal with this &lt;em&gt;new&lt;/em&gt; way.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  The Now
&lt;/h2&gt;

&lt;p&gt;After all the noise with Next.js I went on a journey to find something else that would meet my needs and not lie to me. My journey led me to several options; ones that did things better than Next.js, others not so much. Here is a very brief rundown:&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Laravel&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Considering I already use PHP in the form of TYPO3. I didn't go that way because I already got a sufficient dose of PHP. Also, I wouldn't randomly whip out TYPO3 for any 'ol project.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Vue/Nuxt&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;What put me off of &lt;em&gt;Vue/Nuxt&lt;/em&gt; was mainly their templating engine. It just didn't sit well with me; the particular way the files in it are written. Also, something about its routing felt iffy.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Solid&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;This would have been going back to a version of React/Nextjs type framework. I wouldn't learn as much as I would like. Also things would still be abstracted from me, I was trying to avoid that.&lt;/p&gt;




&lt;h3&gt;
  
  
  Enter Svelte
&lt;/h3&gt;

&lt;p&gt;Long ago, I tried to dabble in Svelte, but that was in my naive and hard-headed days and never took the time to understand what it required of me. Additionally, I tried to do it alongside another person and that did not go well. This time instead, I chose to knuckle down and get into what made Svelte Svelte; the changes in mindset I would need to undertake for this part of my journey.&lt;/p&gt;

&lt;h3&gt;
  
  
  Finding Synergy
&lt;/h3&gt;

&lt;p&gt;I am not going to lie, the move to SvelteKit was not seamless. A lot of shift in mindset was required&lt;/p&gt;

&lt;p&gt;To start the &lt;a href="https://dantedecodes.vercel.app/articles/file-based-vs-directory-based-routing-understanding-the-difference-30mp" rel="noopener noreferrer"&gt;&lt;strong&gt;directory-based routing&lt;/strong&gt;&lt;/a&gt; and wrapping my head around the &lt;code&gt;+page.svelte&lt;/code&gt; naming convention was a bit confusing to get comfortable with. Afterwards; understanding how working with data was accomplished and what the &lt;code&gt;+page.js&lt;/code&gt; and &lt;code&gt;+page.server.js&lt;/code&gt; files did, and where I used each.&lt;/p&gt;

&lt;p&gt;Understanding those things would aid me greatly in grasping how SvelteKit works and how I should approach my journey with it. With determination in my heart and a vantage point I was aimed at, I went to work.&lt;/p&gt;

&lt;p&gt;And then, it clicked! &lt;/p&gt;

&lt;p&gt;During the struggling, the change in mindset and embracing the power of native HTML and how SvelteKit leverages that, it clicked. Sticking to it paid off and my new home had been found and solidified.&lt;/p&gt;

&lt;h3&gt;
  
  
  What I Like About SvelteKit
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Native HTML&lt;/strong&gt;: It strips away the abstraction; no virtual DOM or anything of the kind. It's all just native HTML. Because of that your elements work the way they were intended.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Things are defined clearly&lt;/strong&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;+page.svelte&lt;/code&gt;: is your frontend stuff what you see when a page loads. Basically the crux of what a user sees when they visit your site/app.
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;+page.js&lt;/code&gt; / &lt;code&gt;+page.server.js&lt;/code&gt;: this is where you load data to be displayed on your pages, and where your form actions run.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;+layout.svelte&lt;/code&gt;: this applies styling and/or data to set of routes under the same directory.
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;+layout.js&lt;/code&gt; / &lt;code&gt;+layout.server.js&lt;/code&gt;: allows you to specify data you want applied to an entire set of routes. In essence, the higher level of your &lt;code&gt;page.server.js&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Form actions&lt;/strong&gt;: With it leveraging the native HTML means it takes advantage of all the functionality already present with forms. This means that nothing is hidden from you; what you can do in a form on a basic page, you can do with Sveltekit.  &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;em&gt;progressive enhancement&lt;/em&gt;: since we leverage the default functionality of forms, they will reload the page on a submit. Progressive enhancement gives us the ability to utilise the submit action without making the entire page reload.&lt;/li&gt;
&lt;/ol&gt;


&lt;/li&gt;

&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;Yes sure, Next.js might have now implemented some of this in their new version, but with SvelteKit it feels a lot more thought out and not rushed.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Wrapping Up
&lt;/h2&gt;

&lt;p&gt;All in all, I actually thank Vercel for taking the approach they did. I would not have rediscovered Sveltekit otherwise. In addition, it helps in my goal of stripping away complexity that I talked about in these articles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://dantedecodes.vercel.app/articles/fortify-your-database-supabases-row-level-security-3fh8" rel="noopener noreferrer"&gt;Row Level Security&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dantedecodes.vercel.app/articles/automate-database-processes-supabase-triggers-2dla" rel="noopener noreferrer"&gt;Supabase Triggers&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;And that's the journey; How an advocate of Next.js was not impressed by the direction it took and moved to SvelteKit. Thereby finding a better way, a more honest way, a streamlined way of doing things. A way he is much happier with.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  Thank you for reading, let's connect!
&lt;/h3&gt;

&lt;p&gt;Thank you for visiting this little corner of mine. Let's connect on &lt;a href="https://twitter.com/Psypher1" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt;, &lt;a href="https://discord.com/users/Pharaoh#5441/" rel="noopener noreferrer"&gt;Discord&lt;/a&gt; and &lt;a href="https://www.linkedin.com/in/jamesmidzi/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;&lt;/p&gt;

</description>
      <category>svelte</category>
      <category>sveltekit</category>
      <category>complexity</category>
      <category>simplicity</category>
    </item>
    <item>
      <title>File-Based vs. Directory-Based Routing: Understanding the Difference</title>
      <dc:creator>James 'Dante' Midzi</dc:creator>
      <pubDate>Fri, 24 Nov 2023 18:57:41 +0000</pubDate>
      <link>https://dev.to/psypher1/file-based-vs-directory-based-routing-understanding-the-difference-30mp</link>
      <guid>https://dev.to/psypher1/file-based-vs-directory-based-routing-understanding-the-difference-30mp</guid>
      <description>&lt;p&gt;I don't know who did it, and why everyone is suddenly confused by this. What you are calling file-based routing is not what you claim. I will gladly explain.&lt;/p&gt;

&lt;p&gt;I am going to use Next.js as an example:&lt;/p&gt;

&lt;h3&gt;
  
  
  File Based
&lt;/h3&gt;

&lt;p&gt;This is file-based routing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;src/
└── pages/
    ├── index.js
    ├── about.js
    └── contact.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the folder that defines your pages, if you are able to create a file in there and it automatically becomes a page (contact, about, services etc) that is file based routing.&lt;/p&gt;

&lt;p&gt;File-based routing is a routing where the entry point to your routes is an index file. What that mean is the same way you can have a &lt;code&gt;contact.jsx&lt;/code&gt; , you could also make a &lt;code&gt;contact/index.js&lt;/code&gt; and these two would do exactly the same with little to no issues.&lt;/p&gt;

&lt;p&gt;Frameworks that employ this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Astro&lt;/li&gt;
&lt;li&gt;Eleventy&lt;/li&gt;
&lt;li&gt;Nextjs (with pages)s&lt;/li&gt;
&lt;li&gt;Vue&lt;/li&gt;
&lt;li&gt;Svelte &lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Directory Based
&lt;/h3&gt;

&lt;p&gt;This is directory based routing&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;src/
└── app/
    ├── page.js
    ├── about/
    │   └── page.js
    └── contact/
        └── page.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With this way, there is a defined method of creating new pages i.e a folder with the file name and a special file within it.&lt;/p&gt;

&lt;p&gt;When using this way, anything that does not follow this pattern is not regarded a page.&lt;/p&gt;

&lt;p&gt;Frameworks that use this&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Nextjs (with app)&lt;/li&gt;
&lt;li&gt;SvleteKit&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  A Table To Know What You Are Using
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Ask&lt;/th&gt;
&lt;th&gt;File-Based Routing&lt;/th&gt;
&lt;th&gt;Directory-Based Routing&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Can I make a file name as a route and it works?&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Can I create a folder with an &lt;code&gt;index&lt;/code&gt; file and that will become the page?&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Do I have a special naming convention for pages?&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;With this clarification at hand, can you all stop confusing this? You can? Thank you.&lt;/p&gt;




&lt;h3&gt;
  
  
  Thank you for reading, let's connect!
&lt;/h3&gt;

&lt;p&gt;Thank you for visiting this little corner of mine. Let's connect on &lt;a href="https://twitter.com/Psypher1" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt;, &lt;a href="https://discord.com/users/Pharaoh#5441/" rel="noopener noreferrer"&gt;Discord&lt;/a&gt; and &lt;a href="https://www.linkedin.com/in/jamesmidzi/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;&lt;/p&gt;

</description>
      <category>routing</category>
      <category>filebased</category>
      <category>directorybased</category>
    </item>
  </channel>
</rss>
