<?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: Mostafa Rahmani</title>
    <description>The latest articles on Forem by Mostafa Rahmani (@mosrah).</description>
    <link>https://forem.com/mosrah</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%2F1668115%2F5df6c51b-ecbf-46aa-8fc4-6d590ae1f6d6.jpeg</url>
      <title>Forem: Mostafa Rahmani</title>
      <link>https://forem.com/mosrah</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/mosrah"/>
    <language>en</language>
    <item>
      <title>How to Improve Your Website’s Performance with Lighthouse Metrics</title>
      <dc:creator>Mostafa Rahmani</dc:creator>
      <pubDate>Sat, 14 Dec 2024 10:59:15 +0000</pubDate>
      <link>https://forem.com/mosrah/how-to-improve-your-websites-performance-with-lighthouse-metrics-59cf</link>
      <guid>https://forem.com/mosrah/how-to-improve-your-websites-performance-with-lighthouse-metrics-59cf</guid>
      <description>&lt;h1&gt;
  
  
  How to Improve Your Website’s Performance with Lighthouse Metrics
&lt;/h1&gt;

&lt;p&gt;When it comes to building a website that’s fast, user-friendly, and optimized, &lt;strong&gt;Lighthouse&lt;/strong&gt; is your go-to tool. Lighthouse measures your website's performance using important metrics that directly affect speed, user experience, and search engine rankings. In this article, we’ll explore these metrics and share actionable tips to improve them.&lt;/p&gt;




&lt;h2&gt;
  
  
  Key Metrics to Watch
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. &lt;strong&gt;First Contentful Paint (FCP)&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;What is it?&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
FCP measures the time it takes for the first piece of content (like text or an image) to appear on the screen.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why does it matter?&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
It’s the first visual feedback users get, showing them that your page is loading.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to improve FCP:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use &lt;strong&gt;lazy loading&lt;/strong&gt; for images.&lt;/li&gt;
&lt;li&gt;Optimize your fonts and avoid loading unnecessary ones.&lt;/li&gt;
&lt;li&gt;Minify CSS and JavaScript files.&lt;/li&gt;
&lt;li&gt;Preload critical resources for faster delivery.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  2. &lt;strong&gt;Largest Contentful Paint (LCP)&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;What is it?&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
LCP tracks the time it takes for the largest visible content (like a hero image or headline) to fully load.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why does it matter?&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
This helps users quickly access the most important content.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to improve LCP:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use a &lt;strong&gt;Content Delivery Network (CDN)&lt;/strong&gt; to reduce server response time.&lt;/li&gt;
&lt;li&gt;Compress and optimize images using modern formats like &lt;strong&gt;WebP&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Remove unnecessary JavaScript and CSS blocking the rendering process.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  3. &lt;strong&gt;Cumulative Layout Shift (CLS)&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;What is it?&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
CLS measures unexpected visual shifts on the page, like buttons or images moving around.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why does it matter?&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Unexpected shifts can frustrate users, especially when they’re trying to interact with your site.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to improve CLS:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Define width and height for images and videos.&lt;/li&gt;
&lt;li&gt;Preload web fonts to avoid layout changes.&lt;/li&gt;
&lt;li&gt;Ensure ads or dynamic content don’t push elements around.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  4. &lt;strong&gt;Speed Index&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;What is it?&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Speed Index shows how quickly the content becomes visually complete for users.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why does it matter?&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
The faster your content loads, the better the user experience.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to improve Speed Index:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Combine CSS and JavaScript files to reduce the number of requests.&lt;/li&gt;
&lt;li&gt;Use browser caching for repeated resources.&lt;/li&gt;
&lt;li&gt;Minimize unused CSS and JavaScript.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  5. &lt;strong&gt;Time to Interactive (TTI)&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;What is it?&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
TTI measures how long it takes for your page to become fully interactive.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why does it matter?&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Users want to interact with your page as soon as possible.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to improve TTI:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Defer loading non-essential JavaScript files.&lt;/li&gt;
&lt;li&gt;Break JavaScript into smaller pieces using &lt;strong&gt;code splitting&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Limit third-party scripts that can delay interactivity.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  6. &lt;strong&gt;Total Blocking Time (TBT)&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;What is it?&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
TBT measures how long users are blocked from interacting with your page.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why does it matter?&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
The longer the delay, the worse the user experience.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to improve TBT:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Minimize JavaScript execution time.&lt;/li&gt;
&lt;li&gt;Use &lt;strong&gt;Web Workers&lt;/strong&gt; to handle heavy tasks in the background.&lt;/li&gt;
&lt;li&gt;Avoid large, blocking tasks that freeze the browser.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  7. &lt;strong&gt;First Input Delay (FID)&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;What is it?&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
FID tracks the delay between a user’s first interaction (like clicking a button) and when the site responds.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why does it matter?&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Quick responses make your site feel more seamless and responsive.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to improve FID:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Optimize JavaScript tasks to make them shorter.&lt;/li&gt;
&lt;li&gt;Use lazy loading for images and other assets.&lt;/li&gt;
&lt;li&gt;Remove unnecessary third-party scripts.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  8. &lt;strong&gt;Efficiently Encode Images&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;What is it?&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Lighthouse flags images that aren’t optimized for size and format.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to fix this:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Convert images to newer formats like &lt;strong&gt;WebP&lt;/strong&gt; or &lt;strong&gt;AVIF&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Use tools like &lt;strong&gt;TinyPNG&lt;/strong&gt; or &lt;strong&gt;ImageOptim&lt;/strong&gt; to compress images.&lt;/li&gt;
&lt;li&gt;Enable lazy loading for images to reduce the initial load time.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  General Tools and Techniques for Better Performance
&lt;/h2&gt;

