<?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: Brad Bodine</title>
    <description>The latest articles on DEV Community by Brad Bodine (@bradbodine-dev).</description>
    <link>https://dev.to/bradbodine-dev</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%2F86182%2Fe4c29b1f-51fc-44bf-b4d0-c7eed69e252f.png</url>
      <title>DEV Community: Brad Bodine</title>
      <link>https://dev.to/bradbodine-dev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/bradbodine-dev"/>
    <language>en</language>
    <item>
      <title>How Signals Can Boost Your Angular Performance</title>
      <dc:creator>Brad Bodine</dc:creator>
      <pubDate>Wed, 17 Jan 2024 18:56:23 +0000</pubDate>
      <link>https://dev.to/bradbodine-dev/how-signals-can-boost-your-angular-performance-b5m</link>
      <guid>https://dev.to/bradbodine-dev/how-signals-can-boost-your-angular-performance-b5m</guid>
      <description>&lt;p&gt;Angular is a popular framework for building web applications, but it also comes with some challenges. One of them is how to manage state changes and update the view efficiently. Angular uses a change detection mechanism that runs every time an event occurs, such as a user interaction, a timer, or an HTTP request. This can lead to performance issues, especially for complex applications with many components and data bindings.&lt;/p&gt;

&lt;p&gt;To solve this problem, Angular introduces a new feature: Signals. Signals are a way to wrap values that can change over time and notify interested consumers when they do. Signals can contain any value, from simple primitives to complex data structures. A signal's value is always read through a getter function, which allows Angular to track where the signal is used. Signals may be either writable or read-only.&lt;/p&gt;

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

&lt;p&gt;Signals offer several advantages over the traditional way of managing state in Angular. Here are some of them:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Granular change detection&lt;/strong&gt;: Signals allow Angular to know exactly which parts of the application depend on which signals, and only update those parts when the signals change. This reduces the amount of unnecessary rendering and improves performance.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reactive programming&lt;/strong&gt;: Signals enable a declarative and reactive style of programming, where you can define how your state is derived from other signals, and let Angular handle the updates automatically. This makes your code more readable, maintainable, and testable.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Easy debugging&lt;/strong&gt;: Signals make it easy to inspect and manipulate the state of your application at any point in time. You can use the Angular DevTools extension to view the current values of your signals, and even change them on the fly to see how your application reacts.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How to Use Signals
&lt;/h2&gt;

&lt;p&gt;To use signals in your Angular application, you need to import &lt;code&gt;signal&lt;/code&gt; from the &lt;code&gt;@angular/core&lt;/code&gt; module and use the provided functions to create and manipulate signals. Here are some examples of how to use signals:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Writable signals&lt;/strong&gt;: Writable signals provide an API for updating their values directly. You create writable signals by calling the &lt;code&gt;signal&lt;/code&gt; function with the signal's initial value:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;signal&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@angular/core&lt;/span&gt;&lt;span class="dl"&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;countSignal&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;signal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Signal values can be anything, including objects and arrays.&lt;/span&gt;

&lt;span class="c1"&gt;// Signals are getter functions - calling them reads their value.&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;The count is: &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nf"&gt;countSignal&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;

&lt;span class="c1"&gt;// To change the value of a writable signal, you can either .set() it directly:&lt;/span&gt;
&lt;span class="nx"&gt;countSignal&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// or use the .update() operation to compute a new value from the previous one:&lt;/span&gt;
&lt;span class="c1"&gt;// Increment the count by 1.&lt;/span&gt;
&lt;span class="nx"&gt;countSignal&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;update&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Computed signals&lt;/strong&gt;: A computed signal derives its value from other signals. Define one using &lt;code&gt;computed&lt;/code&gt; and specifying a derivation function:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;signal&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;computed&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@angular/core&lt;/span&gt;&lt;span class="dl"&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;countSignal&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;signal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;doubleCount&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;computed&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;countSignal&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// The doubleCount signal depends on count. Whenever count updates, Angular knows that anything which depends on either count or doubleCount needs to update as well.&lt;/span&gt;

&lt;span class="nf"&gt;increment&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;qty&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;countSignal&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;update&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;qty&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;ul&gt;
&lt;li&gt;
&lt;strong&gt;Binding signals to templates&lt;/strong&gt;: You can use signals in your templates just like any other expression, by using the &lt;code&gt;{{ }}&lt;/code&gt; interpolation syntax or the &lt;code&gt;[ ]&lt;/code&gt; property binding syntax. Angular will automatically update the view when the signals change:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Current Count: {{ countSignal() }}&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Doubled Count: {{ doubleCount() }}&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;(click)=&lt;/span&gt;&lt;span class="s"&gt;"increment()"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Increment&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Signal template updates currently require the use of &lt;code&gt;changeDetection: ChangeDetectionStrategy.OnPush&lt;/code&gt; in the component. &lt;a href="https://stackoverflow.com/a/76487286/307836"&gt;Stack Overflow Explanation&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

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

