<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Aziz Bergach</title>
    <description>The latest articles on DEV Community by Aziz Bergach (@azizbergach).</description>
    <link>https://dev.to/azizbergach</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%2F1240024%2Fd955a923-fce9-46a2-b626-92aa5adf3fbf.png</url>
      <title>DEV Community: Aziz Bergach</title>
      <link>https://dev.to/azizbergach</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/azizbergach"/>
    <language>en</language>
    <item>
      <title>How to Make Money with the Fiverr Affiliate Program in 2025: A Comprehensive Guide</title>
      <dc:creator>Aziz Bergach</dc:creator>
      <pubDate>Sat, 12 Jul 2025 22:46:10 +0000</pubDate>
      <link>https://dev.to/azizbergach/how-to-make-money-with-the-fiverr-affiliate-program-in-2025-a-comprehensive-guide-ned</link>
      <guid>https://dev.to/azizbergach/how-to-make-money-with-the-fiverr-affiliate-program-in-2025-a-comprehensive-guide-ned</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdtpwjo60ffsgwi56sj5d.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdtpwjo60ffsgwi56sj5d.jpg" alt=" " width="800" height="452"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Catchy Introduction
&lt;/h2&gt;

&lt;p&gt;In the ever-evolving landscape of digital opportunities, the quest to &lt;strong&gt;make money online&lt;/strong&gt; has become a driving force for many. Among the myriad avenues available, &lt;strong&gt;affiliate marketing&lt;/strong&gt; stands out as a powerful and accessible model for generating &lt;strong&gt;passive income&lt;/strong&gt;. Imagine earning by simply connecting people with services they already need, without having to create those services yourself. This is the core appeal of &lt;strong&gt;affiliate marketing&lt;/strong&gt;, and for those looking to tap into the booming gig economy, the Fiverr affiliate program presents a particularly compelling opportunity.&lt;/p&gt;

&lt;p&gt;Fiverr, a globally recognized marketplace for &lt;strong&gt;digital services&lt;/strong&gt;, offers a unique pathway for individuals to transform their online presence into a robust &lt;strong&gt;online business&lt;/strong&gt;. Through the Fiverr affiliate program, you can promote a vast array of services — from graphic design and writing to programming and video editing — and earn a &lt;strong&gt;commission&lt;/strong&gt; for every successful referral. Whether you’re a seasoned marketer or just starting your journey into the world of &lt;strong&gt;freelancing&lt;/strong&gt; and online entrepreneurship, this guide will walk you through everything you need to know to leverage the &lt;strong&gt;Fiverr affiliate&lt;/strong&gt; program and unlock its significant earning potential in 2025.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is the Fiverr Affiliate Program?
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;Fiverr affiliate&lt;/strong&gt; program is an initiative designed by Fiverr to reward individuals and businesses for driving new customers to its platform. Essentially, you become a partner, promoting Fiverr’s diverse range of &lt;strong&gt;digital services&lt;/strong&gt; (known as ‘Gigs’) to your audience. When someone signs up and makes a purchase through your unique affiliate link, you earn a &lt;strong&gt;commission&lt;/strong&gt;. It’s a win-win: new users discover valuable services, freelancers get more work, and you get paid for making the connection.&lt;/p&gt;

&lt;h2&gt;
  
  
  Benefits of Joining
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;High Earning Potential:&lt;/strong&gt; With a wide variety of services and attractive &lt;strong&gt;commission&lt;/strong&gt; rates, the potential for substantial income is considerable.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Diverse Services:&lt;/strong&gt; Promote everything from logo design and website development to content writing and virtual assistance. This vast selection means you can always find services relevant to your niche.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Global Reach:&lt;/strong&gt; Fiverr is a global platform, allowing you to reach an international audience and maximize your earning opportunities.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Marketing Tools &amp;amp; Support:&lt;/strong&gt; Access a suite of professional marketing &lt;strong&gt;tools&lt;/strong&gt; and dedicated support to help you optimize your campaigns.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Reliable Payouts:&lt;/strong&gt; Enjoy timely and consistent payouts for your earned commissions.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Commission Plans: CPA vs. Hybrid Model
&lt;/h2&gt;

&lt;p&gt;Fiverr offers different &lt;strong&gt;commission&lt;/strong&gt; plans to cater to various affiliate strategies. Understanding these models is crucial for maximizing your earnings:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;CPA (Cost Per Acquisition):&lt;/strong&gt; This model pays a fixed &lt;strong&gt;commission&lt;/strong&gt; for every first-time buyer you refer to Fiverr. The &lt;strong&gt;CPA&lt;/strong&gt; rate can vary depending on the category of service purchased, with higher-value services often yielding larger payouts. For instance, referring a buyer who purchases a high-end web development Gig might earn you a significant flat fee.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Hybrid Model:&lt;/strong&gt; This plan combines a smaller fixed &lt;strong&gt;CPA&lt;/strong&gt; for the first-time buyer with a revenue share from their future purchases over a specific period. For example, you might get a &lt;strong&gt;CPA&lt;/strong&gt; for the initial sale and then a percentage of all subsequent purchases made by that referred buyer for 12 months. This model is excellent for building &lt;strong&gt;passive income&lt;/strong&gt; streams from long-term customer value.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Choosing between the &lt;strong&gt;CPA&lt;/strong&gt; and &lt;strong&gt;hybrid model&lt;/strong&gt; depends on your promotional strategy and target audience. If you aim for high-volume referrals of diverse services, &lt;strong&gt;CPA&lt;/strong&gt; might be more straightforward. If you focus on driving users who are likely to become repeat buyers, the &lt;strong&gt;hybrid model&lt;/strong&gt; could offer more sustainable long-term earnings.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Get Started: A Step-by-Step Guide
&lt;/h2&gt;

&lt;p&gt;Embarking on your journey as a &lt;strong&gt;Fiverr affiliate&lt;/strong&gt; is straightforward. Here’s a step-by-step guide to get you started:&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Signing Up for the Program
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Visit the Fiverr Affiliate Website:&lt;/strong&gt; Navigate to the official &lt;a href="https://go.fiverr.com/visit/?bta=684220&amp;amp;brand=fiverraffiliates" rel="noopener noreferrer"&gt;Fiverr Affiliate Program page&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Click ‘Join Now’:&lt;/strong&gt; You’ll be prompted to fill out a registration form with your personal details, preferred payment method, and promotional channels.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Review Terms and Conditions:&lt;/strong&gt; Carefully read and agree to the program’s terms and conditions.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Account Activation:&lt;/strong&gt; Once your application is reviewed and approved (usually within a few business days), you’ll receive an email confirming your account activation.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  2. Understanding the Affiliate Dashboard
&lt;/h2&gt;

&lt;p&gt;Upon logging in, you’ll gain access to your personalized affiliate dashboard. This is your command center for managing your campaigns. Key features include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Performance Reports:&lt;/strong&gt; Monitor clicks, conversions, and earnings in real-time.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Marketing Tools:&lt;/strong&gt; Generate unique &lt;strong&gt;links&lt;/strong&gt;, access banners, and other creative assets.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Payment Information:&lt;/strong&gt; View your current earnings and payout history.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Sub-ID Tracking:&lt;/strong&gt; Create unique identifiers for different campaigns to track their performance precisely.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3. Finding Relevant Services to Promote
&lt;/h2&gt;