&lt;p&gt;Here are some overall strategies to boost your Lighthouse scores:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Use a CDN&lt;/strong&gt;: Deliver resources faster by serving them from servers closer to your users.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enable Compression&lt;/strong&gt;: Use Gzip or Brotli to reduce file sizes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Upgrade to HTTP/2 or HTTP/3&lt;/strong&gt;: Faster communication protocols make your site load faster.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Leverage Browser Caching&lt;/strong&gt;: Cache static resources to avoid reloading them for returning users.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Prioritize Critical Resources&lt;/strong&gt;: Preload important files and scripts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lazy Loading&lt;/strong&gt;: Only load images and scripts when they’re needed.&lt;/li&gt;
&lt;/ol&gt;




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

&lt;p&gt;Improving your website’s performance with Lighthouse metrics isn’t just about boosting your scores—it’s about providing a better experience for your users. By focusing on these metrics, you’ll create a faster, more reliable website that keeps visitors coming back.&lt;/p&gt;

&lt;p&gt;Need help implementing these strategies? Let us know—we’d love to help you optimize your site!&lt;/p&gt;

</description>
      <category>performanceoptimization</category>
      <category>lighthouse</category>
      <category>frontend</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Best Practices for Naming Git Branches in Your Development Team</title>
      <dc:creator>Mostafa Rahmani</dc:creator>
      <pubDate>Mon, 11 Nov 2024 15:33:23 +0000</pubDate>
      <link>https://forem.com/mosrah/best-practices-for-naming-git-branches-in-your-development-team-g7n</link>
      <guid>https://forem.com/mosrah/best-practices-for-naming-git-branches-in-your-development-team-g7n</guid>
      <description>&lt;p&gt;In software development, maintaining clear and consistent branch names in Git helps everyone on the team stay organized and productive. When you’re working on a project with multiple branches—adding new features, fixing bugs, or preparing a release—a well-thought-out branch naming convention keeps everything running smoothly.&lt;/p&gt;

&lt;p&gt;In this article, we’ll cover simple, effective best practices for naming Git branches. Inspired by the popular Git Flow approach, these practices have been expanded with a few helpful tricks to make life easier when working with task-tracking tools like Jira.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why Does a Branch Naming Convention Matter?
&lt;/h3&gt;

&lt;p&gt;Having a consistent approach to branch naming isn’t just about keeping things neat—it also helps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Quickly communicate the purpose of each branch.&lt;/li&gt;
&lt;li&gt;Make tracking the status of work easy and clear.&lt;/li&gt;
&lt;li&gt;Reduce the chances of mix-ups, like accidentally merging the wrong branch.&lt;/li&gt;
&lt;li&gt;Improve teamwork and make it easier to find and work on relevant code.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  A Practical Branch Naming Convention
&lt;/h3&gt;

&lt;p&gt;One of the most popular approaches to branching is &lt;strong&gt;Git Flow&lt;/strong&gt;. Git Flow gives us a basic structure with different types of branches for different purposes, like new features or urgent bug fixes. This can be extended with &lt;strong&gt;task-based names&lt;/strong&gt; (e.g., adding task IDs or short descriptions), making it even easier to know what each branch does at a glance.&lt;/p&gt;

