<?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: Lem Dulfo</title>
    <description>The latest articles on DEV Community by Lem Dulfo (@bytehala).</description>
    <link>https://dev.to/bytehala</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%2F372536%2Ffad34774-3d5c-45ce-861e-e513f5a2e4fe.jpeg</url>
      <title>DEV Community: Lem Dulfo</title>
      <link>https://dev.to/bytehala</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/bytehala"/>
    <language>en</language>
    <item>
      <title>React Native: Android Studio Build Failing</title>
      <dc:creator>Lem Dulfo</dc:creator>
      <pubDate>Sat, 26 Apr 2025 17:56:06 +0000</pubDate>
      <link>https://dev.to/bytehala/android-studio-build-failing-6i9</link>
      <guid>https://dev.to/bytehala/android-studio-build-failing-6i9</guid>
      <description>&lt;p&gt;I'm currently primarily working in React Native, and a lot of the time, I use the command line to launch the app, for Android it's &lt;code&gt;react-native run-android&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Sometimes though, you need to launch the app through Android Studio. For example when you want an easy way to see Logcat logs.&lt;/p&gt;

&lt;p&gt;I ran into this issue where the app was building properly through the command line, but failing in Android Studio.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh1lwukux6ngamhtcrtjb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh1lwukux6ngamhtcrtjb.png" alt="Android studio build failing" width="800" height="373"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is odd, because behind the scenes, both the command line and Android Studio use the same tools.&lt;/p&gt;

&lt;p&gt;One of the build errors mentioned &lt;code&gt;react-native-vector-icons&lt;/code&gt;, and I found this issue on their Github: &lt;a href="https://github.com/software-mansion/react-native-svg/issues/1723" rel="noopener noreferrer"&gt;https://github.com/software-mansion/react-native-svg/issues/1723&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It mentions &lt;code&gt;react-native doctor&lt;/code&gt; and JDK 17. The thing is, running this in command line, where the build is already succeeding, will most likely show that you have the correct version of JDK.&lt;/p&gt;

&lt;p&gt;Could it be that Android Studio was using a different JDK version? Let's check.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0l9k1ves1ds62q4txvck.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0l9k1ves1ds62q4txvck.png" alt="Android Studio Gradle JDK setting" width="800" height="515"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It was using JDK 21 for some reason. I changed it to JDK 17 and the build succeeded.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhq3recfzglmpu2q47nye.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhq3recfzglmpu2q47nye.png" alt="Android Studio build successful" width="800" height="520"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So there it is, here's some things I learned:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;react-native doctor&lt;/code&gt; is available, I didn't know about it before&lt;/li&gt;
&lt;li&gt;Android Studio runs a different environment from your command line&lt;/li&gt;
&lt;li&gt;Error messages can sometimes mislead you, treat them as a clue instead of a fact&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>android</category>
      <category>mobile</category>
      <category>reactnative</category>
    </item>
    <item>
      <title>Real World Experience: Github Copilot Edits</title>
      <dc:creator>Lem Dulfo</dc:creator>
      <pubDate>Tue, 11 Feb 2025 21:42:17 +0000</pubDate>
      <link>https://dev.to/bytehala/real-world-experience-github-copilot-edits-4k37</link>
      <guid>https://dev.to/bytehala/real-world-experience-github-copilot-edits-4k37</guid>
      <description>&lt;p&gt;Will AI replace developers? Maybe. But for now, it augments developer productivity.&lt;/p&gt;

&lt;p&gt;For example, in our React Native codebase we were replacing occurrences of fontSize, fontWeight, and lineHeight with something from a pre-defined object, like textStyle.title, which contains all 3 attributes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F23gbt2hvp52cdty1zuz4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F23gbt2hvp52cdty1zuz4.png" alt="a git diff showing Github Copilot Edits at work" width="800" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It was repetitive, so why not ask GitHub Copilot Edits to do it for us?&lt;/p&gt;

