<?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: Ankita Kulkarni</title>
    <description>The latest articles on DEV Community by Ankita Kulkarni (@kulkarniankita9).</description>
    <link>https://dev.to/kulkarniankita9</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%2F79354%2F05158841-c512-4a2f-ad9b-5fd3ac6ec108.png</url>
      <title>DEV Community: Ankita Kulkarni</title>
      <link>https://dev.to/kulkarniankita9</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kulkarniankita9"/>
    <language>en</language>
    <item>
      <title>Mistakes you should avoid as a Senior Engineer</title>
      <dc:creator>Ankita Kulkarni</dc:creator>
      <pubDate>Wed, 22 Mar 2023 16:59:20 +0000</pubDate>
      <link>https://dev.to/kulkarniankita9/dodging-the-pitfalls-of-engineering-leadership-tips-for-the-freshly-minted-managers-9ej</link>
      <guid>https://dev.to/kulkarniankita9/dodging-the-pitfalls-of-engineering-leadership-tips-for-the-freshly-minted-managers-9ej</guid>
      <description>&lt;p&gt;Congrats, you have successfully transitioned from a Senior Developer to a Engineering Leader. But you have got to watch out for a few mistakes that every Senior Developer makes.&lt;/p&gt;

&lt;p&gt;As a newer engineering leader or manager, it can take time to judge what success should look like and what things you can avoid.&lt;/p&gt;

&lt;p&gt;Becoming a new engineering manager is an &lt;strong&gt;exciting and challenging step in any engineer’s career&lt;/strong&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;However, with great power comes great responsibility, and the stakes are high.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;As a new engineering manager, there are countless ways to succeed, but unfortunately, there are also plenty of ways to fail. This blog post will discuss some of the most common ways to fail as a new engineering manager and how to avoid them.&lt;/p&gt;

&lt;p&gt;Let’s review a few mistakes that newer engineering leaders make,&lt;/p&gt;

&lt;h3&gt;
  
  
  Don’t promote themselves 🪜
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rYC8ZeM3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://cdn-images-1.medium.com/max/480/1%2AbQnfrwyN4_cXuhp8OS5FsA.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rYC8ZeM3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://cdn-images-1.medium.com/max/480/1%2AbQnfrwyN4_cXuhp8OS5FsA.gif" alt="" width="480" height="270"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;promotion&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;It’s essential to promote yourself first mentally and start taking on the responsibilities of this new role.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If you continue to act like an IC, you will burn yourself out and won’t deliver results.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You got this job because you deserved it, but it’s important to keep learning to get better at this new job.&lt;/p&gt;

&lt;h3&gt;
  
  
  Don’t delegate 👉
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;This is a common mistake 😅.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It would be best to delegate as much as possible, as you will only have time to complete some tasks. You can take on the easy tasks and let your team handle the rest. Delegating is important and should not be skipped.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Do you have all the time in the world to do the job of a manager and maker? then you should assess again as I’m sorry to say but you won’t.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Your job is to enable others and get the tasks done through them.&lt;/p&gt;

&lt;h3&gt;
  
  
  Will push code like an IC (Individual Contributor) 👩🏽‍💻
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SX4SYAwv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/500/1%2AmVaRdrobKkKkIKjE-OarSQ.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SX4SYAwv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/500/1%2AmVaRdrobKkKkIKjE-OarSQ.jpeg" alt="" width="500" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You probably were very good at being an IC, hence why you got promoted. You knew what it takes to be a good IC, but now, as a leader, your priorities and focus should shift.&lt;/p&gt;

&lt;p&gt;You won’t be able to ship code like an IC, but that is not to say you shouldn’t. You can assess your priorities and allocate time accordingly ⏲.&lt;/p&gt;

&lt;h3&gt;
  
  
  Wait to give feedback until performance reviews 👀
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NPAdZOV4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/725/1%2AFNBk3bcBlygu0kINLLIMmg.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NPAdZOV4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/725/1%2AFNBk3bcBlygu0kINLLIMmg.jpeg" alt="" width="725" height="426"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Feedback should be given frequently. Your job is to make your team the best it can be. Feedback will allow you to do this. Don’t wait until performance reviews for this.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Nothing should come off as a surprise during performance reviews.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Don’t set clear expectations
&lt;/h3&gt;

&lt;p&gt;One of the most common mistakes new engineering managers make is failing to set clear expectations. It’s &lt;strong&gt;easy to assume&lt;/strong&gt; that everyone knows what is expected of them, but this is rarely true.&lt;/p&gt;

&lt;p&gt;As an engineering manager, you must clearly and regularly communicate your expectations. This includes everything from project deadlines to team goals to individual performance expectations.&lt;/p&gt;

&lt;p&gt;Without clear expectations, your &lt;strong&gt;team will struggle&lt;/strong&gt; to meet your standards, leaving you frustrated and disappointed.&lt;/p&gt;

&lt;h3&gt;
  
  
  Don’t partner with Product, Design, or Data Science 🤝
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--p7O7NdX4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://cdn-images-1.medium.com/max/498/1%2As3qYdLKb9bOSdHl_lrWtbg.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--p7O7NdX4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://cdn-images-1.medium.com/max/498/1%2As3qYdLKb9bOSdHl_lrWtbg.gif" alt="" width="498" height="498"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Identify who you should collaborate with and partner with them to make the decisions. Your expertise is in one area, and working closely with your squad will allow you to make the best decisions for your team and product.&lt;/p&gt;

&lt;h3&gt;
  
  
  Leadership is a never-ending journey 🚗
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7eCgUkpV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2AZtOWV3J7kIj957rIYpQR5Q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7eCgUkpV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2AZtOWV3J7kIj957rIYpQR5Q.png" alt="" width="800" height="600"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Leaders create more leaders&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;One day you will think you know everything, but you may feel the opposite the next, so don’t be too hard on yourself and keep learning. Lean on your friends and family, and take care of yourself 💖.&lt;/p&gt;

&lt;p&gt;Remember, being a successful engineering manager is &lt;strong&gt;not just about technical skills; it’s also about leadership&lt;/strong&gt; , communication, and emotional intelligence. Good luck on your journey! 💛&lt;/p&gt;

&lt;p&gt;If you plan to use any of these techniques or have more to share, please comment below and would love to know your thoughts! 💬&lt;/p&gt;

&lt;h3&gt;
  
  
  FREE Engineering Manager’s Mind Map ✨
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--P-X1qSDG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5r3ahfkb57aq1hezcjhq.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--P-X1qSDG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5r3ahfkb57aq1hezcjhq.gif" alt="Mind map" width="800" height="505"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Download a FREE Visual representation for Navigating the Engineering Manager’s Mind&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;‣ Covers key areas, concepts, and tasks that an Engineering manager needs to be aware of&lt;br&gt;&lt;br&gt;
‣ Gives you a solid foundation to start building your intuition.&lt;/p&gt;

&lt;p&gt;If you are interested in a FREE mind map, &lt;a href="https://bit.ly/3ZaxnBV"&gt;you can get it for free here&lt;/a&gt;&lt;/p&gt;

</description>
      <category>developer</category>
      <category>leadership</category>
      <category>management</category>
      <category>engineeringmangement</category>
    </item>
    <item>
      <title>6 Common Mistakes New Engineering Leaders make</title>
      <dc:creator>Ankita Kulkarni</dc:creator>
      <pubDate>Tue, 07 Mar 2023 05:18:18 +0000</pubDate>
      <link>https://dev.to/kulkarniankita9/the-6-common-mistakes-new-engineering-leaders-make-5agi</link>
      <guid>https://dev.to/kulkarniankita9/the-6-common-mistakes-new-engineering-leaders-make-5agi</guid>
      <description>&lt;p&gt;As a newer engineering leader or manager, it can take time to judge what success should look like and what things you can avoid. Let's review a few mistakes that newer engineering leaders make,&lt;/p&gt;

&lt;h2&gt;
  
  
  Don't promote themselves 🪜
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uXfKeMMb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f2mbfuirpfm8l3q41ixi.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uXfKeMMb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f2mbfuirpfm8l3q41ixi.gif" alt="Promotion" width="480" height="270"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It's essential to promote yourself first mentally and start taking on the responsibilities of this new role. If you continue to act like an IC, you will burn yourself out and won't deliver results. You got this job because you deserved it, but it's important to keep learning to get better at this new job.&lt;/p&gt;

&lt;h2&gt;
  
  
  Don't delegate 👉
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/VCKP6nyNALhGoVEonF/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/VCKP6nyNALhGoVEonF/giphy.gif" alt="leadership" width="480" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is a common mistake. It would be best to delegate as much as possible, as you will only have time to complete some tasks. You can take on the easy tasks and let your team handle the rest. Delegating is important and should not be skipped.&lt;/p&gt;

&lt;h2&gt;
  
  
  Will push code like an IC (Individual Contributor) 👩🏽‍💻
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WYVWvId8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jhivqrzd63cl8pv0xnwn.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WYVWvId8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jhivqrzd63cl8pv0xnwn.jpg" alt="Code less" width="500" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You probably were very good at being an IC, hence why you got promoted. You knew what it takes to be a good IC, but now, as a leader, your priorities and focus should shift. You won't be able to ship code like an IC, but that is not to say you shouldn't. You can assess your priorities and allocate time accordingly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wait to give feedback until performance reviews 👀
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jo20vsOu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q1l7pfg7tclmlwbusnsc.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jo20vsOu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q1l7pfg7tclmlwbusnsc.jpg" alt="performance reviews" width="725" height="426"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Feedback should be given frequently. Your job is to make your team the best it can be. Feedback will allow you to do this. Don't wait until performance reviews for this.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Nothing should come off as a surprise during performance reviews.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Don't partner with Product, Design, or Data Science 🤝
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kXML6NW6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rx0g3lpoelodfllclgs6.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kXML6NW6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rx0g3lpoelodfllclgs6.gif" alt="Pretend to be nice" width="498" height="498"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Identify who you should collaborate with and partner with them to make the decisions. Your expertise is in one area, and working closely with your squad will allow you to make the best decisions for your team and product.&lt;/p&gt;

&lt;h3&gt;
  
  
  Leadership is a never-ending journey 🚗
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zcNido2z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nlebpva3q16ku8eai3sg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zcNido2z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nlebpva3q16ku8eai3sg.png" alt="Leaders create more leaders" width="880" height="660"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;One day you will think you know everything, but you may feel the opposite the next, so don't be too hard on yourself and keep learning. Lean on your friends and family, and take care of yourself 💖.&lt;/p&gt;

&lt;p&gt;If you plan to use any of these techniques or have more to share, please comment below and would love to know your thoughts! 💬&lt;/p&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;FREE Engineering Manager's Mind Map ✨&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4WmzbMiD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7ds2y4b34dtuej15fq9x.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4WmzbMiD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7ds2y4b34dtuej15fq9x.gif" alt="mind map visual" width="880" height="556"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Download a FREE Visual representation for Navigating the Engineering Manager's Mind&lt;/p&gt;

&lt;p&gt;‣ Covers key areas, concepts, and tasks that an Engineering manager needs to be aware of&lt;br&gt;
‣ Gives you a solid foundation to start building your intuition.&lt;/p&gt;

&lt;p&gt;If you are interested in a FREE mindmap, &lt;a href="https://engineeringleadership.kulkarniankita.com/engineering-managers-mind-map"&gt;you can get it for free here&lt;/a&gt;&lt;/p&gt;

</description>
      <category>career</category>
      <category>management</category>
      <category>leadership</category>
    </item>
    <item>
      <title>Learn React Server Components in 7 easy to follow steps</title>
      <dc:creator>Ankita Kulkarni</dc:creator>
      <pubDate>Thu, 02 Mar 2023 15:51:56 +0000</pubDate>
      <link>https://dev.to/kulkarniankita9/learn-react-server-components-in-7-easy-to-follow-steps-52mb</link>
      <guid>https://dev.to/kulkarniankita9/learn-react-server-components-in-7-easy-to-follow-steps-52mb</guid>
      <description>&lt;h2&gt;
  
  
  Learn React Server Components step-by-step
&lt;/h2&gt;

&lt;p&gt;I've created a FREE course on teaching you everything you need to know about React Server components in 7 easy to follow steps visually. If you are interested, sign up here:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://bit.ly/3y5FjZW" rel="noopener noreferrer"&gt;React Server Components Course&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We'll build an app and cover concepts such as,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What are Server and Client Components&lt;/li&gt;
&lt;li&gt;How they are different from each other&lt;/li&gt;
&lt;li&gt;The difference between Server-side Rendering and Server Components&lt;/li&gt;
&lt;li&gt;How to create shared components?&lt;/li&gt;
&lt;li&gt;How to pass data from one component to the other?&lt;/li&gt;
&lt;li&gt;Advanced: Best Practices&lt;/li&gt;
&lt;li&gt;and more...&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You'll build an app from scratch + take quizzes along the way so you can test your knowledge 🚀&lt;/p&gt;

&lt;p&gt;If you are interested, check it out!&lt;/p&gt;

</description>
      <category>vibecoding</category>
    </item>
    <item>
      <title>Create a culture of Psychological Safety in Engineering</title>
      <dc:creator>Ankita Kulkarni</dc:creator>
      <pubDate>Tue, 01 Nov 2022 17:17:39 +0000</pubDate>
      <link>https://dev.to/kulkarniankita9/create-a-culture-of-psychological-safety-in-engineering-3ead</link>
      <guid>https://dev.to/kulkarniankita9/create-a-culture-of-psychological-safety-in-engineering-3ead</guid>
      <description>&lt;p&gt;Have you ever felt psychologically unsafe at work? I hope you say no, but I know I might be wrong here.&lt;/p&gt;

&lt;p&gt;But first, let's understand what Psychological safety is and learn some strategies to build Psychological safety in your team and organization.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Psychological safety? 🤔
&lt;/h2&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%2Fmedia0.giphy.com%2Fmedia%2FgZ52gto59R88Gtm8C8%2Fgiphy.gif%3Fcid%3Decf05e4769liib17zkmkmg15oa6yt7nal580an6fco5pqlsi%26rid%3Dgiphy.gif%26ct%3Dg" 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%2Fmedia0.giphy.com%2Fmedia%2FgZ52gto59R88Gtm8C8%2Fgiphy.gif%3Fcid%3Decf05e4769liib17zkmkmg15oa6yt7nal580an6fco5pqlsi%26rid%3Dgiphy.gif%26ct%3Dg" alt="team work"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;br&gt;
  It is a belief that people are allowed to make mistakes, and it's okay to make them, and they won't be punished for it.&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What is not Psychological safety? 🪴
&lt;/h2&gt;

&lt;p&gt;Here are a few signs when teams are not feeling safe:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;When teams disagree a lot without hearing each other's opinions&lt;/li&gt;
&lt;li&gt;When decisions are being made in secret&lt;/li&gt;
&lt;li&gt;When teams are hesitant to share their ideas and are protecting it&lt;/li&gt;
&lt;li&gt;When teams can't laugh together or have fun in meetings or while working together&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Storytime: 📙
&lt;/h3&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%2Fstatic.wikia.nocookie.net%2Fbarney%2Fimages%2F5%2F5f%2FStorytimewithbarneyin2014.jpg%2Frevision%2Flatest%3Fcb%3D20220103153326%3D100x20" 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%2Fstatic.wikia.nocookie.net%2Fbarney%2Fimages%2F5%2F5f%2FStorytimewithbarneyin2014.jpg%2Frevision%2Flatest%3Fcb%3D20220103153326%3D100x20" alt="story time"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When I was starting as an entry-level developer, my manager asked me only to ask good questions, not bad ones. Before that, I believed every question was good as it showcases where you lack understanding and how we can bridge it. But that wasn't the case here.&lt;/p&gt;

&lt;p&gt;Throughout my work term, I held off from asking questions as I didn't know what a good question meant to him. It made the next month or so very unsafe for me. I would spend hours contemplating whether it was a good question, which was unhealthy for me and the org.&lt;/p&gt;

&lt;p&gt;I always look back to this incident as it shaped me into the leader I am today.&lt;/p&gt;

&lt;p&gt;I encourage others to ask questions and think every question is good. If folks ask something they weren't sure of, I know it would save them minutes or hours of work trying to find the answer to that question. But, on the other hand, this would make them less productive.&lt;/p&gt;

&lt;p&gt;In addition, instead of giving them direct answers, I ask them questions to help them think, creating a good learning environment.&lt;/p&gt;