&lt;p&gt;Here’s a simple, friendly approach to branch naming based on Git Flow and task-based naming.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Branch Types and How to Name Them
&lt;/h3&gt;

&lt;h4&gt;
  
  
  1. &lt;strong&gt;Feature Branches&lt;/strong&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Prefix&lt;/strong&gt;: &lt;code&gt;feature/&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Purpose&lt;/strong&gt;: New features or significant improvements to the codebase.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Example&lt;/strong&gt;: &lt;code&gt;feature/1234-user-registration&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Feature branches are where you implement new functionality. Starting with the prefix &lt;code&gt;feature/&lt;/code&gt;, followed by the task ID (if you’re using one) and a short description, makes it clear what this branch adds to the project. Using both an ID and a description helps with quick identification.&lt;/p&gt;

&lt;h4&gt;
  
  
  2. &lt;strong&gt;Bug Fix Branches&lt;/strong&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Prefix&lt;/strong&gt;: &lt;code&gt;fix/&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Purpose&lt;/strong&gt;: Fixing known issues or bugs in the project.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Example&lt;/strong&gt;: &lt;code&gt;fix/5678-login-error&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Bug fix branches help with ongoing maintenance by organizing work specifically aimed at resolving bugs. They start with &lt;code&gt;fix/&lt;/code&gt;, followed by the bug ID or a short description. This naming style helps team members identify and track fixes as they move from development to production.&lt;/p&gt;

&lt;h4&gt;
  
  
  3. &lt;strong&gt;Hotfix Branches&lt;/strong&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Prefix&lt;/strong&gt;: &lt;code&gt;hotfix/&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Purpose&lt;/strong&gt;: High-priority fixes, usually for production issues.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Example&lt;/strong&gt;: &lt;code&gt;hotfix/9102-critical-error&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When there’s an urgent issue in production, a hotfix branch helps address it quickly. With a &lt;code&gt;hotfix/&lt;/code&gt; prefix, these branches stand out as important, allowing you to track critical fixes separately from regular development.&lt;/p&gt;

&lt;h4&gt;
  
  
  4. &lt;strong&gt;Chore Branches&lt;/strong&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Prefix&lt;/strong&gt;: &lt;code&gt;chore/&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Purpose&lt;/strong&gt;: Non-functional tasks, like refactoring, updating dependencies, or performing general cleanup.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Example&lt;/strong&gt;: &lt;code&gt;chore/clean-up-unused-components&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Chore branches are useful for smaller, supportive tasks that aren’t directly tied to features or bug fixes. Use &lt;code&gt;chore/&lt;/code&gt; to label these branches, so team members know it’s maintenance work, not a functional update.&lt;/p&gt;

&lt;h3&gt;
  
  
  Keeping Things Consistent
&lt;/h3&gt;

&lt;p&gt;Using a convention like this keeps branch names clear and straightforward. Each prefix (&lt;code&gt;feature/&lt;/code&gt;, &lt;code&gt;fix/&lt;/code&gt;, &lt;code&gt;hotfix/&lt;/code&gt;, &lt;code&gt;chore/&lt;/code&gt;) tells a team member what kind of work the branch contains. Adding task IDs and short descriptions provides additional context, helping the whole team stay on the same page and find specific branches quickly.&lt;/p&gt;

&lt;h3&gt;
  
  
  A Few Final Tips
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Document the convention&lt;/strong&gt;: Once you’ve chosen a structure, add it to the project documentation. This makes it easy for everyone to follow the same rules.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use lowercase and hyphens&lt;/strong&gt;: Naming branches in lowercase with hyphens (e.g., &lt;code&gt;fix/user-login-issue&lt;/code&gt;) improves readability, especially with longer branch names.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keep names short and descriptive&lt;/strong&gt;: Aim for clear, concise names that quickly communicate the branch’s purpose.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With these practices, your team can enjoy a smoother workflow, spend less time tracking down branches, and focus on what really matters: building great software. Happy branching! 😊&lt;/p&gt;

</description>
      <category>gitbestpractices</category>
      <category>devteamworkflow</category>
      <category>gitflowguide</category>
      <category>gitbranching</category>
    </item>
  </channel>
</rss>