&lt;p&gt;Here's how it works: you write the instructions in &lt;code&gt;.github/copilot-instructions.md&lt;/code&gt;, then you "chat" with Copilot to do the thing. Simple.&lt;/p&gt;

&lt;p&gt;Could it be done without the use of AI? Of course! We could have spent some time writing a script. The catch: you'll have to capture your thoughts as code.&lt;br&gt;
(Okay, let's ignore the fact that I just described what a programmer is literally paid to do... 😅)&lt;/p&gt;

&lt;p&gt;With AI, you write your thoughts down as natural language, and watch the magic happen.&lt;/p&gt;

&lt;p&gt;Don't sleep on it, here's the documentation: &lt;a href="https://code.visualstudio.com/docs/copilot/copilot-edits" rel="noopener noreferrer"&gt;https://code.visualstudio.com/docs/copilot/copilot-edits&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>reactnative</category>
      <category>react</category>
    </item>
    <item>
      <title>2025: Where I Am / Where I Want To Be</title>
      <dc:creator>Lem Dulfo</dc:creator>
      <pubDate>Tue, 28 Jan 2025 00:59:28 +0000</pubDate>
      <link>https://dev.to/bytehala/2025-digitally-nomadic-ke6</link>
      <guid>https://dev.to/bytehala/2025-digitally-nomadic-ke6</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/newyear"&gt;2025 New Year Writing challenge&lt;/a&gt;: Compiling 2025.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Distributed by Design
&lt;/h2&gt;

&lt;p&gt;I don't know when I started the format "where I am and where I want to be", but I found a journal entry as early as 2018. It included "Remote work". I've wanted to be a digital nomad ever since I heard the term. I finally work for a company where one of the tenets is &lt;code&gt;Distributed by Design&lt;/code&gt;, but fear has kept me from "doing the thing", coming up with some excuse or other.&lt;/p&gt;

&lt;p&gt;Yesterday, I arrived in Brazil, fresh from Toronto where we celebrated Clio's Team Day 2025.&lt;/p&gt;

&lt;p&gt;I'll be here for a few months, where I get to escape Canadian winter. Oddly enough, I still don't think "digital nomad" applies to me.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fznfziuy58gho2pukxigo.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fznfziuy58gho2pukxigo.jpg" alt="Photo of the author wearing a hoodie with a CN Tower print, while looking at the real CN Tower, back facing the camera" width="800" height="1066"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Where I Am
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;1200+ DEV.to followers&lt;/li&gt;
&lt;li&gt;not much of a YouTube dev presence&lt;/li&gt;
&lt;li&gt;only learning when I feel like it&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Where I Want To Be / What I Want To Do
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;participate in more DEV challenges&lt;/li&gt;
&lt;li&gt;make time for learning intentionally&lt;/li&gt;
&lt;li&gt;present at Dev Talks&lt;/li&gt;
&lt;li&gt;attend more in-person events (hmm... maybe even in Brazil)&lt;/li&gt;
&lt;li&gt;improve communication and presentation skills&lt;/li&gt;
&lt;li&gt;finally release my "deconstructing React Native" series of articles and YouTube videos&lt;/li&gt;
&lt;li&gt;attend React Native Universe Conf&lt;/li&gt;
&lt;li&gt;ask for help&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Looking at that list, it seems like a lot. I would really need to be more disciplined so I can achieve my goals. I need to remind myself to give myself some grace.&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>newyearchallenge</category>
      <category>career</category>
    </item>
    <item>
      <title>Annual Reminder: Brag About Your Work</title>
      <dc:creator>Lem Dulfo</dc:creator>
      <pubDate>Tue, 07 Jan 2025 17:54:03 +0000</pubDate>
      <link>https://dev.to/bytehala/annual-reminder-brag-about-your-work-913</link>
      <guid>https://dev.to/bytehala/annual-reminder-brag-about-your-work-913</guid>
      <description>&lt;p&gt;I work with one of the authors of 7 More Languages in 7 Weeks. Yesterday, I did a drive-by code review on her pull request, suggesting we implement the Strategy Pattern instead of the mishmash of &lt;code&gt;.includes&lt;/code&gt; and &lt;code&gt;===&lt;/code&gt; checks everywhere in our codebase.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;It's starting to look like we need a Strategy pattern (?) for region, such that we can just do:&lt;/p&gt;


&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nx"&gt;RegionStrategy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;currentState&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;region&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;hasAwesomeFeature&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;Instead of the current approach&lt;/p&gt;


&lt;pre class="highlight typescript"&gt;&lt;code&gt;    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;regionsWithFeature&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="s1"&gt;OR&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;TX&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;PI&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;regionsWithFeature&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;includes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;currentState&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;region&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// and other includes or ===, etc variants all over our code&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/blockquote&gt;

&lt;p&gt;She replied, "Awesome idea, I'm going to implement it."&lt;/p&gt;

&lt;p&gt;I was privately gushing to my friends about how awesome it felt to be seen by "a great". But I didn't want to seem braggy and pompous to the greater dev community, so I didn't write an article about it.&lt;/p&gt;

&lt;p&gt;This morning, I examined myself -- why not write the article? Why hide? Why suppress the feeling of being validated? After all, this is one of my whys for being a dev: the recognition by my peers that I know my stuff.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bragging
&lt;/h2&gt;

&lt;p&gt;It is January again, the start of another 6 month cycle. A performance cycle just ended, and many of you were asked to write a self-assessment. What did you achieve in the past 6 months? Did you have anything to write?&lt;/p&gt;

&lt;p&gt;Here's a tip from my favorite manager: Keep a Brag Document.&lt;/p&gt;

&lt;p&gt;It wasn't an original thought, and many have written about it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://jvns.ca/blog/brag-documents/" rel="noopener noreferrer"&gt;Julia Evans - Get Your Work Recognized&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.reddit.com/r/webdev/comments/19dtf6r/why_a_brag_doc_is_indispensable/" rel="noopener noreferrer"&gt;r/webdev - why a brag doc is indespensable&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.reddit.com/r/ExperiencedDevs/comments/h972k3/keep_a_brag_document/" rel="noopener noreferrer"&gt;r/ExperiencedDevs&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.hackerone.com/engineering/brag-document" rel="noopener noreferrer"&gt;hackerone - Why I Keep A Brag Document&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.thefountaininstitute.com/blog/brag-documents" rel="noopener noreferrer"&gt;Fountain Institute - Keeping Track of Your Accomplishments&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Takeaway
&lt;/h2&gt;

&lt;p&gt;Don't be shy. Be proud of your work. Remind yourself why you're doing what you do, and why you love doing this.&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>career</category>
      <category>discuss</category>
      <category>learning</category>
    </item>
    <item>
      <title>Pop Quiz: Is There a Bug in This React Native Component?</title>
      <dc:creator>Lem Dulfo</dc:creator>
      <pubDate>Mon, 06 Jan 2025 21:38:53 +0000</pubDate>
      <link>https://dev.to/bytehala/pop-quiz-is-there-a-bug-in-this-react-native-component-j71</link>
      <guid>https://dev.to/bytehala/pop-quiz-is-there-a-bug-in-this-react-native-component-j71</guid>
      <description>&lt;p&gt;The code below has no IDE or compiler warnings, but is there a bug?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;MyComponent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;MyComponentProps&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;loading&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useQuery&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;GET_ALL_USERS&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="nf"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;onLoadingStateChange&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;loading&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="nx"&gt;loading&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;UserList&lt;/span&gt;
      &lt;span class="p"&gt;{...&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Take a moment to look at the code and think about it.&lt;/p&gt;




&lt;p&gt;
  Click to Reveal the Answer
  &lt;br&gt;
&lt;strong&gt;Answer:&lt;/strong&gt; Yes! Kind of.

&lt;p&gt;(If you answered yes, consider your answer correct.)&lt;br&gt;
Technically, it's not a bug but a subtle performance pitfall.&lt;/p&gt;

&lt;p&gt;Because the &lt;code&gt;useEffect&lt;/code&gt; depends on &lt;code&gt;props&lt;/code&gt;, it the side effect will run when any attribute inside props has changed.&lt;/p&gt;

&lt;p&gt;The fix:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;onLoadingStateChange&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// destructure, so the dependency array is more specific&lt;/span&gt;
  &lt;span class="nf"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;onLoadingStateChange&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;loading&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="nx"&gt;loading&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;onLoadingStateChange&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;💬 NOTE&lt;br&gt;
This might seem like a contrived example that doesn't happen in real life, but I assure you: seeing this during code review prompted me to write the article.&lt;/p&gt;
&lt;/blockquote&gt;



&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Did you get it right? Please don't spoil the answer in the comments.&lt;br&gt;
❤️ - you got it right&lt;br&gt;
🤯 - didn't get it right, but learned something&lt;/p&gt;

</description>
      <category>react</category>
      <category>reactnative</category>
      <category>tutorial</category>
      <category>learning</category>
    </item>
    <item>
      <title>Function Naming: When It’s Called vs What It Does</title>
      <dc:creator>Lem Dulfo</dc:creator>
      <pubDate>Tue, 24 Dec 2024 23:41:24 +0000</pubDate>
      <link>https://dev.to/bytehala/function-naming-when-its-called-vs-what-it-does-346l</link>
      <guid>https://dev.to/bytehala/function-naming-when-its-called-vs-what-it-does-346l</guid>
      <description>&lt;p&gt;Naming functions might seem trivial, but it can significantly impact readability and maintainability. One common dilemma is whether to name a function based on &lt;strong&gt;when it’s called&lt;/strong&gt; or &lt;strong&gt;what it does&lt;/strong&gt;. Let’s explore this with a simple example.&lt;/p&gt;




&lt;h3&gt;
  
  
  Example: Showing a Popup
&lt;/h3&gt;

&lt;p&gt;Suppose you have a function that shows a popup when a button is pressed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;onButtonPressed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;popupInstance&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;show&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;LENGTH_LONG&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Button&lt;/span&gt; &lt;span class="nx"&gt;onPress&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;onButtonPressed&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="sr"&gt;/&amp;gt;&lt;/span&gt;&lt;span class="err"&gt;;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The function name onButtonPressed clearly reflects &lt;strong&gt;when&lt;/strong&gt; this function is called – in response to a button press.&lt;/p&gt;

&lt;p&gt;But what if you also need to show the same popup when the page loads?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// other initialization code...&lt;/span&gt;
&lt;span class="nf"&gt;onButtonPressed&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we have a small mismatch – the function name implies a button press, but we're calling the function &lt;strong&gt;even if no button is pressed.&lt;/strong&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  An Alternative Approach: Name it Based on What it Does
&lt;/h3&gt;

&lt;p&gt;Consider renaming the function to reflect &lt;strong&gt;what it does&lt;/strong&gt;, not when it’s called:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;showPopup&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;popupInstance&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;show&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;LENGTH_LONG&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  When the button is pressed:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Button&lt;/span&gt; &lt;span class="nx"&gt;onPress&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;showPopup&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="sr"&gt;/&amp;gt;&lt;/span&gt;&lt;span class="err"&gt;;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  When the page loads:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// other initialization code...&lt;/span&gt;
&lt;span class="nf"&gt;showPopup&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This small change improves clarity. It’s immediately obvious that the function &lt;strong&gt;shows a popup&lt;/strong&gt;, regardless of the trigger.&lt;/p&gt;




&lt;h3&gt;
  
  
  When is ‘When It’s Called’ Appropriate?
&lt;/h3&gt;

&lt;p&gt;Naming functions based on &lt;strong&gt;when&lt;/strong&gt; they are triggered (&lt;code&gt;onPress&lt;/code&gt;, &lt;code&gt;onSubmit&lt;/code&gt;, &lt;code&gt;onScroll&lt;/code&gt;) is perfectly fine. In fact, it’s often preferred for handlers tied to specific events.&lt;/p&gt;

&lt;p&gt;However, as functionality grows and the same logic needs to run in different contexts, consider transitioning to names that describe &lt;strong&gt;what the function actually does.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  The Takeaway
&lt;/h3&gt;

&lt;p&gt;It’s okay to start with “when it’s called” names. Just be open to &lt;strong&gt;renaming functions as their use evolves&lt;/strong&gt;. Let function names reflect their true purpose, making your code easier to read and reuse.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Solved: npm or yarn install node_modules is too big</title>
      <dc:creator>Lem Dulfo</dc:creator>
      <pubDate>Fri, 20 Dec 2024 20:31:46 +0000</pubDate>
      <link>https://dev.to/bytehala/solved-npm-or-yarn-install-nodemodules-is-too-big-2j23</link>
      <guid>https://dev.to/bytehala/solved-npm-or-yarn-install-nodemodules-is-too-big-2j23</guid>
      <description>&lt;p&gt;TLDR: It might be your node_modules hoisting limit configuration. Run &lt;code&gt;yarn config get nmHoistingLimits&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Background Context:&lt;/p&gt;

&lt;p&gt;A colleague's local environment was generating a different &lt;code&gt;licenses.txt&lt;/code&gt; file than what our CI system was generating, so his pull requests kept failing in CI.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;licenses.txt&lt;/code&gt; is important when releasing a React Native app to the public, like Apple App Store or Google Play Store, especially when including MIT-licensed packages. Otherwise, your company might be held liable for improper attribution.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fje1ns25oa7rjoun0r1u7.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fje1ns25oa7rjoun0r1u7.jpg" alt="meme saying no to driver's license, yes to MIT license" width="500" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Process of elimination, we compared our environments:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;same: license-checker npm package&lt;/li&gt;
&lt;li&gt;same: yarn.lock&lt;/li&gt;
&lt;li&gt;same: nodenv, node, and yarn versions&lt;/li&gt;
&lt;li&gt;same: .yarnrc&lt;/li&gt;
&lt;li&gt;different: &lt;code&gt;yarn install&lt;/code&gt; speed&lt;/li&gt;
&lt;li&gt;different: string searching &lt;code&gt;node_modules&lt;/code&gt; for one arbitrary library &lt;code&gt;@babel/code-frame&lt;/code&gt; library yielded 100 results for me, and 400+ for him&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It didn't initially make sense that the same package.json would behave differently, when our node and yarn were the same versions, and even our .yarnrc&lt;/p&gt;

&lt;p&gt;Not knowing how to proceed, I described my problem to Chat GPT and it gave me this command to try:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yarn config list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We ran this and found out that my config had this, and his did not:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nmHoistingLimits: 'workspaces'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Hope this helps!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>npm</category>
      <category>opensource</category>
      <category>githubactions</category>
    </item>
    <item>
      <title>Idle MMORPG with DevCycle Feature Flags 🧝‍♀️</title>
      <dc:creator>Lem Dulfo</dc:creator>
      <pubDate>Thu, 19 Dec 2024 10:51:28 +0000</pubDate>
      <link>https://dev.to/bytehala/feature-factions-mobile-cooperate-and-battle-with-devcycle-feature-flags-4mnk</link>
      <guid>https://dev.to/bytehala/feature-factions-mobile-cooperate-and-battle-with-devcycle-feature-flags-4mnk</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/devcycle"&gt;DevCycle Feature Flag Challenge&lt;/a&gt;: Feature Flag Funhouse&lt;/em&gt;&lt;/p&gt;

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

&lt;p&gt;For this challenge, I built a role-playing game in React Native where players remit their mined gold to their faction's bank and collectively unlock features. The more players a faction recruits, the faster that faction can buy feature upgrades.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd03yjsp772q33qxlx5yf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd03yjsp772q33qxlx5yf.png" alt="Feature Factions game banner" width="800" height="280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Welcome to Feature Factions, where the fate of three ancient races rests in your hands! Will you join the precise and mechanical Aetheron, the resilient and cunning Bessari, or the mystical and graceful Calenwyn? Mine resources to fuel your faction’s treasury—the Aetheron Central Node 🤖, the Bessari Guild Vault 🧑‍🏭, or the Calenwyn Sylvan Reliquary 🧝‍♀️. Work with your allies to unlock powerful upgrades and strategize for the ultimate showdown. The war is coming—#StopPretending 🧙and #StartShipping 🚀&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnjen1v4zc9qrqqovohr4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnjen1v4zc9qrqqovohr4.png" alt="Screenshots of the 3 factions in Feature Factions game" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;These are original sprites I designed, inspired by Realm of the Mad God.&lt;/p&gt;

&lt;p&gt;For the first "upgrade", all Factions get a baseline option.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiqzv9y8vb2pu9fyur1g9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiqzv9y8vb2pu9fyur1g9.png" alt="Screenshot showing feature varations in DevCycle" width="800" height="639"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I used Permission Feature Flags, and gated based on the UserFaction property. The Bessaris get Configuration 2:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5v3nq7apx30eqq8yd0l4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5v3nq7apx30eqq8yd0l4.png" alt="screenshot showing targeting in DevCycle" width="800" height="502"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  My Code
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/bytehala/feature-factions-rpg" rel="noopener noreferrer"&gt;https://github.com/bytehala/feature-factions-rpg&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  My DevCycle Experience
&lt;/h2&gt;

&lt;p&gt;A rocky start, but overall good.&lt;/p&gt;

&lt;p&gt;I followed the React Native quickstart, and I kept getting &lt;code&gt;UserError: Invalid SDK key provided&lt;/code&gt; when I used the mobile SDK key.&lt;/p&gt;

&lt;p&gt;To debug this, I installed the DevCycle CLI and worked to rule out React Native as the source of the error. This led me to discover the &lt;code&gt;dvc keys get&lt;/code&gt; command, which showed the same keys I was seeing in my dashboard. Interestingly, the client key worked in my React Native app, but the mobile SDK key did not.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl85hgl3iray0s0pynz3s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl85hgl3iray0s0pynz3s.png" alt="A screenshot of the DevCycle CLI command dvc keys get" width="800" height="176"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The DevCycle documentation that I needed for React Native, CLI, and the Management API are quite thorough. I like that the CLI is available, as well as the Management API. These allowed me to quickly test features and contextualize DevCycle feature flags outside of my Feature Factions code without having to scaffold a brand new app.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Getting an auth token in the command line via cURL:&lt;/span&gt;
curl &lt;span class="nt"&gt;--request&lt;/span&gt; POST &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--url&lt;/span&gt; &lt;span class="s2"&gt;"https://auth.devcycle.com/oauth/token"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--header&lt;/span&gt; &lt;span class="s1"&gt;'content-type: application/x-www-form-urlencoded'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--data&lt;/span&gt; &lt;span class="nv"&gt;grant_type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;client_credentials &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--data&lt;/span&gt; &lt;span class="nv"&gt;audience&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;https://api.devcycle.com/ &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--data&lt;/span&gt; &lt;span class="nv"&gt;client_id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&amp;lt;client &lt;span class="nb"&gt;id&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--data&lt;/span&gt; &lt;span class="nv"&gt;client_secret&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&amp;lt;client secret&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I also like that the client app can identify with DevCycle using custom data. It opens up possibilities such as the app "asking" for features because of an on-device trigger or threshold that gets reached, for example, if the user has interacted enough times with the app, it can ask the backend if there are newly configured features or rewards.&lt;/p&gt;

&lt;p&gt;In Feature Factions, I used customData to send the user's faction to DevCycle:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nx"&gt;devCycleClient&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;identifyUser&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;user_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;test-user&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;customData&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;userFaction&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I then grab the available upgrade options for that faction, which I use to populate the button choices:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;options&lt;/span&gt;&lt;span class="p"&gt;}:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;options&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;[]}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
    &lt;span class="nf"&gt;useVariableValue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;variableKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="na"&gt;options&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[]});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And that's how we can use DevCycle feature flags to dynamically control upgrade options that players can vote for in their faction. Think of all the possibilities!&lt;/p&gt;