&lt;h2&gt;
  
  
  Characteristics of a Psychologically-safe team 💜
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;&lt;br&gt;
A Psychologically safe team would empower others and build great products.&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Here are some signs your team is not feeling safe:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;They don't speak up and aren't allowed to make mistakes&lt;/li&gt;
&lt;li&gt;They get defensive when you make a statement or ask questions&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Psychological safety in practice 👇
&lt;/h2&gt;

&lt;p&gt;Discussing this topic with examples and how it would work in practice is easier. Let's take a look,&lt;/p&gt;

&lt;h3&gt;
  
  
  Here is an ideal team:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;You don't feel afraid to make mistakes&lt;/li&gt;
&lt;li&gt;You feel comfortable taking risks and picking up complex tasks&lt;/li&gt;
&lt;li&gt;Your opinions are accounted for, and you feel a valued member of the team&lt;/li&gt;
&lt;li&gt;You are appreciated for being your authentic self&lt;/li&gt;
&lt;li&gt;You think your ideas are appreciated, and you are given credit&lt;/li&gt;
&lt;li&gt;You have fun and aren't afraid to share your ideas&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Always keep this checklist ✅ in your mind and review it consistently if this is how you feel.&lt;/p&gt;

&lt;h3&gt;
  
  
  Ask Questions and get curious ❓
&lt;/h3&gt;

&lt;p&gt;We need to ask questions instead of making statements. Get curious about what's going on without jumping to conclusions. When you ask questions to your team, you should bring everyone in, and they will start feeling comfortable participating in the discussion.&lt;/p&gt;

&lt;p&gt;You can pick someone, ask them their thoughts, and add a disclaimer that you want folks to share, and it won't bother you if their opinion differs from yours. This will help folks get involved and share their thoughts.&lt;/p&gt;

&lt;h3&gt;
  
  
  Create open space for making mistakes 👐
&lt;/h3&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%2Fmedia0.giphy.com%2Fmedia%2FWxIXZWZ5TqiiXEO35S%2Fgiphy.gif%3Fcid%3Decf05e47qatfu9u5fjopj91763unexlyjc47ujalss6nn20h%26rid%3Dgiphy.gif%26ct%3Dg" 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%2Fmedia0.giphy.com%2Fmedia%2FWxIXZWZ5TqiiXEO35S%2Fgiphy.gif%3Fcid%3Decf05e47qatfu9u5fjopj91763unexlyjc47ujalss6nn20h%26rid%3Dgiphy.gif%26ct%3Dg" alt="it's okay to make mistakes"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The best way to make it okay for anyone to make mistakes is when you admit you also make mistakes or, better, when you do make mistakes make it a learning experience and share what you can do.&lt;/p&gt;

&lt;p&gt;May you have heard of a post-mortem? Create a learning experience post-mortem where you share what happened, what you did to fix it, and what you can do next. Again, don't mention names but involve the entire team in the meeting. The goal with documentation is not to call out people but figure out what you can do next as a team.&lt;/p&gt;

&lt;p&gt;When something like this happens, it's clear there is a gap in our processes, and we can from it, so let's focus on learning ✍️. We don't point fingers as part of our culture.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;br&gt;
For example, a person on one of my teams was on-call and wasn't receiving any pages. However, they had been on-call before, where they got paged successfully. So, what could go wrong, right? Since they never got paged, their manager (reporting to me) got paged. Luckily, he got on-call and resolved it. Hence having primary and secondary on-call shifts help a ton.&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Post-mortem learning hour 🕰
&lt;/h4&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%2Fmedia4.giphy.com%2Fmedia%2F24FVIYV226vScTh3Sn%2Fgiphy.gif%3Fcid%3Decf05e47f7wiaswn8gs1e0czzfonkg3bkyk2gx4ezp9z72p1%26rid%3Dgiphy.gif%26ct%3Dg" 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%2Fmedia4.giphy.com%2Fmedia%2F24FVIYV226vScTh3Sn%2Fgiphy.gif%3Fcid%3Decf05e47f7wiaswn8gs1e0czzfonkg3bkyk2gx4ezp9z72p1%26rid%3Dgiphy.gif%26ct%3Dg" alt="Learning hour"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I asked their engineering lead (reporting to me) to book a post-mortem learning hour, and we only discussed how to make sure team members were well set up, what the problem was if the alert was too sensitive, how we fixed it and documented it all.&lt;/p&gt;

&lt;h3&gt;
  
  
  Allow room to present ideas without facing the fear of being rejected or failure 💡
&lt;/h3&gt;

&lt;p&gt;Does your team(s) feel open to sharing ideas with you or in any of the meetings? What does their behaviour tell you? When you kick off a meeting, ask discussion-provoking questions. Your job after the questions is to sit back and relax and let the team chime in. They should feel open about sharing their ideas.&lt;/p&gt;

&lt;p&gt;Commend good ideas but also not-so-good ideas. Don't shut it down 🙅🏽‍♀️ even if the idea isn't good. Instead, listen and ask questions to dig deeper into areas.&lt;/p&gt;

&lt;h3&gt;
  
  
  Ask their opinion before presenting yours 🎁
&lt;/h3&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%2Fmedia4.giphy.com%2Fmedia%2FlqvOP6ZqZLxwxu1ppD%2Fgiphy.gif%3Fcid%3Decf05e47dotacrnw2o5qq66qzkm4dyhwafbdrsl1flozi493%26rid%3Dgiphy.gif%26ct%3Dg" 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%2Fmedia4.giphy.com%2Fmedia%2FlqvOP6ZqZLxwxu1ppD%2Fgiphy.gif%3Fcid%3Decf05e47dotacrnw2o5qq66qzkm4dyhwafbdrsl1flozi493%26rid%3Dgiphy.gif%26ct%3Dg" alt="opinion"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If it's okay with your team, you can ask specific folks for more context and their opinion. For example, ask someone entry-level or new to your team or work on their confidence to speak up more. Regardless, ask your team for their opinions. &lt;/p&gt;

&lt;p&gt;If someone I know holds an opinion but isn't sharing it, it might be a good idea to invite them into the conversation. You need to read the room, but doing this will also help encourage others to share without fear.&lt;/p&gt;

&lt;h3&gt;
  
  
  Avoid passive-aggressive comments 💬
&lt;/h3&gt;

&lt;p&gt;Whether you know it or not, your Psychological safety skill is to test when shit hits the fan. You have time to think when things are good, but when they are not, you don't. This is when you need to be careful and avoid any passive-aggressive comments. Emotions would run high during this time, not just for you but for your entire team, so make sure to keep your emotions in check. ✔️&lt;/p&gt;

&lt;p&gt;I tend to write down how I'm feeling and journal my thoughts 📓, so when I presented myself in front of the team or others in the org, I was calm and collected. It doesn't need to be a fancy bullet journal but could be as simple as&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;br&gt;
I'm not feeling good right now. I committed to this timeline, and it's time to discuss this with others.&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  'I don't know' is a complete sentence ✅
&lt;/h2&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%2Fmedia3.giphy.com%2Fmedia%2Fce0TcIf9fHKPbU62gq%2Fgiphy.gif%3Fcid%3Decf05e474l89i7d6bda7gdm04y5ri3zob7gw3736pqn865qt%26rid%3Dgiphy.gif%26ct%3Dg" 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%2Fmedia3.giphy.com%2Fmedia%2Fce0TcIf9fHKPbU62gq%2Fgiphy.gif%3Fcid%3Decf05e474l89i7d6bda7gdm04y5ri3zob7gw3736pqn865qt%26rid%3Dgiphy.gif%26ct%3Dg" alt="I don't know"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;'I don't know' are a powerful set of words. You can share what you don't know when you don't know something. The senior you get, you won't know all the details in your team, so get comfortable in saying, 'i don't know. You can say,&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;br&gt;
I believe it's &amp;lt;&amp;gt;, but I don't know at this moment &amp;lt;the thing&amp;gt;, but I'll get back to you towards the end of the day.&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Only commit to a timeline if you can get back to me, but communication is critical here.&lt;/p&gt;

&lt;p&gt;If you don't know something, admit it 🙌. We all have been there where we don't have the full context of the scenario or are leading through others, so it's normal not to know it all.&lt;/p&gt;

&lt;h2&gt;
  
  
  Be kind and transparent 💕
&lt;/h2&gt;

&lt;p&gt;We need to be kind to everyone around us as these are our co-workers, and we care about them. But they are humans, and their feelings can get hurt.&lt;/p&gt;

&lt;p&gt;Be transparent about what's happening so your team or stakeholders know the situation. But on the other hand, you can shield the team by being transparent and only sharing what they need to know. I know it's a tricky balance, but with practice, you will get there, I promise.&lt;/p&gt;

&lt;p&gt;✔️ For example,&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;br&gt;
Going through headcount reduction was one of the most challenging things I went through. My teams could see that we stopped hiring and are not interviewing anymore, so nothing is hidden about this.&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;What would you do in this case? How would you handle it? If you share, everything is fine, and do not worry about it. You are giving them more reasons to worry.&lt;/p&gt;

&lt;p&gt;Here is what I did instead, which I found was received well,&lt;/p&gt;

&lt;p&gt;`&lt;br&gt;
We are shifting our focus internally and are pausing hiring temporarily to ensure we are sustaining the growth of the org. We have grown a lot, and it's time to pause and reflect.&lt;/p&gt;

&lt;p&gt;Do you all have any ideas for how we can focus on our internal growth? are there any improvements we can make? You are shifting their perspective to what's important but also sharing what's going on. Transparency builds trust, which builds Psychological safety.&lt;br&gt;
`&lt;/p&gt;

&lt;p&gt;This allowed them to chime in, share their thoughts and have a forward-thinking approach. I wrote more on how to lead during uncertain times here &lt;a href="https://dev.to/leadership/6-ways-you-should-show-up-as-a-leader"&gt;you can check it out here&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Foster a culture of collaboration and curiosity during code reviews 👩🏽‍💻
&lt;/h2&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%2Fmedia1.giphy.com%2Fmedia%2FVhWVAa7rUtT3xKX6Cd%2Fgiphy.gif%3Fcid%3D790b76116000f119d268321ff0215b217131b24448418aff%26rid%3Dgiphy.gif%26ct%3Dg" 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%2Fmedia1.giphy.com%2Fmedia%2FVhWVAa7rUtT3xKX6Cd%2Fgiphy.gif%3Fcid%3D790b76116000f119d268321ff0215b217131b24448418aff%26rid%3Dgiphy.gif%26ct%3Dg" alt="Code review"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Code reviews add to the stress of an engineer's day to day 👩🏽‍💻. Think about it, when you write code, you want to make sure you can ask questions to your team and share your ideas on architecture decisions, refactoring significant changes etc.&lt;/p&gt;

&lt;p&gt;It will be stressful for engineers 😅 if they don't feel like they can make mistakes. So be mindful of your tone and over-communicate your thoughts on approaching this.&lt;/p&gt;

&lt;p&gt;In addition, I wrote a blog post on &lt;a href="https://kulkarniankita.com/career/humanizing-code-reviews" rel="noopener noreferrer"&gt;The Art of Humanizing Code Reviews&lt;/a&gt; so check that out to learn more.&lt;/p&gt;

&lt;h2&gt;
  
  
  Provide feedback in a constructive way 💪
&lt;/h2&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%2Fmedia1.giphy.com%2Fmedia%2FdaOrHfoE9sxowLnuRJ%2Fgiphy.gif%3Fcid%3Decf05e47x01o620qew93kj6dmmrxynkveocwho75bw9ux7n6%26rid%3Dgiphy.gif%26ct%3Dg" 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%2Fmedia1.giphy.com%2Fmedia%2FdaOrHfoE9sxowLnuRJ%2Fgiphy.gif%3Fcid%3Decf05e47x01o620qew93kj6dmmrxynkveocwho75bw9ux7n6%26rid%3Dgiphy.gif%26ct%3Dg" alt="Constructive feedback"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Feedback as a leader or developer is your #1 asset to any team or organization you join. If you can give constructively, your team will grow, but if you don't, it will create fear and uncertainty. You want your engineers to grow, and effective feedback is key to their growth.&lt;/p&gt;

&lt;p&gt;This helps a ton with building psychological safety, as the engineers on the team will feel good working on their growth with feedback. 💯&lt;/p&gt;

&lt;h2&gt;
  
  
  Remote teams: Run inclusive meetings 🚀
&lt;/h2&gt;

&lt;p&gt;Make sure everyone knows the meeting agenda beforehand. Often, it's all about learning how to run meetings, who should be involved, what they should know beforehand and if they are required to be active.&lt;/p&gt;

&lt;p&gt;Let them know if they will be presenting or if questions will be asked to them, set expectations, ask if they feel comfortable sharing, and be inclusive first.&lt;/p&gt;

&lt;p&gt;Don't exclude people unless they know why. Always make it known that anyone can join any meetings they like, but you are doing your best to protect their time, so if you miss someone, as after all, you are a human. Just apologize and course correct.&lt;/p&gt;

&lt;p&gt;✔️ Meet them after the meeting, share context and ask for their thoughts and bring them in moving forward.&lt;/p&gt;

&lt;h2&gt;
  
  
  Lead by example 🧐
&lt;/h2&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%2Fmedia4.giphy.com%2Fmedia%2FJkLcsQMmNqKmnw7aRU%2Fgiphy.gif%3Fcid%3Decf05e47fthesp8xg90um4hou3yrrzpm31gui1tjqv614er8%26rid%3Dgiphy.gif%26ct%3Dg" 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%2Fmedia4.giphy.com%2Fmedia%2FJkLcsQMmNqKmnw7aRU%2Fgiphy.gif%3Fcid%3Decf05e47fthesp8xg90um4hou3yrrzpm31gui1tjqv614er8%26rid%3Dgiphy.gif%26ct%3Dg" alt="Lead by example"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Believe it or not, you are dictating behaviours as a lead. For example, if you take an hour-long break at the park, your team will also think it's okay to do the same. So, learn to walk the talk. Model behaviour that you would like others to follow.&lt;/p&gt;

&lt;p&gt;If you want to take a break for mental-health reasons, do it 🚶🏽‍♀️ and let the team know if you are comfortable. They will also think it's okay to do so.&lt;/p&gt;

&lt;h2&gt;
  
  
  Set vision and direction for your team 👁
&lt;/h2&gt;

&lt;p&gt;Nothing is more frustrating than heading in a direction where we don't know where we are going. You need to know your organization's vision and need to set the vision for your team. This also helps build Psychological safety as your team knows you got this 💪 and they will follow you where you go.&lt;/p&gt;

&lt;p&gt;Without this, it's hard to know, and there is uncertainty which creates chaos and slowly, individuals will lack focus and drive to deliver.&lt;/p&gt;

&lt;h2&gt;
  
  
  Resources 🔗
&lt;/h2&gt;

&lt;p&gt;Here are a few resources to check out:&lt;/p&gt;

&lt;p&gt;Great questions to ask that are open-ended for &lt;a href="https://www.linkedin.com/feed/update/urn:li:activity:6864161699084214272/" rel="noopener noreferrer"&gt;creating an inclusive culture&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That's a wrap. What would you like to add to this? How are you creating a culture of psychological safety in your team and org? Comment below 💬&lt;/p&gt;

&lt;p&gt;--&lt;/p&gt;

&lt;h2&gt;
  
  
  Frontend Snacks 🍿
&lt;/h2&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%2Fwww.frontendsnacks.dev%2Fimages%2Fog-default.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%2Fwww.frontendsnacks.dev%2Fimages%2Fog-default.png" alt="Newsletter"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;↪️ &lt;a href="https://www.frontendsnacks.dev/utm_source=devto&amp;amp;utm_medium=blog" rel="noopener noreferrer"&gt;Sign me up&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A Frontend Newsletter you'll love &amp;amp; get FREE weekly Snacks!&lt;/p&gt;

&lt;p&gt;🎨 A code snippet to teach complex topics visually&lt;br&gt;
✨ Latest Frontend gossip/news&lt;br&gt;
🧡 A snack for thought&lt;/p&gt;

&lt;p&gt;All this to help you grow as a developer!&lt;/p&gt;

</description>
      <category>career</category>
      <category>softwaredevelopment</category>
      <category>webdev</category>
      <category>leadership</category>
    </item>
    <item>
      <title>Deep dive on SEO with Next.js Head</title>
      <dc:creator>Ankita Kulkarni</dc:creator>
      <pubDate>Wed, 07 Sep 2022 14:34:14 +0000</pubDate>
      <link>https://dev.to/kulkarniankita9/seo-deep-dive-in-nextjs-2f8g</link>
      <guid>https://dev.to/kulkarniankita9/seo-deep-dive-in-nextjs-2f8g</guid>
      <description>&lt;p&gt;In this blog post, we will cover what SEO is, what are some of the best practices with SEO, provide you with real world SEO code examples in Next.js, screenshots of how your site will look like in a popular search engine like Google and you will take away some SEO tools with you towards the end of this article.&lt;/p&gt;