&lt;p&gt;The key to successful &lt;strong&gt;affiliate marketing&lt;/strong&gt; is promoting services that genuinely resonate with your audience.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Niche Research:&lt;/strong&gt; Identify your target audience’s needs and interests. What problems are they trying to solve? What services could benefit them?&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Explore Fiverr Categories:&lt;/strong&gt; Browse Fiverr’s extensive categories (e.g., Graphics &amp;amp; Design, Digital Marketing, Writing &amp;amp; Translation, Video &amp;amp; Animation, Programming &amp;amp; Tech, Business, Lifestyle).&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Identify High-Demand Gigs:&lt;/strong&gt; Look for Gigs with high ratings, numerous reviews, and competitive pricing. Consider promoting services that offer recurring value or are evergreen in demand.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Personal Experience:&lt;/strong&gt; If you’ve used Fiverr services yourself and had a positive experience, these are often the best to promote as you can provide authentic testimonials.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Effective Strategies to Promote Fiverr Gigs and Services
&lt;/h2&gt;

&lt;p&gt;Once you’re set up, the next step is to drive traffic to your &lt;strong&gt;affiliate links&lt;/strong&gt;. Here are highly effective strategies:&lt;/p&gt;

&lt;h2&gt;
  
  
  Content Marketing
&lt;/h2&gt;

&lt;p&gt;Creating valuable &lt;strong&gt;content&lt;/strong&gt; is paramount for attracting and engaging your target audience.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Blog Posts:&lt;/strong&gt; Write detailed articles reviewing specific Fiverr Gigs, comparing services, or offering tutorials.&lt;/li&gt;
&lt;li&gt;  &lt;em&gt;Examples:&lt;/em&gt; ‘Best Logo Designers on Fiverr for Small Businesses,’ ‘How to Get a Professional Voiceover on Fiverr: A Step-by-Step Guide,’ ‘Fiverr vs. Upwork: Which Platform is Better for Freelance Writers?’&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Detailed Reviews:&lt;/strong&gt; Provide honest and thorough reviews of Fiverr services you recommend, highlighting their benefits and how they solve common problems.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Comparison Articles:&lt;/strong&gt; Create &lt;strong&gt;content&lt;/strong&gt; comparing different Gigs or freelancers within a specific niche on Fiverr, helping users make informed decisions.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Tutorials:&lt;/strong&gt; Develop step-by-step guides on how to use a particular Fiverr service or how to order a specific Gig, embedding your &lt;strong&gt;affiliate links&lt;/strong&gt; naturally.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Niche Content Ideas:&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;  ‘Top 5 AI Writing Services on Fiverr for Bloggers’&lt;/li&gt;
&lt;li&gt;  ‘Getting Your Podcast Edited Professionally on Fiverr: A Full Guide’&lt;/li&gt;
&lt;li&gt;  ‘Custom Website Design on Fiverr: What to Look For’&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Social Media Marketing
&lt;/h2&gt;

&lt;p&gt;Leverage the power of social platforms to reach a broad audience.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;YouTube:&lt;/strong&gt; Create video reviews of Fiverr Gigs, tutorials on using Fiverr services, or ‘day in the life’ videos featuring your experience with freelancers. Embed your &lt;strong&gt;affiliate links&lt;/strong&gt; in the video description.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;TikTok:&lt;/strong&gt; Produce short, engaging videos showcasing quick tips, before-and-after transformations from Fiverr services, or humorous takes on common digital needs. Use relevant hashtags.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Instagram:&lt;/strong&gt; Share visually appealing graphics promoting Fiverr services, success stories, or behind-the-scenes glimpses. Utilize Instagram Stories and Reels for quick promotions. Use the swipe-up feature (if available) or &lt;strong&gt;link&lt;/strong&gt; in bio.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Facebook Groups:&lt;/strong&gt; Participate in relevant niche-specific Facebook groups. Offer genuine advice and subtly introduce Fiverr services as solutions where appropriate, ensuring you adhere to group rules regarding promotion.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Email Marketing
&lt;/h2&gt;

&lt;p&gt;Building an &lt;strong&gt;email&lt;/strong&gt; list allows for direct and targeted promotions.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Lead Magnets:&lt;/strong&gt; Offer valuable free resources (e.g., e-books, checklists, templates) in exchange for email addresses.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Targeted Promotions:&lt;/strong&gt; Segment your &lt;strong&gt;email&lt;/strong&gt; list and send tailored promotions for Fiverr Gigs that are highly relevant to each segment’s interests.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Newsletter Integration:&lt;/strong&gt; Include recommended Fiverr services in your regular newsletters, perhaps as “tools of the week” or “services we love.”&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Forum and Community Engagement
&lt;/h2&gt;

&lt;p&gt;Engage in online forums and communities where your target audience spends time.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Provide Value:&lt;/strong&gt; Answer questions, offer insights, and establish yourself as an expert.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Subtle Promotion:&lt;/strong&gt; When relevant, gently recommend Fiverr services as solutions to common problems, always ensuring your contributions are helpful and not overtly promotional. Avoid spamming &lt;strong&gt;links&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  SEO Optimization
&lt;/h2&gt;

&lt;p&gt;Even with great &lt;strong&gt;content&lt;/strong&gt;, if people can’t find it, it won’t be effective. &lt;strong&gt;SEO&lt;/strong&gt; (Search Engine Optimization) is crucial.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Keyword Research:&lt;/strong&gt; Identify the terms and phrases your target audience uses when searching for services on Fiverr. Incorporate these naturally into your &lt;strong&gt;content&lt;/strong&gt;’s headings, body, and meta descriptions.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;High-Quality Content:&lt;/strong&gt; Search engines prioritize valuable, comprehensive, and well-structured &lt;strong&gt;content&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Backlinks:&lt;/strong&gt; Build high-quality backlinks to your &lt;strong&gt;content&lt;/strong&gt; from authoritative websites to improve your search engine ranking.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Mobile-Friendliness:&lt;/strong&gt; Ensure your website and &lt;strong&gt;content&lt;/strong&gt; are optimized for mobile devices.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Maximizing Your Earnings: Advanced Tips
&lt;/h2&gt;

&lt;p&gt;To truly thrive as a &lt;strong&gt;Fiverr affiliate&lt;/strong&gt; and build a sustainable &lt;strong&gt;online business&lt;/strong&gt;, consider these advanced strategies:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Focusing on High-Commission Services:&lt;/strong&gt; While promoting a wide range is good, prioritize Gigs and categories that offer higher &lt;strong&gt;CPA&lt;/strong&gt; rates or are likely to result in repeat purchases under the &lt;strong&gt;hybrid model&lt;/strong&gt;. For example, promoting high-value tech services or long-term business solutions can lead to greater income per conversion.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Building Trust and Authority with Your Audience:&lt;/strong&gt; People are more likely to click on your &lt;strong&gt;links&lt;/strong&gt; if they trust your recommendations. Be transparent about your &lt;strong&gt;affiliate&lt;/strong&gt; relationship, provide honest reviews, and consistently deliver valuable &lt;strong&gt;content&lt;/strong&gt;. Your authority in a niche will directly correlate with your conversion rates.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Analyzing Performance Data and Optimizing Campaigns:&lt;/strong&gt; The &lt;strong&gt;Fiverr affiliate&lt;/strong&gt; dashboard provides detailed analytics. Regularly review your data to understand which &lt;strong&gt;content&lt;/strong&gt; and promotional channels are performing best. Identify underperforming areas and iterate on your strategies. A/B test different calls to action, headlines, and &lt;strong&gt;content&lt;/strong&gt; formats.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Staying Updated with Fiverr’s New Services and Promotions:&lt;/strong&gt; Fiverr constantly adds new Gigs and runs special promotions. Stay informed by subscribing to their affiliate newsletter and regularly checking the platform. Being an early adopter in promoting new, in-demand services can give you a significant advantage.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Diversifying Promotion Channels:&lt;/strong&gt; Don’t put all your eggs in one basket. While you might excel in one area (e.g., blogging), exploring other channels like YouTube, podcasts, or even paid advertising can significantly expand your reach and &lt;strong&gt;make money online&lt;/strong&gt; faster. Each channel caters to a different audience and &lt;strong&gt;content&lt;/strong&gt; consumption preference.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Common Challenges and How to Overcome Them
&lt;/h2&gt;

