<?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>Forem: Travis Ramos</title>
    <description>The latest articles on Forem by Travis Ramos (@travislramos).</description>
    <link>https://forem.com/travislramos</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F344016%2F309f7d0e-349e-4edc-952e-76d1ae278bd4.jpg</url>
      <title>Forem: Travis Ramos</title>
      <link>https://forem.com/travislramos</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/travislramos"/>
    <language>en</language>
    <item>
      <title>The Resurgence of Server-Side Rendering in the JavaScript Era</title>
      <dc:creator>Travis Ramos</dc:creator>
      <pubDate>Wed, 30 Oct 2024 15:43:41 +0000</pubDate>
      <link>https://forem.com/travislramos/the-resurgence-of-server-side-rendering-in-the-javascript-era-bd8</link>
      <guid>https://forem.com/travislramos/the-resurgence-of-server-side-rendering-in-the-javascript-era-bd8</guid>
      <description>&lt;p&gt;With the release of React 19 and React frameworks like Next.js and Remix offering server-side rendering, it might seem like everything is coming full circle. Well, that’s because it is—only now you can do all of this using JavaScript.&lt;/p&gt;

&lt;p&gt;In the past, languages like PHP would handle server-side rendering by dynamically generating HTML on the server for every request. This meant that when a user visited a site, the server would send back a fully rendered page. It was efficient for SEO and great for users with slow internet connections, as they didn’t have to wait for JavaScript to load and hydrate the page.&lt;/p&gt;

&lt;p&gt;Then came the rise of client-side rendering (CSR) with libraries like React, Angular, and Vue. The idea was to build highly interactive single-page applications (SPAs) that could load once and update dynamically without needing full-page refreshes. While this made apps feel fast and fluid, it introduced a few tradeoffs: poor SEO, slow initial loads, and a less-than-ideal experience on low-end devices. Developers started noticing the gaps, especially for content-heavy sites like blogs or e-commerce stores.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why SSR Is Making a Comeback
&lt;/h2&gt;

&lt;p&gt;Modern SSR with React frameworks is about finding the sweet spot between the traditional server-rendered model and the highly interactive world of SPAs. SSR today doesn’t just generate static HTML; it also enables &lt;strong&gt;hydration&lt;/strong&gt;, where the server sends pre-rendered HTML, and React takes over once the page is loaded to make it interactive. This results in faster page loads, better SEO, and improved accessibility.&lt;/p&gt;

&lt;p&gt;What’s even more exciting is that frameworks like Next.js and Remix allow you to choose between rendering methods based on the needs of each page. You can use &lt;strong&gt;SSR&lt;/strong&gt; for content-heavy or SEO-critical pages and &lt;strong&gt;client-side rendering (CSR)&lt;/strong&gt; for highly interactive sections that don’t need to be indexed by search engines. Think dashboards and highly dynamic content. They even offer &lt;strong&gt;static site generation (SSG)&lt;/strong&gt;, which pre-renders pages at build time, and &lt;strong&gt;ISR (Incremental Static Regeneration)&lt;/strong&gt;, where static pages are updated on demand.&lt;/p&gt;

&lt;h2&gt;
  
  
  SSR in the JavaScript Ecosystem
&lt;/h2&gt;

&lt;p&gt;This new generation of SSR also leverages modern APIs. React 19’s focus on concurrent rendering and streaming means that pages can be sent to the client in chunks, improving perceived performance. Combined with features like &lt;strong&gt;React Server Components (RSC)&lt;/strong&gt;, which reduce the amount of JavaScript sent to the browser, these advances make SSR with React much more scalable than in the past. If you’d like to learn more about the latest changes coming to React 19, check out my &lt;a href="https://travislramos.com/blog/whats-new-in-react-19" rel="noopener noreferrer"&gt;article on it&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;With frameworks like Next.js integrating deeply with &lt;strong&gt;Edge Functions&lt;/strong&gt; and &lt;strong&gt;CDNs&lt;/strong&gt;, SSR now happens closer to the user, reducing latency. This is a big win, especially for global applications. And let’s not forget, SSR isn’t just about rendering—it’s about &lt;strong&gt;data fetching&lt;/strong&gt;. Remix, for example, has reimagined how routes handle data, making SSR not only possible but seamless with loaders that return data on the server before the page is sent. By the way, Next.js 15 is releasing soon, don’t miss &lt;a href="https://travislramos.com/blog/whats-new-in-nextjs-15-key-updates-for-developers" rel="noopener noreferrer"&gt;the latest updates&lt;/a&gt;!&lt;/p&gt;

&lt;h2&gt;
  
  
  What Developers Should Keep in Mind
&lt;/h2&gt;

&lt;p&gt;While SSR offers plenty of benefits, it isn’t a silver bullet. It can introduce complexity, especially around caching, managing state across client and server, and handling re-renders during hydration. Developers need to carefully weigh when to use SSR, CSR, or SSG for optimal performance. Tools like &lt;strong&gt;Next.js Middleware&lt;/strong&gt; can help implement logic at the edge to decide how and where to render a page.&lt;/p&gt;

&lt;p&gt;In short, SSR is back—and it’s better than ever. It offers the performance and SEO advantages that made it so popular in the past, now coupled with the power and flexibility of the modern JavaScript ecosystem. Whether you’re building e-commerce sites, blogs, or dashboards, SSR is a tool you can’t ignore if you want to deliver fast, engaging, and search-friendly experiences.&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>nextjs</category>
      <category>webdev</category>
    </item>
    <item>
      <title>What's New in Next.js 15: Key Updates for Developers</title>
      <dc:creator>Travis Ramos</dc:creator>
      <pubDate>Tue, 22 Oct 2024 17:20:05 +0000</pubDate>
      <link>https://forem.com/travislramos/whats-new-in-nextjs-15-key-updates-for-developers-2epj</link>
      <guid>https://forem.com/travislramos/whats-new-in-nextjs-15-key-updates-for-developers-2epj</guid>
      <description>&lt;p&gt;Next.js 15 just became stable which means we can now use it in production without worrying too much about things not working as expected. If you're on the fence about updating, Next.js 15 brings some major improvements that enhance performance, simplify development workflows, and ensure better compatibility with modern tools like React 19, which is planning on being released soon! Here’s a breakdown of some of the most important changes to take a look at.&lt;/p&gt;

&lt;h2&gt;
  
  
  React 19 Support
&lt;/h2&gt;

&lt;p&gt;We’ve all been waiting for React 19 to launch and so has Vercel. With Next.js’s newest release, they ensured it would integrate seamlessly with React 19, giving developers access to advanced client and server features. This update makes it easier to implement React’s latest capabilities, including server-side actions for better state management and UI updates.&lt;/p&gt;

&lt;p&gt;If you’d like to see what’s new coming from React 19, take a look at an &lt;a href="https://travislramos.com/blog/whats-new-in-react-19" rel="noopener noreferrer"&gt;article I wrote&lt;/a&gt; covering all the latest features being released!&lt;/p&gt;

&lt;h2&gt;
  
  
  Enhances Hydration Error Handling
&lt;/h2&gt;

&lt;p&gt;Hydration can sometimes be a pain to deal with, but thanks to this latest release, debugging hydration errors becomes even easier. Developers will now receive clearer error messages when the rendered HTML on the server doesn’t match the client. This will help devs quickly resolve discrepancies speeding up development so we can get that code pushed into production bug-free.&lt;/p&gt;

&lt;h2&gt;
  
  
  New Caching Strategies
&lt;/h2&gt;

&lt;p&gt;Previously caching was built in, and enabled by default, and developers had to manually opt out of caching to disable it. With this latest release, caching behavior has been refined to having to be enabled explicitly and disabled by default. This may sound counterintuitive, but unnecessary caching can lead to unexpected performance issues which can be hard to debug when you don’t know where they are stemming from. By having to manually enable caching, developers will have more control and greater flexibility when building applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  Partial Pre-rendering (PPR)
&lt;/h2&gt;

&lt;p&gt;This new feature introduces incremental adoption of pre-rendering. This allows developers to optimize parts of a page without a full overhaul. For example, dynamic sections wrapped in a &lt;code&gt;Suspense&lt;/code&gt; boundary can be pre-rendered separately, improving performance without compromising interactivity.&lt;/p&gt;

&lt;h2&gt;
  
  
  New Post-Response Execution
&lt;/h2&gt;

&lt;p&gt;Sometimes non-essential tasks, like logging or analytics, can slow a site down resulting in a poorer experience for the user. With Next.js’s new &lt;code&gt;unstable_after&lt;/code&gt; flag, you can offload these background operations resulting in a faster initial response for the user. This helps improve page load times resulting in a better UX and better SEO.&lt;/p&gt;

&lt;h2&gt;
  
  
  Improvements to the Developer Experience
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;create-next-app&lt;/code&gt; template has been overhauled making it easier for developers to set up new projects. With the addition of TurboPack being integrated into the setup process, it’s now much faster and more efficient when starting a new project from scratch.&lt;/p&gt;

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

&lt;p&gt;With all of the latest features and improvements coming to Next.js 15, it’s hard not to be excited about the future of the web.&lt;/p&gt;

&lt;p&gt;These improvements not only deliver more optimization for performance but also enhance the developer usability. Next.js 15 addresses long-standing pain points like hydration issues while also pushing the boundaries with new capabilities built for modern development.&lt;/p&gt;

&lt;p&gt;For a more detailed insight into what’s coming, you can explore the official release notes on &lt;a href="https://nextjs.org/blog/next-15" rel="noopener noreferrer"&gt;Next.js’s blog&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If you enjoyed this article, you might also enjoy my free newsletter I send out every week to developers just like you. You can &lt;a href="https://travislramos.beehiiv.com/subscribe" rel="noopener noreferrer"&gt;sign up here&lt;/a&gt;.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>react</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>React Under The Hood: What’s Really Happening?</title>
      <dc:creator>Travis Ramos</dc:creator>
      <pubDate>Wed, 25 Sep 2024 19:25:00 +0000</pubDate>
      <link>https://forem.com/travislramos/react-under-the-hood-whats-really-happening-2p4d</link>
      <guid>https://forem.com/travislramos/react-under-the-hood-whats-really-happening-2p4d</guid>
      <description>&lt;p&gt;React has long been a go-to JavaScript library and is easily one of the most popular in the world. Also, with popular frameworks like Next.js and Remix being built on top of React and the ability to do mobile development with React-Native, this library is not going away anytime soon. The problem with this however is that most beginners flock to React and start learning it without really understanding how it works. So let’s dive in.&lt;/p&gt;

&lt;h2&gt;
  
  
  How JSX Works
&lt;/h2&gt;

&lt;p&gt;In React, JSX (JavaScript XML) is a syntax that looks similar to HTML but works within JavaScript. It’s not valid JavaScript itself, so React uses a transpiler (usually Babel) to convert JSX into standard JavaScript. This JavaScript code is what the browser ultimately interprets.&lt;/p&gt;

&lt;p&gt;When you write JSX, it gets transformed into &lt;code&gt;React.createElement()&lt;/code&gt; function calls. These function calls produce React elements, which are the building blocks of a React application. Each element represents a piece of the UI.&lt;/p&gt;

&lt;p&gt;Here’s an example of what that looks like:&lt;/p&gt;

&lt;p&gt;JSX in a React Component&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const element = (
  &amp;lt;div&amp;gt;
    &amp;lt;h1&amp;gt;Hello, React!&amp;lt;/h1&amp;gt;
    &amp;lt;p&amp;gt;This is a paragraph.&amp;lt;/p&amp;gt;
  &amp;lt;/div&amp;gt;
);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;JSX Transformed into JavaScript:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const element = React.createElement(
  'div',
  null,
  React.createElement('h1', null, 'Hello, React!'),
  React.createElement('p', null, 'This is a paragraph.')
);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;React takes these nested &lt;code&gt;React.createElement()&lt;/code&gt; calls and converts them into the corresponding HTML elements in the browser’s DOM.&lt;/p&gt;

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