&lt;p&gt;A lot of these techniques can be applied in react apps or for SEO in general but the examples here would be more focused on Next.js. 🚀&lt;/p&gt;

&lt;h2&gt;
  
  
  What is SEO? 🤠
&lt;/h2&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%2Fv4sh4nue7jb8pgeh6izb.gif" 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%2Fv4sh4nue7jb8pgeh6izb.gif" alt="sponge bob describing seo"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;SEO is search engine optimization. Just like you and I are communicating in English, SEO using HTML is a language used between a bot and your site 💜. The techniques used in SEO lets the bot know what your site consists of.&lt;/p&gt;

&lt;p&gt;It is our responsibility to make it as easy as possible for the bot to read our content. &lt;/p&gt;

&lt;p&gt;I recently revamped my entire site: &lt;a href="https://kulkarniankita.com/" rel="noopener noreferrer"&gt;https://kulkarniankita.com/&lt;/a&gt; so we will be using that as an example.&lt;/p&gt;

&lt;p&gt;Before we dive in, let's first understand how Mr. Bot works first,&lt;/p&gt;

&lt;h3&gt;
  
  
  Who is Mr.Bot? 🤖
&lt;/h3&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%2Fczdbqq5ugjysmf3ngk97.gif" 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%2Fczdbqq5ugjysmf3ngk97.gif" alt="Mr.Bot"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We will be calling the bot that crawls our sites and search engines use Mr.bot throughout this post.&lt;/p&gt;

&lt;p&gt;Mr.Bot performs 3 operations 🥉:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Crawling 🐊&lt;br&gt;
it will discover pages and try to find them. If a website has referenced a URL to a blog post i.e. linking, then that is one way of discovering it. If your home page links to other internal pages, that is another way of crawling all the pages on your website.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Indexing 🔎&lt;br&gt;
Once discovered, Mr.bot will try to understand what's on the page and this is why we need to speak the same language that the browser understands. We will talk about those techniques in a bit.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Ranking 🥇&lt;br&gt;
Finally, it now has a handful of discovered pages and tried to understand what's on them. Now, it ranks and stores those based on that in a database. This ranking also varies based on your location, language, device etc.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When we try to search 🔎 for a term on a search engine like Google, it will look into the database where Mr. Bot 🤖 has stored all the pages and return the ones that are ranked higher. Mr. Bot does do a lot more but the above is a simplified version.&lt;/p&gt;

&lt;p&gt;Now that we understand a bit more about, let's review some of the techniques we can implement to rank higher on Google:&lt;/p&gt;

&lt;h2&gt;
  
  
  Meta tags
&lt;/h2&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%2Fvbvyq1owxmgu8c5ub10q.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%2Fvbvyq1owxmgu8c5ub10q.png" alt="Ankita's newsletter on google"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The above is the title and description of my page kulkarniankita.com/newsletter. You might be wondering how I show up on Google on the first page on top.🤔&lt;/p&gt;

&lt;p&gt;Well, I hope I get this popular in the future 🥰 but for now, I’m using a tool called &lt;a href="https://chrome.google.com/webstore/detail/seo-minion/giihipjfimkajhlcilipnjeohabimjhi?hl=en" rel="noopener noreferrer"&gt;SEO minion&lt;/a&gt; 🔗 that shows you how your site or a page will look like on Google. You can use this to test and make sure everything is okay.💯&lt;/p&gt;

&lt;p&gt;📣 Call to Action: One thing I need to work on is reducing my description length as you can see the ellipsis which makes it difficult for my reader to know everything I have to say. The optimal length is between 50 to 160 characters and mine is 177 characters which is no beuno.&lt;/p&gt;

&lt;p&gt;Next.js provides a &lt;a href="https://nextjs.org/docs/api-reference/next/head" rel="noopener noreferrer"&gt; component&lt;/a&gt; 🔗 that you can add to every page so the details of every page can be easily tweaked. This makes applying these SEO techniques a lot easier. 🙌 Here is an Example code 👩‍💻:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//pages/newsletter.js
import Head from 'next/head';

const Newsletter = () =&amp;gt; {
  return (
    &amp;lt;&amp;gt;
      &amp;lt;Head&amp;gt;
        &amp;lt;title&amp;gt;This is Ankita Kulkarni's newsletter&amp;lt;/title&amp;gt;
          &amp;lt;meta charSet="utf-8" /&amp;gt;
          &amp;lt;meta name="description" content={"A newsletter related to front-end development, leadership, career development, my journey into content creation, and lots more behind the scenes that I don't share anywhere else"} /&amp;gt;
      &amp;lt;/Head&amp;gt;
            &amp;lt;div&amp;gt;rest of the content...&amp;lt;/div&amp;gt;
    &amp;lt;/&amp;gt;
  );
}

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Socials: Facebook and Twitter 🐧
&lt;/h2&gt;

&lt;p&gt;When we share a link to a post like a newsletter, for example, &lt;a href="https://kulkarniankita.com/newsletter" rel="noopener noreferrer"&gt;https://kulkarniankita.com/newsletter&lt;/a&gt; once that’s shared on social media like Twitter or Facebook, here is what we see:&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%2F9s57w8x9t4l3c1t39tof.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%2F9s57w8x9t4l3c1t39tof.png" alt="How Newsletter looks on Twitter"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Notice how the title is a newsletter, it has a description of what this page is all about and also has an image. This is a good example of how meta tags for socials work. They do have a name and are known as Open Graph tags.📉&lt;/p&gt;

&lt;h3&gt;
  
  
  What is Open Graph?**
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://ogp.me/" rel="noopener noreferrer"&gt;Open Graph&lt;/a&gt; 🔗 is a protocol that enables web pages to become a right fit for social media. Notice the name “graph” in its name. That’s because it creates a graph object of your metadata. Its goal is to provide simplicity for developers and one protocol for all social media.✨&lt;/p&gt;

&lt;p&gt;Here is an example for those og meta tags 👩‍💻:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;
&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;meta&lt;/span&gt; &lt;span class="na"&gt;property&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"og:title"&lt;/span&gt; &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Newsletter&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;meta&lt;/span&gt; &lt;span class="na"&gt;property&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"og:type"&lt;/span&gt; &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"website"&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;meta&lt;/span&gt; &lt;span class="na"&gt;property&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"og:description"&lt;/span&gt; &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;A newsletter related to front-end development, leadership, career development, my journey into content creation, and lots more behind the scenes that I don't share anywhere else&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;meta&lt;/span&gt; &lt;span class="na"&gt;property&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"og:image"&lt;/span&gt; &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/images/ogImage.png&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt; &lt;span class="c1"&gt;// for example: https://kulkarniankita.com/images/newsletter.png&lt;/span&gt;

&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;meta&lt;/span&gt; &lt;span class="na"&gt;property&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"og:image:alt"&lt;/span&gt; &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;ogImageAlt&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;meta&lt;/span&gt; &lt;span class="na"&gt;property&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"og:image:width"&lt;/span&gt; &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"1200"&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;meta&lt;/span&gt; &lt;span class="na"&gt;property&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"og:image:height"&lt;/span&gt; &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"627"&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;

&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;meta&lt;/span&gt; &lt;span class="na"&gt;property&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"og:url"&lt;/span&gt; &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;ogUrl&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There are 2 tools you can use to test your site for SEO:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://developers.facebook.com/tools/debug/" rel="noopener noreferrer"&gt;Facebook Debugger&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developers.google.com/search/docs/advanced/structured-data" rel="noopener noreferrer"&gt;Google Rich Snippets Testing Tool&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;They will give you a visual of what your crawled website looks like on social.&lt;/p&gt;

&lt;p&gt;The other tags shown in the example are a bit more obvious as the title refers to the title of the page, the description refers to the description, image is the image of the page when your site page is shared. But what are canonical URLs?&lt;/p&gt;

&lt;h2&gt;
  
  
  Canonical URLs ♾
&lt;/h2&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%2Fu19xkv4btnwa5x51zdw4.gif" 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%2Fu19xkv4btnwa5x51zdw4.gif" alt="forever"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;They are permanent IDs in the graph that we talked about earlier.&lt;/p&gt;

&lt;p&gt;How you can represent a canonical URL:&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="canonical" href={PROD_URL + canonicalUrl} /&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;og:url&lt;/code&gt; is how canonical URLs are represented for socials and rel="canonical" is how your individual pages are treated as canonical pages. As Mr. Bot reviews these meta tags, canonical URL's become the id in the graph which are sort of permanent.&lt;/p&gt;

&lt;p&gt;They should represent your page in a human-readable way. The name &lt;code&gt;id&lt;/code&gt; might confuse you as you might assume that it needs to be some auto-generated id like &lt;code&gt;asdswpp&lt;/code&gt; but instead, it’s the opposite ╳, it should indicate what kind of content is in that URL 🔗 when a user navigates to it.&lt;/p&gt;

&lt;p&gt;For example 👇,&lt;/p&gt;

&lt;h3&gt;
  
  
  good canonical URL ✅:
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://kulkarniankita.com/next.js/lets-get-data-rich-with-nextjs-visualization" rel="noopener noreferrer"&gt;https://kulkarniankita.com/next.js/lets-get-data-rich-with-nextjs-visualization&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  bad Canonical URL ❌:
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://kulkarniankita.com/next.js/lets-get-data-rich-with-nextjs-visualization" rel="noopener noreferrer"&gt;https://kulkarniankita.com/next.js/l&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Behind the scenes, your blog posts or products might use a URL like this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;/products/lip-gloss?variant=123&lt;/code&gt; ❌&lt;/p&gt;

&lt;p&gt;but you should format it and set the canonical URL as:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;/products/lip-gloss/pink&lt;/code&gt; ✅&lt;/p&gt;

&lt;p&gt;Shopify wrote a great article which further elaborates canonical URLs, check it out &lt;a href="https://www.shopify.ca/partners/blog/canonical-urls" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  SEO React Component 🍱
&lt;/h2&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%2Fkgjo9uuwc4ditcaltmd6.jpg" 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%2Fkgjo9uuwc4ditcaltmd6.jpg" alt="react as lego"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Imagine you have a site that has a list of blog posts, newsletter, about-me image and more, you will be copy pasting more or less similar tags with variations in title, description, image etc. on every page. Now, this is not clean code and you might miss some important tags that would have a huge impact on SEO.😮&lt;/p&gt;

&lt;p&gt;Instead, I would recommend creating a &lt;code&gt;React component&lt;/code&gt;. For example, I have a component called &lt;code&gt;SEO&lt;/code&gt;. This component accepts props such as &lt;code&gt;title&lt;/code&gt;, &lt;code&gt;description&lt;/code&gt;, &lt;code&gt;og&lt;/code&gt; tags names, and more. I also provide default values too just in case I forget to provide those. This helps me stay organized and the existence of SEO component assures me and puts me at ease that I'm consistently taking care of SEO.😌&lt;/p&gt;

&lt;p&gt;Here is an example 👩‍💻:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Head&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;next/head&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;SEO&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;canonicalUrl&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;ogImage&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;ogDescription&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;ogTitle&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;ogUrl&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;metaDesc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Articles for developers and leaders focused on Next.js, GraphQL, leadership and more;

&amp;lt;Head&amp;gt;
      &amp;lt;title&amp;gt;{title}&amp;lt;/title&amp;gt;
      &amp;lt;meta charSet="utf-8" /&amp;gt;
      &amp;lt;meta name="description" content={description || metaDesc} /&amp;gt;

            &amp;lt;meta property="og:title" content={&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="nx"&gt;Newsletter&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;} /&amp;gt;
            &amp;lt;meta property="og:type" content="website" /&amp;gt;
            &amp;lt;meta property="og:description" content={ogDescription || description} /&amp;gt;
            &amp;lt;meta property="og:image" content={&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;images&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;ogImage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;png&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;} /&amp;gt; // for example: https://kulkarniankita.com/images/newsletter.png

            &amp;lt;meta property="og:image:alt" content={&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="nx"&gt;image&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt; &lt;span class="nx"&gt;featured&lt;/span&gt; &lt;span class="kd"&gt;with&lt;/span&gt; &lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;} /&amp;gt;
            &amp;lt;meta property="og:image:width" content="1280" /&amp;gt;
            &amp;lt;meta property="og:image:height" content="675" /&amp;gt;

            &amp;lt;meta property="og:url" content={ogUrl || canonicalUrl} /&amp;gt;
  &amp;lt;Head&amp;gt;
}

export default SEO;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can customize the above SEO component based on your needs but the above code will give you a rough idea. It also helps you avoid any mistakes. I promise you I have caught many SEO mistakes because of this. 🤠&lt;/p&gt;

&lt;h2&gt;
  
  
  What are Sitemaps? 📍
&lt;/h2&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%2Fqnd0fdldqtfp4cd3j9in.gif" 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%2Fqnd0fdldqtfp4cd3j9in.gif" alt="map finder"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A sitemap is an XML or a text file where you can provide information about all the pages and files in your web app. Mr. Bot 🤖 will look for this file and read it while crawling the site. You can tell which pages are important ✅ and which ones should not be crawled. ❌&lt;/p&gt;

&lt;p&gt;You might need a sitemap if your site is large but might not if it’s small. You can read more &lt;a href="https://developers.google.com/search/docs/advanced/sitemaps/overview" rel="noopener noreferrer"&gt;here&lt;/a&gt; 🔗 although I would recommend creating it as we are trying to make our communication with &lt;a href="http://Mr.Bot" rel="noopener noreferrer"&gt;Mr. Bot&lt;/a&gt; as smooth as possible.&lt;/p&gt;

&lt;p&gt;The important piece I implemented on my website was to only include canonical URLs that I preferred to be indexed by Mr. Bot 🤖 i.e. if your site has 2 ways of reaching the same content, add the URL you want people to discover to your sitemap. You can read more on &lt;a href="https://developers.google.com/search/docs/advanced/sitemaps/build-sitemap" rel="noopener noreferrer"&gt;how to build one here for specifics&lt;/a&gt;. Although here is how I built it in Next.js.&lt;/p&gt;

&lt;p&gt;If your site only has non-dynamic content i.e. no blog but only a few static pages, you can create a very simple sitemap that looks like this: 👩‍💻&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;PROD_URL&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://www.kulkarniankita.com&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;generateSitemap&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;
    &amp;lt;urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"&amp;gt;
            &amp;lt;url&amp;gt;
          &amp;lt;loc&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;PROD_URL&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/aboutme`&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;&amp;lt;/loc&amp;gt;
      &amp;lt;/url&amp;gt;
            &amp;lt;url&amp;gt;
          &amp;lt;loc&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;PROD_URL&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/newsletter`&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;&amp;lt;/loc&amp;gt;
      &amp;lt;/url&amp;gt;
        &amp;lt;/urlset&amp;gt;
`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But the chances are that your site does contain dynamic pages therefore the above sitemap needs to be created dynamically for example, if you have a list of blog posts like I do. For that, I would recommend creating a page in Next.js that returns XML data. You can do that by creating a file called sitemap.xml.js inside the pages directory.👩‍💻&lt;/p&gt;

&lt;h3&gt;
  
  
  sitemap.xml.js
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;PROD_URL&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://www.kulkarniankita.com&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;generateSitemap&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;posts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;`&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;
    &amp;lt;urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"&amp;gt;
        &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;posts&lt;/span&gt;
          &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;slug&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;`
                &amp;lt;url&amp;gt;
                    &amp;lt;loc&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;PROD_URL&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;slug&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;&amp;lt;/loc&amp;gt;
                &amp;lt;/url&amp;gt;
            `&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
          &lt;span class="p"&gt;})&lt;/span&gt;
          &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;&lt;span class="s2"&gt;
    &amp;lt;/urlset&amp;gt;