&lt;p&gt;While the &lt;strong&gt;Fiverr affiliate&lt;/strong&gt; program offers immense potential, you might encounter some hurdles. Here’s how to address them:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Low Conversion Rates:&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Solution:&lt;/strong&gt; Re-evaluate your target audience. Are you attracting the right people? Improve the quality and relevance of your &lt;strong&gt;content&lt;/strong&gt;. Ensure your calls to action are clear and compelling. Consider A/B testing different landing pages or promotional messages.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Competition:&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Solution:&lt;/strong&gt; Differentiate yourself. Focus on a specific niche where you can become an authority. Offer unique insights or a personal touch. Build a strong brand around your recommendations.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Finding the Right Audience:&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Solution:&lt;/strong&gt; Conduct thorough market research. Use social media analytics, forum discussions, and keyword research &lt;strong&gt;tools&lt;/strong&gt; to understand where your target audience congregates online and what their pain points are. Tailor your &lt;strong&gt;content&lt;/strong&gt; and promotions accordingly.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Algorithm Changes:&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Solution:&lt;/strong&gt; Stay agile. Search engine and social media algorithms are constantly changing. Keep up-to-date with industry news, experiment with new strategies, and diversify your traffic sources to mitigate the impact of sudden shifts.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Maintaining Originality:&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Solution:&lt;/strong&gt; Even when covering similar topics, strive to offer fresh perspectives. Share your personal experiences, conduct unique case studies, or interview Fiverr users/sellers. Focus on actionable advice and real-world scenarios that provide genuine value.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;The &lt;strong&gt;Fiverr affiliate&lt;/strong&gt; program offers an incredible pathway to &lt;strong&gt;make money online&lt;/strong&gt; and build a thriving &lt;strong&gt;online business&lt;/strong&gt; in 2025. By understanding its mechanics, leveraging effective promotional strategies, and continuously optimizing your efforts, you can tap into the vast potential of the gig economy. Remember, success in &lt;strong&gt;affiliate marketing&lt;/strong&gt; is a journey of consistency, learning, and adaptation. Focus on providing genuine value to your audience, building trust, and diligently promoting &lt;strong&gt;digital services&lt;/strong&gt; that truly solve problems.&lt;/p&gt;

&lt;p&gt;Don’t just dream of &lt;strong&gt;passive income&lt;/strong&gt;; make it a reality. Take the first step today: &lt;a href="https://go.fiverr.com/visit/?bta=684220&amp;amp;brand=fiverraffiliates" rel="noopener noreferrer"&gt;sign up for the &lt;strong&gt;Fiverr affiliate&lt;/strong&gt; program&lt;/a&gt;, explore the endless possibilities of &lt;strong&gt;freelancing&lt;/strong&gt; and &lt;strong&gt;digital services&lt;/strong&gt;, and begin your journey towards financial independence. The digital world is brimming with opportunities — seize yours with Fiverr.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>ai</category>
    </item>
    <item>
      <title>Why Investing in Cryptocurrency on Bybit in 2025 Could Be Profitable</title>
      <dc:creator>Aziz Bergach</dc:creator>
      <pubDate>Thu, 21 Nov 2024 16:38:11 +0000</pubDate>
      <link>https://dev.to/azizbergach/why-investing-in-cryptocurrency-on-bybit-in-2025-could-be-profitable-hp7</link>
      <guid>https://dev.to/azizbergach/why-investing-in-cryptocurrency-on-bybit-in-2025-could-be-profitable-hp7</guid>
      <description>&lt;h2&gt;
  
  
  Why Bybit Is Your Go-To Crypto Exchange for 2025 Investments
&lt;/h2&gt;

&lt;p&gt;With cryptocurrency markets gearing up for a potential bullish rally in 2025, there’s never been a better time to start investing. Analysts predict Bitcoin could soar beyond $100,000, making it a golden opportunity for those who get in early. Bybit stands out as the perfect platform for this journey, offering exclusive benefits, including a $200 reward on your first deposit when you sign up with this &lt;a href="https://www.bybit.com/invite?ref=V2WQ9O" rel="noopener noreferrer"&gt;special referral link&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Reasons Bitcoin Could Hit $100,000
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Institutional Investment: Institutions like BlackRock are treating Bitcoin as “digital gold,” driving demand and pushing prices higher​&lt;/li&gt;
&lt;li&gt;Bitcoin ETFs: With billions flowing into Bitcoin ETFs, this new vehicle is making crypto investments easier and more attractive to the mainstream market​&lt;/li&gt;
&lt;li&gt;Historical Trends: Bitcoin’s past performance after market highs points to strong potential for returns of 40% or more within months​&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Why Use Bybit?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Earn $200 Bonus: Make your first deposit on Bybit through this special link and earn up to $200 in rewards.&lt;/li&gt;
&lt;li&gt;Low Fees: Maximize your returns with one of the lowest fee structures in the market.&lt;/li&gt;
&lt;li&gt;Advanced Tools: Bybit provides comprehensive features for spot trading, derivatives, and portfolio management.&lt;/li&gt;
&lt;li&gt;24/7 Support: Their customer service ensures you’re never stuck, no matter the time zone.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What Makes Bybit Special?
&lt;/h2&gt;

&lt;p&gt;Bybit is more than just an exchange; it’s a gateway to financial freedom. From beginner-friendly tutorials to advanced trading tools, it empowers investors to navigate the cryptocurrency landscape confidently.&lt;/p&gt;

&lt;h3&gt;
  
  
  Get Started Today!
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Sign up through this &lt;a href="https://www.bybit.com/invite?ref=V2WQ9O" rel="noopener noreferrer"&gt;referral link&lt;/a&gt; and make your first deposit to claim your $200 bonus.&lt;/li&gt;
&lt;li&gt;Explore Bybit’s intuitive platform and educational resources.&lt;/li&gt;
&lt;li&gt;Invest in Bitcoin and other cryptocurrencies and capitalize on the 2025 rally.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Don’t miss out on this once-in-a-lifetime opportunity to ride the crypto wave and earn an exclusive bonus! Sign up today.&lt;/p&gt;

