<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Serdar Sayın on Medium]]></title>
        <description><![CDATA[Stories by Serdar Sayın on Medium]]></description>
        <link>https://medium.com/@sayinserdar?source=rss-c9798d47edb0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*aBVwfvLeHJh_0swjHm-Rbg.jpeg</url>
            <title>Stories by Serdar Sayın on Medium</title>
            <link>https://medium.com/@sayinserdar?source=rss-c9798d47edb0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 16:56:53 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sayinserdar/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[9 Hidden Features of Chrome DevTools]]></title>
            <link>https://medium.com/codeshakeio/9-hidden-features-of-chrome-devtools-ca18fbf8470c?source=rss-c9798d47edb0------2</link>
            <guid isPermaLink="false">https://medium.com/p/ca18fbf8470c</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[google]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Serdar Sayın]]></dc:creator>
            <pubDate>Fri, 23 Apr 2021 08:53:00 GMT</pubDate>
            <atom:updated>2021-04-23T08:53:00.020Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lhTyNdL2KcsT4F0E_HXkoA.png" /><figcaption><a href="https://en.wikipedia.org/wiki/Wanderer_above_the_Sea_of_Fog">Wanderer Above the Sea of Fog</a> by Caspar David Friedrich</figcaption></figure><blockquote>For the sake of integrity I would encourage you to read from start to end because there are connections between them. <em>✌️</em></blockquote><h4>Prerequisites</h4><ul><li>Having a basic understanding of Chrome DevTools is more than enough.</li><li>The basics of web development are also nice to have.</li></ul><h3>Introduction</h3><p>Web development is hard. There are so many tools/languages/frameworks out there. When someone asks you; Hey! do you know <em>library X</em>? You might say, Yeah I heard good things about it or you might say I have somewhat experience. These conversations remind me of a great novel.</p><p>In the book “A Wizard of Earthsea”, there are multiple names for each character/object. However, there is only one <strong>true name</strong><em> </em>that needs to be kept secret. Because, if you know the true name of that character/object you have full power against them, and the only way to discover the real name is by <strong>knowing</strong> the character/object. It might seem a little abstract but here is the connection.</p><p>When you know your tool in detail not by how it resonates when you hear but with the full knowledge on that domain. That’s when you have full power over them. This story will try to help you to learn the <strong>true name</strong> of Google Chrome DevTools.</p><p>Let’s go.</p><h3>1. Command Menu 🕵️</h3><p>The very first thing is the command menu. It enables you to search through all possibilities Dev Tools give you. I actually could just give you this shortcut and call this an article 🤖.</p><p>After you open up your DevTools</p><p>Use these shortcuts to open up the command menu depending on your operating system.</p><p>macOS</p><pre>Cmd + Shift + P </pre><p>Windows and Linux</p><pre>Ctrl + Shift + P</pre><p>You can see all the possibilities and they are classified under several names. I’m going to try to explain some of the most useful/hidden capabilities in this article. I cannot urge you enough to dive into detail.</p><h3>2. Throttling 🚧️</h3><p>If you are living in a first-world country you probably have a minimal amount of experience on how hard life is surfing on the internet with terrible connections. Even if you are living in those states your users may not live under similar circumstances.</p><p>According to ITU (International Telecommunication Union), 10% of the mobile users in Developing* countries are using 3G. That’s roughly millions of people. I’m not even counting jitters on your <strong>fast connections </strong>or terrible connections when having a hiking trip with your buddies. If you are not prepared for these kinds of conditions your retention rate may drop drastically or simply they wouldn’t enjoy your application.</p><p>Staring at a blank screen sucks. Only if there&#39;s a way to emulate these conditions. 🤔</p><p>Let’s type <strong>Show Throttling</strong> in your command menu.</p><p>This tab’s purpose is solely to emulate different internet speed connections. You can create new user profiles for your own needs and pretend as if you are them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*RJ65kubzTdq9jCSV.gif" /><figcaption>Creating Throttle Profile</figcaption></figure><p>Open up your <strong>Network</strong> tab and click the <strong>No throttling</strong> dropdown.</p><p>You’ll see a couple of options to emulate, you can pick default options or use the custom one that you can create.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*ZLHg5RODIXrqGpf_.gif" /><figcaption>Usage of Throttle Profile</figcaption></figure><h3>3. Experiments 🔮️</h3><p>For the time being, I’m using version <strong>90.0.4430.72 (Official Build)</strong><em>. </em>The features that I show you are stable except the 4th one. Super talented people at Google are still working on making DevTools better day by day. However, you may not see every feature unless you enable the <strong>experiments</strong> explicitly. So here is the tip.</p><p>Go to your <strong>Command Menu </strong>and type <strong>Show Experiments</strong></p><p>You’ll see that there are tons of features that you probably haven’t had a chance to try out. They classified them under two sections. Briefly, they say we have <strong>unstable</strong> features and we also have <strong>particularly unstable</strong> ones that you can opt-in. Basically, we are warned by the team to be more precautious. I definitely encourage you to fool around with experiments.</p><h3>4. CSS Overview 🔭️</h3><p>I’m pretty sure you have seen a web application that leaves you in awe. Here is a tip to steal some of their design systems 😜</p><p>For the time being, this feature has an experimental flag. From the previous section, you know how to enable experimental features in DevTools now.</p><p>Go to <strong>Experiments </strong>and enable <strong>CSS Overview</strong></p><p>You need to reload your DevTools. You’ll see a blue button to do so or you can just restart Google Chrome.</p><p>Now that it’s enabled, just go to the<strong> CSS Overview</strong> tab to see the color palette, typography options, media queries even unused declarations.🤯</p><p>This feature is really versatile under various circumstances. It can be used to ensure your teams are aligned with your design system. You might say, we have 5 different teams, and each of them responsible for one project, and they are supposed to follow the same design system. This feature is a fantastic inspection tool for that. You can easily pinpoint the unwanted colors, font sizes, etc.</p><p>It also gives you the option to find the occurrences of that color/font. All you need is to click on it and the element’s class will be present below.</p><h3>5. Getting all styling changes at once 💄️</h3><p>Whenever you want to debug something or just simply trying out things on the browser you just change some stuff on the browser but sometimes it&#39;s too daunting to find &amp; copy everything you just tried.</p><p>I used to ask the question; what and where did I change styling that ended up like this? 🤔️</p><p>There’s a pretty good solution for that.</p><p>In your command menu type <strong>Show Changes</strong></p><p>Whenever you change the styling of an element inside the DOM you’ll see the changes in this tab. There is also an addition to that. If you make a habit to modify styling whilst creating a new class. There will be a new CSS file that you can just export from chrome or simply see all of the changes on a structured file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*fitrxhkC8lJU7HZC.gif" /><figcaption>Example usage of Changes Tab</figcaption></figure><h3>6. Importing Exporting HAR files ️⛩️</h3><p>Sometimes throttling or trying new ways is not enough to find a bug. It may get really ugly super-fast.</p><p>At a point in my career, I had a chance to contribute to a project that supposes to run in China. You may know that some services that “everyone” uses in Europe, North America are not present in China. So our customer came up with a bug. She couldn’t access our web application or it takes so much time that it is not acceptable for us to leave it as it is.</p><p>Here comes the DevTools feature.</p><p>We asked her to <strong>record </strong>network activity and share it with us. She recorded and shared with us and we solved the problem. Apparently, the problem was one of our services is running extremely slow in China. We sorted it out.</p><p>For the sake of readability, I’m going to give you great documentation of Google and you can continue from <a href="https://developer.chrome.com/docs/devtools/network/reference/#export">there</a></p><h3>7. Filtering requests ☕️</h3><p>In my humble opinion, this feature is really subtle but super powerful. In your <strong>Network</strong> tab, you can see there a couple of tab-looking radio buttons that you can select.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/840/1*5NxfJZoCXuGVIB6kFc3-Ag.png" /><figcaption>Network Tab</figcaption></figure><p>You can easily filter them and ease your debugging process. Here is a real-life example that I can give you. I used to work on a project with tons of images and I needed to only track the XHR requests for some reason. Needless to say, I only selected XHR requests and I didn’t need to scroll all the time to find the API call I&#39;m looking for. If you know the exact wording you can also filter from the input field.</p><h3>8. Rendering 🕶️</h3><p>This section is as important as it gets. You are highly likely familiar with <a href="https://developers.google.com/web/tools/lighthouse">Google Lighthouse</a>. That’s a fact that it gives you great information about several aspects of your web application but sometimes it might be tricky to fix those problems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*11QFRbS0oK8OOwlm.png" /><figcaption>Lighthouse Example</figcaption></figure><p>As you can see from the above image, several metrics affect the performance score of your application. Finding a starting point to fix those problems can be hard unless you use the <strong>Rendering </strong>tab.</p><p>Open up your command line and type <strong>Rendering</strong>.</p><p>It will open up a tab below and there are several options that you can choose from. Once you select any of them, there will be some changes to your content.</p><p>For example, if you checked the box with the <strong>Core Web Vitals</strong> label. There is a new overlay on your content to show similar scores with <em>Lighthouse.</em></p><p>Another cool one is <strong>Layout Shift Regions. </strong>When you enable this feature all shifting movements will be highlighted. This shifting process can hurt your application&#39;s performance if it’s not well thought.</p><p>These two are not the only useful ones. You should play around with these options like every other section I mentioned🤸️</p><h3>9. Instrument coverage 🎷️</h3><p>I was obsessed with this feature of Chrome when I first focused on the performance of the application that I’m supposed to work on. DevTools can tell you what percentage of your bundle is used and which lines are used which are not. Here is how you do it.</p><p>Open up your command menu and type <strong>Instrument Coverage.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NyxhG9fTOOHDl-IEtOn4LA.png" /><figcaption>Coverage Tab</figcaption></figure><p>A tab with the name <strong>Coverage </strong>should be open. On the bottom, you can see what percentage of your code is used and whatnot. When you double click one of the rows that file will be open with a perfect indicator. If lines are used, it has an indicator that’s used with a blueish color, if not there is a red indicator for those two that are not used. It’s reactive to the changes while you navigate yourself in your application so that it’s not narrowed down to a limited amount of time. This can give you a perfect clue for reducing your bundle size and implementing methods like code splitting and lazy loading.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/634/1*A1aHLzwiOzf6Lnatm7nJSw.png" /><figcaption>Example of used/unused code</figcaption></figure><h3>Conclusion</h3><p>I personally believe that knowing the <em>true name </em>of Google Chrome is underestimated. All these things will give you an edge in your career. 💪</p><p>Knowing all these features and having them in your tool belt is a great start to stand out among others. However, like every other area, you have to keep up with the latest updates. The best way to do it is by following the updates from Google. Checking out the latest features of DevTools is not hard but it could make a drastic change to your and your team’s workflow.</p><p><a href="https://developers.google.com/web/updates">https://developers.google.com/web/updates</a></p><h3>Resources</h3><ol><li><a href="https://www.itu.int/en/ITU-D/Statistics/Documents/facts/FactsFigures2020.pdf">https://www.itu.int/en/ITU-D/Statistics/Documents/facts/FactsFigures2020.pdf</a></li><li><a href="https://developers.google.com/web/tools/lighthouse">https://developers.google.com/web/tools/lighthouse</a></li><li><a href="https://developer.chrome.com/docs/devtools/network/reference/#export">https://developer.chrome.com/docs/devtools/network/reference/</a></li></ol><p>Special thanks to <a href="https://www.instagram.com/dinemilieu/">Dinem Kursun</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ca18fbf8470c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codeshakeio/9-hidden-features-of-chrome-devtools-ca18fbf8470c">9 Hidden Features of Chrome DevTools</a> was originally published in <a href="https://medium.com/codeshakeio">codeshakeio</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to Angular Best Practices]]></title>
            <link>https://medium.com/codeshakeio/introduction-to-angular-best-practices-921bd205f7db?source=rss-c9798d47edb0------2</link>
            <guid isPermaLink="false">https://medium.com/p/921bd205f7db</guid>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[clean-code]]></category>
            <category><![CDATA[best-practices]]></category>
            <dc:creator><![CDATA[Serdar Sayın]]></dc:creator>
            <pubDate>Thu, 25 Feb 2021 09:31:13 GMT</pubDate>
            <atom:updated>2021-02-27T14:17:06.465Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2HXqUCkLv8AeFWWHVf1E-A.jpeg" /><figcaption>Veiled Lady by Raffaelo Monti — <a href="https://collections.artsmia.org/art/12092/veiled-lady-raffaelo-monti">https://collections.artsmia.org/art/12092/veiled-lady-raffaelo-monti</a></figcaption></figure><h3>What this post is about?</h3><ul><li>Some suggestions to write not only <em>better </em>Angular also Javascript code.</li><li>Concise but simple tips on performance with well-established examples.</li><li>A teaser on some topics related to Angular and Javascript.</li></ul><blockquote><strong><em>Since Typescript is a strict superset of Javascript. I use Javascript as a keyword in the context whenever it’s possible. Everything applies to Typescript.</em></strong></blockquote><h3><strong>Introduction 🖼</strong></h3><p>I tend not to use any stock photos when I write an article or documentation but in this case, there is a story behind it. Stay with me.</p><p>I believe what makes this piece of art hauntingly beautiful is the details. The artist convinced you that there is a veil with enough detail.</p><p>As someone said (probably Leonardo Da Vinci — no proof 😕)</p><blockquote>“Details make perfection, and perfection is not a detail.”</blockquote><p>Regardless of what you are working on if you care about details you are on the path to perfection whether you reach or not.</p><p>Software engineering is not far different from art in this particular aspect. Clean, well-architectured, and performant software is what we seek after @<a href="https://medium.com/codeshakeio">codeshake</a>.</p><p>I prepared some tips/suggestions for you on Angular. Enough chit-chat. Let’s dive into content.</p><h3>1. Template Conditions</h3><p>If you even come across an Angular codebase, you’ll see that template conditions are the backbone of the template. This tip is not for improving the performance or functionality. This is all about developer experience.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c2b776a86e899d56fcd8a0f5c27a6712/href">https://medium.com/media/c2b776a86e899d56fcd8a0f5c27a6712/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8986941236b12b69cc471b8e367df398/href">https://medium.com/media/8986941236b12b69cc471b8e367df398/href</a></iframe><p>You can see the difference at a glance. This may seem trivial at first but when the conditions get complicated it’s better to encapsulate them into a variable with meaningful naming. Sometimes you have no choice but to define in the template (Loops), writing meaningful comments would suffice in that case. You got the idea 🚀</p><h3>2. ESNext Features</h3><p>Writing better Javascript code is a requirement for better Angular applications. <a href="https://262.ecma-international.org/11.0/#sec-intro">ESNext</a> features are a topic on their own but I’m going to mention features that I use every day. This is something you need to keep yourself up to date because it changes periodically. These are just the tip of the iceberg. I urge you to read more about ESNext features.</p><h4>Spread Operator</h4><p>The spread operator is one of the most versatile features in Javascript. You can accomplish so many things. Here are some.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7afa18ceda84f525d51c0a2eea48aad1/href">https://medium.com/media/7afa18ceda84f525d51c0a2eea48aad1/href</a></iframe><p>The last one is a real-life example. Basically if hobbiesis present assign hobbies, if hobbiesis falsy don’t even set as hobbies: null instead, leave that property <strong>empty.</strong></p><p>The syntax is debatable. It can be <em>simplified</em> or you can still achieve the same result with alternative methods. I can assure you it will be messier.</p><p>As a result, the spread operator is a powerful and nice tool to have in your arsenal.</p><p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax">For more information</a></p><h4>Arrow Functions</h4><p>If you ever had to write a code like this var self = this;. This one’s for you.</p><p>Arrow function is a concise, simplified version of the traditional function. There are some things it can and can’t. For instance, the arrow function doesn’t have a separate scope so it shares the parent’s scope unlike the traditional one. Tackling data fetching and Observables is way easier with arrow functions.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3bdc5c2e25bbb32e63cdd07c890158b9/href">https://medium.com/media/3bdc5c2e25bbb32e63cdd07c890158b9/href</a></iframe><p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions">For more information</a></p><h3>3. Short-Circuiting in Javascript</h3><p>From my experience, this is one of the most overlooked features of the language. Not every language supports this but luckily JS does.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b09f5d2bf66f0730b1e16f80cf797539/href">https://medium.com/media/b09f5d2bf66f0730b1e16f80cf797539/href</a></iframe><p>To assign a value to result<em>, </em>the<em> </em>engine seeks out a shortcut. If the condition is met before reaching the end, it <em>short-circuits </em>and moves onto the next line.</p><p>In the example, only checking the condition of variable “e” is enough if you order correctly. By utilizing this feature you can prevent loading states/unnecessary API calls and you can even reduce initial load latencies.</p><p>Check out this <a href="https://web.dev/why-speed-matters/">article</a> to see how important is short-circuiting 😛</p><h3>4. ngFor with trackBy 🔮</h3><p>Most of the time, you can foresee the future of the lifecycle of an application. You may assume specific changes in your template or simply you may don’t want your template to react to every little change. Wouldn’t be nice if Angular renders only when we want to? That’s where trackBy comes into play. trackBy is just a function to compare data with its previous state. If it’s different rerender if it’s not no action.</p><p>Let’s take a quick look at this example. There are two versions one with trackBy and the other is without.</p><p>If there is no trackBy, every time data changes every element inside of that loop is going to rerender 😒</p><p>If we <em>track </em>the change only we care, Angular engine wouldn’t rerender unnecessarily.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/363/1*BWLsaG04EUiv9djLncb0Hw.gif" /><figcaption>ngFor without trackBy</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/386/1*10KaqdfYpC17jefTZG110Q.gif" /><figcaption>ngFor with trackBy</figcaption></figure><p>For the sake of this article, I only recorded the DOM so we can see the difference. For both cases, I’m clicking the same button relentlessly. Simple ngFor rerenders every time button is clicked, However, on the second one trackBy function looks for <strong>change</strong> and It only renders if there’s a difference after the button is clicked. Just be careful, It’s not a silver bullet. Sometimes you don’t want trackBy. (<em>When you want to display every little detail </em>🤔)</p><p><a href="https://codesandbox.io/s/blissful-montalcini-66jzs">Check it out.</a></p><h3>5. Virtual Scrolling with Angular CDK</h3><p>I can’t stress enough how important this one is. Especially if you have to develop a page with too much scrolling. Like the previous tip, this is also about performance. Angular CDK’s examples are more than enough to justify the needs of this feature.</p><p>Angular material docs also simplify the process into one sentence.</p><blockquote>Virtual scrolling enables a performant way to simulate all items being rendered by making the height of the container element the same as the height of total number of elements to be rendered, and then only rendering the items in view</blockquote><p>Here is a list of the most obvious aspects of virtual scrolling.</p><ol><li>It doesn’t render every possibility at once. It only renders the ones that are visible to the user.</li><li>It utilizes caching and uses the <em>same</em> template when it’s possible. In basic terms, it recycles the template therefore more performant loops. 💪</li></ol><p>Check out <a href="https://material.angular.io/cdk/scrolling/overview">here</a> for more information. I also want to encourage you to play with examples and see the difference in the DOM.</p><h3><strong>6. Pipes in Angular</strong></h3><p>Sometimes we — Frontend Developers — forget the fact that Angular takes care of so many things for us. Sometimes it’s overwhelming, most of the time it’s cool</p><p>This is a cool one. 🚀</p><p>When you import a common module, not only ngIf comes with it. Some super-useful pipes are built-in. I’m going to focus on the two most useful ones.</p><p><strong>CurrencyPipe</strong></p><p>At some point in my career, I had to work with dozens of currencies and almost each of them had different requirements. Too many commas, zeros it was overwhelming. Currency pipe was handy, and I took a step further and extended CurrencyPipe which was pretty easy.</p><p><strong>DatePipe</strong></p><p>The same thing applies to DatePipe. Don’t take these pipes for granted and utilize them as much as you can 💪</p><p>Not only Angular’s own pipes are useful there are some fantastic ones out there. Here is <a href="https://github.com/danrevah/ngx-pipes">one</a></p><h3><strong>7. Don’t forget to unsubscribe streams.</strong></h3><p>It feels really straightforward to subscribe to a stream. Do you feel the same thing about unsubscription? If you are lucky, you may not even realize that you need to unsubscribe. It’s that subtle.</p><p>If I try to explain every bit of this concept I would need to write another article. Let’s make it simple. If you don’t want <strong>memory leaks </strong>and <strong>performance issues, </strong>you have to unsubscribe from streams (Observables, events, etc.).</p><p>There are several ways of unsubscribing here are some.</p><ol><li>Use <strong>async </strong>pipe. Angular takes care of the unsubscription when the template is destroyed.</li><li>You can unsubscribe from the source on <strong>ngOnDestroy </strong>hook. However, you should be careful about this one. You may still want that <strong>Subscription</strong> to exist.</li><li>If you want to t<em>ake </em>the specified number of value from the source. You may want to consider RxJS operators like <strong>take</strong>, <strong>takeLast</strong>,<strong>takeUntil</strong>, <strong>first. </strong>These operators don’t require unsubscription.</li></ol><h3><strong>8. RxJS operators</strong></h3><p>Nice transition eh 😜</p><p>Angular ecosystem is super-rich when it comes to reactive programming. <a href="https://ngrx.io/"><strong>NgRx</strong></a> and <a href="https://datorama.github.io/akita/"><strong>Akita</strong></a> are just from the top of my head. I’m not even mentioning how <a href="https://angular.io/api/common/http/HttpClient"><strong>HttpClient</strong></a> works in Angular.</p><p>The funny thing is if you invest in yourself to learn RxJS, all of these concepts apply to almost any other language. Checkout <a href="https://github.com/ReactiveX/RxSwift">RxSwift</a> and <a href="https://github.com/ReactiveX/RxJava">RxJava</a>.</p><p>Here is my take on this. <strong>Invest in learning RxJS. </strong>You won’t regret it.</p><p>If no one said it already.</p><blockquote>Codebases, languages change, design patterns don’t.</blockquote><p>Here are some great resources would help your understanding to level up.</p><p><a href="https://www.learnrxjs.io/">https://www.learnrxjs.io/</a></p><ul><li><a href="https://www.rxjs-fruits.com/">rxjs-fruits.com</a></li><li><a href="http://reactivex.io/">ReactiveX</a></li></ul><h3><strong>9. Dumb-smart components</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/721/0*5bwiSMObp8vWeX0o" /><figcaption>Drawing on dumb-smart component</figcaption></figure><p>The title may not sound delicate enough. In essence, the idea is like this. You have a smart one and several dumb ones for that specific feature/page. The smart component takes care of more “logical” stuff and passes enough data to dumb components to present.</p><p>For example, if the Sidebar component emits an event and this event has to trigger another component — you guessed it right — the smart component takes care of it.</p><p>I first learned this concept from <a href="https://medium.com/@dan_abramov/smart-and-dumb-components-7ca2f9a7c7d0">Dan Abramov</a>. Even though he sort of changed his mind in this concept especially for React development, I still believe it’s a good practice to separate your components in this fashion.</p><h3><strong>10. Using Augury</strong></h3><p>Augury is sort of an equivalent of React/Vue dev tools. I didn’t benefit too much while I develop Angular apps but when you want to see an overview of your application from a broader perspective it’s quite useful. Especially if you are on a relatively bigger project.</p><p><a href="https://augury.rangle.io/">Check it out.</a></p><h3><strong>11. [hidden] vs ngIf</strong></h3><p>The difference between ‘<em>hidden</em>’ and ‘<em>ngIf</em>’ is quite subtle yet super powerful when the time comes. Imagine you have a component with a huge template. However, initially, the user doesn’t want to see this feature.</p><p><em>I do </em>s<em>mell performance.</em>🤔</p><p>If you choose <strong>hidden, </strong>the component won’t be rendered in the DOM but if you inspect you’ll see that everything is loaded but marked <em>hidden</em>.</p><p>On the other hand, If you choose <strong>ngIf, </strong>it<strong> </strong>will comment out the data if the expression is false. This will reduce the initial load but components need relapse for loading.</p><p>Basically, it’s a trade-off.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/726/1*9ZqKLHeXiF6UVQK5Jv1v2Q.gif" /><figcaption>hidden vs ngIf on DOM</figcaption></figure><p><a href="https://stackblitz.com/edit/angular-ivy-dw1cnd?file=src/app/app.component.html">Here</a> is a quick example you can see the same results.</p><h3><strong>12. Absolute path with tsconfig.json</strong></h3><p>This one is gold ✨</p><p>I’m sure you encounter import statements like this. It just doesn’t look pleasing and maintainable.</p><p>import {GrazieModule} from &#39;./../../app/shared/component/grazie.module</p><p>🤮</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6c7eb92fa6dc48f94afe9b7efc51b845/href">https://medium.com/media/6c7eb92fa6dc48f94afe9b7efc51b845/href</a></iframe><p>Luckily Typescript takes care of this mess if you make enough adjustment. In your tsconfig.jsonfile, you can create absolute paths. Only lines that matters are from line 17 to line 32. You are sort of creating a shortcut for that path. Now you can rephrase it as following.</p><p>import {GrazieModule} from &#39;@shared/component/grazie.module&#39;</p><p>❄️ VSCode is really helpful if you make these adjustments. It suggests you use shortcuts instead of relative import.</p><h3><strong>13. Attribute/class/style binding</strong></h3><p>Using binding may not be on top of your head. Sometimes it might be tempting to go for ngIf rather than adding a class binding. However, It’s more performant and better DX overall.</p><p>👾 Using attribute binding with BEM is delightful.</p><p>Let’s take a look at this comparison.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/78bbcd91b3078916ed1fdbac4df157be/href">https://medium.com/media/78bbcd91b3078916ed1fdbac4df157be/href</a></iframe><p>It might seem trivial but the difference is too big to ignore 🤷‍♂️</p><h3>Yaaay! 🎉</h3><p>I hope you learned some new stuff. We just scratched the surface. There are tons of things that I didn’t mention because it’s an introduction. Check out this awesome <a href="https://medium.com/angular-in-depth/all-you-need-to-know-about-ivy-the-new-angular-engine-9cde471f42cf">article</a> and check out the best practices section of <a href="https://angular.io/">Angular docs</a>.</p><p>If you have any questions or any remark don’t hesitate to contact me ✌️</p><h4>Good morning, and in case I don’t see ya: Good afternoon, good evening, and good night! 👋</h4><h4>Resources</h4><ol><li><a href="https://262.ecma-international.org/11.0/#sec-intro">https://262.ecma-international.org/11.0/#sec-intro</a></li><li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax">https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax</a></li><li><a href="https://www.javascripttutorial.net/es6/javascript-arrow-function/">https://www.javascripttutorial.net/es6/javascript-arrow-function/</a></li><li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions">https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions</a></li><li><a href="https://web.dev/why-speed-matters/">https://web.dev/why-speed-matters/</a></li><li><a href="https://material.angular.io/cdk/scrolling/overview">https://material.angular.io</a>/</li><li><a href="https://datorama.github.io/akita/">https://datorama.github.io/akita/</a></li><li><a href="https://ngrx.io/">https://ngrx.io/</a></li><li><a href="https://angular.io/">https://angular.io/</a></li><li><a href="https://www.rxjs-fruits.com/">www.rxjs-fruits.com</a></li><li><a href="http://reactivex.io/">reactivex.io</a></li><li><a href="https://www.learnrxjs.io/">https://www.learnrxjs.io/</a></li><li><a href="https://medium.com/@dan_abramov/smart-and-dumb-components-7ca2f9a7c7d0">https://medium.com/@dan_abramov/smart-and-dumb-components-7ca2f9a7c7d0</a></li><li><a href="https://augury.rangle.io/">https://augury.rangle.io/</a></li><li><a href="https://medium.com/angular-in-depth/all-you-need-to-know-about-ivy-the-new-angular-engine-9cde471f42cf">https://medium.com/angular-in-depth/all-you-need-to-know-about-ivy-the-new-angular-engine-9cde471f42cf</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=921bd205f7db" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codeshakeio/introduction-to-angular-best-practices-921bd205f7db">Introduction to Angular Best Practices</a> was originally published in <a href="https://medium.com/codeshakeio">codeshakeio</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>