&lt;p&gt;The diagram below illustrates how a backend service would enable features for Factions when they reach a Gold threshold or other conditions:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdv4xif2wdqfeya6pifk9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdv4xif2wdqfeya6pifk9.png" alt="flowchart describing how the backend generates features for Feature Factions" width="800" height="272"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Since this is a POC, I didn’t create an actual backend integration with DevCycle, I just used DevCycle Dashboard directly. However, I was able to simulate the backend functionality by using a cURL command to enable features for the Factions, thanks to the DevCycle Management API.&lt;/p&gt;

&lt;p&gt;This was a fun challenge overall, and the prompt really made me think of feature flags in a new light.&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>devcyclechallenge</category>
      <category>webdev</category>
      <category>devops</category>
    </item>
    <item>
      <title>2024 Update on DEV.to Monetization: REMOVED</title>
      <dc:creator>Lem Dulfo</dc:creator>
      <pubDate>Wed, 18 Dec 2024 21:51:14 +0000</pubDate>
      <link>https://dev.to/bytehala/2024-update-on-devto-monetization-removed-4517</link>
      <guid>https://dev.to/bytehala/2024-update-on-devto-monetization-removed-4517</guid>
      <description>&lt;p&gt;The Payment Pointer and micropayments to your DEV.to articles are a thing of the past.&lt;/p&gt;