`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;Sitemap&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;

&lt;span class="nx"&gt;Sitemap&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getInitialProps&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;allPosts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;getBlogPostsData&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;staticPages&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;about&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;blog&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;courses&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;conferences&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;about&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;allPages&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
      &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;allPosts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(({&lt;/span&gt; &lt;span class="nx"&gt;categorySlug&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;slug&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;categorySlug&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;slug&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
      &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;staticPages&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;];&lt;/span&gt;

    &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setHeader&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Content-Type&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;text/xml&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;generateSitemap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;allPages&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
    &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;end&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;Sitemap&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Why getInitialProps? 🤔
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://nextjs.org/docs/api-reference/data-fetching/get-initial-props" rel="noopener noreferrer"&gt;getInitialProps&lt;/a&gt; is great for SEO 💯 as it will send the data before the page gets rendered from the server.&lt;/p&gt;

&lt;p&gt;Notice how we are setting the header as text/xml and writing XML as a response. This is because we don’t want anything else but XML to get dynamically rendered since the format of our sitemap is going to be &lt;code&gt;XML&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Here is a condensed version of sitemap looks like: 👇&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%2Fxugb9masyijn8grqdjmv.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%2Fxugb9masyijn8grqdjmv.png" alt="condensed version of sitemap"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  robots.txt 🦾
&lt;/h3&gt;

&lt;p&gt;Mr. Bot uses robots.txt to figure out where your sitemap is located so we need to generate robots.txt as well. Here is how robots.txt will 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;User-agent: *
Allow: /
Disallow: /nogooglebot/
Sitemap: https://www.kulkarniankita.com/&amp;lt;location-of-sitemap.xml&amp;gt;
Host: https://www.kulkarniankita.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can disallow specific pages to be indexed by &lt;code&gt;Disallow&lt;/code&gt; property whereas &lt;code&gt;Allow&lt;/code&gt; indicates that all other user agents are allowed to crawl the entire site.&lt;/p&gt;

&lt;p&gt;The site's sitemap file is located at the URL specified in &lt;code&gt;Sitemap&lt;/code&gt; property.&lt;/p&gt;

&lt;h2&gt;
  
  
  Static Generation in Next.js
&lt;/h2&gt;

&lt;p&gt;By default, in Next.js all your content will be pre-rendered i.e all the HTML content will be available in advance vs having it all done on client-side JavaScript. This proves to be great for SEO as when Mr. Bot 🤖 is looking to crawl your data and review HTML, it will find all the text of that site. This is a huge advantage of using Next.js.&lt;/p&gt;




&lt;p&gt;That's a wrap, hope this post was useful. 🙌 There is a lot more to SEO for which I'll create a part 2 of this article as I build my blog further.&lt;/p&gt;

&lt;p&gt;If you would like to learn more about Next.js, I have a course on 2 platforms: &lt;a href="https://bit.ly/3nRIsbi" rel="noopener noreferrer"&gt;Udemy&lt;/a&gt; and &lt;a href="https://academy.zerotomastery.io/a/aff_7jt8vq28/external?affcode=441520_0jp32c0x" rel="noopener noreferrer"&gt;Zero to Mastery&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Intersection of Frontend and Leadership 💌:
&lt;/h3&gt;

&lt;p&gt;If you found this article helpful, you will like my newsletter 💌! I write a weekly newsletter on content related to front-end development, leadership, career development, my journey into content creation, and lots more behind the scenes that I don’t share anywhere else. If you would like to know more or would like to subscribe, visit the link below: &lt;a href="https://kulkarniankita.com/newsletter" rel="noopener noreferrer"&gt;https://kulkarniankita.com/newsletter&lt;/a&gt;&lt;/p&gt;

</description>
      <category>seo</category>
      <category>nextjs</category>
      <category>react</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Data Fetching Techniques in Next.js with Visuals ✨</title>
      <dc:creator>Ankita Kulkarni</dc:creator>
      <pubDate>Mon, 08 Aug 2022 16:34:01 +0000</pubDate>
      <link>https://dev.to/kulkarniankita9/lets-get-data-rich-with-nextjs-visualizations-2no0</link>
      <guid>https://dev.to/kulkarniankita9/lets-get-data-rich-with-nextjs-visualizations-2no0</guid>
      <description>&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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2A2zaVQgYpZO5yUjkR_uZflQ.jpeg" 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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2A2zaVQgYpZO5yUjkR_uZflQ.jpeg" alt="computer web development"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Next.js is a popular JS framework and is incredibly powerful. It is one of my favourite frameworks as it does a great job of making its APIs simple and easy to understand. It has become the production framework for React and rightly so.&lt;/p&gt;
&lt;/blockquote&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%2Fcdn-images-1.medium.com%2Fmax%2F600%2F1%2ASE68YnfdRuCnl8I99sbRxQ.jpeg" 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%2Fcdn-images-1.medium.com%2Fmax%2F600%2F1%2ASE68YnfdRuCnl8I99sbRxQ.jpeg" alt="visualization works every time"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We often tend to visualize things 🔮 and concepts to understand them better. If you want to master Next.js, it provides many techniques to fetch data in a manner that is right for your use case. You need to know how and when to fetch it, that’s all. 🌸&lt;/p&gt;

&lt;p&gt;There are many powerful 💪 ways to fetch data. Here are a few of them:&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%2Fcdn-images-1.medium.com%2Fmax%2F416%2F1%2AtWpptbz96DhvevZyd7LSZg.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%2Fcdn-images-1.medium.com%2Fmax%2F416%2F1%2AtWpptbz96DhvevZyd7LSZg.png" alt="_Different data fetching techniques in Next.js_"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now that we know what they are called, let’s review how you can fetch data in Next.js in the form of visuals:&lt;/p&gt;

&lt;h2&gt;
  
  
  Static-site Generation (SSG) 💯
&lt;/h2&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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AmHdgdzUCPs66olIwlZjkuQ.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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AmHdgdzUCPs66olIwlZjkuQ.png" alt="_How Static-site Generation (SSG) works_"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;SSG is great for static sites. If you have a lot of static content on your site, SSG is the right fit. 💯&lt;/p&gt;

&lt;h3&gt;
  
  
  Without API calls i.e. No external data: 🙅‍♀️
&lt;/h3&gt;

&lt;p&gt;It is pre-rendered by default since the data is available to us statically. We are not invoking any APIs here so Next.js will store it at build time. For example, the About page, static navigation data, headers, etc.&lt;/p&gt;

&lt;h3&gt;
  
  
  With API calls i.e. external data 👌
&lt;/h3&gt;

&lt;p&gt;SSG pre-generates i.e. downloads all the static content at build time before you deploy your site and then serves it directly which means it won’t make live API calls for every user but &lt;em&gt;instead fetch from the build&lt;/em&gt;. The same HTML will be used for every request, making it lightning fast⚡️.&lt;/p&gt;

&lt;p&gt;Whenever you can, use SSG as it will help a lot with performance.&lt;/p&gt;

&lt;h2&gt;
  
  
  Incremental Static Regeneration (ISR) ⚡️
&lt;/h2&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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AvuIc9Ms4MGU1wLdK20R_7g.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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AvuIc9Ms4MGU1wLdK20R_7g.png" alt="_How Incremental static regeneration (ISR) works_"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This method is one of my favourite 💜 way of fetching data. It gives you the best of both worlds — SSG + SSR. You can opt-in to re-generate a specific page or pages at a specific interval. Let's say you set the interval to be 60 seconds ⏰and the first user that visits gets stale data but the user after will get fresh data. 🏄‍♀️&lt;/p&gt;

&lt;p&gt;For example, let's say you run a coffee ☕️ store and one of your products gets popular. Now you want to get the latest data about that store but that data won’t get updated every minute. With ISR, you can say I want that store with store id 456232 to get re-generated every 5 minutes 🕰. This way you still reap 👆the benefits of pre-generating the data at build time but also take advantage of fresh data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;: Old Twitter tweets, not many users will visit old tweets so it is okay for old tweets to have stale data although, with ISR, you can get fresh data for the following request. 🙂&lt;/p&gt;

&lt;h2&gt;
  
  
  Server-side Rendering (SSR) 🪴
&lt;/h2&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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AjtU9CTLcqfPy4YChfJF8iw.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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AjtU9CTLcqfPy4YChfJF8iw.png" alt="_How Server-side Rendering (SSR) works_"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In SSR, HTML is generated for every request on the server. You want to use SSR for a news feed where we always want the latest most relevant news but also want to pre-render data as that is good for SEO. 🤖&lt;/p&gt;

&lt;p&gt;SSR only runs on the server and not on the browser. 🤠&lt;/p&gt;

&lt;h2&gt;
  
  
  Client-side Rendering (CSR) 👩‍💻
&lt;/h2&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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2Arcv00FbOORbCEAu5v_KeAw.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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2Arcv00FbOORbCEAu5v_KeAw.png" alt="_How Client-side Rendering (CSR) works_"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is the traditional way of rendering content to the client 👌. With CSR, we don’t need to pre-render data and instead fetch data at runtime in a useEffect. The browser is responsible for rendering content to the client. This can impact performance as the data is not cached. 😰&lt;/p&gt;




&lt;p&gt;I hope you found this post useful 🙌. If you did, comment 💬 on how you are planning to use Next.js or are using it already. If you would like to learn more about Next.js, I have a course on 2 platforms: &lt;a href="https://bit.ly/3nRIsbi" rel="noopener noreferrer"&gt;Udemy&lt;/a&gt; and&lt;a href="https://bit.ly/nextjs-ankita" rel="noopener noreferrer"&gt;Zero to Mastery&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>webdev</category>
      <category>react</category>
      <category>javascript</category>
    </item>
    <item>
      <title>6 ways you should show up as a leader during downturn</title>
      <dc:creator>Ankita Kulkarni</dc:creator>
      <pubDate>Thu, 16 Jun 2022 14:41:43 +0000</pubDate>
      <link>https://dev.to/kulkarniankita9/6-ways-you-should-show-up-as-a-leader-during-uncertain-times-5b1d</link>
      <guid>https://dev.to/kulkarniankita9/6-ways-you-should-show-up-as-a-leader-during-uncertain-times-5b1d</guid>
      <description>&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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AfrrMOkeilnN1TKlE03tnpQ.jpeg" 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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AfrrMOkeilnN1TKlE03tnpQ.jpeg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We have yet again entered an uncertain time 😥. This feels way too familiar for most of us since we experienced something similar when the pandemic hit. But we need to be more resilient this time as winter might be coming. As a lead, I have changed my strategies to show up as a leader for my teams and wanted to share them here.👇&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here are 6 ways you should show up as a leader during uncertain times:&lt;/strong&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Lead with Empathy 🤗
&lt;/h1&gt;

&lt;p&gt;As a leader, you need to &lt;em&gt;lean in more&lt;/em&gt; to provide support wherever needed. Be more mindful in your 1:1’s and fully present. For example, many people might be anxious; you should try to be there for them and do health checks to ensure they feel supported. 💜 Empathetic leaders bring out the best in their team.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;People thrive&lt;/em&gt;&lt;/strong&gt; when they still have the freedom to do the work. 🧡&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Additionally, if they focus better on things that can help them stay motivated, do it and be open about it.&lt;/p&gt;

&lt;h1&gt;
  
  
  Ruthlessly Prioritize 💯
&lt;/h1&gt;

&lt;p&gt;Now is a great time to ruthlessly prioritize and get your teams to focus on things that will significantly impact the business. If you can make investments to help reduce developer hours, then you should do it. You should lean in wherever to unblock the team or your leads to make sure they have the right focus.&lt;/p&gt;

&lt;h1&gt;
  
  
  Disrupt habits and be mindful 🚀
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;p&gt;This is how we do things. &lt;em&gt;🙈&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I want to challenge this 👆. Now is not the time to go with old habits. Instead, question your moves and challenge yourself if this is how you should still do things. Also, truly understand how you do things and how you can be more effective as a leader. Share your learnings with other leads and also your teams which will truly allow everyone to grow.&lt;/p&gt;

&lt;h1&gt;
  
  
  Celebrate the small wins ✨
&lt;/h1&gt;

&lt;p&gt;In whatever way you decide to celebrate small wins, please do it! You should celebrate successes and showcase the impact of your team’s work. It might sound corny but being positive and making folks aware of the positive changes and the focus of work is more important now. Additionally, also celebrate learnings and growth 🪴&lt;/p&gt;

&lt;h1&gt;
  
  
  Adapt and Lead with Clarity 👏
&lt;/h1&gt;

&lt;p&gt;Be open and transparent with your team but also adapt by zooming 🔍 out and looking at the big picture. Build consistency in your communication. Lean in more and provide that additional context needed. Build a strategy and stay open to feedback. If something isn’t working, pivot as quickly as possible. Your ability to adapt is being put to the test now.&lt;/p&gt;

&lt;h1&gt;
  
  
  Self Learning ✍️
&lt;/h1&gt;

&lt;p&gt;Be more vulnerable and use other leaders to brainstorm ideas and openly discuss things. But please remember, your mental health is equally important. 🌸&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Alone we are weak. Together we are strong 💪&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;As a leader, it is natural to think about the team before yourself, but it’s also important to prioritize your mental health. Invest time in self-learning 📕, going for walks 🚶‍♀️or whatever you do to ensure you are healthy. Don’t hesitate to be vulnerable with the team as we are humans at the end of the day, and just as we did at the beginning of the pandemic, we will come out the other side more resilient.🪴&lt;/p&gt;




&lt;p&gt;If you plan to use any of these techniques or have more to share, please comment or tweet about this to share your thoughts! 🐥&lt;/p&gt;

</description>
      <category>leadershipdevelopmen</category>
      <category>softwaredevelopment</category>
      <category>leadership</category>
      <category>management</category>
    </item>
    <item>
      <title>Oh Hello Apollo Client , Goodbye Redux!</title>
      <dc:creator>Ankita Kulkarni</dc:creator>
      <pubDate>Mon, 01 Feb 2021 18:07:48 +0000</pubDate>
      <link>https://dev.to/kulkarniankita9/oh-hello-apollo-client-goodbye-redux-4dpi</link>
      <guid>https://dev.to/kulkarniankita9/oh-hello-apollo-client-goodbye-redux-4dpi</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;I know I got excited with the title there but it is kinda true &lt;em&gt;😅&lt;/em&gt;. In this blog post, I will cover why your switch to GQL and Apollo Client 3 should make you walk away from Redux. I will also talk about my journey from Redux -&amp;gt; Apollo Client.&lt;/p&gt;
&lt;/blockquote&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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AgpdBjVIH-cK-GGaKTySyPg.jpeg" 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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AgpdBjVIH-cK-GGaKTySyPg.jpeg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I have had my share of doubts so in the past couple of projects, I was really skeptical of using &lt;em&gt;Apollo Client&lt;/em&gt; as a state management solution. I love ❤ Apollo and specifically the changes made in Apollo client 3 that changed my mind completely 😻&lt;/p&gt;

&lt;h2&gt;
  
  
  Why I like &lt;em&gt;Redux&lt;/em&gt; and what it is good at 💙
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Global state management solution where you have a good visual of your entire state&lt;/li&gt;
&lt;li&gt;You use actions to trigger state updates and asynchronous requests (love 💌 my boo: &lt;a href="https://github.com/redux-saga/redux-saga/tree/master/packages/core" rel="noopener noreferrer"&gt;&lt;em&gt;Redux&lt;/em&gt; saga&lt;/a&gt; 🔗)&lt;/li&gt;
&lt;li&gt;The entire ecosystem is amazing, you get &lt;em&gt;Redux&lt;/em&gt; time travel too for debugging! ⏲&lt;/li&gt;
&lt;li&gt;You can use libraries like &lt;em&gt;Redux&lt;/em&gt; selectors (&lt;a href="https://github.com/reduxjs/reselect" rel="noopener noreferrer"&gt;another awesome library&lt;/a&gt; 🔗) to select data from the state and transform&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;which brings me to my next point… 👇&lt;/p&gt;

&lt;h2&gt;
  
  
  What is considered a good state management solution? ✅
&lt;/h2&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%2Fcdn-images-1.medium.com%2Fmax%2F320%2F1%2AOwX4VI0egzH-LdXovha0fg.gif" 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%2Fcdn-images-1.medium.com%2Fmax%2F320%2F1%2AOwX4VI0egzH-LdXovha0fg.gif"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;My data is normalized (no dupes please 🙏)&lt;/li&gt;
&lt;li&gt;Specific actions i.e. user logging in / routing should be able to trigger asynchronous requests 💯&lt;/li&gt;
&lt;li&gt;We want to transform the data so that our component is not huge and we can write tests!! 🍵&lt;/li&gt;
&lt;li&gt;Lastly, visualize the store i.e. we can view our global state and debug easily 🌎&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;and I’m sure there are more but the above were the top ones in my list! 🥇&lt;/p&gt;

&lt;h2&gt;
  
  
  After I started using GQL ✨
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;I didn’t use Redux in the GQL project because we were using React Hooks and React Context and it felt repetitive because you can use useReducer and useContext where you can dispatch actions and update state&lt;/li&gt;
&lt;li&gt;Apollo Client exposes custom hooks ⚓️ like useQuery, useMutation which automatically exposed loading, success and error states so I didn’t need to trigger 3 different actions in my redux store i.e. CART_REQUEST, CART_SUCCESS and CART_ERROR. For example, here is a comparison ⚡️&lt;/li&gt;
&lt;/ul&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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AgskPBEjiGNbwiUOwBHYssA.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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AgskPBEjiGNbwiUOwBHYssA.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A lot of boilerplate code has reduced 😈 You get the loading, success, and error states right from the useQuery and useMutation hook.&lt;/p&gt;

&lt;h2&gt;
  
  
  So what was missing? 😅
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;Going back to the definition of a good state management library &lt;em&gt;👆&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&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%2Fcdn-images-1.medium.com%2Fmax%2F480%2F1%2A1xA_9fo5KZ3-w_mJvm_ckg.gif" 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%2Fcdn-images-1.medium.com%2Fmax%2F480%2F1%2A1xA_9fo5KZ3-w_mJvm_ckg.gif"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I really loved useQuery and useMutation custom hooks although I wasn’t fully convinced to switch for state management completely as I really liked using &lt;em&gt;Redux selectors&lt;/em&gt; that select data &amp;amp; we have the ability to transform it 😥&lt;/li&gt;
&lt;li&gt;In the meanwhile, I was using &lt;em&gt;React Context&lt;/em&gt; instead of &lt;em&gt;Redux&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;I also didn’t want to read the Apollo cache all the time&lt;/li&gt;
&lt;li&gt;At the time, there was no way to store values outside the cache&lt;/li&gt;
&lt;li&gt;I also wanted actions to trigger asynchronous requests like &lt;em&gt;Redux saga’s&lt;/em&gt; do 🚶‍♀&lt;/li&gt;
&lt;li&gt;On top of this, I found Apollo client cache really hard to read 😫&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;But with Apollo Client 3, they introduced&lt;/strong&gt;  &lt;strong&gt;Reactive Variables and local only fields that changed everything&lt;/strong&gt; 💖&lt;/p&gt;

&lt;h3&gt;
  
  
  Apollo Client 3 gives us 2 really cool things 😎
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Local only fields&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reactive Variables&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;They are fields that resolve on the client side itself by reading data from the cache if you want thus replacing the transformers in Redux. Let’s take a look how that would work.&lt;/p&gt;

&lt;h2&gt;
  
  
  My data is normalized (no dupes please 🙏)
&lt;/h2&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%2Fcdn-images-1.medium.com%2Fmax%2F480%2F1%2Aj23l4PvBa6nMs1xZdjowqA.jpeg" 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%2Fcdn-images-1.medium.com%2Fmax%2F480%2F1%2Aj23l4PvBa6nMs1xZdjowqA.jpeg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Apollo Client&lt;/em&gt; takes care of the heavy lifting for you 💪. You don’t need to constantly dispatch actions to change state. With redux, we were really used to that and the benefit there is you have full control although do we really need full control? 😶&lt;/p&gt;

&lt;p&gt;You are already using GQL ❤️ so everything is a graph 📈 and is stored in the graph i.e. you already have all your data in your cache then why add Redux on top to duplicate it? 🤷‍♀ You are going to add more overhead 🙈&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Apollo Client&lt;/em&gt; automatically caches your data and normalizes new data in query responses and after mutation.&lt;/strong&gt; Similar to what you would do in Redux where you would need to make sure that your data is normalized. If you are onboarding a new developer, it’s hard because they also need to consider and learn how to do this on an architecture level which adds more overhead.&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%2Fcdn-images-1.medium.com%2Fmax%2F805%2F1%2AmTg7zlvsfrnWETU7YX90Mg.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%2Fcdn-images-1.medium.com%2Fmax%2F805%2F1%2AmTg7zlvsfrnWETU7YX90Mg.png" alt="Visualization of the Apollo client cache with cart data in it"&gt;&lt;/a&gt;How the cache looks like&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Apollo client&lt;/em&gt;&lt;/strong&gt; stores data using &lt;strong&gt;references&lt;/strong&gt; so it can be smart by looking it up easily using that reference as a key. Here is an &lt;a href="https://www.apollographql.com/blog/demystifying-cache-normalization/" rel="noopener noreferrer"&gt;awesome blog post&lt;/a&gt; 🔗 written by &lt;em&gt;Khalil Stemmler on Demystifying Apollo Cache&lt;/em&gt; which you should read before switching to AC3 for state management. 💯&lt;/p&gt;

&lt;h2&gt;
  
  
  Data transformations 😄
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;We want data transformations in an application so there is a clear separation of side-effect to transform layer. This way we can make sure that our component file is not huge and we can write tests for those transformers&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://medium.com/media/bcb60b1b989a751e19eb3c6117889e25/href" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;a href="https://medium.com/media/bcb60b1b989a751e19eb3c6117889e25/href" rel="noopener noreferrer"&gt;https://medium.com/media/bcb60b1b989a751e19eb3c6117889e25/href&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We will use local only fields mainly for transforming data.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Local only fields 🌼
&lt;/h3&gt;

&lt;p&gt;Local only fields is a way we can define client side fields on the GQL type that doesn’t need to come from the server. You can resolve them locally on your frontend.&lt;/p&gt;

&lt;p&gt;Let’s say we have the following query for getting the user’s cart ⚡&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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AMfiMEXjhsTpr6eJWA4KVqg.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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AMfiMEXjhsTpr6eJWA4KVqg.png"&gt;&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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AiobrKgcM1ZTCxGid6FxCWw.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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AiobrKgcM1ZTCxGid6FxCWw.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here is how your cart query &lt;em&gt;data&lt;/em&gt; object from the above query looks like 👈&lt;/p&gt;

&lt;p&gt;Let’s say we have this user story, 💄&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;As a user, I want to see if an item is out of stock or low stock based on the items in my cart.👩🏽‍💻&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Here is how your &lt;strong&gt;React&lt;/strong&gt; component might look like for it without using the &lt;strong&gt;Apollo&lt;/strong&gt;  &lt;strong&gt;client side&lt;/strong&gt; variable: 💄 ⚡️&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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2Ae5cgrFi2fv6jZFppMdWQow.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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2Ae5cgrFi2fv6jZFppMdWQow.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Typically in &lt;em&gt;Redux&lt;/em&gt;, we would extract the logic of the function getTextForLowOrOutOfStock outside using a redux selector. 🆗&lt;/p&gt;

&lt;p&gt;With AC3, you can achieve the above by &lt;strong&gt;reading the cache&lt;/strong&gt; and adding the string for ‘out of stock’ and ‘low stock’ accordingly within your client itself.&lt;/p&gt;

&lt;h3&gt;
  
  
  OK But, how can we use local only fields? 🤔
&lt;/h3&gt;

&lt;p&gt;We can create &lt;strong&gt;local only fields&lt;/strong&gt; on the &lt;strong&gt;Cart type&lt;/strong&gt; with the @client directive. 🎉 &lt;em&gt;For example,&lt;/em&gt; ⚡️ here stockText is the client side field.&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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2A29ab-LRL0Q7Hs0FZbZg0og.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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2A29ab-LRL0Q7Hs0FZbZg0og.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With the @client directive, Apollo client will look into the cache to resolve the field. It won’t make a call over the network for that field because of the directive. Now stockText can be accessed anytime we declare a Cart type because it is a field on the Cart type.&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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AeOlDXhsJQpj4_rvrZhb_1A.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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AeOlDXhsJQpj4_rvrZhb_1A.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we can directly access stockText in our React component by doing the following ⚡️&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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2Aa6Fjs7WpGqfEr2I5rl6otA.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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2Aa6Fjs7WpGqfEr2I5rl6otA.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Reactive Variables 🌸
&lt;/h3&gt;

&lt;p&gt;We can also create custom client side values stored outside the cache known as Reactive Variables. Sometimes we just want to create a field outside of the type structure which can still be accessed through the &lt;em&gt;Apollo client&lt;/em&gt; globally. For that, &lt;em&gt;Apollo client&lt;/em&gt; gives us &lt;strong&gt;Reactive variables.&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Modifying a reactive variable triggers an update of every active query that depends on that variable, as well an update of the react state associated with any variable values returned from the &lt;em&gt;useReactiveVar&lt;/em&gt; React hook.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Reactive variables don’t update the cache&lt;/strong&gt; but store the state information that we want to access at any point in our application. In &lt;em&gt;Redux&lt;/em&gt;, we usually dispatch an action to store such a value in the store.&lt;/p&gt;

&lt;p&gt;Let’s say we have this user story, 💄&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;As a user, I want to view the number of items in my cart that are on sale. 💯 👩🏽‍💻&lt;/p&gt;

&lt;p&gt;For this you would have to read all the items in cart, check items that are on sale and count them. With Apollo client, you can achieve this by 👇 ⚡️&lt;/p&gt;
&lt;/blockquote&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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2A3D3LmDF2h4ImkpAdA4Z-GA.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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2A3D3LmDF2h4ImkpAdA4Z-GA.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can do way more than this. You can also access existing fields (i.e. readNumberOfOOSItems) through other fields as well. 🙌&lt;/p&gt;

&lt;p&gt;You can access the above readNumberOfOOSItems via a query as well which gives you loading, data and error states:&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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2Af3o2TN9gozE2CVWVA5jlAA.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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2Af3o2TN9gozE2CVWVA5jlAA.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  But wait, what is the difference between local only fields and reactive variables? 🤔
&lt;/h3&gt;

&lt;p&gt;In a local only field, you create a new field on the type itself i.e. from our example, we created stockText on the Cart type i.e. you can’t access stockText anywhere else.&lt;/p&gt;

&lt;p&gt;But for reactive variables, you can access it &lt;strong&gt;anywhere&lt;/strong&gt; you like and it isn’t &lt;strong&gt;restricted to a specific type&lt;/strong&gt;. Unlike the Apollo Client cache, reactive variables don’t enforce data normalization, meaning &lt;strong&gt;you can store data in any format you want.&lt;/strong&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%2Fcdn-images-1.medium.com%2Fmax%2F480%2F1%2A_hly2GrmZ1b8doISQtwErw.gif" 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%2Fcdn-images-1.medium.com%2Fmax%2F480%2F1%2A_hly2GrmZ1b8doISQtwErw.gif" alt="noice"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Specific actions should trigger asynchronous requests ⏩
&lt;/h2&gt;

&lt;p&gt;Once we do retrieve data or if the user wants to route based on certain information from the server, we might want to trigger asynchronous requests or rather specific actions that the user should take.&lt;/p&gt;

&lt;p&gt;Let’s say we have this user story, 💄&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;As a user, I want to be taken to the sign in page if I’m not logged in else I want to see the app page&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Here we want to track if the user is logged in or not and accordingly route the user. We can achieve this by creating a &lt;strong&gt;reactive variable&lt;/strong&gt; for it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reactive variables&lt;/strong&gt; are variables stored in the client and outside the cache but the components can also access their values directly. In the example below, &lt;em&gt;isUserLoggedIn&lt;/em&gt; is a reactive variable that has been created using makeVar function. It invokes the function to check if there is a token in the browser &lt;em&gt;Cookies&lt;/em&gt;🍪. (In the real world, we will obviously check for token expiry as well 😉).&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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AKwy65dAiitVcTmR0rI4QOA.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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AKwy65dAiitVcTmR0rI4QOA.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Anything under fields is a &lt;strong&gt;field policy&lt;/strong&gt;. A field policy is basically a contract between client and the function which dictates how that field is going to be resolved. We have a field policy to read the number of out of stock items and check if the user is logged in or not.&lt;/p&gt;

&lt;p&gt;Next, in order to access this value within the component, we can do the following ⚡️&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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2ARJEZmsH8TMC80EusneYlKg.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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2ARJEZmsH8TMC80EusneYlKg.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The above will re-render whenever the value changes for isUserLoggedInVar&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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2A3QL0teAibXQkx8vb_62Z5A.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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2A3QL0teAibXQkx8vb_62Z5A.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you want to trigger an &lt;em&gt;API request&lt;/em&gt; once the user has logged in, you can achieve this by listening to isUserLoggedIn in a useEffect. 👈&lt;br&gt;&lt;br&gt;
Therefore, we can trigger async requests based on what’s in the state.&lt;/p&gt;

&lt;h3&gt;
  
  
  But wait, can I update the value of the Reactive variable? 🤔
&lt;/h3&gt;

&lt;p&gt;Yes you can! We can update the value of the reactive variable anywhere in our application, for example if we wanted to update the value of isUserLoggedInVar to false or anything else, we can! We just need to invoke the function isUserLoggedInVar directly!&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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2Airz3nCdOFgNSNOzaBzeBYA.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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2Airz3nCdOFgNSNOzaBzeBYA.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Visualize store / cache 🔮
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;Lastly, visualize the store i.e. we can view our global state and debug easily&lt;/p&gt;
&lt;/blockquote&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%2Fcdn-images-1.medium.com%2Fmax%2F500%2F1%2AID2Su-eygzYYwMKPWfvSJw.gif" 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%2Fcdn-images-1.medium.com%2Fmax%2F500%2F1%2AID2Su-eygzYYwMKPWfvSJw.gif"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Just like &lt;em&gt;Redux developer tools&lt;/em&gt;, &lt;em&gt;Apollo client&lt;/em&gt; also have their developer tools, here is a &lt;a href="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm" rel="noopener noreferrer"&gt;link&lt;/a&gt;. 🔗 Initially, I had some difficulty visualizing the cache as the Apollo developer tools are not as mature as Redux developer tools.&lt;/p&gt;

&lt;p&gt;But after understanding how Apollo client stores data internally and how it optimizes it, things got a lot easier. I am able to visualize the cache. 😄&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%2Fcdn-images-1.medium.com%2Fmax%2F877%2F1%2AH56HhIGrJH2w3cV-DhWhMA.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%2Fcdn-images-1.medium.com%2Fmax%2F877%2F1%2AH56HhIGrJH2w3cV-DhWhMA.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the &lt;strong&gt;Queries&lt;/strong&gt; and &lt;strong&gt;Mutation&lt;/strong&gt; tab, you will see a list of Queries and Mutations executed in your application (just like Redux does). In the cache tab, you will see the entire cache i.e. your Root query along with the cache references that got updated.&lt;/p&gt;

&lt;p&gt;You can use &lt;strong&gt;&lt;em&gt;GraphiQL&lt;/em&gt;&lt;/strong&gt; to query anything (including Reactive variables) just like you would in the GQL playground. But &lt;strong&gt;if you want to query Reactive variables&lt;/strong&gt; , make sure to check the checkbox “Load from cache”.&lt;/p&gt;

&lt;p&gt;I find that &lt;em&gt;Redux dev tools&lt;/em&gt; are superior with time travel although once you learn how the cache looks like and how it takes care of the heavy lifting for you, it will get a lot simpler. But, I would say this is definitely a pain point of &lt;em&gt;Apollo client dev tools&lt;/em&gt; overall 🤕.&lt;/p&gt;

&lt;h2&gt;
  
  
  Lastly, keep an open mind
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://medium.com/media/7f446247325b2b814408d4727aaf4695/href" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;a href="https://medium.com/media/7f446247325b2b814408d4727aaf4695/href" rel="noopener noreferrer"&gt;https://medium.com/media/7f446247325b2b814408d4727aaf4695/href&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The difference between &lt;em&gt;Redux&lt;/em&gt; and &lt;em&gt;Apollo Client&lt;/em&gt; is that you either take control and do everything on your own (like Redux) or let a mature library like Apollo Client handle that for you 🙌&lt;/li&gt;
&lt;li&gt;Don’t get me wrong, I do love control 😂. but &lt;em&gt;Apollo client&lt;/em&gt; is taking care of the bulk of the work for you so you can focus on the core of your application&lt;/li&gt;
&lt;li&gt;I kept comparing &lt;em&gt;Apollo client&lt;/em&gt; to &lt;em&gt;Redux&lt;/em&gt; 1:1 and although it was great to help me understand how my app would scale, this was also a reason I was holding back because now I have to unlearn what I have learned and trust that &lt;em&gt;Apollo client&lt;/em&gt; will take care of it for you. 👌&lt;/li&gt;
&lt;li&gt;When you are using Apollo client, it does feel redundant to use Redux on top of it as you are now keeping 2 copies of the same data i.e. Apollo client cache and Redux global store. 🙈&lt;/li&gt;
&lt;li&gt;The more you learn about the cache, the more you start to love it! ❤️&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Thank you for making it so far, hope you found this post useful 💯 and it helps you draw comparisons between Redux and &lt;em&gt;Apollo Client.&lt;/em&gt; 🙌&lt;/p&gt;

</description>
      <category>graphql</category>
      <category>javascript</category>
      <category>react</category>
      <category>frontend</category>
    </item>
    <item>
      <title>How to get started and debug Lambda functions</title>
      <dc:creator>Ankita Kulkarni</dc:creator>
      <pubDate>Wed, 23 Oct 2019 17:05:26 +0000</pubDate>
      <link>https://dev.to/kulkarniankita9/how-to-get-started-and-debug-lambda-functions-ag6</link>
      <guid>https://dev.to/kulkarniankita9/how-to-get-started-and-debug-lambda-functions-ag6</guid>
      <description>&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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2A7mlo9yv8x_5gFTKyIWjEYw.jpeg" 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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2A7mlo9yv8x_5gFTKyIWjEYw.jpeg"&gt;&lt;/a&gt;Get started with Lambda functions&lt;/p&gt;

&lt;p&gt;The best way to learn anything is to play with it on a project and build 👷🏼‍♀️ something. As I started learning about Lambda functions, I had this list of questions❓that kept coming to mind. To help you better understand Lambda functions, I’ve converted all of my questions, and their answers into a helpful blog post to get you started. Let’s dive in!&lt;/p&gt;

&lt;h3&gt;
  
  
  What are lambda functions 🤔 and why are they so popular 🌟?
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://medium.com/media/1402eea3d30c09d34956ea82b5e0a934/href" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;a href="https://medium.com/media/1402eea3d30c09d34956ea82b5e0a934/href" rel="noopener noreferrer"&gt;https://medium.com/media/1402eea3d30c09d34956ea82b5e0a934/href&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Lambda functions replace the backend API’s 🤯 as you don’t need to have a separate backend repository, but store your lambda functions in the front end itself. They follow the “supply on-demand” model i.e. they will only run when you need them ⏳. Unlike your server, they are not running all the time which means you end up saving a lot of resources, and gives you a performance boost. ✅&lt;/p&gt;

&lt;p&gt;You are not maintaining two repositories 🙅🏻‍♀️ — one for front end 💅 and the other for the backend 👾 but just one which is cool. You would call your functions from your front-end the same way you would call your APIs, i.e. using fetch.&lt;/p&gt;

&lt;p&gt;These reasons were enough for me to get started using them on a project. Plus, since Lambda functions are trendy right now, and I was really excited to try them out. 😎&lt;/p&gt;

&lt;h3&gt;
  
  
  So how do I get started 🍷?
&lt;/h3&gt;

&lt;p&gt;The best way to get started is by searching out some starter documentation online (like this blog post 😉) 🤷🏻‍♀️. That gave me a bunch of results like this one: &lt;a href="https://docs.netlify.com/functions/overview/" rel="noopener noreferrer"&gt;https://docs.netlify.com/functions/overview/&lt;/a&gt;. This resource really did a good job of explaining what Lambda functions are. I also learned that I could just get started by building a hello world function and deploy it using my Netlify account. This seemed easy. 😊&lt;/p&gt;

&lt;p&gt;I created a project using create react app using the following command as I wanted to build my front end with React.&lt;/p&gt;

&lt;p&gt;npx create-react-app hello-world&lt;/p&gt;

&lt;p&gt;I then installed netlify-cli package 📦 so that I can start creating lambda functions in my project.&lt;/p&gt;

&lt;p&gt;👉 Please note, there are two main ways of building your lambda functions — netlify dev and netlify lambda. This &lt;a href="https://github.com/netlify/netlify-lambda#when-to-use-netlify-dev-or-netlify-lambda-or-both" rel="noopener noreferrer"&gt;doc&lt;/a&gt; 🔗 explains when to use what.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;netlify dev: a new way of working with lambda functions.&lt;/li&gt;
&lt;li&gt;netlify-lambda: a shortcut to install function dependencies in production and, (if needed) bundle functions with babel and webpack if you need to (e.g. for writing functions with typescript).&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Where can I add my functions code? 🤔
&lt;/h3&gt;

&lt;p&gt;You can declare a path to your functions directory inside netlify.toml, the convention is to call them ‘functions’ but you can call it whatever you want. netlify.toml is where you can tell Netlify to go look 🔎 for your lambda functions. I created a functions directory inside my src and then created a primary hello-world function inside that. I used this post to write a hello world function: &lt;a href="https://functions-playground.netlify.com/" rel="noopener noreferrer"&gt;https://functions-playground.netlify.com/&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;exports.handler = (event, context, callback) =&amp;gt; {
  callback(null, { statusCode: 200, body: "Hello, World" });
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;My netlify.toml file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[build]
 command = “yarn build”
 functions = “src/functions”
 publish = “build”
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;so far so good 🏅&lt;/p&gt;

&lt;h3&gt;
  
  
  How can I run my functions locally? 👀
&lt;/h3&gt;

&lt;p&gt;Get the netlify cli to test your functions locally. Netlify CLI is a command-line utility that will help you to run and debug your functions. You can just run netlify dev 💯 to see if everything works.&lt;/p&gt;

&lt;p&gt;Here is how my project structure looks like:&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%2Fcdn-images-1.medium.com%2Fmax%2F626%2F1%2AR3Ptj5U9lZ1rdp2IkM7ONw.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%2Fcdn-images-1.medium.com%2Fmax%2F626%2F1%2AR3Ptj5U9lZ1rdp2IkM7ONw.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here is how you run functions from your browser:&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%2Fcdn-images-1.medium.com%2Fmax%2F486%2F1%2AZ9IYxApobKVs0bFRsv9_AQ.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%2Fcdn-images-1.medium.com%2Fmax%2F486%2F1%2AZ9IYxApobKVs0bFRsv9_AQ.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  How can I deploy these functions on Netlify along with my 💅 front end?
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://medium.com/media/4b7783b26029c43960280eb061c2c944/href" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;a href="https://medium.com/media/4b7783b26029c43960280eb061c2c944/href" rel="noopener noreferrer"&gt;https://medium.com/media/4b7783b26029c43960280eb061c2c944/href&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you use netlify-dev, you don’t need to use npm-run-all to run your functions and front end in parallel. You need to use netlify dev to start your functions and front-end.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"scripts": {
  "start": "react-scripts start",
  "build": "react-scripts build"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Deploy your project to Netlify ♻️
&lt;/h3&gt;

&lt;p&gt;You can use the Netlify CLI to deploy your functions or just push your code to Github and connect your repository to Netlify. Here is a good post on how to do that: &lt;a href="https://docs.netlify.com/site-deploys/create-deploys/#deploy-with-git" rel="noopener noreferrer"&gt;https://docs.netlify.com/site-deploys/create-deploys/#deploy-with-git&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%2Fcdn-images-1.medium.com%2Fmax%2F674%2F1%2AXx4NDs4hTfHPI4LdVa3O9A.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%2Fcdn-images-1.medium.com%2Fmax%2F674%2F1%2AXx4NDs4hTfHPI4LdVa3O9A.png"&gt;&lt;/a&gt;Functions on Netlify&lt;/p&gt;

&lt;h3&gt;
  
  
  What if my functions want to use different “node_modules” 📦?
&lt;/h3&gt;

&lt;p&gt;Let’s change the hello world function to use a node module: firebase-admin&lt;/p&gt;

&lt;p&gt;To do that, let’s create a hello-world functions directory 📁 which has the hello world function inside it. It lists users collection data from your cloud firestore database. Every function needs to be treated like it’s in an isolated environment, so each directory 📁 will have it’s own node modules 📦, any files 🗂 it needs etc. which means we need a package.json file.&lt;/p&gt;

&lt;p&gt;👉 We also need to add a new package.json script called postinstall which will be run by Netlify to install all the node modules for your lambda functions. You do need to use netlify-lambda here to install the node modules for your functions as currently there is no way to do the same with netlify dev.&lt;/p&gt;

&lt;p&gt;“postinstall”: “netlify-lambda install”&lt;/p&gt;

&lt;p&gt;👉 Please don’t forget to add a .gitignore file in your functions directory as you don’t want to check in all your node modules to Github.&lt;/p&gt;

&lt;p&gt;Here is how I structured my functions directory 📁:&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%2Fcdn-images-1.medium.com%2Fmax%2F848%2F1%2AS7aVHk2bWoe03UvAtlfrjg.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%2Fcdn-images-1.medium.com%2Fmax%2F848%2F1%2AS7aVHk2bWoe03UvAtlfrjg.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Where do I store my secret 🔑 environment information?
&lt;/h3&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%2Fcdn-images-1.medium.com%2Fmax%2F517%2F1%2AfD1KZqsPbZ2kNdpWgSttZg.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%2Fcdn-images-1.medium.com%2Fmax%2F517%2F1%2AfD1KZqsPbZ2kNdpWgSttZg.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The firebase-admin module requires some config information to run successfully. I’m going to use environment variables to store all the config information. On Netlify, you will store these values like 👈&lt;/p&gt;

&lt;p&gt;👉 Please note, you don’t need to add quotes around your “private_key” as you will get unable to read key errors.&lt;/p&gt;

&lt;h3&gt;
  
  
  Lambda function with firebase-admin
&lt;/h3&gt;

&lt;p&gt;Here is my code that uses firebase-admin module:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const admin = require("firebase-admin");

const config = {
  type: process.env.TYPE,
  project\_id: process.env.PROJECT\_ID,
  private\_key\_id: process.env.PRIVATE\_KEY\_ID,
  private\_key: process.env.PRIVATE\_KEY.replace(/\\n/g, "\n"),
  client\_email: process.env.CLIENT\_EMAIL,
  client\_id: process.env.CLIENT\_ID,
  auth\_uri: process.env.AUTH\_URI,
  token\_uri: process.env.TOKEN\_URI,
  auth\_provider\_x509\_cert\_url: process.env.AUTH\_PROVIDER,
  client\_x509\_cert\_url: process.env.CLIENT\_URL
};

admin.initializeApp({ credential: admin.credential.cert(config) });

const dbInstance = admin.firestore();

const getUsers = () =&amp;gt; {
  const userRefs = dbInstance.collection("users");
  return userRefs.get().then(snapshot =&amp;gt; {
    return snapshot.docs.map(doc =&amp;gt; doc.data());
  });
};

exports.handler = function(event, context, callback) {
  getUsers().then(data =&amp;gt; {
      callback(null, { 
         statusCode: 400, body: JSON.stringify({ data })
      });
    })
    .catch(err =&amp;gt; {
      callback(null, {
        statusCode: 400, body: JSON.stringify({ err: err.message })
      });
    });
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Which node.js version does Netlify support?
&lt;/h3&gt;

&lt;p&gt;It’s &lt;strong&gt;important&lt;/strong&gt; to ask yourself, which node.js version your package 📦 is compatible with? This is what it says in the &lt;a href="https://docs.netlify.com/functions/build-with-javascript/#runtime-settings" rel="noopener noreferrer"&gt;docs&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;By default, Netlify uses Node.js 8.10 as runtime for all new serverless functions written in JavaScript. You can override this by specifying the desired runtime with an &lt;a href="https://docs.netlify.com/configure-builds/environment-variables" rel="noopener noreferrer"&gt;environment variable&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For example, to use Node.js 10 for all future serverless functions deployed, set the variable AWS_LAMBDA_JS_RUNTIME with the value nodejs10.x&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;👉 I had to set AWS_LAMBDA_JS_RUNTIME &lt;em&gt;to&lt;/em&gt; nodejs10.x as firebase-admin is compatible with that. 💯 This is very important as your functions might not work if you don’t use the correct node.js version and might return a blank screen. You should always read your logs but this is when you should definitely read the logs for more clues.😄&lt;/p&gt;

&lt;h3&gt;
  
  
  How to debug Netlify functions 💯?
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://medium.com/media/21da8fe0642a7f6ebda7d877885bab42/href" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;a href="https://medium.com/media/21da8fe0642a7f6ebda7d877885bab42/href" rel="noopener noreferrer"&gt;https://medium.com/media/21da8fe0642a7f6ebda7d877885bab42/href&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/netlify/cli" rel="noopener noreferrer"&gt;Netlify CLI&lt;/a&gt; 🔗 is very helpful to debug your lambda functions. I like to use netlify deploy which basically deploys the current instance of your lambda functions and gives you a live preview. You can test your functions right away without having to push your code to Github and wait for it to deploy. It also provides you with a link to the logs which you can use for debugging reasons if something works locally but not on Netlify. The turnaround time ⏰is pretty fast.&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%2Fcdn-images-1.medium.com%2Fmax%2F803%2F1%2A-TAVNoY4Fsq2a9VNVtlPBQ.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%2Fcdn-images-1.medium.com%2Fmax%2F803%2F1%2A-TAVNoY4Fsq2a9VNVtlPBQ.png"&gt;&lt;/a&gt;netlify deploy&lt;/p&gt;

&lt;p&gt;👉 Please note, the logs and the draft URL changes every time you publish a new build using netlify deploy&lt;/p&gt;

&lt;h3&gt;
  
  
  How to call 🤙 functions from the front-end 💅?
&lt;/h3&gt;

&lt;p&gt;I used fetch to invoke my function and then called getUserService from my front end. Here is how I did it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export const getUserService = () =&amp;gt; {
  return fetch(`/.netlify/functions/helloWorld`).then(response =&amp;gt; {  
    return response.json();
  });
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;❌ If you invoke your function like localhost:, you will get a CORS error as you are trying to call your functions port from your front end port which is different.&lt;/p&gt;

&lt;p&gt;I hope this helps and gives you a good overview of how to get started and debug your functions. The code is deployed here if you want to take a look at it: &lt;a href="https://github.com/kulkarniankita/hello-world-netlify" rel="noopener noreferrer"&gt;https://github.com/kulkarniankita/hello-world-netlify&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you have any questions, please post it in the comments below. 🙌&lt;/p&gt;




</description>
      <category>serverless</category>
      <category>aws</category>
      <category>lambda</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Accessibility 360 — Web and mobile</title>
      <dc:creator>Ankita Kulkarni</dc:creator>
      <pubDate>Tue, 03 Sep 2019 19:59:32 +0000</pubDate>
      <link>https://dev.to/kulkarniankita9/accessibility-360-web-and-mobile-323d</link>
      <guid>https://dev.to/kulkarniankita9/accessibility-360-web-and-mobile-323d</guid>
      <description>&lt;h3&gt;
  
  
  Accessibility 360 — Web 🕸 and mobile📱
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--oE5irlx0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AF0yQcsKEstNX0eLlIxP9FA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--oE5irlx0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AF0yQcsKEstNX0eLlIxP9FA.png" alt=""&gt;&lt;/a&gt;We need to make this world 🌎 a better place for everyone.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://medium.com/media/a5f95d8a6bcb6f5dd9cb78b699d9c3e8/href"&gt;&lt;/a&gt;&lt;a href="https://medium.com/media/a5f95d8a6bcb6f5dd9cb78b699d9c3e8/href"&gt;https://medium.com/media/a5f95d8a6bcb6f5dd9cb78b699d9c3e8/href&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As a developer, I’ve noticed ever since starting out that a lot of us are intimidated by building accessible apps. The fact of the matter is, it doesn’t have to (and shouldn’t) be that way. Accessibility is just like building 🏗 any other feature — and there needs to be greater awareness around this. 🤯&lt;/p&gt;

&lt;p&gt;If you’ve incorporated accessibility into apps before or want to integrate accessibility for the first time, then this post is for you ⬅. I’m going to use both web 🕸 and mobile📱as an example.&lt;/p&gt;

&lt;p&gt;Here are a few things ✨ to consider when incorporating accessibility. Let’s get started!&lt;/p&gt;

&lt;h3&gt;
  
  
  👏🏼 Semantics 👏🏼
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--eVPO9dDi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AIoNhWQWNdQnDlRrKTlvDvg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--eVPO9dDi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AIoNhWQWNdQnDlRrKTlvDvg.png" alt=""&gt;&lt;/a&gt;Semantics for Web and Mobile&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Follow the semantics 🧠&lt;/strong&gt;. When any assistive device scans a web page, it will read the HTML structure of the page. That means when using an image on the page, don’t use a div and give it a background-image but instead use a &lt;a href="" class="article-body-image-wrapper"&gt;&lt;img&gt;&lt;/a&gt; tag for it because semantically img is the correct HTML element to use. Another example is a &lt;/p&gt; and &lt;span&gt; tag which is mainly used for layout only as they are semantically meaningless, they don’t have a keyboard ⌨️ or touch support in any browser 🕸.

&lt;p&gt;Similarly, for 📱mobile, use the Image API from React Native which is the correct semantic element. If you don’t, you will have to patch it up with different accessibility tags 🔖. This way, you’ll get accessibility right out of the gate instead of having to fix 🔨 things later.&lt;/p&gt;
&lt;h3&gt;
  
  
  Accessibility is great for SEO 💹
&lt;/h3&gt;

&lt;p&gt;In HTML, we have six levels of header tags from H1 to H6. If a user primarily uses a keyboard ⌨️ to navigate using tabs, the headings act as markers that the screen reader uses to navigate. By using the correct header a screen reader can help the user to find the section they want to read. This also helps screen readers 📖 to skip the block of contents and only focus on headings. When a user looks 🔍 for a term using a search engine, and you’ve used the correct semantics, it will rank higher on the page which can lead to an increase in traffic🚦.&lt;/p&gt;

&lt;p&gt;That means when you’re thinking of accessibility, you’re also thinking of SEO. 💯&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Bonus: you will make the marketing team happy when you get that SEO right.😉&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;
  
  
  Build accessible components ⛩
&lt;/h3&gt;

&lt;p&gt;With the power 💪🏼 of components, we get a lot of re-usability. When we onboard new developers, it is easier for them to find a component that already exists and use that instead of creating a new one. 🤷🏻‍♀️ This is where a design system 💅 comes in handy because we can make these components accessible.&lt;/p&gt;

&lt;p&gt;It’s important to add accessibility properties to these common components such as accessibilityLabel for React Native or ariaLabel for the web (take a look at the wrapper example below) and use linters to suggest that developers add these to your components while using them. Therefore adding a wrapper to these components with accessibility properties baked in is really useful 💯. That way anyone using the component will get the default accessibility properties baked in automatically.&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;interface IButtonProps {
  onPress: () =&amp;gt; void;
  accessibilityLabel: string;
  accessibilityHint?: string;
  accessibilityRole: string;
  text: string;
  buttonStyle?: any;
  isDisabled: boolean;
  buttonTheme?: any; 
}
&lt;/code&gt;&lt;/pre&gt;



&lt;h3&gt;
  
  
  Build a 👏🏼 design 👏🏼 system 👏🏼 of 👏🏼 accessible 👏🏼components 👏🏼
&lt;/h3&gt;

&lt;p&gt;There’s a lot to be said on how design systems 💅 can improve accessibility, it’s not easy to sum up the many, many benefits in a few sentences. For example, as you build accessible components, your accessibility becomes baked in wherever those components are used therefore improving accessibility across your app — &lt;em&gt;keeping in mind that doesn’t mean your entire app is accessible.&lt;/em&gt; The list goes on.&lt;/p&gt;

&lt;p&gt;An excellent example of a component library is &lt;a href="https://reakit.io/"&gt;Reakit&lt;/a&gt;. They have a separate section on accessibility with some fantastic explanations of the different considerations you should be thinking about. For your team, you can start using “Reakit” as it will provide you with a lot of common accessible components so you don’t have to build 👷‍♀️ from scratch. Alternatively, you can also build a Design System 💅 yourself and use ReaKit as a reference. For example,&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jNTKUG8l--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/898/1%2ARzzAyx1q5voRQXx_b9LZFQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jNTKUG8l--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/898/1%2ARzzAyx1q5voRQXx_b9LZFQ.png" alt=""&gt;&lt;/a&gt;Reakit accessibility button example 💜&lt;/p&gt;

&lt;p&gt;Personally, I like using &lt;a href="https://storybook.js.org/"&gt;Storybook&lt;/a&gt; ❤️ as it serves as documentation for your components and everyone on the team has visibility 👀 of all the components, it’s properties etc. You can also use it to keep track 🛤 of which components are accessible and which are not and run automated accessibility tests on them.&lt;/p&gt;

&lt;h3&gt;
  
  
  Rules to follow 📐
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---EdEziXk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2Ad_i5Sxdf_Dk_2wkH9gnfhA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---EdEziXk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2Ad_i5Sxdf_Dk_2wkH9gnfhA.png" alt=""&gt;&lt;/a&gt;Different states to consider for apps&lt;/p&gt;

&lt;p&gt;Every web 🕸 or mobile📱 app will have elements such as Text, Buttons, Keyboard navigation, responsiveness and more, some of which are depicted above. Try adding a wrapper around components with the required and optional properties related to accessibility just like you would otherwise. You can determine these properties through the docs. This not only helps onboard new developers quickly but also help keep accessibility top of mind. 🧠&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The reality 😐 is, we humans are creatures of habit 🤷🏻‍♀️ and this will help create good habits. 💯&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Example of an accessible component 💯
&lt;/h3&gt;

&lt;p&gt;This is just a basic checkbox ✅ component but will give you an idea on how we can start adding accessibility.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://medium.com/media/a51ee039bfa1972d0fa552e81b3264a0/href"&gt;&lt;/a&gt;&lt;a href="https://medium.com/media/a51ee039bfa1972d0fa552e81b3264a0/href"&gt;https://medium.com/media/a51ee039bfa1972d0fa552e81b3264a0/href&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Screen Reader 🖥 for web 🕸 and mobile 📱
&lt;/h3&gt;

&lt;p&gt;On the web 🌎, if you are a Mac 🍎 user, you can turn on voiceover by using cmd+f5. You should turn on the screen reader very early in the development process to see how it will inevitably read the contents of your website. This will help create a better user experience and help ensure you use the right accessibility properties. Here is an example of how the above checkbox component will be read by the screen reader when voice over is turned on.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--96HRnh3z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://cdn-images-1.medium.com/max/618/1%2Auj-n_ClZSYBi3O71hz9zvQ.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--96HRnh3z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://cdn-images-1.medium.com/max/618/1%2Auj-n_ClZSYBi3O71hz9zvQ.gif" alt=""&gt;&lt;/a&gt;Checkbox component when then voice over is turned on&lt;/p&gt;

&lt;h3&gt;
  
  
  Accessibility checklist ✅
&lt;/h3&gt;

&lt;p&gt;Below is a handy checklist ✔ on what should be considered when thinking of accessibility. This is a great start and serves as a solid reference point. It’s important to also keep in mind that there is more to accessibility than what is listed here. Here is the 🔗&lt;a href="https://frontendchecklist.io/#section-accessibility"&gt;link&lt;/a&gt; to this checklist.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BSH02jBP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/781/1%2AvrAfQKCpinQo_1QT9k0L9g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BSH02jBP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/781/1%2AvrAfQKCpinQo_1QT9k0L9g.png" alt=""&gt;&lt;/a&gt;Accessibility checklist&lt;/p&gt;

&lt;h3&gt;
  
  
  Make Open-source 👐🏼 libraries more flexible or accessible
&lt;/h3&gt;

&lt;p&gt;If you are an open-source developer, you can help promote 💪 accessibility by adding accessibility yourself, making your library manageable so that others can add accessibility properties themselves — &lt;em&gt;or both&lt;/em&gt; 🙌🏼. This is very important as developers tend to use a lot of packages 📦 on our projects. This way, before we decide to code something ourselves, we can look for existing packages that will do the job for us.&lt;/p&gt;

&lt;p&gt;If those packages aren’t flexible enough to inject properties, you can fork🍴 their repository and add accessibility properties yourself. However, this is a much more difficult option 😢 and takes a lot more time ⏰. Therefore it is our responsibility as open-source developers to make our packages more flexible.&lt;/p&gt;

&lt;p&gt;I hope that after reading how you can get started with accessibility, you realize how important it is to consider it from the start — not as an afterthought. If you’re interested in learning more, check out one of my recent talks at React Europe, here: &lt;a href="https://youtu.be/X_3tnSwXLls"&gt;https://youtu.be/X_3tnSwXLls&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Please give it some 👏 if you liked it 🙏 and share your experience in the comments below.&lt;/p&gt;



&lt;br&gt;
&lt;/span&gt;

</description>
      <category>design</category>
      <category>technology</category>
      <category>programming</category>
      <category>a11y</category>
    </item>
    <item>
      <title>You are NOT a React Native noob</title>
      <dc:creator>Ankita Kulkarni</dc:creator>
      <pubDate>Mon, 20 Aug 2018 16:37:48 +0000</pubDate>
      <link>https://dev.to/kulkarniankita9/you-are-not-a-react-native-noob-55ik</link>
      <guid>https://dev.to/kulkarniankita9/you-are-not-a-react-native-noob-55ik</guid>
      <description>&lt;h4&gt;
  
  
  Common React Native gotchas and concepts that will help you before and during development ✨
&lt;/h4&gt;

&lt;blockquote&gt;
&lt;p&gt;React Native lets you use the same knowledge base of React and you can do native mobile app development. It is a lot of fun 🐼&lt;/p&gt;
&lt;/blockquote&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%2Fcdn-images-1.medium.com%2Fmax%2F384%2F1%2A_Q8TCuSlMVz2PIglVnKO_A.jpeg" 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%2Fcdn-images-1.medium.com%2Fmax%2F384%2F1%2A_Q8TCuSlMVz2PIglVnKO_A.jpeg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you are a React developer and know some basics of native development i.e. iOS 🍎 or Android 🤖 then you will pick up React Native easily i.e. not a noob 🙈. Although, it is not 1 - 1 relational. When I initially learned React Native, I forgot how my native development skills will be easily transferable.&lt;/p&gt;

&lt;p&gt;Here is a list of React Native info and gotchas you will encounter as a React Native developer:&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting a project together — Expo vs React Native cli ✨
&lt;/h2&gt;

&lt;p&gt;There are 2 main ways to get a react-native project together:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Expo&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;React Native cli.&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Expo&lt;/strong&gt; is basically an open source project built for newbies using Expo APIs to help build react-native and prototype apps quickly. You use the create-react-native-app to get started with Expo. It makes your project pure JavaScript and you never have to dive into the native code.&lt;/p&gt;

&lt;p&gt;Once you are ready to release it to the app/play store, you can basically “eject” which generates iOS and Android bundle/folders. (You cannot release without ejecting). During this process, things can break when something is being converted to native code. Not sure about you but this makes me very uncertain. I don’t like when there is a lot of magic going on ¯_(ツ)_/¯. It is usually very hard to debug the root cause of it.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;➕&lt;/em&gt; You should be building your projects and verifying it on a device at the end of every story/task you work on.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I would suggest using Expo when you are new so you can learn how everything works although it’s risky while working with clients as debugging gets harder when something breaks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For React-Native cli,&lt;/strong&gt; you create a full-stack project by using react-native-cli init. It generates Android 🤖 and iOS 🍎 folders and files 📁 in your project right from the start which gives you so much visibility as a developer. &lt;strong&gt;There is no eject step as you get the project folders generated by default.&lt;/strong&gt; You can do your builds right away and run it on a device provided your environments are up to date with the requirements. Unless you do something crazy this will work.✨&lt;/p&gt;

&lt;h2&gt;
  
  
  Layout components 💄
&lt;/h2&gt;

&lt;p&gt;You use &lt;a href="https://facebook.github.io/react-native/docs/flexbox.html" rel="noopener noreferrer"&gt;Flexbox&lt;/a&gt; flavour for laying out components on the page. If you don’t know Flexbox already, here is a great 🔗 &lt;a href="https://css-tricks.com/snippets/css/a-guide-to-flexbox/" rel="noopener noreferrer"&gt;link&lt;/a&gt; to learn from. React-native also provides native specific components such as Text, View, etc. You wrap the component usually in a View as View is designed to be nested inside other views and can have 0 to many children of any type.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;➕&lt;/em&gt; &lt;strong&gt;&lt;em&gt;Tip&lt;/em&gt;&lt;/strong&gt; &lt;em&gt;:&lt;/em&gt; Keep in mind that you are building for different devices. Hence, try not to hardcode values in too much as a &lt;code&gt;top: 5&lt;/code&gt; will position differently for different device sizes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Phones can rotate&lt;/strong&gt; and if that is a requirement for your app then you would need to account for both portrait and landscape mode while writing CSS. &lt;em&gt;💄&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I also suggest using &lt;a href="https://www.styled-components.com/docs/basics#react-native" rel="noopener noreferrer"&gt;Styled-components&lt;/a&gt; 💅 for more of a design system.&lt;/p&gt;

&lt;h2&gt;
  
  
  You are not coding 🙅 for the browser 🕸
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Even if it feels like it, you are not coding for the browser 🕸 please keep this in mind at all times.&lt;/strong&gt; While doing web development, your browser will provide the &lt;strong&gt;window&lt;/strong&gt; object and you can easily access &lt;strong&gt;setTimeout&lt;/strong&gt; 🕐 for example but there’s no native equivalent and you won’t know what happened.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Now, this might even work during a debug build where you might have hot reloading setup so browser might inject and it will look like it works. &lt;strong&gt;Although, it won’t on release builds as it does not have access to a lot of common web API’s.&lt;/strong&gt;  🕸️&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;There are a lot of npm packages 📦 that keep web in mind while writing the package&lt;/strong&gt; so again that might not work hence be careful before picking a package for your project. Look at their package dependencies too to make sure you are good to go. Most libraries are very good at documenting it and a quick Google search will tell you the same so do that first! 💯&lt;/p&gt;

&lt;h2&gt;
  
  
  Async Storage 🗑️
&lt;/h2&gt;

&lt;p&gt;Android 🤖 and iOS 🍎 both have storage equivalents so you can store data on the device which gets deleted when you uninstall the app.&lt;/p&gt;

&lt;p&gt;React Native provides a very helpful API called Async Storage which does a good job of storage on both platforms. Just like you would use local storage API in a browser, you use AsyncStorage in the same fashion.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;On iOS,&lt;/strong&gt;  &lt;strong&gt;AsyncStorage is backed by native code that stores small values in a serialized dictionary and larger values in separate files&lt;/strong&gt;. &lt;strong&gt;On Android&lt;/strong&gt; , &lt;strong&gt;AsyncStorage will use either RocksDB or SQLite based on what is available.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;User story example,&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;As a user &lt;em&gt;💁&lt;/em&gt;, I want to stay logged in after logging in once even if I close the app&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You would want to use Async storage in this scenario. As user logs in using the login button, store the user info or token, next time they come back to check if the token exists and hasn’t expired and accordingly show them your main screen or login screen so they don’t have to re-login.&lt;/p&gt;

&lt;h2&gt;
  
  
  Async await 🕐
&lt;/h2&gt;

&lt;p&gt;Remember this is a native application. There is a UI thread that is responding to gestures from the user. Now with async await, the program can run other code like gesture responders and rendering methods while the async task is in progress. Hence by using async await🕐, you can run your code concurrently🎉, for 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 storeUserInfo = async (token) =&amp;gt; {
    try {
      await AsyncStorage.setItem("userToken", token);
    } catch (error) {
      console.log(error);
    }
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Don’t think you won’t open Xcode 🍎 or Android Studio 🤖
&lt;/h2&gt;

&lt;p&gt;As a React Native developer, don’t expect to never open Android studio (IDE for Android) and Xcode (IDE for iOS) as you most likely will. The more familiar you get, the better it is for you.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;User story example:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;As a user &lt;em&gt;👩&lt;/em&gt;, I want the app to not rotate so that I have a better user experience&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;From a developer perspective, this means you want to lock your device orientation to only portrait mode. This is a setting that each platform has. You would have to make the change in androidManifest.xml for Android and a checkbox setting in iOS.&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%2Fcdn-images-1.medium.com%2Fmax%2F285%2F1%2AWWSyvvzVtHba9ZZ9xflAtg.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%2Fcdn-images-1.medium.com%2Fmax%2F285%2F1%2AWWSyvvzVtHba9ZZ9xflAtg.png"&gt;&lt;/a&gt;iOS config for locking orientation&lt;/p&gt;

&lt;p&gt;🍎&lt;a href="https://stackoverflow.com/a/32177887/1881309" rel="noopener noreferrer"&gt;https://stackoverflow.com/a/32177887/188130&lt;/a&gt;9&lt;/p&gt;

&lt;p&gt;🤖 &lt;a href="https://stackoverflow.com/a/44485271/1881309" rel="noopener noreferrer"&gt;https://stackoverflow.com/a/44485271/1881309&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;➕ &lt;strong&gt;Tip:&lt;/strong&gt; Always add “React Native” to your Google search, it will help you get better search results. 💯&lt;/p&gt;

&lt;h2&gt;
  
  
  Assets 📷
&lt;/h2&gt;

&lt;p&gt;Assets are your images, audio and video files but the most common scenario is images. I can’t think of an app without images 🤷.&lt;/p&gt;

&lt;p&gt;User story example:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;As a user &lt;em&gt;👵&lt;/em&gt;, I want to see the company’s logo in the login background&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Since we are targeting different devices iOS 🍎 and Android 🤖, the resolution for each device is different hence my suggestion would be to provide 2x, 3x images. React Native does a good job of picking the right image based on different screen densities.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;company-logo.png
company-logo@2x.png
company-logo@3x.png
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;For example, &lt;a href="mailto:company-logo@2x.png"&gt;company-logo@2x.png&lt;/a&gt; will be used on an iPhone 7, while &lt;a href="mailto:company-logo@3x.png"&gt;company-logo@3x.png&lt;/a&gt; will be used on an iPhone 7 Plus or a Nexus 5. If there is no image matching the screen density, the closest best option will be selected.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;By taking this approach, your app will look beautiful💄 and won’t pixelate.&lt;/p&gt;

&lt;h3&gt;
  
  
  Navigation
&lt;/h3&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%2Fcdn-images-1.medium.com%2Fmax%2F199%2F1%2Ai63pKvT_8ZJWI2JivEJdyA.gif" 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%2Fcdn-images-1.medium.com%2Fmax%2F199%2F1%2Ai63pKvT_8ZJWI2JivEJdyA.gif"&gt;&lt;/a&gt;Navigation example (iOS)&lt;/p&gt;

&lt;p&gt;React Native has tons of different libraries for react navigation. One of the most popular ones is &lt;a href="https://github.com/wix/react-native-navigation" rel="noopener noreferrer"&gt;react-native-navigation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Even though the library is good and has many ⭐. I found that it wasn’t good for beginners as it requires some native specific setup. I personally had a hard time setting it up even though I have native development experience. It also has a huge learning curve for a JS developer hence I would recommend using &lt;a href="https://reactnavigation.org/" rel="noopener noreferrer"&gt;https://reactnavigation.org/&lt;/a&gt;. This library took me 5mins ⏲ to get started and is very easy to use.&lt;/p&gt;

&lt;h2&gt;
  
  
  Debug vs Release builds 🚀
&lt;/h2&gt;

&lt;p&gt;Debug builds are mainly for development and Release is for production i.e. App store 🍎 and Play store 🤖 deployment. During development, you are running a debug build where you have hot re-loading 🔥 and the ability to debug remotely. When you need to test it on a device, you need a release build.&lt;/p&gt;

&lt;p&gt;When you want to run the app on your device in a non-dev environment, you need to run the following command that generates a release build for you Let’s take a look at an iOS example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node node\_modules/react-native/local-cli/cli.js run-ios --configuration=Release
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  How App lifecycle corresponds to component lifecycle 🚲
&lt;/h2&gt;

&lt;p&gt;The React component lifecycle 🚲 correspond correctly to the Activity lifecycle in Android or Screen in iOS. As you usually build your React apps, you would do the same for React Native so fetching data before component renders in componentDidMount and so on.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Although, how would you know if the app is in background or foreground (very native specific)?&lt;/em&gt; You get AppState from react-native which basically has event listeners and you can listen to it as the app goes in background or foreground. Here is some sample code:&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

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

class App extends Component {
  componentDidMount(): void {
    AppState.addEventListener("change", this.\_handleAppStateChange);
  }

  componentWillUnmount(): void {
    AppState.addEventListener("change", this.\_handleAppStateChange);
  }

// state can be active for foreground and inactive when transitioning between background and foreground
  \_handleAppStateChange = (nextAppState) =&amp;gt; {     
    if (nextAppState === 'background') {      
       console.log('App is in background!')     
    }
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Hope you found this post useful 💯 and it gives you a good understanding of how React Native works and how it corresponds to native development. 🙌&lt;/p&gt;

&lt;p&gt;Please give it some 👏 if you liked it 🙏 and also share your React-native experience in comments 🙌&lt;/p&gt;




</description>
      <category>mobileappdevelopment</category>
      <category>reactnative</category>
      <category>react</category>
      <category>android</category>
    </item>
    <item>
      <title>The Art of Humanizing Pull Requests (PR’s)</title>
      <dc:creator>Ankita Kulkarni</dc:creator>
      <pubDate>Tue, 19 Jun 2018 00:11:49 +0000</pubDate>
      <link>https://dev.to/kulkarniankita9/the-art-of-humanizing-pull-requests-prs-2238</link>
      <guid>https://dev.to/kulkarniankita9/the-art-of-humanizing-pull-requests-prs-2238</guid>
      <description>&lt;h4&gt;
  
  
  What are PR’s, how to effectively create a PR, how to give feedback on PR’s and how to respond to feedback
&lt;/h4&gt;

&lt;h3&gt;
  
  
  What is a Pull Request (PR)?
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--biyc5GSc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/306/1%2AVaJjpzF3103dSFJ_CE2Iiw.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--biyc5GSc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/306/1%2AVaJjpzF3103dSFJ_CE2Iiw.jpeg" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It is a request for changing code in a repository. Once you make changes you need in your code, you submit a PR. Once submitted, interested parties will perform a code review and provide you with any feedback/changes needed.&lt;/p&gt;

&lt;p&gt;Pull Requests are typically used by teams &lt;em&gt;for shared collaboration and feature work or bug fixes.&lt;/em&gt; The idea is to make sure well written and bug-free code gets pushed to the repository. It is a way to develop high-quality code.&lt;/p&gt;

&lt;h3&gt;
  
  
  How to Create a Pull Request
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Breakdown your story/feature
&lt;/h4&gt;

&lt;p&gt;Before you start working on a story/feature, &lt;strong&gt;make a mental/written note on how you want to break it down into several smaller PR’s.&lt;/strong&gt; This doesn’t just help your reviewer but also &lt;em&gt;YOU&lt;/em&gt; as you can keep track of your progress and get frequent feedback. Another benefit is, as the codebase is shared with other developers, reverting a change gets a lot easier. Hence, try to keep the scope of your PR to a single issue while breaking it down.&lt;/p&gt;

&lt;p&gt;For example, let’s say you are implementing a todo list and have the following story:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;As a user, I can add and delete items to/from a list respectively&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I would break it down by:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;PR #1:&lt;/strong&gt; Add a text box and an add button on the page.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;PR #2:&lt;/strong&gt; Clicking on add button adds the item to the list&lt;br&gt;&lt;br&gt;
&lt;strong&gt;PR #3:&lt;/strong&gt; Clicking on delete button on the list item deletes that item from the list&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You will get reviewer blessings 🙏 for doing so. Imagine if your co-worker blasted a HUGE PR, you wouldn’t want to review, would you? 🙈&lt;/p&gt;

&lt;h4&gt;
  
  
  Add comments on your PR
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--L0fhD9z1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/9a9ui3sall6fbf08yokx.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--L0fhD9z1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/9a9ui3sall6fbf08yokx.gif" alt="How-to-add-a-code-comment"&gt;&lt;/a&gt;&lt;/p&gt;

How to add a code comment

&lt;p&gt;Wherever you have done something different, usually, it’s a good idea to 🔗 &lt;a href="https://help.github.com/articles/commenting-on-a-pull-request/"&gt;add a comment on the line number&lt;/a&gt; explaining why you did what you did. If you are not completely sure of your code, you should definitely tag “@” at those who have the most context on that code to get some feedback. For example,&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;You used a new function from the library &lt;a href="https://lodash.com/docs/4.17.10"&gt;Lodash&lt;/a&gt; called &lt;code&gt;isNan&lt;/code&gt; which might not be used in the codebase a lot, you might want to add a comment there saying &lt;code&gt;this function basically checks if the value is Nan and returns a boolean&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This helps your reviewer a lot as that saves their time (i.e. if they don’t already know what the function does).&lt;/p&gt;

&lt;h4&gt;
  
  
  Add screenshots/gifs
&lt;/h4&gt;

&lt;p&gt;Screenshots and gifs are proof that the code that you submitted works! &lt;em&gt;This increases the likelihood of acceptance and also gives your reviewer a visual of what you have implemented.&lt;/em&gt; A screenshot definitely works although when your code is doing more than what a screenshot can capture, create a gif. By using a gif, you can click around and show everything that your PR covers. My favourite one is: &lt;a href="https://www.cockos.com/licecap/"&gt;Licecap&lt;/a&gt; 🔗&lt;/p&gt;

&lt;h4&gt;
  
  
  Tests are documentation of your code
&lt;/h4&gt;

&lt;p&gt;Whenever you have worked on something which makes sense to you and you want to explain this complex code to future developers your intention for that particular change. Don’t litter the code with code comments and ask yourself these questions, if it’s so difficult to understand,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Can I split this code into smaller functions?&lt;/li&gt;
&lt;li&gt;Can I rename this function to something more obvious? ask your team for function name suggestions if you like.&lt;/li&gt;
&lt;li&gt;How can I simplify my code further so I don’t call it complex?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Irrespective of what you pick, &lt;strong&gt;you should write a TEST. 🔥&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Your tests are there to test your logic but also, are the documentation of your code.&lt;/strong&gt; Try to add a test explaining that part of your code.&lt;/p&gt;

&lt;h3&gt;
  
  
  How to review Pull Requests?
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Be empathetic
&lt;/h4&gt;

&lt;p&gt;As a reviewer, it’s extremely important to provide feedback in a courteous manner. &lt;strong&gt;You need to remember&lt;/strong&gt; that you are reviewing your teammates’ code who you like to talk to and go for team outings, lunches etc. &lt;strong&gt;They are human, they have feelings and feelings can get hurt easily! 💥&lt;/strong&gt; Hence, be more empathetic during your reviews.&lt;/p&gt;

&lt;h4&gt;
  
  
  Make yourself more familiar with the code
&lt;/h4&gt;

&lt;p&gt;Always get in the habit of teaching and it doesn’t matter if you consider yourself a junior or a senior developer. Instead of telling them what the problem is, ask them questions, &lt;strong&gt;make them think&lt;/strong&gt; and use a friendly tone. Following are a few examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Do you think&lt;/strong&gt; maybe we could assign this to a variable and re-use it on line 9?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Could we&lt;/strong&gt; possibly use this helpful utility that already does that for us which our dear teammate Sarah built?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Can we&lt;/strong&gt; move this code in its own function so we can write more tests 😃?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What do you think about trying&lt;/strong&gt; this option 🤔?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;I’m not sure if I understand the whole picture&lt;/strong&gt;  &lt;strong&gt;but could you explain what this function is doing?&lt;/strong&gt; This will make them possibly think that the function name could be renamed. After they explain what it does, then follow it up with a suggestion such as:&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;“I get it now, sorry for being slow! I’m not sure but do you think we could rename this function to option1, option2 or something along those lines, what are your thoughts”?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Always ask them their thoughts&lt;/strong&gt; as remember you are a reviewer and they wrote the code so its possible they have more context than you do.&lt;/p&gt;

&lt;p&gt;Imagine if your co-worker used words such as “Don’t do this, just rename the function”. That sounds so much direct, less friendly and &lt;strong&gt;sounds like you are giving them a command rather than taking their input on it.&lt;/strong&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Always provide suggestions for code improvements
&lt;/h4&gt;

&lt;p&gt;Rather than just telling them, “this code could be improved”. Provide them suggestions/examples on how it could be improved further for example,&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This code works perfectly but after I started reading it further, I thought of another idea that I wanted to run it by you. I’m not sure but what about?&lt;br&gt;&lt;br&gt;
sample code #1,&lt;br&gt;&lt;br&gt;
sample code #2&lt;br&gt;&lt;br&gt;
What are your thoughts?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  Use emoji’s
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IEpzOaiB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/225/1%2AZ2daFSeH84K2Y7L0TS6GgA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IEpzOaiB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/225/1%2AZ2daFSeH84K2Y7L0TS6GgA.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Online criticism is misinterpreted easily. Hence, emoji’s are one of the best tools for communicating online. Using them automatically adds a friendly tone to your sentences. &lt;em&gt;Use it when you start feeling that the conversation is getting too serious&lt;/em&gt; &lt;strong&gt;.&lt;/strong&gt; But if that’s not you then don’t force it, keep it real.&lt;/p&gt;

&lt;h4&gt;
  
  
  Take it offline
&lt;/h4&gt;

&lt;p&gt;If you find yourself going back and forth in conversations with your teammate, the conversations are getting too long and its leading nowhere, take it offline. There is no point spending time typing when you can quickly hop on a call 🤙or just walk 🚶‍ to their desk.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;When you meet face to face, you automatically develop more empathy and understand their point of view even further and alternatively, they understand yours&lt;/em&gt;. When you come to a conclusion, post a comment on the PR summarizing your discussion so other readers following along are aware of it and &lt;strong&gt;your future self will thank you for it.&lt;/strong&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  nitpick
&lt;/h4&gt;

&lt;p&gt;While reviewing code, you may find something that is basically a nitpick i.e. it may not necessarily block the approval of the PR but something to consider. &lt;em&gt;Nitpicks are not important but technically correct.&lt;/em&gt; They can be related to grammar corrections, un-intentional new lines, any aesthetics, minor code refactor etc. For example,&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;nit: extra white space&lt;br&gt;&lt;br&gt;
nit: can we assign this value to a &lt;code&gt;constant&lt;/code&gt; for better readability purposes?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  How to respond to feedback
&lt;/h3&gt;

&lt;p&gt;The rules that apply while submitting a PR equally apply while responding to it as well.&lt;/p&gt;

&lt;h4&gt;
  
  
  When suggestions are provided
&lt;/h4&gt;

&lt;p&gt;Always remember that you are collaborating and writing code. If a suggestion is provided, always treat it &lt;strong&gt;like a possibility of improving your code&lt;/strong&gt;. If you don’t understand something, ask for clarification for example,&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Can you please provide an example or Can you please clarify further? I don’t understand it completely.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you think the feedback is valid, implement it! However big or small the change is, if you think the feedback is valid, always reply and let the reviewer know that you took their feedback. For example,&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;That’s an excellent point, change coming right away!&lt;br&gt;&lt;br&gt;
Good point, thanks for catching that.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  If you disagree 👈
&lt;/h4&gt;

&lt;p&gt;Disagreements are bound to happen as different developers have different ways of writing code. Although, try to voice your opinion in a very friendly manner. &lt;strong&gt;If you agree to them partially then let them know but also provide your reasoning at where you disagree with them.&lt;/strong&gt; For example,&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;That’s a great point. I do agree with your first suggestion, will make a change right away. Totally missed that one. Although for the 2nd one, I did consider that option and decided to not go that route as for the following scenario, we don’t want to display that. //&lt;strong&gt;or whatever your reasoning was, be honest. 👈&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  Make your commit message obvious
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GD0l0-Mt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/436/1%2ApbuzadnGkN6Il2nsrmAIYw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GD0l0-Mt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/436/1%2ApbuzadnGkN6Il2nsrmAIYw.png" alt=""&gt;&lt;/a&gt;Gitmoji — commits example&lt;/p&gt;

&lt;p&gt;Now that you spent time on your feedback, write a good commit message which lets the reviewer know that you did consider their feedback but don’t make the message too long. A very handy tool is 🔗 &lt;a href="https://gitmoji.carloscuesta.me/"&gt;Gitmoji&lt;/a&gt;. 😍 They provide an easy way of identifying the purpose or intention of a commit by looking at the emojis used.&lt;/p&gt;

&lt;h4&gt;
  
  
  Take it a step further
&lt;/h4&gt;

&lt;p&gt;You have made some changes in your code based on the feedback you got. Now your code handles an additional scenario which you didn’t think of or wasn’t aware or may have missed but there’s your chance to &lt;strong&gt;“Write a test”&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Once your code is merged in, a defect gets filled. &lt;strong&gt;Once you fix that defect, add a test&lt;/strong&gt; to make sure that the defect is actually fixed and there’s proof 🕵️‍. Now, its documented!! 😃 You get brownie 🍫 points if you take it a step further. You will automatically gain the trust of your team.&lt;/p&gt;




&lt;p&gt;I hope you enjoyed reading this article and learned something. If you did, please give it some ❤️ and also, would love to hear your personal experiences on pull requests in comments. If you have any questions, please feel free to reach out on my Twitter.&lt;/p&gt;

</description>
      <category>developertools</category>
      <category>softwaredevelopment</category>
      <category>codereview</category>
      <category>pullrequest</category>
    </item>
  </channel>
</rss>