</description>
      <category>career</category>
      <category>news</category>
      <category>discuss</category>
      <category>google</category>
    </item>
    <item>
      <title>How to Create Your Own Wordle Game in HTML, CSS, and JS</title>
      <dc:creator>Aziz Bergach</dc:creator>
      <pubDate>Sun, 28 Jan 2024 18:49:40 +0000</pubDate>
      <link>https://dev.to/azizbergach/how-to-create-your-own-wordle-game-in-html-css-and-js-3bgg</link>
      <guid>https://dev.to/azizbergach/how-to-create-your-own-wordle-game-in-html-css-and-js-3bgg</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;Introduction&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;A Glimpse into Wordle's World&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Hey there! Ever caught yourself absolutely hooked on Wordle, that wildly popular word puzzle game? It's simple, fun, and oh-so-addictive, right? But what if I told you that you could channel that addiction into something incredibly productive? That's right! Today, we're diving into the exciting journey of building your very own Wordle game. And guess what? You'll be doing it with HTML, CSS, and JavaScript - the holy trinity of web development!&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Why This Project Rocks for Learning&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Creating a Wordle game is more than just a fun pastime. It's a hands-on way to sharpen your web development skills. You'll get to play around with the structure, design, and logic of a web application, and come out on the other side with something to show off. Ready to jump in? Let's get started!&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;What You'll Need: Prerequisites&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;The Basics: HTML, CSS, JS Knowledge&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Before we start, let's make sure you've got the basics down. A comfortable grasp of HTML for structure, CSS for styling, and JavaScript for functionality is crucial. Don't worry if you're not an expert – enthusiasm and willingness to learn are your best tools here.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Free Wordle Game API access&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;We are going to use &lt;a href="https://rapidapi.com/azizbergach/api/wordle-game-api1"&gt;Wordle Game API&lt;/a&gt; in this tutorial as it provide a free plan to use, and I think it's really good for the purpose of the tutorial&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Tools of the Trade&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;You'll also need a text editor (like Visual Studio Code or Sublime Text) and a browser to test your game. That's it! No fancy software required.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Setting the Stage: HTML Structure&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Creating the Game Board&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;First things first: your HTML document. This is where you'll set up your game board. Think of it as the skeleton of your Wordle game.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Input Fields for Guesses&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;You'll need a place for players to input their guesses. We'll set up input fields that not only look neat but are super user-friendly.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Display Area for Feedback&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Players need to know how they're doing, right? We'll create a section to display feedback for each guess. Green for right, yellow for close, and gray for try-again.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;the html code structure&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html lang="en"&amp;gt;
&amp;lt;head&amp;gt;
    &amp;lt;meta charset="UTF-8"&amp;gt;
    &amp;lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&amp;gt;
    &amp;lt;title&amp;gt;Custom Wordle Game&amp;lt;/title&amp;gt;
    &amp;lt;link rel="stylesheet" href="styles.css"&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;h1&amp;gt;Wordle Game&amp;lt;/h1&amp;gt;
    &amp;lt;div id="gameBoard"&amp;gt;&amp;lt;/div&amp;gt;
    &amp;lt;input type="text" id="guessInput" maxlength="5"&amp;gt;
    &amp;lt;button id="guessButton"&amp;gt;Guess&amp;lt;/button&amp;gt;
    &amp;lt;script src="script.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;Bringing It to Life: CSS Styling&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Styling the Game Board&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Now, let's make it pretty with CSS. We're talking colors, fonts, and layout. This is where your game starts to come alive visually.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Responsive Design Tips&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;We want everyone to enjoy your game, whether they're on a laptop or a smartphone. I'll show you some tricks to make your game responsive and accessible.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Color Scheme and Aesthetics&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Picking the right color scheme is crucial. We'll dive into how to choose a palette that's not only appealing but also user-friendly.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;The styling code in CSS&lt;/strong&gt;*
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;body {
    font-family: Arial, sans-serif;
    text-align: center;
    background-color: #f0f0f0;
}

#gameBoard {
    display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin: 20px auto;
  max-width: fit-content;
}

.cell {
    width: 60px;
    height: 60px;
    border: 2px solid #333;
    text-align: center;
    line-height: 60px;
    font-size: 2em;
}

.cell.correct {
  background: #538d4e;
  color: white;
}

.cell.semi-correct {
  background: #b59f3b;
  color: white;
}

.cell.incorrect {
  background: #3a3a3c;
  color: white;
}