&lt;p&gt;Actually, it has been removed since November 2023.&lt;br&gt;
&lt;a href="https://github.com/forem/forem/issues/20401" rel="noopener noreferrer"&gt;https://github.com/forem/forem/issues/20401&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'm writing this article because the internet is littered with articles about how to get micropayments when writing for DEV.to and other platforms, and it currently takes a bit of digging to find out that those articles are outdated.&lt;/p&gt;

&lt;p&gt;So yes, Coil is no longer operational. DEV.to monetization using micropayments has been removed. You can no longer set your payment pointer in your DEV settings &lt;a href="https://dev.to/settings/misc"&gt;https://dev.to/settings/misc&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The original article should be deprecated &lt;a href="https://dev.to/devteam/dev-is-now-web-monetized-21db"&gt;https://dev.to/devteam/dev-is-now-web-monetized-21db&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I hope this gets surfaced, so others can save time and heartbreak.&lt;/p&gt;

&lt;p&gt;As for me, I'm still writing down my learnings in hopes of helping others but mostly my future self, because it's easy to forget things when you don't write them down.&lt;/p&gt;

</description>
      <category>webmonetization</category>
      <category>web</category>
      <category>gftwhackathon</category>
      <category>opensource</category>
    </item>
    <item>
      <title>IDE Warning When Calling Async Function with No Await</title>
      <dc:creator>Lem Dulfo</dc:creator>
      <pubDate>Fri, 06 Dec 2024 23:41:47 +0000</pubDate>
      <link>https://dev.to/bytehala/ide-warning-when-calling-async-function-with-no-await-1lkn</link>
      <guid>https://dev.to/bytehala/ide-warning-when-calling-async-function-with-no-await-1lkn</guid>
      <description>&lt;p&gt;When should it be okay to not have an &lt;code&gt;await&lt;/code&gt; for an async call?&lt;br&gt;