&lt;p&gt;JSX makes writing React components easier by allowing you to write syntax similar to HTML, but it’s just syntactic sugar for &lt;code&gt;React.createElement()&lt;/code&gt; calls that create the structure of your app using JavaScript. This is what allows React to manage the UI efficiently through its Virtual DOM mechanism.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If you enjoyed this article, you might also enjoy my free newsletter I send out every week to developers just like you. You can sign up &lt;a href="https://travislramos.beehiiv.com/subscribe" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>State vs Props in React</title>
      <dc:creator>Travis Ramos</dc:creator>
      <pubDate>Tue, 24 Sep 2024 14:22:38 +0000</pubDate>
      <link>https://forem.com/travislramos/state-vs-props-in-react-25nd</link>
      <guid>https://forem.com/travislramos/state-vs-props-in-react-25nd</guid>
      <description>&lt;p&gt;In React, the two main concepts that govern the data flow within a component are &lt;em&gt;State&lt;/em&gt; and &lt;em&gt;Props&lt;/em&gt;. Understanding the difference between these two is crucial for building effective and maintainable React applications. Let’s dive in.&lt;/p&gt;

&lt;h2&gt;
  
  
  State
&lt;/h2&gt;

&lt;p&gt;State refers to the internal data of a component. It represents the current condition or properties of the component. State is managed within the component itself and can be updated using the setter from your &lt;code&gt;useState()&lt;/code&gt; hook method.&lt;/p&gt;

&lt;p&gt;State is typically initialized in the component’s constructor if using a Class based component, or by using the &lt;code&gt;useState()&lt;/code&gt; hook when using a Functional component. Typically when working on newer applications, you’ll be using functional components. If you’d like to learn more about React hooks and what all changed with their release, read my blog post about it. You can find the post &lt;a href="https://travislramos.com/blog/react-hooks-for-beginners" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Some key characteristics of State:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;State is local to the component&lt;/li&gt;
&lt;li&gt;State is private to the component&lt;/li&gt;
&lt;li&gt;State can be changed over time&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here’s an example of what it looks like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React, { useState } from 'react';