@media (max-width: 400px) {
  .cell {
    width: 40px;
    height: 40px;
    border: 1px solid #333;
    text-align: center;
    line-height: 40px;
    font-size: 1em;
}
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;The Game Logic: JavaScript Core&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Setting Up the Game Logic&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The heart of your game is its logic. We'll write JavaScript code that defines how the game works, how words are chosen, and how guesses are evaluated.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Handling User Input&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;We need to make sure the game responds to player input correctly. This means checking their guesses, providing hints, and keeping track of their progress.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Implementing the Wordle Algorithm&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The Wordle magic lies in its algorithm. I'll guide you through creating an algorithm that randomly selects words and checks player guesses against it.&lt;/p&gt;

&lt;h3&gt;
  
  
  ** Javascript code for the wordle game**
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const apiKey = 'the api key from the wordle game api &amp;lt;X-RapidAPI-Key&amp;gt;'; // Replace with your API key from RapidAPI
const apiUrl = 'https://wordle-game-api1.p.rapidapi.com/guess';

const gameBoard = document.getElementById('gameBoard');
const guessInput = document.getElementById('guessInput');
const guessButton = document.getElementById('guessButton');
const inputs = [];
const results = [];

let solutionWord = '';

// Fetch a word from the API
function validate(word) {
    fetch(apiUrl, {
        "method": 'POST',
        "headers": {
          'content-type': 'application/json',
          'X-RapidAPI-Key': apiKey,
          'X-RapidAPI-Host': 'wordle-game-api1.p.rapidapi.com'
        },
        "body": JSON.stringify({word})
    })
    .then(response =&amp;gt; response.json())
    .then(data =&amp;gt; {
      const {result , isOk, error} = data;
      if (!isOk) {
        console.log(error)
      } else {
        inputs.push(word);
        results.push(result);
        guessInput.value = "";
        refreshGame();
      }
    })
    .catch(err =&amp;gt; {
        console.error(err);
    });
}

// update game UI
function refreshGame() {
  const cells = gameBoard.getElementsByClassName('cell');
    for (let i = 0; i &amp;lt; 30; i++) { // 6 attempts, 5 letters each
        let cell = cells[i];
        let y = Math.floor(i / 5);
        let x = i - y * 5;
      if(inputs.length &amp;gt; y &amp;amp;&amp;amp; inputs[y][x]) {
        const result = results[y][x] === "+" ? "correct" : results[y][x] === "x" ? "semi-correct" : "incorrect";
        cell.textContent = inputs[y][x].toUpperCase();
        cell.classList.add(result);
      }
    }
}

// Initialize game
function initializeGame() {
    for (let i = 0; i &amp;lt; 30; i++) { // 6 attempts, 5 letters each
        let cell = document.createElement('div');
        cell.classList.add('cell');
        let y = Math.floor(i / 5);
        let x = i - y * 5;
      if(inputs.length &amp;gt; y &amp;amp;&amp;amp; inputs[y][x]) {
        const result = results[y][x] === "+" ? "correct" : results[y][x] === "x" ? "semi-correct" : "incorrect";
        cell.textContent = inputs[y][x].toUpperCase();
        cell.classList.add(result);
      }
        gameBoard.appendChild(cell);
    }
}

// Event listener for the guess button
guessButton.addEventListener('click', function() {
    let guess = guessInput.value.toLowerCase();
    if (guess.length === 5) {
        validate(guess)
    } else {
        alert('Please enter a 5-letter word.');
    }
});

initializeGame();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;Enhancing User Experience&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Adding Animations and Transitions&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Animations can make your game feel more dynamic. We'll add some smooth transitions to make the gameplay experience even more engaging.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;User Feedback and Error Handling&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;A great game communicates with its players. We'll implement clear messages for errors and successes, enhancing the overall user experience.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Storing Game Data&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Using Local Storage for Game Progress&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Don't want players to lose their progress? We'll use the browser's local storage to save their game state, so they can pick up where they left off.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Reset and Continue Game Options&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Giving players the option to reset or continue their game is key. We'll add functionality for both, making your game flexible and user-friendly.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Making the Game Challenging&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Implementing a Dictionary of Words&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;A good Wordle game needs a solid word list. We'll explore how to implement a dictionary of words that the game can use to challenge players.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Difficulty Levels and Daily Challenges&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;To keep things spicy, we'll add different difficulty levels and daily challenges. This will keep your players coming back for more.&lt;/p&gt;

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

&lt;p&gt;We've covered a lot, haven't we? From setting up your HTML structure to deploying your game online, you're now ready to create your own version of Wordle. Remember, the best way to learn is by doing, so don't be afraid to experiment and make mistakes. That's how you grow!&lt;br&gt;
You could check the preview &lt;a href="https://codepen.io/azizbergach/full/WNmdQJN"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;FAQs&lt;/strong&gt;
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;How do I make sure my Wordle game is unique?&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Can I add more features to my game than what's covered here?&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;What are some common challenges I might face when coding this game?&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;How can I ensure my game is accessible to all players?&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Where can I share my completed Wordle game to get feedback?&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>gamedev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Next.js 14 Server Actions: Boosting Performance</title>
      <dc:creator>Aziz Bergach</dc:creator>
      <pubDate>Mon, 22 Jan 2024 13:20:09 +0000</pubDate>
      <link>https://dev.to/azizbergach/nextjs-14-server-actions-boosting-performance-11l7</link>
      <guid>https://dev.to/azizbergach/nextjs-14-server-actions-boosting-performance-11l7</guid>
      <description>&lt;p&gt;Hello developers, today I will show you how to use server actions in next js 14. For the ones who are new to next js, next js is a popular open-source framework for developing server-side rendered React applications. It was created by Vercel, the company formerly known as Zeit, and is maintained by a community of developers, like me. It aims to simplify the development process for "React js" applications by providing various features and tools that streamline the workflow and improve performance. the best thing about next js is the performance and the seo. let's get started!&lt;/p&gt;

&lt;h2&gt;
  
  
  What are server actions in next js
&lt;/h2&gt;

&lt;p&gt;I will simplify the meaning, they are just a javascript functions, that could be define the react component or in a separated file. the only thing that let them defer from the other function is that they have "use server" in the start point of the function, like this:&lt;/p&gt;

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

// Server Component
export default function Page() {
  // Server Action
  async function create() {
    'use server'

    // ...
  }

  return (
    // ...
  )
}


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

&lt;/div&gt;

&lt;p&gt;they also are "async" functions, because they probably need to use "await" inside of them to call the database using prisma for example:&lt;/p&gt;

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

export default function Page() {
  // Server Action
  async function create(formData) {
    'use server'
     prisma.product.create({
     name: formData.name,
     price: formData.price
   })
  }

  return (
    &amp;lt;form action="create" method="POST" &amp;gt;
           &amp;lt;div&amp;gt;
              &amp;lt;label htmlFor="name"&amp;gt;Product Name&amp;lt;/label&amp;gt;
              &amp;lt;div&amp;gt;
                &amp;lt;input id="name" name="text" type="text"
                  placeholder="MacBook pro M2 Max"
                  required
                /&amp;gt;
              &amp;lt;/div&amp;gt;
            &amp;lt;/div&amp;gt;
            &amp;lt;div&amp;gt;
              &amp;lt;label htmlFor="price"&amp;gt;Product Price&amp;lt;/label&amp;gt;
              &amp;lt;div&amp;gt;
                &amp;lt;input id="price" name="text" type="text"
                  placeholder="$15.99"
                  required
                /&amp;gt;
              &amp;lt;/div&amp;gt;
            &amp;lt;/div&amp;gt;
            &amp;lt;div&amp;gt;
              &amp;lt;button type="submit"&amp;gt; Add Todo&amp;lt;/button&amp;gt;
            &amp;lt;/div&amp;gt;
    &amp;lt;/form&amp;gt;
  )
}


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

&lt;/div&gt;
&lt;h2&gt;
  
  
  Why using server actions in next js app ?
&lt;/h2&gt;

&lt;p&gt;to understand that, let's talk of server side rendering "SSR".However, I will let "SSR" for another article, anyway the Server Side Rendering (SSR) is a technique used in web development to improve the user experience by rendering web pages on the server before sending them to the client's browser. So the clients or visitors of the next app would be happy, because there is no heavy tasks compiled on their browsers and it's also good for security reasons. I will cover also "client side vs server side rendering" and "client component vs server component in next js".&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyw70yqd8hgkpfzx6ue31.png" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyw70yqd8hgkpfzx6ue31.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;However, it's good to know that server actions doesn't get compiled in the browser, but in node js "&amp;gt;= v18" server. they are the new API endpoints in next js 14, yes as you heard they are actually end points, if you noticed in the code above, we use the server action function "create" as "action" of the "form" element in HTML:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

async function create(formData) {
    'use server'
     prisma.product.create({
     name: formData.name,
     price: formData.price
   })
  }

  return (
    &amp;lt;form action="create" method="**POST**" &amp;gt;
...
&amp;lt;/form&amp;gt;)


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

&lt;/div&gt;

&lt;p&gt;and if you have some experience using PHP programing language maybe you've noticed that what we see in the next js server actions in the same like:&lt;/p&gt;

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

&amp;lt;form action="script.php" method="POST"&amp;gt;
    &amp;lt;label for="name"&amp;gt;Name:&amp;lt;/label&amp;gt;
    &amp;lt;input type="text" name="name" required&amp;gt;

    &amp;lt;label for="price"&amp;gt;Price:&amp;lt;/label&amp;gt;
    &amp;lt;input type="text" name="price" required&amp;gt;

    &amp;lt;button type="submit"&amp;gt;Create Product&amp;lt;/button&amp;gt;
&amp;lt;/form&amp;gt;


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

&lt;/div&gt;

&lt;p&gt;where the "script.php" is the file where you implement the logic to insert the product to database , it may something like:&lt;/p&gt;

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

&amp;lt;?php

// Include your database connection logic here
// For example, assuming you have a file named "db.php" with database connection details
require_once('db.php');

if ($_SERVER["REQUEST_METHOD"] == "POST") {
    // Get form data
    $name = $_POST["name"] ?? null;
    $price = $_POST["price"] ?? null;

    // Validate form data (you may want to add more validation)
    if ($name &amp;amp;&amp;amp; $price) {
        // Use MySQLi to connect to the database (adjust with your database details)
        $conn = new mysqli($db_host, $db_username, $db_password, $db_name);

        // Check the connection
        if ($conn-&amp;gt;connect_error) {
            die("Connection failed: " . $conn-&amp;gt;connect_error);
        }

        // Prepare and execute the SQL query to insert the product
        $stmt = $conn-&amp;gt;prepare("INSERT INTO products (name, price) VALUES (?, ?)");
        $stmt-&amp;gt;bind_param("ss", $name, $price);

        if ($stmt-&amp;gt;execute()) {
            // Product inserted successfully
            echo "Product created successfully!";
        } else {
            // Handle any errors that occurred during product creation
            echo "Error creating product: " . $stmt-&amp;gt;error;
        }

        // Close the database connection
        $stmt-&amp;gt;close();
        $conn-&amp;gt;close();
    } else {
        // Handle invalid form data
        echo "Invalid form data!";
    }
}
?&amp;gt;


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

&lt;/div&gt;

&lt;p&gt;next js and php use the same context for handling API calls at the same manner, like you sent a "POST" request from  the "form" in php you do the same in next js 14, as you see, server actions are just API end points.&lt;/p&gt;

&lt;p&gt;let's resume why you need use server actions in next js 14:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;they get rendered in the server side&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;you could gather your logic in one place&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;you could export and use it anywhere&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;no more extra APIs&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Fetching data from external APIs&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;perform business logic that requires server execution&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;update DB data without creating separate API routes&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Implementing server actions in next js 14
&lt;/h2&gt;

&lt;p&gt;After releasing next js 14, which is a wonderful update from vercel, server actions became stable and you could start using them safely right away!&lt;br&gt;
In the past versions like next js 13, we implement API (server side routes) in another folder called "api" like this:&lt;/p&gt;

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

// apis
/app/api/hello/route.ts
/app/api/product/create/route.ts
/app/api/login/route.ts

// front end
/app/login/page.tsx
/app/dashboard/page.tsx


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

&lt;/div&gt;

&lt;p&gt;we separate the back-end from the front-end, and this could lead to creating extra endpoints or maybe an endpoint for one purpose, one page from the from end that use it.&lt;/p&gt;

&lt;p&gt;Next js becomes more PHP like, and I think that is not bad too much. the ability of contacting with database from server or client react component is useful in many cases and make the development easy.&lt;/p&gt;

&lt;p&gt;To use server actions in Next Js 14, you could use them directly inside the component, it doesn't matter if it is a client or server component the definition (of the server action function) and the utilize stays the same, it's like we do before. In the other hand, you could use them in separate file, the only condition is to remark the entire file with "use server" at the top so everything inside of this file will execute on the server:&lt;br&gt;
&lt;code&gt;/src/actions/product-actions.ts&lt;/code&gt;&lt;/p&gt;

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

"use server"

export async function createProduct(formData) {
     prisma.product.create({
     name: formData.name,
     price: formData.price
   })
  }

export async function updateProduct(formData) {
     prisma.product.create({
     name: formData.name,
     price: formData.price
   })
  }


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

&lt;/div&gt;
&lt;h3&gt;
  
  
  How server actions work
&lt;/h3&gt;

&lt;p&gt;let's jump to the work process. In a Next.js 14 app, when a user does something or met certain condition on the app, like clicking a button or filling out a form, it triggers a special async function that works on the server called "Server Action". Think of it like calling a function that works in the background.&lt;/p&gt;

&lt;p&gt;Next.js makes the development process easy for you as a next js developer. It takes the information from the user's action, like form data like we did in the example before, then serialize the request parameters, and after that next js sends it over to the server. Once there, the server will then deserialize the request parameters, understands them, and uses the specific function related to the "Server Action" you put as action of form.&lt;br&gt;
&lt;code&gt;&amp;lt;form action="create" method="POST" &amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;After Server Action has finished executing successfully, the server will prepare the information, and serialize the response, and sends it back to Next.js 14, and then Next.js will deserialize the response from server and sends it to the user's browser. When everything is ready and settled, the user's browser continues doing what it needs to do on the webpage based on the received information. It's like a smooth conversation between the user's browser and the server in a Next.js application, making things work efficiently.&lt;/p&gt;
&lt;h2&gt;
  
  
  The utilize of server actions
&lt;/h2&gt;

&lt;p&gt;in this section, we will learn what can server action do ?&lt;br&gt;
Server actions are built to take rid of the API routes that you use inside the app, if your project need an external use API, meaning another app or website will use that API, then just create the &lt;code&gt;/api/my-api/route.ts&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;However,the utilize of next js 14 server actions is very simple, it doesn't offer data fetching on the client, but it handles the other staff, database update and insert or fetching data from external APIs. Server actions are the new API endpint unless data fetching, use server component to do this &lt;code&gt;await prisma.product.findMany()&lt;/code&gt;, because server component has an access to database and that wasn't weird, just read its name &lt;strong&gt;server&lt;/strong&gt; component.&lt;/p&gt;

&lt;p&gt;To utilize server actions you'll need to define them, so to define server action on server component:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

// Server Component
export default function Page() {
  // Server Action
  async function create() {
    'use server'

    // ...
  }

  return (
    // ...
  )
}


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

&lt;/div&gt;

&lt;p&gt;and unfortunately,you can't do the same in client component, However, you could define them in separate file for example &lt;code&gt;app/actions.ts&lt;/code&gt;, just like this:&lt;/p&gt;

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

'use server'

export async function create() {
  // ...
}


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

&lt;/div&gt;

&lt;p&gt;and you could the number of server actions you want, and to use them on the client component, let say &lt;code&gt;app/ui/button.tsx&lt;/code&gt; you will need to import them and use them in a &lt;code&gt;&amp;lt;from action="create" method="POST"&amp;gt;&lt;/code&gt; like we did in the server component:&lt;/p&gt;

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

import { create } from '@/app/actions'

export function Button() {
  return (
    // ...
  )
}


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

&lt;/div&gt;

&lt;p&gt;In some cases, you may need to pass this server action to a client component as prop, yes you could do it just like this &lt;code&gt;&amp;lt;ClientComponent createProduct={create} /&amp;gt;&lt;/code&gt;, and you can use it like if you import it, think of it like this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;it's a good practice if the Page for example &lt;code&gt;src/app/page.tsx&lt;/code&gt; to be a &lt;strong&gt;server component&lt;/strong&gt; and create another folder for example &lt;code&gt;src/components/ui/&lt;/code&gt; and put all the client components here in separate folders and then import them to your Page.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;you could define a custom server action that you will just need to use in that server component (Page) and his children client components also&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;you can pass it throw props, or you could use context API from React Js&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;then start use it in the children components also&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Nice&lt;/strong&gt;, until now you've learned a lot, but we didn't finished yet :)&lt;br&gt;
I still have problem, what if I create a server action that updates products (name and description) in the file &lt;code&gt;src/app/actions.ts&lt;/code&gt; that looks like this:&lt;/p&gt;

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

'use server'

export async function update(productID, formData) {
  // ...
}


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

&lt;/div&gt;

&lt;p&gt;and for the component I have something like this:&lt;/p&gt;

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

'use client'

import { update } from './actions'

export function updateProduct({ productID }: { productID: string }) {

  return (
    &amp;lt;form action={update}&amp;gt;
      &amp;lt;input type="text" name="name" /&amp;gt;
      &amp;lt;button type="submit"&amp;gt;Update Product Name&amp;lt;/button&amp;gt;
    &amp;lt;/form&amp;gt;
  )
}


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

&lt;/div&gt;

&lt;p&gt;MMM, that's look good, but how I could get the id of the product ?&lt;br&gt;
For that situation I come to you with a trick to pass the id of the product without any problem, just do like this and pass any number of args you like, but keep it like this &lt;code&gt;.bind(null, arg1, arg2, ...)&lt;/code&gt; and you are good to go:&lt;/p&gt;

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

'use client'

import { update } from './actions'

export function updateProduct({ productID }: { productID: string }) {
  const updateProductWithId = updateProduct.bind(null, productID)

  return (
    &amp;lt;form action={updateProductWithId}&amp;gt;
      &amp;lt;input type="text" name="name" /&amp;gt;
      &amp;lt;button type="submit"&amp;gt;Update Product Name&amp;lt;/button&amp;gt;
    &amp;lt;/form&amp;gt;
  )
}


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

&lt;/div&gt;

&lt;p&gt;I think this method is the best, however, there is an alternative of it. Use hidden inputs like this &lt;code&gt;&amp;lt;input type="hidden" name="productID" value={productID} /&amp;gt;&lt;/code&gt; and make sure to put them between &lt;code&gt;&amp;lt;form&amp;gt; ...here... &amp;lt;/form&amp;gt;&lt;/code&gt;, this just for anyone that doesn't like the first method for any reason :)&lt;/p&gt;

&lt;h3&gt;
  
  
  Different use places of server actions in next js 14
&lt;/h3&gt;

&lt;p&gt;this is a too long article, but we still in progress, we didn't finished the utilize yet. maybe someone ask, is the form action the only way to use server actions in Next Js 14 ?&lt;br&gt;
Good question, the simple answer is no, they can be invoked from event handlers, useEffect, third-party libraries, and other form elements like . &lt;/p&gt;

&lt;h4&gt;
  
  
  Invoke server actions from event handler
&lt;/h4&gt;

&lt;p&gt;for example let's update a user info, using server action invoked by &lt;strong&gt;onClick&lt;/strong&gt; event of a button:&lt;/p&gt;

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

import { updateUser } from './serverAction';

function UpdateUser() {
  const handleButtonClick = async () =&amp;gt; {
    const data = { /* ... */ };
    await updateUser(data);
  };

  return (
    &amp;lt;button onClick={handleButtonClick}&amp;gt;Update User&amp;lt;/button&amp;gt;
  );
}


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

&lt;/div&gt;
&lt;h4&gt;
  
  
  Invoke server actions from UseEffect hook
&lt;/h4&gt;

&lt;p&gt;If we say &lt;strong&gt;useEffect&lt;/strong&gt;, we could imagine what may be the purpose of that server action, yes you are right, it could be two things, as I think, fetching data or tricking some thing like page view, I mean doing something when a &lt;strong&gt;state&lt;/strong&gt; changed. Let's just fetch user profiles data from database using server action inside useEffect hook:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

import { useEffect, useState } from 'react';
import { fetchUserProfile } from './serverActions';

function UserProfileComponent({ userId }) {
  const [userProfile, setUserProfile] = useState(null);

  useEffect(() =&amp;gt; {
    async function getUserProfile() {
      const profile = await fetchUserProfile(userId);
      setUserProfile(profile);
    }

    getUserProfile();
  }, [userId]);

  if (!userProfile) {
    return &amp;lt;div&amp;gt;Loading profile...&amp;lt;/div&amp;gt;;
  }

  return (
    &amp;lt;div&amp;gt;
      &amp;lt;h1&amp;gt;{userProfile.name}&amp;lt;/h1&amp;gt;
      {/* Render other profile details */}
    &amp;lt;/div&amp;gt;
  );
}


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

&lt;/div&gt;

&lt;p&gt;because I hate talking about something without demonstration, so here is the code to track page views with server actions and useEffect hook:&lt;/p&gt;

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

'use client'

import { incrementViews } from './actions'
import { useState, useEffect } from 'react'

export default function ViewCount({ initialViews }: { initialViews: number }) {
  const [views, setViews] = useState(initialViews)

  useEffect(() =&amp;gt; {
    const updateViews = async () =&amp;gt; {
      const updatedViews = await incrementViews()
      setViews(updatedViews)
    }

    updateViews()
  }, [])

  return &amp;lt;p&amp;gt;Total Views: {views}&amp;lt;/p&amp;gt;
}


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

&lt;/div&gt;

&lt;p&gt;and if didn't understand anything, just let me know in the comment :)&lt;/p&gt;

&lt;h4&gt;
  
  
  Invoke server actions from third party libarary
&lt;/h4&gt;

&lt;p&gt;let's take an example of 'react-query', its an npm package and you could install it by &lt;code&gt;npm i react-query&lt;/code&gt;.&lt;/p&gt;

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

import { useQuery } from 'react-query';
import { getLatestNews } from './serverActions';

function NewsComponent() {
  const { data: news, isLoading } = useQuery('latestNews', getLatestNews);

  if (isLoading) {
    return &amp;lt;div&amp;gt;Loading news...&amp;lt;/div&amp;gt;;
  }

  return (
    &amp;lt;div&amp;gt;
      {news.map((newsItem, index) =&amp;gt; (
        &amp;lt;div key={index}&amp;gt;
          &amp;lt;h3&amp;gt;{newsItem.title}&amp;lt;/h3&amp;gt;
          {/* render other news item details */}
        &amp;lt;/div&amp;gt;
      ))}
    &amp;lt;/div&amp;gt;
  );
}


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

&lt;/div&gt;

&lt;p&gt;As you see above, we’ve implemented the server action ‘getLatestNews()’ Inside of the hook ‘useQuery()’,  it's  quite simple.&lt;/p&gt;

&lt;p&gt;If you have any questions, feel free to leave them in the comments section. you could find me on &lt;a href="https://softwareengine.substack.com/" rel="noopener noreferrer"&gt;substack&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>nextjs</category>
      <category>react</category>
    </item>
    <item>
      <title>Mastering Next.js 14: A Comprehensive Tutorial for Web Developers</title>
      <dc:creator>Aziz Bergach</dc:creator>
      <pubDate>Sat, 23 Dec 2023 15:39:22 +0000</pubDate>
      <link>https://dev.to/azizbergach/mastering-nextjs-14-a-comprehensive-tutorial-for-web-developers-3nd3</link>
      <guid>https://dev.to/azizbergach/mastering-nextjs-14-a-comprehensive-tutorial-for-web-developers-3nd3</guid>
      <description>&lt;p&gt;Next.js 14, the most recent iteration of the acclaimed React framework, emerges as a revolutionary advancement, aiming to refine the developer encounter and augment the efficiency of web applications. Marking a milestone, this release unveils an array of innovative features and enhancements, solidifying its status as the most substantial update in the history of Next.js.&lt;br&gt;
Principally tailored for constructing server-side rendered and static web applications, Next.js 14 offers a comprehensive suite of functionalities encompassing pre-rendering, server-side rendering, static site generation, and beyond. These attributes position it as the preferred choice for developers engaged in crafting high-performance, SEO-friendly web applications.&lt;/p&gt;
&lt;h2&gt;
  
  
  Eloquent Example of a Simple Next.js Component
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function HomePage() {

  return &amp;lt;div&amp;gt;Welcome to Next.js!&amp;lt;/div&amp;gt;

}

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

&lt;/div&gt;

&lt;h2&gt;
  
  
  Revolutionary Advancement: Turbocharged Next.js Compiler
&lt;/h2&gt;

&lt;p&gt;A pivotal enhancement in Next.js 14 lies in its turbocharged compiler. The diligent efforts of the Next.js team manifest in a Rust-based compiler that is poised to achieve stabilization imminently. The commitment to accelerating local server startup and expediting code updates underscores the significance of this development.&lt;br&gt;
Empowering Developers: Forms and Mutations in Next.js 14&lt;/p&gt;

&lt;p&gt;Introducing a streamlined approach to managing forms and mutations, Next.js 14 breaks away from the conventional method where developers were compelled to manually create API routes for handling form submissions. Enter Server Actions, empowering developers to articulate functions executed securely on the server and directly callable from React components.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;async function create(formData: FormData) {

  'use server';

  const id = await createItem(formData);

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Facilitating Developer Interaction: Server Actions Unveiled
&lt;/h2&gt;

&lt;p&gt;A novel inclusion in Next.js 14, Server Actions serves to simplify the intricate process of crafting data mutations. By enabling developers to define functions executed securely on the server, directly callable from React components, this feature harmonizes with fundamental web concepts, such as forms and the FormData Web API, thus resonating with those accustomed to server-centric frameworks.&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;form action={create}&amp;gt;

  &amp;lt;input type="text" name="name" /&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;h2&gt;
  
  
  Seamless Integration: Server Actions in App Router Model
&lt;/h2&gt;

&lt;p&gt;The pervasive integration of Server Actions into the App Router model augments the capabilities offered. From revalidating cached data to redirecting routes, setting and reading cookies, and handling optimistic UI updates, this comprehensive integration streamlines development workflows and elevates the overall performance of web applications.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;revalidatePath('/path/to/data')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Teaser of Technological Advancement: Partial Prerendering in Next.js 14
&lt;/h2&gt;

&lt;p&gt;Previewing the technological frontier, Next.js 14 unveils Partial Prerendering, an optimization within the compiler targeting dynamic content, ensuring a swift initial static response. Rooted in a decade of research spanning server-side rendering (SSR), static-site generation (SSG), and incremental static revalidation (ISR), this feature beckons a paradigm shift.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export default function Page() {

  return (

    &amp;lt;main&amp;gt;

      &amp;lt;header&amp;gt;

        &amp;lt;h1&amp;gt;My Store&amp;lt;/h1&amp;gt;

        &amp;lt;Suspense fallback={&amp;lt;CartSkeleton /&amp;gt;}&amp;gt;

          &amp;lt;ShoppingCart /&amp;gt;

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

      &amp;lt;/header&amp;gt;

      &amp;lt;Banner /&amp;gt;

      &amp;lt;Suspense fallback={&amp;lt;ProductListSkeleton /&amp;gt;}&amp;gt;

        &amp;lt;Recommendations /&amp;gt;

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

      &amp;lt;NewProducts /&amp;gt;

    &amp;lt;/main&amp;gt;

  );

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Unveiling the Vision: Motivation Behind Partial Prerendering
&lt;/h2&gt;

&lt;p&gt;The rationale behind embracing Partial Prerendering lies in simplifying the existing model without burdening developers with the learning curve of new APIs. It aspires to deliver the speed and reliability of static rendering while accommodating fully dynamic, personalized responses, all without necessitating the acquisition of new knowledge.&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;Suspense fallback={&amp;lt;ProductListSkeleton /&amp;gt;}&amp;gt;

  &amp;lt;Recommendations /&amp;gt;

&amp;lt;/Suspense&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Innovation in Suspension: Partial Prerendering Anchored in React Suspense
&lt;/h2&gt;

&lt;p&gt;The underpinnings of Partial Prerendering within Next.js 14 rest upon the innovative framework of React Suspense. Its mechanism involves crafting a static shell based on Suspense boundaries, with the prerendered fallback from React Suspense paving the way for dynamic components to seamlessly integrate upon request.&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;Suspense fallback={&amp;lt;CartSkeleton /&amp;gt;}&amp;gt;

  &amp;lt;ShoppingCart /&amp;gt;

&amp;lt;/Suspense&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Operational Mechanics: How Partial Prerendering Unfolds
&lt;/h2&gt;

&lt;p&gt;The execution of Partial Prerendering entails an instantaneous serving of a static HTML shell upon request. Forging this shell from predefined boundaries and the prerendered React Suspense fallback, dynamic components, encompassing tasks like reading cookies or displaying personalized banners, are seamlessly streamed in tandem with the static shell. This innovative approach obviates the need for extraneous network round trips.&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;main&amp;gt;

  &amp;lt;header&amp;gt;

    &amp;lt;h1&amp;gt;My Store&amp;lt;/h1&amp;gt;

    &amp;lt;div class="cart-skeleton"&amp;gt;

      &amp;lt;!-- Hole --&amp;gt;

    &amp;lt;/div&amp;gt;

  &amp;lt;/header&amp;gt;

  &amp;lt;div class="banner" /&amp;gt;

  &amp;lt;div class="product-list-skeleton"&amp;gt;

    &amp;lt;!-- Hole --&amp;gt;

  &amp;lt;/div&amp;gt;

  &amp;lt;section class="new-products" /&amp;gt;

&amp;lt;/main&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Anticipating Evolution: Future Trajectory of Partial Prerendering
&lt;/h2&gt;

&lt;p&gt;As a work in active progress, the evolution of Partial Prerendering unfolds with a promise of continual updates and refinements in forthcoming minor releases of Next.js. The overarching objective is to augment the developer experience and elevate the performance benchmark of web applications.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log('Stay tuned for more updates on Partial Prerendering');
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Metadata Refinement: Unveiling Enhancements in Next.js 14
&lt;/h2&gt;

&lt;p&gt;In the realm of metadata, Next.js 14 introduces pivotal refinements to enrich the user experience. By preventing flickering caused by alterations in theme color or layout shifts stemming from viewport changes, these enhancements ensure that only select metadata options block, permitting non-blocking metadata to coexist seamlessly with a partially prerendered page.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const metadata = {

  viewport: 'width=device-width, initial-scale=1',

  generateViewport: true

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Unshackling Metadata: Decoupling Blocking and Non-Blocking Attributes
&lt;/h2&gt;

&lt;p&gt;A paradigm shift in Next.js 14 is the decoupling of blocking and non-blocking metadata. The non-blocking variant ensures that alterations in metadata do not impede a partially prerendered page, mitigating flickering and layout shifts. This departure enhances the user experience by minimizing disruptions arising from metadata modifications.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const metadata = {

  nonBlocking: true

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Emergence of Novel Options: Metadata Landscape in Next.js 14
&lt;/h2&gt;

&lt;p&gt;The introduction of novel metadata options in Next.js 14 prompts a transition from deprecated choices. Notably, viewport and generateViewport emerge as new additions, while existing metadata options remain intact. Developers are encouraged to embrace these contemporary APIs, with legacy options continuing to function until their eventual removal in a future major version.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const metadata = {

  viewport: 'width=device-width, initial-scale=1'

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Culmination: Next.js 14 Unveils a Technological Panorama
&lt;/h2&gt;

&lt;p&gt;In summation, the advent of Next.js 14 heralds a plethora of features and refinements that redefine the developer landscape and amplify the performance trajectory of web applications. From the prowess of Server Actions to the foresight of Partial Prerendering and the nuanced handling of metadata, Next.js 14 stands as an indispensable asset for front-end web developers.&lt;/p&gt;

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