&lt;p&gt;Signals are a powerful feature that can help you write more performant, reactive, and maintainable Angular applications. They are currently available as an experimental feature in Angular 16, and you can try them out by following the &lt;a href="https://angular.dev/guide/signals"&gt;Angular Signals&lt;/a&gt; guide. If you want to learn more about signals, you can also check out these resources:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://blog.angular-university.io/angular-signals/"&gt;Angular Signals: Complete Guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/angularwave/introduction-to-angular-signals-e20dba5737db"&gt;Introduction to Angular Signals&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.freecodecamp.org/news/angular-signals/"&gt;Signals in Angular – How to Write More Reactive Code&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I hope you enjoyed this article and found it useful. If you have any questions or feedback,&lt;br&gt;
please let me know. 😊&lt;/p&gt;

</description>
      <category>angular</category>
      <category>signals</category>
      <category>performance</category>
    </item>
    <item>
      <title>Jam Aims to be a QA's Best Friend</title>
      <dc:creator>Brad Bodine</dc:creator>
      <pubDate>Thu, 11 Jan 2024 22:06:35 +0000</pubDate>
      <link>https://dev.to/bradbodine-dev/jam-aims-to-be-a-qas-best-friend-46fl</link>
      <guid>https://dev.to/bradbodine-dev/jam-aims-to-be-a-qas-best-friend-46fl</guid>
      <description>&lt;p&gt;(And a developers too)&lt;/p&gt;

&lt;p&gt;Jam is a browser extension that allows you to create the perfect bug report in just one click.&lt;/p&gt;

&lt;p&gt;The goal of Jam is to make bug reporting faster for QA's, faster for developers, and overall pain and frustration free.&lt;/p&gt;

&lt;p&gt;Imagine how bugs are reported at a company. The bug finder, many times a QA, creates a ticket and tries to give you as much detail as they can on how they ended up seeing the bug that they found. Sometimes the details are slim because to the reporter, it looks pretty obvious that a developer would see the bug right away. But, many times, the developer will have a different result because they may have a different browser, a different system; there could be many reasons that the developer isn't seeing the bug that the reporter is. Many times the developer will says, "it works fine on my end!" and close the ticket, ultimately leaving the product with an error.&lt;/p&gt;

&lt;p&gt;With Jam, in one click, you can: take a screenshot, record a video, or capture an instant replay, and Jam will instantly generate a link to share with your team. &lt;/p&gt;

&lt;p&gt;The Jam link will also include all the technical diagnostic info your engineering team needs to quickly debug, such as network requests, console logs, device information, and even network speed! It's all captured so you no longer have to reproduce or find the technical diagnostics before reporting the bug.&lt;/p&gt;

&lt;p&gt;Once you have your Jam link, simply paste it into a ticket or chat message to share it with engineers, or connect Jam to your issue-tracking tool of choice to create tickets right from Jam. No account is required to view, so engineers can click the link, and at a glance see the bug and why it happened.&lt;/p&gt;

&lt;p&gt;Now the QA can capture a perfect reproduction. The developer has all the info they need to fix the bug faster, without a bunch of back and forth trying to figure out why they aren't seeing what the QA saw.&lt;/p&gt;

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

&lt;p&gt;Pain free, easy, simple, bug reporting.&lt;/p&gt;

&lt;p&gt;Jam is currently in beta and is &lt;a href="https://jam.dev/pricing/"&gt;free to try&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Checkout &lt;a href="https://jam.dev/docs"&gt;Jam.dev&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>qa</category>
      <category>management</category>
    </item>
    <item>
      <title>VSCode TypeScript is Stuck!?</title>
      <dc:creator>Brad Bodine</dc:creator>
      <pubDate>Thu, 11 Jan 2024 16:55:10 +0000</pubDate>
      <link>https://dev.to/bradbodine-dev/vscode-typescript-is-stuck-1dh3</link>
      <guid>https://dev.to/bradbodine-dev/vscode-typescript-is-stuck-1dh3</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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fncwd3lt9j5h56afeliy1.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%2Fncwd3lt9j5h56afeliy1.png" alt="TypeScript Code with an error"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;How many times have you seen this little squiggley in your code and you are sure it shouldn't be there? Happens to me quite a lot. Usually when I install a new package and TypeScript doesn't seem to pick it up. Well there is a quick way to fix it (if it really shouldn't be there).&lt;/p&gt;

&lt;p&gt;While you are focused on a typescript file (.ts), open the command prompt &lt;code&gt;cmd&lt;/code&gt; + &lt;code&gt;shift&lt;/code&gt; + &lt;code&gt;p&lt;/code&gt;. Type "restart" in the prompt and look for "TypeScript: Restart TS Server". &lt;/p&gt;

&lt;p&gt;Now, assuming you don't have a type or lint error, you will be good to go again.&lt;/p&gt;

</description>
      <category>vscode</category>
      <category>typescript</category>
      <category>devtip</category>
    </item>
  </channel>
</rss>