Sometimes, I just want to call the async function, but not have to wait for its result. You might want your code to keep going, without needing the return value:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fce9q6m7jmxtcrsyxb1yu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fce9q6m7jmxtcrsyxb1yu.png" alt="Image description" width="375" height="110"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thing is, the IDE will show a warning. It also signals to other devs in your team that "something may or may not be needed to be done for this warning". The worst that could happen is someone else tries to "fix" this by adding an &lt;code&gt;await&lt;/code&gt;, and it slows down your app.&lt;/p&gt;

&lt;p&gt;But if you're sure you're not waiting for the result and you want to signal to the IDE and your team that it's okay, here's what you can do.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwab6o16s1x9v8sn1j7gw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwab6o16s1x9v8sn1j7gw.png" alt="Image description" width="269" height="71"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Receive the result in &lt;code&gt;_&lt;/code&gt;, which is generally accepted as a prefix for unused variables.&lt;/p&gt;

&lt;p&gt;This way the IDE knows that you're aware that something is being returned, in this case it's a Promise, and that you're okay with not doing anything with the result.&lt;/p&gt;

&lt;p&gt;This also keeps the visual tidy, while telling your teammates the intent. They won't be adding an unwanted &lt;code&gt;await&lt;/code&gt;.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>typescript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>patch-package with Artifactory</title>
      <dc:creator>Lem Dulfo</dc:creator>
      <pubDate>Thu, 07 Nov 2024 16:51:28 +0000</pubDate>
      <link>https://dev.to/bytehala/patch-package-with-artifactory-17f5</link>
      <guid>https://dev.to/bytehala/patch-package-with-artifactory-17f5</guid>
      <description>&lt;p&gt;&lt;code&gt;yarn patch-package packagename&lt;/code&gt; fails with 401 Unauthorized, &lt;code&gt;npm run patch-package&lt;/code&gt; doesn't help either.&lt;/p&gt;