function JumpMan() {
  const [jumps, setJumps] = useState(0);
  return (
    &amp;lt;div&amp;gt;
      &amp;lt;p&amp;gt;You jumped {jumps} times.&amp;lt;/p&amp;gt;
      &amp;lt;button onClick={()=&amp;gt; setJumps(jumps + 1)}&amp;gt;Jump Again!&amp;lt;/button&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see, &lt;code&gt;jumps&lt;/code&gt; is the state, and &lt;code&gt;setJumps&lt;/code&gt; is what is called to update the state. Every time the button is clicked, &lt;code&gt;setJumps&lt;/code&gt; is called and increases &lt;code&gt;jumps&lt;/code&gt; by 1.&lt;/p&gt;

&lt;h2&gt;
  
  
  Props
&lt;/h2&gt;

&lt;p&gt;Props, on the other hand, are the input parameters that are passed down to a component from its parent. They are immutable, meaning they cannot be changed by the child component.&lt;/p&gt;

&lt;p&gt;Some key characteristics of Props:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Props are passed from parent to child components&lt;/li&gt;
&lt;li&gt;Props are read-only and cannot be modified by the child component&lt;/li&gt;
&lt;li&gt;Props are used to make components more reusable and flexible&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Props allow you to customize the behavior and appearance of a component without modifying the component itself. They provide a way to pass data down the component tree, enabling parent components to control the state and behavior of their children. This separation of concerns promotes modularity and makes components more independent and reusable.&lt;/p&gt;

&lt;p&gt;Here’s an example of what it looks like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React from 'react';
import ChildComponent from './ChildComponent';

const ParentComponent = () =&amp;gt; {
  const message = "Hello from the parent component!";

  return (
    &amp;lt;div&amp;gt;
      &amp;lt;h1&amp;gt;Parent Component&amp;lt;/h1&amp;gt;
      {/* Passing the 'message' prop to the ChildComponent */}
      &amp;lt;ChildComponent message={message} /&amp;gt;
    &amp;lt;/div&amp;gt;
  );
};

export default ParentComponent;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React from 'react';

const ChildComponent = ({ message }) =&amp;gt; {
  return (
    &amp;lt;div&amp;gt;
      &amp;lt;h2&amp;gt;Child Component&amp;lt;/h2&amp;gt;
      {/* Accessing the 'message' prop passed from the ParentComponent */}
      &amp;lt;p&amp;gt;{message}&amp;lt;/p&amp;gt;
    &amp;lt;/div&amp;gt;
  );
};

export default ChildComponent;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, the parent component &lt;code&gt;ParentComponent&lt;/code&gt; defines a variable called &lt;code&gt;message&lt;/code&gt;. It then passes this message down to its child component &lt;code&gt;ChildComponent&lt;/code&gt; via &lt;code&gt;message={message}&lt;/code&gt; The child component receives the &lt;code&gt;message&lt;/code&gt; prop and displays it using &lt;code&gt;{message}&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Props are a powerful tool for building composable and flexible React components. By passing data through props, you can create reusable components that can be easily integrated into different parts of your application. This promotes a unidirectional data flow, where data moves from parent to child, making the application more predictable and easier to reason about.&lt;/p&gt;

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

&lt;p&gt;Understanding the difference between state and props is essential for managing the data flow in your React applications. State is used for managing the internal data of a component, while props are used for passing data from parent to child components.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If you found this article helpful, consider subscribing to my weekly newsletter. You can find&lt;/strong&gt; &lt;a href="https://travislramos.beehiiv.com/subscribe" rel="noopener noreferrer"&gt;&lt;strong&gt;it here&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;. It’s written for developers by a developer (me!).&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>reactnative</category>
      <category>beginners</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Elevating Your Junior Developer Career: Strategies for Standing Out</title>
      <dc:creator>Travis Ramos</dc:creator>
      <pubDate>Mon, 23 Sep 2024 19:24:34 +0000</pubDate>
      <link>https://forem.com/travislramos/elevating-your-junior-developer-career-strategies-for-standing-out-b4j</link>
      <guid>https://forem.com/travislramos/elevating-your-junior-developer-career-strategies-for-standing-out-b4j</guid>
      <description>&lt;p&gt;The road to becoming a Junior Developer is hard. You’ve probably experienced some late nights, broken code, and some challenging problems. You may even have become an expert at using Stack Overflow. For those who are still in the process, don’t lose hope and keep moving forward. So long as you don’t give up, you’ll get there! For those of you who have made it thus far, pat yourself on the back because it’s not easy! Once you’ve made it, the journey is just beginning…&lt;/p&gt;

&lt;h2&gt;
  
  
  Now What?
&lt;/h2&gt;

&lt;p&gt;Now that you’ve landed that first developer job, your goal is to learn as much as possible, stand out among your peers, and continue upgrading your skills so you can advance in your career. Being a software developer is a rewarding career, but with it comes the reality that you’re in a constant state of learning.&lt;/p&gt;

&lt;p&gt;Technology is always evolving, and in today’s world changes are happening fast. To stay relevant, you should be trying to go the extra mile. So how can we do this?&lt;/p&gt;

&lt;h3&gt;
  
  
  Share Your Knowledge
&lt;/h3&gt;

&lt;p&gt;One effective way to stand out as a junior developer is to share your knowledge with others. This could involve writing blog posts, creating tutorials, or even speaking at local meetups or conferences. By sharing your expertise, you not only solidify your own understanding of the material, but you'll also demonstrate your passion and commitment to the field. Additionally, this can help you build a professional network and establish yourself as a thought leader in your area of expertise.&lt;/p&gt;

&lt;p&gt;I myself love sharing what I’m learning to help other developers learn and grow. One way I do this is by writing a &lt;a href="https://travislramos.beehiiv.com/subscribe" rel="noopener noreferrer"&gt;weekly newsletter&lt;/a&gt; geared toward helping developers just like you! Another way I like to share my knowledge is by creating and contributing to open-source software.&lt;/p&gt;

&lt;p&gt;No matter how you choose to share what you know and learn, helping others is a very rewarding feeling!&lt;/p&gt;

&lt;h3&gt;
  
  
  Build a Strong Portfolio
&lt;/h3&gt;

&lt;p&gt;Your portfolio is a powerful tool to showcase your work and attract potential employers. Curate a selection of your best projects, highlighting the technologies used, the challenges faced, and the solutions implemented. Make sure your portfolio is visually appealing, easy to navigate, and showcases your coding skills.&lt;/p&gt;

&lt;p&gt;Additionally, consider including personal projects that demonstrate your passion for coding and problem-solving. These projects can showcase your creativity, attention to detail, and ability to work independently. Remember, your portfolio is a reflection of your skills, so take the time to make it polished and professional.&lt;/p&gt;

&lt;h3&gt;
  
  
  Stay Curious and Continuously Learn
&lt;/h3&gt;

&lt;p&gt;As I mentioned earlier, the field we are in is always changing and evolving. Staying up-to-date with the latest trends and best practices will help you stay relevant and job-ready. No, this doesn’t mean you need to hop on every new framework that gets released, but I would suggest reading through the latest release notes for whatever software you are using and keeping your projects updated.&lt;/p&gt;

&lt;p&gt;For all the React developers out there, React 19 is getting released soon. I wrote an article about some of the major changes coming, you can find it &lt;a href="https://travislramos.com/blog/whats-new-in-react-19" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Contribute to Open-Source Projects
&lt;/h3&gt;

&lt;p&gt;Contributing to open-source projects is another excellent way to showcase your skills, gain experience, and connect with other developers. Look for projects that align with your interests and skill set, and start by submitting bug fixes, documentation improvements, or small feature additions. This not only helps the project but also demonstrates your ability to collaborate, problem-solve, and write clean, maintainable code. Over time, you can take on more challenging tasks and potentially become a regular contributor, further enhancing your reputation and visibility within the developer community.&lt;/p&gt;

&lt;p&gt;Also, consider taking part in hackathons or coding challenges. Not only will this help spur creative project ideas, but you might also help another developer by creating a starter kit they can use for their upcoming project. That’s exactly what I did for a coding challenge built around Neon’s serverless Postgres DB. You can find the project &lt;a href="https://github.com/TRamos5/neon-oss-saas-starter-kit" rel="noopener noreferrer"&gt;here&lt;/a&gt;. I’ll soon be adding some more features so make sure to give it a star if you find it helpful!&lt;/p&gt;

&lt;h2&gt;
  
  
  Concluding Thoughts
&lt;/h2&gt;

&lt;p&gt;Elevating your career as a junior developer takes dedication, creativity, and a willingness to go the extra mile. By sharing your knowledge, building a strong portfolio, staying curious, and contributing to open-source projects, you can distinguish yourself and accelerate your growth.&lt;/p&gt;

&lt;p&gt;Remember, the journey never ends, so embrace the constant learning and seize opportunities to showcase your skills. With persistence and a passion for your craft, you can unlock new possibilities and make a lasting impact in your career.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>tutorial</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Amplify Your Impact: How Building in Public Can Accelerate Your Developer Career</title>
      <dc:creator>Travis Ramos</dc:creator>
      <pubDate>Tue, 17 Sep 2024 15:50:17 +0000</pubDate>
      <link>https://forem.com/travislramos/amplify-your-impact-how-building-in-public-can-accelerate-your-developer-career-45l6</link>
      <guid>https://forem.com/travislramos/amplify-your-impact-how-building-in-public-can-accelerate-your-developer-career-45l6</guid>
      <description>&lt;p&gt;Building in public has become an increasingly popular trend among software developers and entrepreneurs. The idea is to openly share the process of building a product or company, rather than keeping everything behind closed doors until launch. While this approach may seem counterintuitive, there are actually significant benefits for developers who choose to build in public.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Benefits of Building in Public
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Faster Feedback and Validation&lt;/strong&gt; - By sharing your work early and often, you can get valuable feedback from potential users, industry experts, and the broader community. This allows you to validate your ideas and make adjustments before investing too much time and resources.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Increased Visibility and Opportunities&lt;/strong&gt; - Building in public helps you build an audience and personal brand. This can lead to new job opportunities, partnerships, investments, and other valuable connections that you may not have access to otherwise.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Accountability and Motivation&lt;/strong&gt; - Knowing that your work is being watched and discussed publicly can provide a sense of accountability. This can help you stay motivated and focused on delivering consistent progress.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Learning and Skill Development&lt;/strong&gt; - Explaining your thought process, design decisions, and coding techniques to an audience can deepen your own understanding and help you improve your skills.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Overcoming Fears and Concerns
&lt;/h2&gt;

&lt;p&gt;Many developers are hesitant to build in public due to fears of criticism, intellectual property concerns, or simply feeling uncomfortable with the idea of being so transparent. However, these concerns can often be addressed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Criticism can be a valuable learning opportunity if approached with the right mindset.&lt;/li&gt;
&lt;li&gt;Intellectual property is generally better protected by execution than secrecy.&lt;/li&gt;
&lt;li&gt;Building in public doesn't have to mean sharing every detail - you can be selective about what you choose to share.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyi22hvue76hxk7wmd581.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyi22hvue76hxk7wmd581.png" alt="Build In Public Tweet" width="552" height="368"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;Choosing to build in public is often a great choice. In today's competitive tech landscape, building in public can give developers a significant advantage. By embracing transparency, feedback, and community, you can accelerate your learning, increase your visibility, and ultimately build better products. If you're a developer, consider taking the plunge and start building in public. I myself will be building a personal finance app aimed at helping you set up and save more money each month. If you’d like to follow along, &lt;a href="https://x.com/travislramos" rel="noopener noreferrer"&gt;follow me&lt;/a&gt; over on X where I’ll be posting my updates!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>javascript</category>
      <category>programming</category>
    </item>
    <item>
      <title>Understanding Large Language Models and Their Importance</title>
      <dc:creator>Travis Ramos</dc:creator>
      <pubDate>Thu, 12 Sep 2024 17:27:22 +0000</pubDate>
      <link>https://forem.com/travislramos/understanding-large-language-models-and-their-importance-l3l</link>
      <guid>https://forem.com/travislramos/understanding-large-language-models-and-their-importance-l3l</guid>
      <description>&lt;h2&gt;
  
  
  What Are Large Language Models?
&lt;/h2&gt;

&lt;p&gt;Large language models (LLMs) are AI systems that understand and create human language, doing tasks like summarizing articles, answering questions, writing code, and more. They use deep learning to process huge datasets, making them very versatile tools that are changing how we use and understand technology.&lt;/p&gt;

&lt;p&gt;Why do LLMs matter? They bridge the gap between humans and machines. We use them in customer service, content creation, and even to understand complex scientific papers. Their human-like text generation opens up many possibilities.&lt;/p&gt;

&lt;p&gt;This game-changing technology isn’t just for big tech companies, they’re becoming more available with each day and smaller firms and independent developers are using them too. Whether it’s for automating tasks or building new apps, LLMs offer a powerful solution to whatever problem is trying to be solved.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Do Large Language Models Work?
&lt;/h2&gt;

&lt;p&gt;At the core of large language models (LLMs) are deep neural networks trained on massive text datasets. These models utilize transformer architectures, which are particularly adept at understanding and generating human language. The training process involves exposing the neural network to terabytes of text data from the internet, books, articles, and other sources. Through this extensive training, the model learns to identify patterns, relationships, and the contextual meaning of words and phrases.&lt;/p&gt;

&lt;p&gt;The result is an AI system with an incredibly broad knowledge base that can understand and produce human-like language. LLMs can tackle a wide variety of language-related tasks, from summarizing long articles to answering open-ended questions to even writing original text. This versatility is enabled by the models' ability to quickly adapt to new tasks through "few-shot learning" - they only require a small amount of additional training data to apply their language understanding to new domains.&lt;/p&gt;

&lt;p&gt;However, LLMs are not without their limitations. The sheer scale and complexity of these models can make it difficult to fully understand their inner workings and the potential biases encoded in their training data. Additionally, the computational resources required to train and run large language models are immense, presenting challenges for wider deployment and accessibility.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Components
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Encoders&lt;/strong&gt;: These process the input text, creating a data representation. This helps the model understand word context.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Decoders&lt;/strong&gt;: These generate output text from encoded data. They predict the next word using learned patterns.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Self-Attention Mechanisms&lt;/strong&gt;: These help the model focus on relevant parts of the input text. They help understand word relationships across sentences.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By combining these elements, LLMs create text that sounds human. This versatility makes them extremely useful. For more insights on foundational concepts in computer science, you might find my blog post on &lt;a href="https://travislramos.com/blog/big-o-for-the-non-cs-degree-part-1" rel="noopener noreferrer"&gt;Big-O Notation for non-CS degree holders&lt;/a&gt; particularly useful.&lt;/p&gt;

&lt;h2&gt;
  
  
  Training Large Language Models
&lt;/h2&gt;

&lt;p&gt;Training LLMs involves feeding them massive datasets to learn from. These models require vast amounts of text data to understand language patterns and context. Typically, datasets are scraped from the internet, covering various topics and writing styles. This diversity helps the model generalize well across different applications.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Unsupervised Learning&lt;/strong&gt;: LLMs use unsupervised learning, meaning they learn from data without explicit instructions. They identify patterns, grammar rules, and context clues from the text, which allows them to generate coherent responses.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data Collection&lt;/strong&gt;: Gathering data is a crucial step. It involves sourcing text from books, websites, articles, and more. The goal is to create a comprehensive dataset that represents the richness and variability of human language.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Computational Power&lt;/strong&gt;: Training LLMs requires significant computational resources. Powerful GPUs and TPUs are often used to handle intense processing needs. Companies invest heavily in hardware to accelerate training times and improve model performance.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Backpropagation&lt;/strong&gt;: During training, the model makes predictions and adjusts based on the accuracy of these predictions. This process, called backpropagation, tweaks the model's parameters incrementally to improve its performance over time.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Training these models isn't without challenges. The need for large datasets and extensive computational power can be a barrier. Ensuring the data is diverse and representative is also critical to avoid biases and improve the model's fairness.&lt;/p&gt;

&lt;h2&gt;
  
  
  Self-Attention and Transformers
&lt;/h2&gt;

&lt;p&gt;Prior to the development of transformer architectures, language models were often built using recurrent neural networks (RNNs) that processed text sequentially, one word at a time. While effective, this approach had limitations in capturing long-range dependencies and contextual relationships between words.&lt;/p&gt;

&lt;p&gt;At the heart of large language models are transformer architectures, which revolutionize how models process and understand human language. A key component of transformers is their use of self-attention mechanisms.&lt;/p&gt;

&lt;p&gt;Self-attention allows the model to weigh the importance of different words in a sentence, making it more effective at grasping context and meaning. Here's how it works:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Assigning Weights&lt;/strong&gt;: The model assigns a relevant weight to each word in a sentence. This helps it focus on the most important words when generating text.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Capturing Dependencies&lt;/strong&gt;: Self-attention captures dependencies between words, even if they're separated in the sentence. This is crucial for understanding complex language structures.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Parallel Processing&lt;/strong&gt;: Unlike previous models that processed words sequentially, transformers can handle multiple words simultaneously. This parallel processing speeds up training and improves efficiency.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Compared to older language models, transformers offer several key advantages:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Efficiency&lt;/strong&gt;: The parallel processing capabilities of transformers allow them to handle large datasets much faster. This efficiency is vital for training powerful LLMs on diverse text sources.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scalability&lt;/strong&gt;: Transformer architectures scale well as the amount of data and model parameters increase. This makes them well-suited for building ever-larger and more capable language models.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Accuracy&lt;/strong&gt;: Transformers achieve higher accuracy on a wide range of language tasks. Their ability to capture intricate word relationships and dependencies is a major factor in this improved performance.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These benefits make transformer models the foundation for state-of-the-art large language models. By leveraging self-attention, they enable AI systems to understand and generate human language with impressive fluency and versatility.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Future of Large Language Models
&lt;/h2&gt;

&lt;p&gt;Large language models have emerged as a transformative technology, bridging the gap between human and machine intelligence in remarkable ways. From powering chatbots and content creation tools to assisting with complex research and analysis, these versatile AI systems are reshaping how we interact with and leverage technology.&lt;/p&gt;

&lt;p&gt;As LLMs continue to grow in scale and capability, their impact is likely to become even more profound. Advances in areas like few-shot learning and multi-modal understanding will expand their applicability across an ever-wider range of domains. With continued research into addressing challenges like model transparency and bias, these language models may become increasingly trustworthy and reliable.&lt;/p&gt;

&lt;p&gt;However, the rise of LLMs also raises important questions about the societal implications of this technology. Issues around job displacement, algorithmic fairness, and the spread of misinformation will need to be carefully navigated. Responsible development and deployment of these powerful AI systems will be crucial.&lt;/p&gt;

&lt;p&gt;Nonetheless, the potential of large language models to augment and empower human intelligence is undeniable. As we continue to push the boundaries of what's possible with these technologies, we may unlock new frontiers in fields ranging from scientific discovery to creative expression. The future of LLMs is an exciting one, full of both promise and challenge.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If You Enjoyed This, Join Hundreds of Developers Leveling Up With My Weekly Newsletter&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;My free, developer-focused newsletter is packed with insightful tips, strategies, and resources to help you boost your skills and income. Each week, I share practical advice on topics like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Mastering in-demand programming languages and frameworks&lt;/li&gt;
&lt;li&gt;Optimizing your resume and interviewing abilities&lt;/li&gt;
&lt;li&gt;Building profitable side projects and freelance businesses&lt;/li&gt;
&lt;li&gt;Accelerating your career growth and earning potential&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Don't miss out on this valuable resource. &lt;a href="https://travislramos.beehiiv.com/subscribe" rel="noopener noreferrer"&gt;Click here to subscribe&lt;/a&gt; and start receiving my newsletter today!&lt;/p&gt;

</description>
      <category>ai</category>
      <category>chatgpt</category>
      <category>programming</category>
      <category>productivity</category>
    </item>
    <item>
      <title>React 19 Is Here...Get Ready!</title>
      <dc:creator>Travis Ramos</dc:creator>
      <pubDate>Wed, 11 Sep 2024 16:51:32 +0000</pubDate>
      <link>https://forem.com/travislramos/react-19-is-hereget-ready-36da</link>
      <guid>https://forem.com/travislramos/react-19-is-hereget-ready-36da</guid>
      <description>&lt;p&gt;React 19 is here, and it's packed with features that push performance and efficiency to new heights. Whether you're a seasoned pro or just diving into React, these updates are sure to grab your attention.&lt;/p&gt;

&lt;p&gt;First up, the &lt;strong&gt;new React Compiler&lt;/strong&gt;. This bad boy optimizes your code during build time, making your apps faster and more efficient. No more worrying about bloated bundles slowing you down.&lt;/p&gt;

&lt;p&gt;Next, &lt;strong&gt;Server Components&lt;/strong&gt;. These let you offload rendering to the server, reducing the workload on the client side. This means quicker load times and a smoother user experience.&lt;/p&gt;

&lt;p&gt;Then we have &lt;strong&gt;Actions&lt;/strong&gt;. These simplify state management by consolidating your state updates and side effects. Say goodbye to messy code and hello to cleaner, more maintainable projects.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Document Metadata Management&lt;/strong&gt; is another cool feature. Now you can manage metadata like titles and meta tags directly within your components. This streamlines SEO tasks and makes your codebase more cohesive.&lt;/p&gt;

&lt;p&gt;Enhanced &lt;strong&gt;Asset Loading&lt;/strong&gt; steps up the game by allowing more efficient handling of your static assets. Load images, fonts, and other resources faster, making your app more responsive.&lt;/p&gt;

&lt;p&gt;New &lt;strong&gt;Hooks&lt;/strong&gt;. These bring even more power to your functional components, allowing you to manage state and side effects with ease. The new hooks provide more flexibility and control, making your React code cleaner and more efficient.&lt;/p&gt;

&lt;p&gt;Each of these features will be explored in detail in the sections that follow. Stay tuned and get ready to dive deep into the exciting world of React 19!&lt;/p&gt;

&lt;h2&gt;
  
  
  React Compiler Enhancements
&lt;/h2&gt;

&lt;p&gt;The React Compiler in version 19 makes React development better. It turns React code into regular JavaScript, handling memoization and improving state changes and UI updates. You don't need to use &lt;code&gt;useMemo()&lt;/code&gt;, &lt;code&gt;useCallback()&lt;/code&gt;, or &lt;code&gt;memo&lt;/code&gt; anymore. The compiler does it for you, making your code cleaner and faster.&lt;/p&gt;

&lt;p&gt;With this new compiler, React figures out when to update the UI, making development easier. Your apps might run twice as fast because of these improvements. Instagram is already using the React Compiler in real-world situations, showing it works well.&lt;/p&gt;

&lt;p&gt;If you're new to React and looking to understand its fundamental features, you might be interested in exploring the basics of &lt;a href="https://travislramos.com/blog/react-hooks-for-beginners" rel="noopener noreferrer"&gt;React Hooks for Beginners&lt;/a&gt;. This guide provides a comprehensive introduction to using hooks like &lt;code&gt;useState&lt;/code&gt; and &lt;code&gt;useEffect&lt;/code&gt;, which are essential for managing state in functional components.&lt;/p&gt;

&lt;p&gt;Here's a simple example of how the compiler works:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    import React, { useState } from 'react';

    function Counter() {
      const [count, setCount] = useState(0);

      return (
        &amp;lt;div&amp;gt;
          &amp;lt;p&amp;gt;You clicked {count} times&amp;lt;/p&amp;gt;
          &amp;lt;button onClick={() =&amp;gt; setCount(count + 1)}&amp;gt;
            Click me
          &amp;lt;/button&amp;gt;
        &amp;lt;/div&amp;gt;
      );
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, the React Compiler makes the &lt;code&gt;Counter&lt;/code&gt; component better. It handles state changes and updates efficiently, without you having to add extra code.&lt;/p&gt;

&lt;p&gt;The React Compiler makes optimization automatic, improving performance and making code easier to maintain. React 19 brings many new features to make your development experience better.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding Server Components
&lt;/h2&gt;

&lt;p&gt;Server Components in React 19 change the game. They run on the server and send HTML to the client. This means faster page loads, better SEO, and less JavaScript sent to users.&lt;/p&gt;

&lt;p&gt;These components are perfect for tasks that are resource-heavy or need to be done before the page is displayed. By processing these on the server, your app becomes more efficient.&lt;/p&gt;

&lt;p&gt;Server Components integrate seamlessly with Next.js. They use the 'use server' directive to specify that a component should run on the server. This keeps your client-side code lightweight and snappy.&lt;/p&gt;

&lt;p&gt;Here's a quick example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    // server.js
    import { useServer } from 'react';

    function ServerComponent() {
      useServer();

      const data = fetchDataFromAPI(); // Assume this fetches data from an API

      return (
        &amp;lt;div&amp;gt;
          &amp;lt;h1&amp;gt;Data from Server&amp;lt;/h1&amp;gt;
          &amp;lt;p&amp;gt;{data}&amp;lt;/p&amp;gt;
        &amp;lt;/div&amp;gt;
      );
    }

    export default ServerComponent;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, &lt;code&gt;ServerComponent&lt;/code&gt; fetches data from an API on the server. The HTML is then sent to the client, making the page load faster. No waiting around for client-side JavaScript to fetch the data.&lt;/p&gt;

&lt;p&gt;Server Components also make server-side tasks like API calls more efficient. Processing these on the server before the page is delivered means your users get a faster, smoother experience.&lt;/p&gt;

&lt;p&gt;For those interested in optimizing their JavaScript applications further, consider &lt;a href="https://travislramos.com/blog/mastering-code-splitting-unlocking-faster-load-times-for-your-javascript-applications" rel="noopener noreferrer"&gt;mastering code splitting techniques&lt;/a&gt; to enhance load times and performance.&lt;/p&gt;

&lt;p&gt;In short, Server Components make your React apps faster and more efficient. They reduce the client-side workload, improve SEO, and speed up page loads. Give them a try in your next project.&lt;/p&gt;

&lt;h2&gt;
  
  
  Simplifying Form Handling with Actions
&lt;/h2&gt;

&lt;p&gt;React 19's Actions make form handling easier. They replace &lt;code&gt;onSubmit&lt;/code&gt; and use HTML form attributes for server-side execution, handling both sync and async operations on client or server side.&lt;/p&gt;

&lt;p&gt;Actions introduce a pending state. When you submit a form, it activates at the start of the request and resets after the final state update. This keeps the UI responsive during data changes.&lt;/p&gt;

&lt;p&gt;Here's how to use Actions in a form:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    import React from 'react';

    function MyForm() {
      return (
        &amp;lt;form action="/submit" method="post"&amp;gt;
          &amp;lt;label&amp;gt;
            Name:
            &amp;lt;input type="text" name="name" /&amp;gt;
          &amp;lt;/label&amp;gt;
          &amp;lt;button type="submit"&amp;gt;Submit&amp;lt;/button&amp;gt;
        &amp;lt;/form&amp;gt;
      );
    }

    export default MyForm;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, the &lt;code&gt;action&lt;/code&gt; attribute handles data submission. This setup works for client and server-side operations without extra JavaScript for the &lt;code&gt;onSubmit&lt;/code&gt; event.&lt;/p&gt;

&lt;p&gt;Actions improve data management and interactions on web pages. Using HTML form attributes simplifies state updates and keeps the UI interactive. As a result, forms become easier to handle and less likely to break.&lt;/p&gt;

&lt;p&gt;React 19's Actions help developers write simpler code and improve performance. Try Actions in your next project - you might find it makes things work better.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fapi.macawhq.com%2Fimages%2Ff35d02be-71c0-48eb-b5aa-de4f5b9b1248%23f35d02be-71c0-48eb-b5aa-de4f5b9b1248" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fapi.macawhq.com%2Fimages%2Ff35d02be-71c0-48eb-b5aa-de4f5b9b1248%23f35d02be-71c0-48eb-b5aa-de4f5b9b1248" alt="a person sitting in front of a laptop computer"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Managing Document Metadata
&lt;/h2&gt;

&lt;p&gt;React 19 makes managing document metadata a breeze with the new &lt;code&gt;&amp;lt;DocumentHead&amp;gt;&lt;/code&gt; component. This feature allows you to include titles and meta tags directly within your React components. It simplifies SEO and makes your code more cohesive.&lt;/p&gt;

&lt;p&gt;Here's a quick example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    import React from 'react';
    import { DocumentHead } from 'react';

    function MyPage() {
      const pageTitle = "Welcome to My Page";
      const pageDescription = "This is an example page showing off React 19's new DocumentHead component.";

      return (
        &amp;lt;div&amp;gt;
          &amp;lt;DocumentHead&amp;gt;
            &amp;lt;title&amp;gt;{pageTitle}&amp;lt;/title&amp;gt;
            &amp;lt;meta name="description" content={pageDescription} /&amp;gt;
          &amp;lt;/DocumentHead&amp;gt;
          &amp;lt;h1&amp;gt;{pageTitle}&amp;lt;/h1&amp;gt;
          &amp;lt;p&amp;gt;{pageDescription}&amp;lt;/p&amp;gt;
        &amp;lt;/div&amp;gt;
      );
    }

    export default MyPage;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this snippet, &lt;code&gt;&amp;lt;DocumentHead&amp;gt;&lt;/code&gt; is used to set the page title and description dynamically. This approach streamlines SEO tasks by centralizing metadata management within your components.&lt;/p&gt;

&lt;p&gt;Dynamic metadata changes based on the application state, something that was cumbersome with libraries like React Helmet. Now, React 19 handles it natively, making your SEO practices more efficient.&lt;/p&gt;

&lt;p&gt;Using &lt;code&gt;&amp;lt;DocumentHead&amp;gt;&lt;/code&gt; ensures your app's metadata is always up-to-date and consistent. This is crucial for improving search engine rankings and providing a better user experience.&lt;/p&gt;

&lt;p&gt;For those interested in how modern JavaScript features can further optimize your web applications, understanding techniques like &lt;a href="https://travislramos.com/blog/understanding-tree-shaking-in-javascript" rel="noopener noreferrer"&gt;tree shaking to eliminate dead code&lt;/a&gt; is essential. This optimization technique, particularly useful in conjunction with ES6 modules, can significantly enhance performance by reducing the final bundle size.&lt;/p&gt;

&lt;p&gt;React 19's &lt;code&gt;&amp;lt;DocumentHead&amp;gt;&lt;/code&gt; component makes it easier to manage document metadata directly within your components. It simplifies SEO, enhances accessibility, and ensures a cohesive codebase.&lt;/p&gt;

&lt;h2&gt;
  
  
  Improved Web Components Integration
&lt;/h2&gt;

&lt;p&gt;React 19 makes integrating Web Components easier. You can now use custom elements, shadow DOM, and HTML templates without extra packages or conversions. This boosts flexibility and compatibility in frontend development.&lt;/p&gt;

&lt;p&gt;Web Components let you create reusable components with standard HTML, CSS, and JavaScript. React 19's improved support means you can drop these straight into your React projects. This reduces friction and simplifies your development process.&lt;/p&gt;

&lt;p&gt;Here's a basic example of how to incorporate a Web Component into a React app:&lt;/p&gt;

&lt;p&gt;First, define your Web Component:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    // my-web-component.js
    class MyWebComponent extends HTMLElement {
      constructor() {
        super();
        const shadow = this.attachShadow({ mode: 'open' });
        shadow.innerHTML = `
          &amp;lt;style&amp;gt;
            p {
              color: blue;
            }
          &amp;lt;/style&amp;gt;
          &amp;lt;p&amp;gt;Hello from Web Component!&amp;lt;/p&amp;gt;
        `;
      }
    }

    customElements.define('my-web-component', MyWebComponent);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, use this Web Component in your React component:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    import React from 'react';
    import './my-web-component.js';

    function App() {
      return (
        &amp;lt;div&amp;gt;
          &amp;lt;h1&amp;gt;React and Web Components&amp;lt;/h1&amp;gt;
          &amp;lt;my-web-component&amp;gt;&amp;lt;/my-web-component&amp;gt;
        &amp;lt;/div&amp;gt;
      );
    }

    export default App;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, &lt;code&gt;MyWebComponent&lt;/code&gt; is defined with a shadow DOM and some styles. It's then used in the &lt;code&gt;App&lt;/code&gt; component like any other HTML element. No extra libraries or tools are needed.&lt;/p&gt;

&lt;p&gt;This seamless integration lets you leverage the power of Web Components within your React projects. It’s a great way to reuse code and maintain consistency across different parts of your application.&lt;/p&gt;

&lt;p&gt;React 19's enhanced support for Web Components opens up new possibilities for your development workflow. You get the best of both worlds: React's powerful ecosystem and the flexibility of custom elements. Give it a try in your next project.&lt;/p&gt;

&lt;h2&gt;
  
  
  Optimized Asset Loading
&lt;/h2&gt;

&lt;p&gt;Asset loading in React 19 significantly improves. It makes loading images, scripts, stylesheets, and fonts faster and more efficient. By using features like Suspense and new Resource Loading APIs (&lt;code&gt;preload&lt;/code&gt; and &lt;code&gt;preinit&lt;/code&gt;), you can ensure your assets load in the background, reducing wait times and improving user experience.&lt;/p&gt;

&lt;p&gt;Suspense helps you load components or assets in the background, showing a fallback UI until everything is ready. This keeps your app responsive and smooth.&lt;/p&gt;

&lt;p&gt;Here's a basic example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    import React, { Suspense, lazy } from 'react';

    const LazyImage = lazy(() =&amp;gt; import('./LazyImage'));

    function App() {
      return (
        &amp;lt;div&amp;gt;
          &amp;lt;h1&amp;gt;Optimized Asset Loading&amp;lt;/h1&amp;gt;
          &amp;lt;Suspense fallback={&amp;lt;div&amp;gt;Loading...&amp;lt;/div&amp;gt;}&amp;gt;
            &amp;lt;LazyImage /&amp;gt;
          &amp;lt;/Suspense&amp;gt;
        &amp;lt;/div&amp;gt;
      );
    }

    export default App;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this code, &lt;code&gt;LazyImage&lt;/code&gt; loads in the background, and a fallback UI appears until it's ready. This improves the perceived performance and keeps users engaged.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;preload&lt;/code&gt; and &lt;code&gt;preinit&lt;/code&gt; APIs let you control when and how assets load, ensuring critical resources are available when needed.&lt;/p&gt;

&lt;p&gt;Here's an example of using &lt;code&gt;preload&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    &amp;lt;link rel="preload" href="/path/to/image.jpg" as="image"&amp;gt;
    &amp;lt;link rel="preload" href="/path/to/style.css" as="style"&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this HTML snippet, the &lt;code&gt;preload&lt;/code&gt; attribute ensures the image and stylesheet load early, reducing the time users wait for these resources.&lt;/p&gt;

&lt;p&gt;Using &lt;code&gt;preinit&lt;/code&gt; is similar. It preloads scripts to ensure they're ready when needed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    &amp;lt;link rel="preinit" href="/path/to/script.js" as="script"&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By using these techniques together, you can load critical assets efficiently, reducing page load times and improving the overall user experience. React 19's enhanced asset loading capabilities make it easier to build fast, responsive applications.&lt;/p&gt;

&lt;p&gt;For more insights on optimizing your JavaScript modules, you might find it useful to read my detailed comparison on &lt;a href="https://travislramos.com/blog/require-vs-import-in-javascript" rel="noopener noreferrer"&gt;using require vs import in JavaScript&lt;/a&gt;. These features improve user experience and engagement. React 19's optimized asset loading is one of many improvements to the development process.&lt;/p&gt;

&lt;h2&gt;
  
  
  New Hooks in React 19
&lt;/h2&gt;

&lt;p&gt;React 19 brings some exciting new hooks to the table that make handling state and async operations easier. Let’s dive into these new hooks: &lt;code&gt;useOptimistic&lt;/code&gt;, &lt;code&gt;useFormStatus&lt;/code&gt;, &lt;code&gt;useFormState&lt;/code&gt;, and &lt;code&gt;use&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;useOptimistic&lt;/code&gt;: This hook helps manage optimistic UI updates. It allows your UI to update immediately, even before the server confirms the changes. This makes your app feel faster and more responsive.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    import { useOptimistic } from 'react';

    function LikeButton({ postId }) {
      const [isLiked, setIsLiked] = useOptimistic(false);

      const handleLike = async () =&amp;gt; {
        setIsLiked(true);
        await api.likePost(postId);
      };

      return (
        &amp;lt;button onClick={handleLike}&amp;gt;
          {isLiked ? 'Liked' : 'Like'}
        &amp;lt;/button&amp;gt;
      );
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;useFormStatus&lt;/code&gt;: This hook keeps track of the status of form fields. It’s great for showing loading states or validation messages.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    import { useFormStatus } from 'react';

    function MyForm() {
      const { isSubmitting, isValid } = useFormStatus();

      return (
        &amp;lt;form action="/submit" method="post"&amp;gt;
          &amp;lt;label&amp;gt;
            Name:
            &amp;lt;input type="text" name="name" /&amp;gt;
          &amp;lt;/label&amp;gt;
          &amp;lt;button type="submit" disabled={isSubmitting || !isValid}&amp;gt;
            {isSubmitting ? 'Submitting...' : 'Submit'}
          &amp;lt;/button&amp;gt;
        &amp;lt;/form&amp;gt;
      );
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;useFormState&lt;/code&gt;: This one helps manage the state of your forms. It updates state based on form actions, simplifying form management.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    import { useFormState } from 'react';

    function ContactForm() {
      const { values, handleChange } = useFormState({
        name: '',
        email: '',
      });

      return (
        &amp;lt;form&amp;gt;
          &amp;lt;label&amp;gt;
            Name:
            &amp;lt;input type="text" name="name" value={values.name} onChange={handleChange} /&amp;gt;
          &amp;lt;/label&amp;gt;
          &amp;lt;label&amp;gt;
            Email:
            &amp;lt;input type="email" name="email" value={values.email} onChange={handleChange} /&amp;gt;
          &amp;lt;/label&amp;gt;
          &amp;lt;button type="submit"&amp;gt;Submit&amp;lt;/button&amp;gt;
        &amp;lt;/form&amp;gt;
      );
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;use&lt;/code&gt;: This hook simplifies working with promises and async code. It fetches and utilizes resources within components, reducing boilerplate code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    import { use } from 'react';

    function UserProfile({ userId }) {
      const user = use(fetchUserProfile(userId));

      return (
        &amp;lt;div&amp;gt;
          &amp;lt;h1&amp;gt;{user.name}&amp;lt;/h1&amp;gt;
          &amp;lt;p&amp;gt;{user.bio}&amp;lt;/p&amp;gt;
        &amp;lt;/div&amp;gt;
      );
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These new hooks in React 19 make your code cleaner and more efficient. They simplify state management and async operations, making development smoother. Try them out in your next project!&lt;/p&gt;

&lt;h2&gt;
  
  
  Using the Use() Hook
&lt;/h2&gt;

&lt;p&gt;React 19 introduces the &lt;code&gt;use()&lt;/code&gt; hook, making handling promises and async operations a breeze. This hook lets you fetch data and manage async tasks directly within your components, cutting down on boilerplate code.&lt;/p&gt;

&lt;p&gt;Here's a basic example to get you started:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    import { use } from 'react';

    function UserProfile({ userId }) {
      const user = use(fetchUserProfile(userId));

      return (
        &amp;lt;div&amp;gt;
          &amp;lt;h1&amp;gt;{user.name}&amp;lt;/h1&amp;gt;
          &amp;lt;p&amp;gt;{user.bio}&amp;lt;/p&amp;gt;
        &amp;lt;/div&amp;gt;
      );
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, &lt;code&gt;use()&lt;/code&gt; fetches user data from an async function &lt;code&gt;fetchUserProfile&lt;/code&gt;. The fetched data is then used directly within the component, making the code cleaner and more straightforward.&lt;/p&gt;

&lt;p&gt;You can also use &lt;code&gt;use()&lt;/code&gt; for more complex operations, such as fetching multiple resources:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    import { use } from 'react';

    function Dashboard() {
      const user = use(fetchUser());
      const posts = use(fetchPosts(user.id));

      return (
        &amp;lt;div&amp;gt;
          &amp;lt;h1&amp;gt;Welcome, {user.name}&amp;lt;/h1&amp;gt;
          &amp;lt;ul&amp;gt;
            {posts.map(post =&amp;gt; (
              &amp;lt;li key={post.id}&amp;gt;{post.title}&amp;lt;/li&amp;gt;
            ))}
          &amp;lt;/ul&amp;gt;
        &amp;lt;/div&amp;gt;
      );
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, &lt;code&gt;use()&lt;/code&gt; first fetches user data, then fetches posts based on the user ID. This chaining of async operations keeps your component logic tidy and easy to follow.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;use()&lt;/code&gt; hook can even handle conditional logic:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    import { use } from 'react';

    function Notifications({ userId }) {
      const notifications = use(userId ? fetchNotifications(userId) : Promise.resolve([]));

      return (
        &amp;lt;ul&amp;gt;
          {notifications.map(note =&amp;gt; (
            &amp;lt;li key={note.id}&amp;gt;{note.message}&amp;lt;/li&amp;gt;
          ))}
        &amp;lt;/ul&amp;gt;
      );
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this snippet, &lt;code&gt;use()&lt;/code&gt; fetches notifications only if &lt;code&gt;userId&lt;/code&gt; is provided. Otherwise, it returns an empty array. This makes the component logic adaptable and concise.&lt;/p&gt;

&lt;p&gt;React 19's &lt;code&gt;use()&lt;/code&gt; hook simplifies async data handling, making your code cleaner and more maintainable. Try it out to streamline your next project!&lt;/p&gt;

&lt;h2&gt;
  
  
  Form Handling with useFormStatus and useFormState
&lt;/h2&gt;

&lt;p&gt;Form handling in React 19 gets a significant boost with the introduction of &lt;code&gt;useFormStatus&lt;/code&gt; and &lt;code&gt;useFormState&lt;/code&gt;. These hooks simplify managing form submission status and state updates, making your forms more efficient and user-friendly.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;useFormStatus&lt;/code&gt; hook keeps track of the form's submission status. It helps display pending states and handle submission results. This means your users get immediate feedback, enhancing their experience.&lt;/p&gt;

&lt;p&gt;Here's a quick example of &lt;code&gt;useFormStatus&lt;/code&gt; in action:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    import { useFormStatus } from 'react';

    function MyForm() {
      const { isSubmitting, isValid } = useFormStatus();

      return (
        &amp;lt;form action="/submit" method="post"&amp;gt;
          &amp;lt;label&amp;gt;
            Name:
            &amp;lt;input type="text" name="name" /&amp;gt;
          &amp;lt;/label&amp;gt;
          &amp;lt;button type="submit" disabled={isSubmitting || !isValid}&amp;gt;
            {isSubmitting ? 'Submitting...' : 'Submit'}
          &amp;lt;/button&amp;gt;
        &amp;lt;/form&amp;gt;
      );
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, &lt;code&gt;useFormStatus&lt;/code&gt; provides &lt;code&gt;isSubmitting&lt;/code&gt; and &lt;code&gt;isValid&lt;/code&gt; states. The button disables while submitting, giving users clear feedback.&lt;/p&gt;

&lt;p&gt;Next, the &lt;code&gt;useFormState&lt;/code&gt; hook manages form state based on form actions. It updates state efficiently, keeping your code clean and maintainable.&lt;/p&gt;

&lt;p&gt;Here’s how you can use &lt;code&gt;useFormState&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    import { useFormState } from 'react';

    function ContactForm() {
      const { values, handleChange } = useFormState({
        name: '',
        email: '',
      });

      return (
        &amp;lt;form&amp;gt;
          &amp;lt;label&amp;gt;
            Name:
            &amp;lt;input type="text" name="name" value={values.name} onChange={handleChange} /&amp;gt;
          &amp;lt;/label&amp;gt;
          &amp;lt;label&amp;gt;
            Email:
            &amp;lt;input type="email" name="email" value={values.email} onChange={handleChange} /&amp;gt;
          &amp;lt;/label&amp;gt;
          &amp;lt;button type="submit"&amp;gt;Submit&amp;lt;/button&amp;gt;
        &amp;lt;/form&amp;gt;
      );
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this snippet, &lt;code&gt;useFormState&lt;/code&gt; helps manage the form's input values. The &lt;code&gt;handleChange&lt;/code&gt; function updates the state, making form handling straightforward.&lt;/p&gt;

&lt;p&gt;For more advanced techniques in managing your codebase, you might find my &lt;a href="https://travislramos.com/blog/the-essential-git-cheat-sheet-master-version-control-like-a-pro" rel="noopener noreferrer"&gt;Git Cheat Sheet&lt;/a&gt; useful. It covers foundational commands, branching, merging, and more.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;useFormStatus&lt;/code&gt; and &lt;code&gt;useFormState&lt;/code&gt; streamline form management. They provide a more responsive and intuitive experience for both developers and users. Try these hooks in your next project to see how they can simplify your form handling.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fapi.macawhq.com%2Fimages%2Fbf081e54-c9b6-4797-9948-86370e43d414%23bf081e54-c9b6-4797-9948-86370e43d414" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fapi.macawhq.com%2Fimages%2Fbf081e54-c9b6-4797-9948-86370e43d414%23bf081e54-c9b6-4797-9948-86370e43d414" alt="a close up of a computer screen with a lot of text on it"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Optimistic UI with useOptimistic
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;useOptimistic&lt;/code&gt; hook in React 19 new features makes handling UI updates during async operations easier. It lets your UI show changes instantly, even before the server confirms them. This is called optimistic UI, and it makes your app feel faster and more responsive.&lt;/p&gt;

&lt;p&gt;With &lt;code&gt;useOptimistic&lt;/code&gt;, your interface updates right away while the async task runs in the background. If something goes wrong, you can undo the changes. This quick feedback keeps users engaged and makes wait times feel shorter.&lt;/p&gt;

&lt;p&gt;Here's a simple example of how it works:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    import { useOptimistic } from 'react';

    function LikeButton({ postId }) {
      const [isLiked, setIsLiked] = useOptimistic(false);

      const handleLike = async () =&amp;gt; {
        setIsLiked(true);
        try {
          await api.likePost(postId);
        } catch (error) {
          setIsLiked(false); // Undo if the request fails
        }
      };

      return (
        &amp;lt;button onClick={handleLike}&amp;gt;
          {isLiked ? 'Liked' : 'Like'}
        &amp;lt;/button&amp;gt;
      );
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, the &lt;code&gt;LikeButton&lt;/code&gt; component uses &lt;code&gt;useOptimistic&lt;/code&gt; to update the like state right when the button is clicked. If the &lt;code&gt;api.likePost&lt;/code&gt; call fails, it reverts the state, keeping data consistent.&lt;/p&gt;

&lt;p&gt;Using &lt;code&gt;useOptimistic&lt;/code&gt; makes your app feel snappier and more interactive. Users get instant feedback, creating a smoother experience. This hook is great for actions like liking a post, adding items to a cart, or any task where quick feedback matters.&lt;/p&gt;

&lt;p&gt;React 19's &lt;code&gt;useOptimistic&lt;/code&gt; hook makes it easier to implement optimistic UI, helping you build more engaging and user-friendly apps. For more insights on integrating design into your development process, check out my article on &lt;a href="https://travislramos.com/blog/agile-doesnt-mean-no-design" rel="noopener noreferrer"&gt;how Agile methodologies should not exclude design&lt;/a&gt;. Give it a try in your next project - you'll quickly see how it improves things.&lt;/p&gt;

&lt;h2&gt;
  
  
  Steps to Upgrade to React 19
&lt;/h2&gt;

&lt;p&gt;Upgrading to React 19 is straightforward. Follow these steps to ensure a smooth transition:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;Update Dependencies&lt;/strong&gt;: First, update React and ReactDOM to the latest version. Run the following command in your project directory:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    npm install react@19 react-dom@19
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;Check for Deprecated Features&lt;/strong&gt;: Go through the release notes for React 19. Identify any deprecated features and update your code accordingly. This step is crucial to avoid any surprises during the upgrade.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Run Tests&lt;/strong&gt;: Ensure your test suite passes with the new version. Running your tests early helps catch any potential issues that the upgrade might introduce. Use the following command to run your tests:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    npm test
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;Monitor Performance&lt;/strong&gt;: After upgrading, keep an eye on your application's performance. Look out for any regressions. Tools like React Profiler can help you monitor performance changes.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    import { Profiler } from 'react';

    function App() {
    return (

    &amp;lt;Profiler
      id="App"
      onRender={(id, phase, actualDuration) =&amp;gt; {
        console.log({ id, phase, actualDuration });
      }}
    &amp;gt;
      &amp;lt;YourComponent /&amp;gt;
    &amp;lt;/Profiler&amp;gt;
    ); }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;Fix Any Issues&lt;/strong&gt;: Address any problems that arise during testing and performance monitoring. Make sure your application runs smoothly with React 19.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you're interested in the tools and technologies I use to enhance productivity and creativity in my development workflow, check out &lt;a href="https://travislramos.com/uses" rel="noopener noreferrer"&gt;my curated list of technology and equipment&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Following these steps will help you upgrade to React 19 without major hiccups. Happy coding!&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrapping Up React 19 Features
&lt;/h2&gt;

&lt;p&gt;React 19 brings a host of new features that make development smoother and more efficient. The new React Compiler automatically optimizes your code, speeding up your apps without extra effort. Server Components shift heavy lifting to the server, resulting in faster load times and better SEO.&lt;/p&gt;

&lt;p&gt;Actions simplify state management, making your code cleaner and more maintainable. Document Metadata Management streamlines SEO tasks by letting you manage titles and meta tags directly within your components. Enhanced Asset Loading makes your app more responsive by efficiently handling static resources.&lt;/p&gt;

&lt;p&gt;The introduction of new hooks like &lt;code&gt;useOptimistic&lt;/code&gt;, &lt;code&gt;useFormStatus&lt;/code&gt;, &lt;code&gt;useFormState&lt;/code&gt;, and &lt;code&gt;use&lt;/code&gt; provide more flexibility and control in functional components. These hooks simplify async operations and state management, making your code cleaner and more efficient.&lt;/p&gt;

&lt;p&gt;Overall, React 19's updates focus on improving performance and developer experience. Whether you're optimizing assets, managing metadata, or handling async operations, these new features help you build faster, more efficient applications. Give React 19 a go in your next project and experience the improvements firsthand.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If you enjoyed this, consider subscribing to &lt;a href="https://travislramos.beehiiv.com/subscribe" rel="noopener noreferrer"&gt;my newsletter&lt;/a&gt; I send out weekly to hundreds of developers similar to yourself! I help them level up and make more money!&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>react</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>A Comprehensive Guide to Developer Career Growth</title>
      <dc:creator>Travis Ramos</dc:creator>
      <pubDate>Mon, 09 Sep 2024 15:39:39 +0000</pubDate>
      <link>https://forem.com/travislramos/a-comprehensive-guide-to-developer-career-growth-4gkp</link>
      <guid>https://forem.com/travislramos/a-comprehensive-guide-to-developer-career-growth-4gkp</guid>
      <description>&lt;h2&gt;
  
  
  Understanding Developer Career Growth
&lt;/h2&gt;

&lt;p&gt;Starting as a software developer opens many career paths. As tech evolves, your skills and roles must adapt.&lt;/p&gt;

&lt;p&gt;You'll likely begin as a &lt;strong&gt;Junior Developer&lt;/strong&gt;. Here, you'll write simple scripts and learn the basics of application lifecycles.&lt;/p&gt;

&lt;p&gt;Next, you can aim for &lt;strong&gt;Software Developer&lt;/strong&gt; or &lt;strong&gt;Senior Developer&lt;/strong&gt; roles. These jobs involve complex code, full application development, and database management. You'll need strong problem-solving skills.&lt;/p&gt;

&lt;p&gt;If leadership interests you, consider &lt;strong&gt;Lead Developer&lt;/strong&gt; or &lt;strong&gt;Technical Architect&lt;/strong&gt; roles. You'll design complex systems and lead projects. This requires technical skills and effective communication with your team.&lt;/p&gt;

&lt;p&gt;Management roles like &lt;strong&gt;Development Team Lead&lt;/strong&gt; or &lt;strong&gt;Software Development Manager&lt;/strong&gt; follow. You'll oversee teams and handle large-scale projects. These positions need leadership and strategic thinking.&lt;/p&gt;

&lt;p&gt;Senior management roles such as &lt;strong&gt;Director&lt;/strong&gt;, &lt;strong&gt;Vice President&lt;/strong&gt;, or &lt;strong&gt;Chief Technology Officer (CTO)&lt;/strong&gt; are possible. These jobs involve setting strategies and managing entire departments, blending technical expertise with strategic vision.&lt;/p&gt;

&lt;p&gt;Career growth needs more than technical skills. &lt;strong&gt;Critical thinking&lt;/strong&gt;, &lt;strong&gt;communication&lt;/strong&gt;, and &lt;strong&gt;leadership&lt;/strong&gt; are key. Whether you want to specialize or manage, balancing technical know-how with people skills will help you grow.&lt;/p&gt;

&lt;p&gt;Remember, your career growth depends on your skills, drive, and ability to adapt.&lt;/p&gt;

&lt;h2&gt;
  
  
  Junior to Senior Developer Roles
&lt;/h2&gt;

&lt;p&gt;Starting out as a &lt;strong&gt;Junior Developer&lt;/strong&gt; means diving into the basics. You'll write simple scripts and get familiar with the application lifecycle. It’s all about understanding how things work and building a solid foundation.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Key Responsibilities&lt;/strong&gt;: Writing basic code, understanding the application lifecycle, gaining a basic knowledge of databases and application services.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Progressing to a &lt;strong&gt;Senior Developer&lt;/strong&gt; role means stepping up your game. You’ll need a few years of programming experience under your belt. At this stage, you’ll be dealing with complex code and full application development. You’ll also manage databases and ensure everything runs smoothly.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Requirements&lt;/strong&gt;: Several years of programming experience, ability to write complex code, thorough understanding of databases and application lifecycles.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Senior Developers have a choice. They can continue honing their technical skills, diving deeper into coding and system design, or they can pivot towards management. Both paths offer unique challenges and rewards.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Option 1&lt;/strong&gt;: Stay technical, focusing on deepening coding expertise and tackling more complex projects.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Option 2&lt;/strong&gt;: Move into management, where leadership and strategic thinking come into play.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Choosing to stay on the technical track means becoming a master coder. You’ll solve more intricate problems and possibly move into roles like &lt;strong&gt;Technical Architect&lt;/strong&gt;. This path is perfect for those who love the nitty-gritty details of coding.&lt;/p&gt;

&lt;p&gt;Opting for management means overseeing projects and guiding a team. Roles like &lt;strong&gt;Development Team Lead&lt;/strong&gt; or &lt;strong&gt;Software Development Manager&lt;/strong&gt; involve balancing technical knowledge with people skills. It’s about seeing the bigger picture and making strategic decisions.&lt;/p&gt;

&lt;p&gt;Transitioning from Junior to Senior Developer is a journey. It requires dedication, continuous learning, and a willingness to take on new challenges. For those looking to enhance their skills and career prospects, subscribing to my &lt;a href="https://travislramos.com/blog/join-my-new-developer-newsletter-tips-insights-and-resources-to-elevate-your-coding-journey" rel="noopener noreferrer"&gt;Six Figure Dev Newsletter&lt;/a&gt; can provide valuable tips and insights. Whether you stay technical or move into management, the key is to keep growing and adapting.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fapi.macawhq.com%2Fimages%2Fa26ad09d-fc68-44b3-abc3-a4ba5caf31c3%23a26ad09d-fc68-44b3-abc3-a4ba5caf31c3" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fapi.macawhq.com%2Fimages%2Fa26ad09d-fc68-44b3-abc3-a4ba5caf31c3%23a26ad09d-fc68-44b3-abc3-a4ba5caf31c3" alt="people sitting down near table with assorted laptop computers"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Advanced Technical Roles
&lt;/h2&gt;

&lt;p&gt;Advanced technical roles in software development offer exciting challenges and opportunities for growth. As a &lt;strong&gt;Lead Developer&lt;/strong&gt;, you'll coordinate work, make key technical decisions, and still get your hands dirty with code.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Responsibilities&lt;/strong&gt;: Leading projects, implementing technical decisions, coordinating team efforts, and writing code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Requirements&lt;/strong&gt;: Extensive programming experience, strong leadership skills, and the ability to communicate technical concepts clearly.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Lead Developer roles can be a stepping stone to management. You’ll need to balance coding with leadership, providing guidance to your team and ensuring project success. It’s a mix of hands-on work and strategic oversight. For insights on how to enhance communication within your team, you might find my article on &lt;a href="https://travislramos.com/blog/how-to-foster-effective-communication-between-developers-and-clients" rel="noopener noreferrer"&gt;fostering effective communication between developers and clients&lt;/a&gt; particularly useful.&lt;/p&gt;

&lt;p&gt;For those who love diving deep into technical details, the &lt;strong&gt;Technical Architect&lt;/strong&gt; role might be the right fit. Technical Architects design complex systems and occasionally write code. They focus on the big picture, ensuring that all components of a system work harmoniously.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Responsibilities&lt;/strong&gt;: Designing complex systems, providing technical direction, and sometimes coding.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Requirements&lt;/strong&gt;: Deep subject matter expertise, extensive programming experience, and a thorough understanding of system design principles.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Technical Architects often reach the peak of the technical career ladder. They are the go-to experts for solving intricate problems and designing robust, scalable systems. This role is perfect for those who prefer technical challenges over managerial tasks.&lt;/p&gt;

&lt;p&gt;Both paths offer unique rewards and challenges. Whether you choose to lead a team or design systems, advanced technical roles require a blend of deep technical knowledge and strong problem-solving skills.&lt;/p&gt;

&lt;h2&gt;
  
  
  Transitioning to Management Roles
&lt;/h2&gt;

&lt;p&gt;Transitioning from a technical role to management isn't just about changing your job title. It's a shift in focus from coding to people and project management. If you're thinking about moving into roles like &lt;strong&gt;Development Team Lead&lt;/strong&gt; or &lt;strong&gt;Software Development Manager&lt;/strong&gt;, here's what you need to know.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Development Team Lead&lt;/strong&gt;: You'll manage a team of developers, making sure projects stay on track and meet deadlines.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Responsibilities&lt;/strong&gt;: Overseeing daily tasks, guiding team members, resolving conflicts, and ensuring code quality.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Skills Needed&lt;/strong&gt;: Strong leadership, effective communication, and the ability to mediate conflicts.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Software Development Manager&lt;/strong&gt;: This role involves a broader scope. You'll handle larger projects and have more strategic responsibilities.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Responsibilities**&lt;/strong&gt;: Managing multiple teams, handling hiring and firing, reporting on team productivity, and ensuring project alignment with business goals.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Skills Needed&lt;/strong&gt;: Strategic thinking, leadership, and excellent organizational skills.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Moving up to senior management roles like &lt;strong&gt;Director&lt;/strong&gt;, &lt;strong&gt;Vice President&lt;/strong&gt;, or &lt;strong&gt;Chief Technology Officer (CTO)&lt;/strong&gt; brings even more challenges and responsibilities.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Director&lt;/strong&gt;: You'll set long-term goals and strategies for your department, making high-level decisions that impact the entire organization.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Vice President&lt;/strong&gt;: This role involves overseeing multiple departments, ensuring alignment with company objectives, and driving innovation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CTO&lt;/strong&gt;: As CTO, you'll define the overall technology strategy, manage large teams, and make executive decisions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Skills Needed for Senior Management&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Strategic Vision&lt;/strong&gt;: You need to see the big picture and align your team's efforts with company goals.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Leadership&lt;/strong&gt;: Inspire and motivate your teams to achieve their best.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Decision-Making&lt;/strong&gt;: Make informed decisions quickly to keep projects moving forward.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Transitioning to management roles offers new challenges and rewards. It's about balancing technical knowledge with people skills, and if you're ready to step up, these roles can provide a fulfilling career path. For those looking for practical insights from my personal experience, you can explore my extensive work history, including my roles at WaterlooData and other major projects, on my &lt;a href="https://travislramos.com/work" rel="noopener noreferrer"&gt;work page&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fapi.macawhq.com%2Fimages%2F480aed62-4d54-46c0-9240-ad53ba80fa7d%23480aed62-4d54-46c0-9240-ad53ba80fa7d" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fapi.macawhq.com%2Fimages%2F480aed62-4d54-46c0-9240-ad53ba80fa7d%23480aed62-4d54-46c0-9240-ad53ba80fa7d" alt="woman wearing red and black checkered blouse using flat screen computer"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Tips for Long-Term Career Success
&lt;/h2&gt;

&lt;p&gt;Long-term career success in software development isn't just about mastering the latest tech. It's about adopting habits and mindsets that keep you growing. Here are some practical tips:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Continuous Learning&lt;/strong&gt;: Tech evolves. So should you. Stay curious and keep updating your skills. Attend workshops, take courses, and read up on new trends.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Develop Technical and Soft Skills&lt;/strong&gt;: Balance is key. While coding expertise is crucial, don't ignore critical-thinking, communication, and leadership. These "soft" skills can make or break your career.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Build Relationships&lt;/strong&gt;: Network with peers, mentors, and industry professionals. Relationships can open doors you didn't even know existed.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Seek Mentorship&lt;/strong&gt;: A mentor can provide invaluable guidance and feedback. They can help you navigate career paths, overcome challenges, and reach your professional goals.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Be Open to New Opportunities&lt;/strong&gt;: Don’t get too comfortable. Explore different career tracks. Take on new challenges. Whether it's a new project or a different role, stepping out of your comfort zone can lead to growth.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Deliver Consistent Results&lt;/strong&gt;: Reliability matters. Show your team and clients that you're dependable by consistently delivering quality work.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Earn Trust&lt;/strong&gt;: Build a track record of reliability and success. Trust is a currency in the professional world.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Think Big and Take Action&lt;/strong&gt;: Identify bigger problems and opportunities. Don’t just think about solving them—take bold steps to address them.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Be Self-Critical&lt;/strong&gt;: Learn from failures. Every mistake is an opportunity to improve. Don’t shy away from evaluating your own work and making necessary adjustments.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These tips aren't just for the short term. They’re habits that can propel your career forward for years to come. Keep applying these principles, and you'll find yourself constantly progressing and reaching new heights.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>tutorial</category>
      <category>career</category>
      <category>softwaredevelopment</category>
    </item>
    <item>
      <title>The Essential Git Cheat Sheet: Master Version Control Like a Pro</title>
      <dc:creator>Travis Ramos</dc:creator>
      <pubDate>Wed, 04 Sep 2024 15:05:28 +0000</pubDate>
      <link>https://forem.com/travislramos/the-essential-git-cheat-sheet-master-version-control-like-a-pro-1937</link>
      <guid>https://forem.com/travislramos/the-essential-git-cheat-sheet-master-version-control-like-a-pro-1937</guid>
      <description>&lt;p&gt;Git is an indispensable tool for developers, enabling you to track changes, collaborate with others, and manage your codebase efficiently. This cheat sheet covers essential Git commands that every developer should know, along with some advanced commands for more complex tasks.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Setting Up Your Git Repository
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Initialize a New Repository
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command initializes a new Git repository in your project folder. Use it when starting a new project or to begin tracking an existing one.&lt;/p&gt;

&lt;h3&gt;
  
  
  Clone an Existing Repository
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone &amp;lt;repository-url&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Clone an existing repository from a remote source like GitHub or Bitbucket. This is useful for contributing to a project or using an open-source library.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Configuring Git
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Set Your Username
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; user.name &lt;span class="s2"&gt;"Your Name"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Sets your username for all Git repositories on your system.&lt;/p&gt;

&lt;h3&gt;
  
  
  Set Your Email
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; user.email &lt;span class="s2"&gt;"your.email@example.com"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Sets your email address for commits.&lt;/p&gt;

&lt;h3&gt;
  
  
  View Your Configuration
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config &lt;span class="nt"&gt;--list&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Lists all the Git configurations currently set.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Working with Your Repository
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Checking the Status of Your Repository
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Displays the state of your working directory and staging area, showing which changes have been staged, which haven’t, and which files aren’t being tracked by Git.&lt;/p&gt;

&lt;h3&gt;
  
  
  Viewing a Log of Commits
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Shows a detailed history of commits, including author, date, and commit message.&lt;/p&gt;

&lt;h3&gt;
  
  
  Adding Changes to the Staging Area
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add &amp;lt;file-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Stages specific files for a commit. To stage all changes, use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add &lt;span class="nb"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Committing Changes
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Your commit message"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Commits the staged changes with a descriptive message. It’s good practice to write meaningful commit messages.&lt;/p&gt;

&lt;h3&gt;
  
  
  Commit All Changes Directly
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git commit &lt;span class="nt"&gt;-am&lt;/span&gt; &lt;span class="s2"&gt;"Your commit message"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Stages and commits all tracked files in one step. This command does not include untracked files.&lt;/p&gt;

&lt;h3&gt;
  
  
  Viewing Changes
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git diff
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Shows the changes between your working directory and the staging area. Useful for reviewing what you've modified before committing.&lt;/p&gt;

&lt;h3&gt;
  
  
  Viewing a Specific File’s Changes
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git diff &amp;lt;file-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Displays the changes made to a specific file.&lt;/p&gt;

&lt;h3&gt;
  
  
  Removing Files
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git &lt;span class="nb"&gt;rm&lt;/span&gt; &amp;lt;file-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Removes a file from your working directory and stages the deletion.&lt;/p&gt;

&lt;h3&gt;
  
  
  Moving/Renaming Files
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git &lt;span class="nb"&gt;mv&lt;/span&gt; &amp;lt;old-file-name&amp;gt; &amp;lt;new-file-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Moves or renames a file and stages the change.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Branching and Merging
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Create a New Branch
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git branch &amp;lt;branch-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Creates a new branch. Branches are used to develop features or fixes in isolation from the main codebase.&lt;/p&gt;

&lt;h3&gt;
  
  
  List All Branches
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git branch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Lists all branches in your repository, highlighting the current branch.&lt;/p&gt;

&lt;h3&gt;
  
  
  Switch to a Branch
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git checkout &amp;lt;branch-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Switches to the specified branch.&lt;/p&gt;

&lt;h3&gt;
  
  
  Create and Switch to a New Branch
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git checkout &lt;span class="nt"&gt;-b&lt;/span&gt; &amp;lt;branch-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Creates a new branch and immediately switches to it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Merge Branches
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git merge &amp;lt;branch-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Merges changes from the specified branch into your current branch. This is typically used to integrate a feature branch into the main branch.&lt;/p&gt;

&lt;h3&gt;
  
  
  Delete a Branch
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git branch &lt;span class="nt"&gt;-d&lt;/span&gt; &amp;lt;branch-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Deletes a branch that has been merged. Use &lt;code&gt;-D&lt;/code&gt; to force-delete a branch that hasn't been merged.&lt;/p&gt;

&lt;h3&gt;
  
  
  Rebase Branches
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git rebase &amp;lt;branch-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Rebases the current branch onto the specified branch. Rebasing can lead to a cleaner project history but should be used with caution, especially with shared branches.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Working with Remotes
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Adding a Remote Repository
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git remote add origin &amp;lt;repository-url&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Connects your local repository to a remote server, typically a repository on GitHub, GitLab, or Bitbucket.&lt;/p&gt;

&lt;h3&gt;
  
  
  Viewing Remote Repositories
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git remote &lt;span class="nt"&gt;-v&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Lists all remotes and their URLs.&lt;/p&gt;

&lt;h3&gt;
  
  
  Pushing Changes to Remote
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git push origin &amp;lt;branch-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pushes your commits to the remote repository. If it’s your first push, you might need to set the upstream branch:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git push &lt;span class="nt"&gt;--set-upstream&lt;/span&gt; origin &amp;lt;branch-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Pulling Changes from Remote
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git pull
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Fetches and merges changes from the remote repository into your current branch.&lt;/p&gt;

&lt;h3&gt;
  
  
  Fetching Changes from Remote
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git fetch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Downloads objects and refs from another repository. Unlike &lt;code&gt;git pull&lt;/code&gt;, &lt;code&gt;git fetch&lt;/code&gt; does not merge changes into your local branch automatically.&lt;/p&gt;

&lt;h3&gt;
  
  
  Removing a Remote Repository
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git remote remove &amp;lt;remote-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Removes a remote from your repository.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Undoing Changes
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Unstage Changes
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git reset &amp;lt;file-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Removes changes from the staging area but leaves them in your working directory.&lt;/p&gt;

&lt;h3&gt;
  
  
  Discard Unstaged Changes
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git checkout &lt;span class="nt"&gt;--&lt;/span&gt; &amp;lt;file-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Reverts unstaged changes in your working directory to the last commit.&lt;/p&gt;

&lt;h3&gt;
  
  
  Revert a Commit
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git revert &amp;lt;commit-hash&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Creates a new commit that undoes changes from a previous commit without altering the project history.&lt;/p&gt;

&lt;h3&gt;
  
  
  Reset to a Previous Commit
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git reset &lt;span class="nt"&gt;--hard&lt;/span&gt; &amp;lt;commit-hash&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Rolls back your project to a specific commit, discarding all changes made after that point. &lt;strong&gt;Warning:&lt;/strong&gt; This is irreversible.&lt;/p&gt;

&lt;h3&gt;
  
  
  Stash Changes
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git stash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Temporarily saves changes that you don’t want to commit yet, allowing you to work on something else.&lt;/p&gt;

&lt;h3&gt;
  
  
  Apply Stashed Changes
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git stash apply
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Reapplies the most recently stashed changes to your working directory.&lt;/p&gt;

&lt;h3&gt;
  
  
  Drop a Stash
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git stash drop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Removes a specific stash from your list of saved changes.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Advanced Git Commands
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Cherry-Pick a Commit
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git cherry-pick &amp;lt;commit-hash&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Applies the changes from a specific commit to your current branch.&lt;/p&gt;

&lt;h3&gt;
  
  
  Squash Commits
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git rebase &lt;span class="nt"&gt;-i&lt;/span&gt; HEAD~n
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Combines multiple commits into one. Replace &lt;code&gt;n&lt;/code&gt; with the number of commits you want to squash.&lt;/p&gt;

&lt;h3&gt;
  
  
  View Commit History as a Graph
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git log &lt;span class="nt"&gt;--graph&lt;/span&gt; &lt;span class="nt"&gt;--oneline&lt;/span&gt; &lt;span class="nt"&gt;--all&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Displays the commit history in a graph format, showing branches and merges.&lt;/p&gt;

&lt;h3&gt;
  
  
  Cleaning Up Untracked Files
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clean &lt;span class="nt"&gt;-f&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Deletes untracked files from your working directory. Add &lt;code&gt;-d&lt;/code&gt; to remove directories and &lt;code&gt;-n&lt;/code&gt; to perform a dry run.&lt;/p&gt;

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

&lt;p&gt;This cheat sheet covers a broad range of Git commands that will help you manage your projects efficiently. Whether you're committing changes, branching, merging, or working with remote repositories, mastering these commands will make you more effective as a developer. Keep practicing, and these commands will soon become second nature.&lt;/p&gt;

&lt;p&gt;If you found this helpful, don’t forget to bookmark this post so you can come back to it later when you're wondering what command you should use. Also, please share it with your fellow developers so they can use it too!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Now if you really found it helpful, check out my&lt;/strong&gt; &lt;a href="https://travislramos.beehiiv.com/subscribe" rel="noopener noreferrer"&gt;&lt;strong&gt;weekly newsletter&lt;/strong&gt;&lt;/a&gt; &lt;strong&gt;where I help hundreds of other developers level up in their career&lt;/strong&gt;s &lt;strong&gt;and make more money! Also, give me a&lt;/strong&gt; &lt;a href="https://x.com/travislramos" rel="noopener noreferrer"&gt;&lt;strong&gt;follow on X&lt;/strong&gt;&lt;/a&gt; &lt;strong&gt;where I’m active daily!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Happy coding!&lt;/p&gt;

</description>
      <category>git</category>
      <category>github</category>
      <category>tutorial</category>
      <category>basic</category>
    </item>
    <item>
      <title>The Ultimate Open Source Starter Kit</title>
      <dc:creator>Travis Ramos</dc:creator>
      <pubDate>Sun, 01 Sep 2024 00:35:26 +0000</pubDate>
      <link>https://forem.com/travislramos/the-ultimate-open-source-starter-kit-54k6</link>
      <guid>https://forem.com/travislramos/the-ultimate-open-source-starter-kit-54k6</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/neon"&gt;Neon Open Source Starter Kit Challenge &lt;/a&gt;: Ultimate Starter Kit&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  My Kit
&lt;/h2&gt;

&lt;p&gt;My starter kit is built using:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Neon.tech for the PostgreSQL Database (Serverless Version)&lt;/li&gt;
&lt;li&gt;Next.js (App Router)&lt;/li&gt;
&lt;li&gt;Lucia Auth for Authentication&lt;/li&gt;
&lt;li&gt;Light / Dark Mode&lt;/li&gt;
&lt;li&gt;Bun&lt;/li&gt;
&lt;li&gt;Vercel for Hosting&lt;/li&gt;
&lt;li&gt;ShadCN for UI Components&lt;/li&gt;
&lt;li&gt;Tailwind CSS for Styling&lt;/li&gt;
&lt;li&gt;Typescript&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I developed this starter kit to provide a hassle-free foundation for launching your SaaS quickly. All you need to do is customize the styling. It also includes a blog feature integrated with MDX for seamless content management.&lt;/p&gt;

&lt;h2&gt;
  
  
  Link to Kit
&lt;/h2&gt;

&lt;p&gt;You can find the &lt;a href="https://github.com/TRamos5/neon-oss-saas-starter-kit" rel="noopener noreferrer"&gt;repository here&lt;/a&gt;! Just click the button that says "Use this template" and take a look at the &lt;code&gt;README.md&lt;/code&gt; to get started!&lt;/p&gt;

&lt;h2&gt;
  
  
  Your Journey
&lt;/h2&gt;

&lt;p&gt;I chose this stack, centered around Neon.tech, because it offers a modern, scalable solution that aligns with the needs of today's developers. Neon.tech's serverless Postgres database provides a robust backend while maintaining flexibility and efficiency. I also chose to use Next.js since it brings versatility and efficiency to the frontend with its hybrid static and server-side rendering capabilities.&lt;/p&gt;

&lt;p&gt;Throughout this process, I gained a deeper understanding of serverless architecture and just how easy it is to get up and running with Neon.tech and Next.js.&lt;/p&gt;

&lt;p&gt;I hope you enjoy this starter kit and I can't wait to see what you build!&lt;/p&gt;

&lt;p&gt;If you have any questions reach out to me &lt;a href="https://x.com/travislramos" rel="noopener noreferrer"&gt;on X&lt;/a&gt;!&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>neonchallenge</category>
      <category>postgres</category>
      <category>database</category>
    </item>
    <item>
      <title>Mastering Code Splitting: Unlocking Faster Load Times for Your JavaScript Applications</title>
      <dc:creator>Travis Ramos</dc:creator>
      <pubDate>Thu, 29 Aug 2024 16:42:01 +0000</pubDate>
      <link>https://forem.com/travislramos/mastering-code-splitting-unlocking-faster-load-times-for-your-javascript-applications-71i</link>
      <guid>https://forem.com/travislramos/mastering-code-splitting-unlocking-faster-load-times-for-your-javascript-applications-71i</guid>
      <description>&lt;p&gt;As web applications grow, the size of JavaScript bundles can become a significant factor in your applications performance. Large bundles can lead to slower load times, and as bundles get bigger, load times increase. Thankfully there’s a technique called code splitting that helps solve this problem. Let’s dive into what it is and how you can implement it in your project.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Code Splitting?
&lt;/h2&gt;

&lt;p&gt;Code splitting allows you to split your JavaScript bundle into smaller pieces which can then be loaded on demand. Instead of loading an entire application at once, you only load the code needed for the current user interaction and defer loading the other code until it’s actually required. This can drastically improve load times.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Does This Matter?
&lt;/h2&gt;

&lt;p&gt;Let’s face it, we’ve all been there when we are trying to load something, it’s taking too long and we exit out. A faster load time directly translates to a better user experience. Code splitting helps keep users engaged by delivering a snappy, responsive experience, and when your users are engaged, they are more likely to stay on your site, explore its content, and check out your services.&lt;/p&gt;

&lt;p&gt;Now imagine you have a large application where all the code is bundled into a single file. Every time this application is used, the entire bundle is loaded in, even if only a fraction of the functionality is being used at that moment. This is very inefficient and will slow down your application. By implementing code splitting, you reduce the initial bundle size, resulting in a faster load. Only the code that is being used at that moment is pulled in while the rest is waiting to be called in.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Does Code Splitting Work?
&lt;/h2&gt;

&lt;p&gt;Similar to how bundling tools like Webpack or Rollup &lt;a href="https://travislramos.com/blog/understanding-tree-shaking-in-javascript" rel="noopener noreferrer"&gt;implement tree-shaking&lt;/a&gt;, they also bundle your JavaScript files into one or more output files, often called “chunks”. These chunks can then be loaded in as needed, which is where code splitting comes into play. Below we’ll go over implementing code splitting with dynamic imports and route-based splitting.&lt;/p&gt;

&lt;h3&gt;
  
  
  Dynamic Imports
&lt;/h3&gt;

&lt;p&gt;One of the simplest ways to implement code splitting is through dynamic &lt;code&gt;import()&lt;/code&gt; statements. Unlike static imports, dynamic imports allow you to load a module only when it’s needed. Here’s an example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import('./module').then(module =&amp;gt; {
  module.doSomething();
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this case, &lt;code&gt;module.js&lt;/code&gt; is only loaded when the import statement is executed, not when the application initially loads. This allows you to defer loading code until it’s actually required.&lt;/p&gt;

&lt;h3&gt;
  
  
  Route-based Splitting
&lt;/h3&gt;

&lt;p&gt;For single-page applications (SPAs), route-based code splitting is a great approach. This allows you to load different chunks of code depending on which route the user navigates to. In a React application, this is very easy to do using &lt;code&gt;React.lazy&lt;/code&gt; and &lt;code&gt;React.Suspense&lt;/code&gt;. Here’s an example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
const Home = React.lazy(() =&amp;gt; import(‘./Home’));

const About = React.lazy(() =&amp;gt; import(‘./About’));

function App() {

    return (

        &amp;lt;Router&amp;gt;

            &amp;lt;Suspense fallback={&amp;lt;div&amp;gt;Loading…&amp;lt;/div&amp;gt;}&amp;gt;

                        &amp;lt;Route path=”/home” component={Home} /&amp;gt;

                        &amp;lt;Route path=”/about” component={About} /&amp;gt;

            &amp;lt;/Suspense&amp;gt;

        &amp;lt;/Router&amp;gt;

    );

}

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

&lt;/div&gt;



&lt;p&gt;In this example, the &lt;code&gt;Home&lt;/code&gt; and &lt;code&gt;About&lt;/code&gt; components are only loaded when the user navigates to their respective routes. This keeps the initial bundle smaller with additional code being loaded on demand.&lt;/p&gt;

&lt;h2&gt;
  
  
  Best Practices for Code Splitting
&lt;/h2&gt;

&lt;p&gt;It’s crucial to understand the impact of code splitting on your bundle sizes. Tools like Webpack Bundle Analyzer can help you visualize your bundle’s structure and identify areas for optimization.&lt;/p&gt;

&lt;p&gt;To further optimize load times, consider using preloading and prefetching. These techniques allow you to hint to the browser to load certain resources ahead of time. Here’s an example of what that would look like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;link rel="preload" href="/static/js/home.chunk.js" as="script"&amp;gt;
&amp;lt;link rel="prefetch" href="/static/js/about.chunk.js"&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Preloading ensures that critical resources are loaded as soon as possible while prefetching loads resources that might be needed in the near future.&lt;/p&gt;

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

&lt;p&gt;Code splitting is a powerful optimization technique that can significantly improve the performance of your application which allows for a better user experience. By loading only the code that’s needed when it’s needed, you can reduce initial load times and keep users engaged. Implementing code splitting in your projects is an important step towards building faster, more efficient web applications.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If you found this helpful, consider subscribing to my&lt;/strong&gt; &lt;a href="https://travislramos.beehiiv.com/subscribe" rel="noopener noreferrer"&gt;&lt;strong&gt;weekly newsletter&lt;/strong&gt;&lt;/a&gt; &lt;strong&gt;where I help hundreds of other developers like you level up and advance in this field. And let’s face it, better skills = more money!&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Additional Resources to Explore
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://webpack.js.org/guides/code-splitting/" rel="noopener noreferrer"&gt;Webpack Documentation on Code Splitting&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://react.dev/reference/react/lazy" rel="noopener noreferrer"&gt;React Documentation on Lazy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://react.dev/reference/react/Suspense" rel="noopener noreferrer"&gt;React Documentation on Suspense&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>javascript</category>
      <category>react</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