&lt;p&gt;This usually happens when your company self-hosts packages, in our case with JFrog artifactory, but it can be other registries.&lt;/p&gt;

&lt;p&gt;When patch-package fails with 401 Unauthorized for private registries, even if your command line is configured with the Identity Token, you can run this instead:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npx patch-package packagename&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Source: &lt;a href="https://stackoverflow.com/a/71396819" rel="noopener noreferrer"&gt;StackOverflow Answer&lt;/a&gt;&lt;/p&gt;

</description>
      <category>npm</category>
      <category>reactnative</category>
    </item>
    <item>
      <title>Your Apple App Site Association Might Be Wrong</title>
      <dc:creator>Lem Dulfo</dc:creator>
      <pubDate>Fri, 11 Oct 2024 23:21:51 +0000</pubDate>
      <link>https://dev.to/bytehala/your-apple-app-site-association-might-be-wrong-2hcd</link>
      <guid>https://dev.to/bytehala/your-apple-app-site-association-might-be-wrong-2hcd</guid>
      <description>&lt;p&gt;Let's talk about &lt;code&gt;.well-known/apple-app-site-association&lt;/code&gt;. Are you sure you need an empty apps array? What about paths, did you remember to duplicate it to the components array?&lt;/p&gt;

&lt;p&gt;If you're new to iOS development like I am, you know how hard it is to know if you're configuring this file right. Are wildcards allowed? Why is this property here? Should I host this in each subdomain?&lt;/p&gt;

&lt;p&gt;Misconfiguring the AASA can cause your app's handling of universal links to behave inconsistently. Turns out, there is a right way to do it, it's just not very well documented.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftfjux60ow4t0x3w92t4c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftfjux60ow4t0x3w92t4c.png" alt="Apple developer forum linking to wwdc 2019 video for Apple App Site Association" width="800" height="199"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://forums.developer.apple.com/forums/thread/129460" rel="noopener noreferrer"&gt;https://forums.developer.apple.com/forums/thread/129460&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I can tell you my team's AASA file had some deprecated attributes. Check the video out and compare it to your current association file.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/E1rgGlTXedA"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>ios</category>
      <category>reactnative</category>
      <category>mobile</category>
    </item>
  </channel>
</rss>
